int main() { tests_setup(); const UnitTest tests[] = { unit_test(test_no_migration), unit_test(test_up_to_date), unit_test(test_migrate_incoming), unit_test(test_migrate_outgoing), unit_test(test_ignore_wrong_sized), }; PRINT_TEST_BANNER(); int ret = run_tests(tests); tests_teardown(); return ret; }
int main() { PRINT_TEST_BANNER(); tests_setup(); const UnitTest tests[] = { unit_test(test_file_write), unit_test(test_file_read_all), unit_test(test_file_read_truncate), unit_test(test_file_read_empty), unit_test(test_file_read_invalid), }; int ret = run_tests(tests); tests_teardown(); return ret; }
char *test_switch_hall() { tests_setup(); switch_by_message(0); mu_assert(state == STATE_HALL_LIGHTS, "State should be STATE_HALL_LIGHTS after msg_hall received"); mu_assert(fake_port == 0x03, "State should be 0x03 (all ports on) after switch message receiving"); switch_by_message(1); mu_assert(state == STATE_HALL_LIGHTS, "msg_kitchen should not affect state when it is STATE_HALL_LIGHTS"); mu_assert(fake_port == 0x03, "msg_kitchen should not affect port state when state is STATE_HALL_LIGHTS"); switch_by_message(0); mu_assert(state == STATE_HALL_DARK, "State should be STATE_HALL_DARK after switching off"); mu_assert(fake_port == 0x00, "Ports should be switched off after switching off"); tests_teardown(); return NULL; }
char *test_off() { tests_setup(); switch_by_message(0); switch_by_message(2); mu_assert(state == STATE_HALL_DARK, "State should be STATE_HALL_DARK after msg_off received"); mu_assert(fake_port == 0x00, "msg_off should off everything"); switch_by_message(1); switch_by_message(2); mu_assert(state == STATE_HALL_DARK, "State should be STATE_HALL_DARK after msg_off received when kitchen lights"); mu_assert(fake_port == 0x00, "msg_off should off kitchen when lights"); tests_teardown(); return NULL; }
int main() { tests_setup(); const UnitTest tests[] = { unit_test(test_newentry), unit_test(test_update), unit_test(test_reverse_missing), unit_test(test_reverse_conflict), unit_test(test_reverse_missing_forward), unit_test(test_remove), }; PRINT_TEST_BANNER(); int ret = run_tests(tests); tests_teardown(); return ret; }
int main() { #ifdef LMDB return 0; #else tests_setup(); const UnitTest tests[] = { unit_test(test_no_migration), unit_test(test_up_to_date), unit_test(test_migrate_unqualified_names), }; PRINT_TEST_BANNER(); int ret = run_tests(tests); tests_teardown(); return ret; #endif }