improved test code

This commit is contained in:
Bob Polis 2020-04-25 16:39:57 +02:00
parent eeaa962aba
commit a3f0de4582

View File

@ -20,9 +20,10 @@
using namespace std; using namespace std;
void print_help() { void print_help() {
std::cout << "usage: sciotest [-h][-v][-t TEST_ID]\n"; std::cout << "usage: sciotest -h|-v|-t TEST_ID\n";
std::cout << " -h, --help show this help text and exit\n"; std::cout << " -h, --help show this help text and exit\n";
std::cout << " -t, --test perform test with given ID\n"; std::cout << " -t, --test perform test with given TEST_ID\n";
std::cout << " currently a number between 1 and 5, inclusive\n";
std::cout << " -v, --version show version number and exit\n"; std::cout << " -v, --version show version number and exit\n";
} }
@ -88,8 +89,9 @@ void test5() {
file << "A line of text\n"; file << "A line of text\n";
file.seekg(0); file.seekg(0);
string line; string line;
file >> line; if (getline(file, line)) {
cout << line; cout << line << '\n';
}
throw_if_min1(::close(fd)); throw_if_min1(::close(fd));
} }