int main() { WritingWords test; std::cout << test.write("A") << std::endl; // should return 1 std::cout << test.write("ABC") << std::endl; // 6 std::cout << test.write("ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ") << std::endl; // 1300 return 0; }
bool do_test(string word, int __expected) { time_t startClock = clock(); WritingWords *instance = new WritingWords(); int __result = instance->write(word); double elapsed = (double)(clock() - startClock) / CLOCKS_PER_SEC; delete instance; if (__result == __expected) { cout << "PASSED!" << " (" << elapsed << " seconds)" << endl; return true; } else { cout << "FAILED!" << " (" << elapsed << " seconds)" << endl; cout << " Expected: " << to_string(__expected) << endl; cout << " Received: " << to_string(__result) << endl; return false; } }
// BEGIN CUT HERE int main( int argc, char* argv[] ) { { WritingWords theObject; eq(0, theObject.write("A"),1); } { WritingWords theObject; eq(1, theObject.write("ABC"),6); } { WritingWords theObject; eq(2, theObject.write("VAMOSGIMNASIA"),143); } { WritingWords theObject; eq(3, theObject.write("TOPCODER"),96); } { WritingWords theObject; eq(4, theObject.write("SINGLEROUNDMATCH"),183); } { WritingWords theObject; eq(5, theObject.write("ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"),1300); } return 0; }