Skip to content
Browse files

Fix fuzzy minutes index calculation and enable tests

  • Loading branch information...
1 parent eaf4d82 commit b7f998ce2e817aca6dc8200c124f7d938454c1ed @caio committed
Showing with 8 additions and 8 deletions.
  1. +1 −1 src/fuzzyclock.c
  2. +7 −7 tests/check_fuzzyclock.c
View
2 src/fuzzyclock.c
@@ -42,7 +42,7 @@ void get_fuzzy_time(struct tm* clock, char* buffer) {
int min = clock->tm_min;
if (min > 2) {
- index = ((min - 3) / 5) - 1;
+ index = ((min - 3) / 5) + 1;
}
if (index > 6) { hour++; }
View
14 tests/check_fuzzyclock.c
@@ -78,7 +78,7 @@ START_TEST(test_twentyfivepast) {
}
END_TEST
-START_TEST(test_haltpast) {
+START_TEST(test_halfpast) {
fuzzy_time_test_gen(1, 0, 28, 33, "half past %s", 0);
}
END_TEST
@@ -90,12 +90,12 @@ Suite* fuzzy_suite(void) {
tcase_add_test(tc_core, test_get_hour_string);
tcase_add_test(tc_core, test_oclock);
- /* tcase_add_test(tc_core, test_fivepast); */
- /* tcase_add_test(tc_core, test_tenpast); */
- /* tcase_add_test(tc_core, test_quarterpast); */
- /* tcase_add_test(tc_core, test_twentypast); */
- /* tcase_add_test(tc_core, test_twentyfivepast); */
- /* tcase_add_test(tc_core, test_haltpast); */
+ tcase_add_test(tc_core, test_fivepast);
+ tcase_add_test(tc_core, test_tenpast);
+ tcase_add_test(tc_core, test_quarterpast);
+ tcase_add_test(tc_core, test_twentypast);
+ tcase_add_test(tc_core, test_twentyfivepast);
+ tcase_add_test(tc_core, test_halfpast);
suite_add_tcase(suite, tc_core);

0 comments on commit b7f998c

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