1 /*******************************************************
2 * Unit test for the hour class
4 * test the date parser that converts String to hour
5 ******************************************************
20 std::cout << "String \"" << the_time << "\" converts to: \"" << h0 << "\"\n";
22 assert(h0 == hour(11, 34, 0));
26 std::cout << "String \"" << the_time << "\" converts to: \"" << h0 << "\"\n";
27 assert(h0 == hour(11, 34, 0));
31 std::cout << "String \"" << the_time << "\" converts to: \"" << h0 << "\"\n";
32 assert(h0 == hour(11, 34, 0));
36 std::cout << "String \"" << the_time << "\" converts to: \"" << h0 << "\"\n";
37 assert(h0 == hour(11, 34, 27));
39 the_time = "11:34:27";
41 std::cout << "String \"" << the_time << "\" converts to: \"" << h0 << "\"\n";
42 assert(h0 == hour(11, 34, 27));
44 the_time = "11.34.27";
46 std::cout << "String \"" << the_time << "\" converts to: \"" << h0 << "\"\n";
47 assert(h0 == hour(11, 34, 27));
49 // TODO: test for invalid houts and syntax errors