Skip to content
Browse files

Implement test_fivepast but keep it disabled

  • Loading branch information...
1 parent f80420f commit ab5efe1ce7ba4acba23ba74836fee52c74556fae @caio committed Mar 28, 2012
Showing with 25 additions and 0 deletions.
  1. +25 −0 tests/check_fuzzyclock.c
View
25 tests/check_fuzzyclock.c
@@ -38,16 +38,41 @@ START_TEST(test_oclock) {
fail_if(strcmp(test, buff) != 0, "WANTED \"%s\", GOT \"%s\"", test, buff);
}
+}
+END_TEST
+
+START_TEST(test_fivepast) {
+ char buff[MAX_MSG_SIZE];
+ char test[MAX_MSG_SIZE];
+ time_t now = time(NULL);
+ struct tm* clock = localtime(&now);
+ int i = 0;
+
+ // Verifying "five past"
+ clock->tm_hour = 1;
+
+ for (i = 3; i < 8; i++) {
+ clock->tm_min = i;
+
+ snprintf(test, MAX_MSG_SIZE, "five past one");
+
+ get_fuzzy_time(clock, buff);
+
+ fail_if(strcmp(test, buff) != 0, "WANTED \"%s\", GOT \"%s\"", test, buff);
+ }
}
END_TEST
Suite* fuzzy_suite(void) {
Suite* suite = suite_create("fuzzyclock");
TCase* tc_core = tcase_create("Core");
+
tcase_add_test(tc_core, test_get_hour_string);
tcase_add_test(tc_core, test_oclock);
+ /* tcase_add_test(tc_core, test_fivepast); */
+
suite_add_tcase(suite, tc_core);
return suite;

0 comments on commit ab5efe1

Please sign in to comment.
Something went wrong with that request. Please try again.