/*create the test suite with all the test cases*/ TestRef AlarmsTest_seq4_t1_instance(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("test_t1_instance",test_t1_instance) }; EMB_UNIT_TESTCALLER(AlarmsTest,"AlarmsTest_sequence4",NULL,NULL,fixtures); return (TestRef)&AlarmsTest; }
/*create the test suite with all the test cases*/ TestRef InterruptProcessingTest_seq1_isr2_instance9(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("test_isr2_instance9",test_isr2_instance9) }; EMB_UNIT_TESTCALLER(InterruptProcessingTest,"InterruptProcessingTest_sequence1",NULL,NULL,fixtures); return (TestRef)&InterruptProcessingTest; }
/*create the test suite with all the test cases*/ TestRef COMInternalTest_seq6_t4_instance(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("test_t4_instance",test_t4_instance) }; EMB_UNIT_TESTCALLER(COMInternalTest,"COMInternalTest_sequence6",NULL,NULL,fixtures); return (TestRef)&COMInternalTest; }
/*create the test suite with all the test cases*/ TestRef AutosarSTTest_seq2_error_instance8(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("test_error_instance8",test_error_instance8) }; EMB_UNIT_TESTCALLER(AutosarSTTest,"AutosarSTTest_sequence2",NULL,NULL,fixtures); return (TestRef)&AutosarSTTest; }
/*create the test suite with all the test cases*/ TestRef AutosarSPTest_seq1_error_instance3(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("test_error_instance3",test_error_instance3) }; EMB_UNIT_TESTCALLER(AutosarSPTest,"AutosarSPTest_sequence1",NULL,NULL,fixtures); return (TestRef)&AutosarSPTest; }
/*create the test suite with all the test cases*/ TestRef TaskManagementTest_seq9_t3_instance2(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("test_t3_instance2",test_t3_instance2) }; EMB_UNIT_TESTCALLER(TaskManagementTest,"TaskManagementTest_sequence9",NULL,NULL,fixtures); return (TestRef)&TaskManagementTest; }
/*create the test suite with all the test cases*/ TestRef InterruptProcessingTest_seq6_error_instance14(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("test_error_instance14",test_error_instance14) }; EMB_UNIT_TESTCALLER(InterruptProcessingTest,"InterruptProcessingTest_sequence6",NULL,NULL,fixtures); return (TestRef)&InterruptProcessingTest; }
/*create the test suite with all the test cases*/ TestRef AutosarSPTest_seq2_t1_instance(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("test_t1_instance",test_t1_instance) }; EMB_UNIT_TESTCALLER(AutosarSPTest,"AutosarSPTest_sequence2",NULL,NULL,fixtures); return (TestRef)&AutosarSPTest; }
/*create the test suite with all the test cases*/ TestRef AutosarSTSTest_seq14_t2_instance2(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("test_t2_instance2",test_t2_instance2) }; EMB_UNIT_TESTCALLER(AutosarSTSTest,"AutosarSTSTest_sequence14",NULL,NULL,fixtures); return (TestRef)&AutosarSTSTest; }
/*create the test suite with all the test cases*/ TestRef HookTest_seq5_posttask_instance1(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("test_posttask_instance1",test_posttask_instance1) }; EMB_UNIT_TESTCALLER(HookTest,"HookTest_sequence5",NULL,NULL,fixtures); return (TestRef)&HookTest; }
/*create the test suite with all the test cases*/ TestRef COMInternalTest_seq1_comerror_instance1(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("test_comerror_instance1",test_comerror_instance1) }; EMB_UNIT_TESTCALLER(COMInternalTest,"COMInternalTest_sequence1",NULL,NULL,fixtures); return (TestRef)&COMInternalTest; }
/*create the test suite with all the test cases*/ TestRef HookTest_seq4_pretask_instance2(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("test_pretask_instance2",test_pretask_instance2) }; EMB_UNIT_TESTCALLER(HookTest,"HookTest_sequence4",NULL,NULL,fixtures); return (TestRef)&HookTest; }
/*create the test suite with all the test cases*/ TestRef AutosarTPTest_seq1_protection_instance1(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("test_protection_instance1",test_protection_instance1) }; EMB_UNIT_TESTCALLER(AutosarTPTest,"AutosarTPTest_sequence1",NULL,NULL,fixtures); return (TestRef)&AutosarTPTest; }
/*create the test suite with all the test cases*/ TestRef EventMechanismTest_seq5_t5_instance(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("test_t5_instance",test_t5_instance) }; EMB_UNIT_TESTCALLER(EventMechanismTest,"EventMechanismTest_sequence5",NULL,NULL,fixtures); return (TestRef)&EventMechanismTest; }
/*create the test suite with all the test cases*/ TestRef HookTest_seq1_startup_instance(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("test_startup_instance",test_startup_instance) }; EMB_UNIT_TESTCALLER(HookTest,"HookTest_sequence1",NULL,NULL,fixtures); return (TestRef)&HookTest; }
/*create the test suite with all the test cases*/ TestRef TaskManagementTest_seq14_t11_instance(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("test_t11_instance",test_t11_instance) }; EMB_UNIT_TESTCALLER(TaskManagementTest,"TaskManagementTest_sequence14",NULL,NULL,fixtures); return (TestRef)&TaskManagementTest; }
Test *tests_core_ringbuffer_tests(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture(tests_core_ringbuffer), }; EMB_UNIT_TESTCALLER(ringbuffer_tests, NULL, NULL, fixtures); return (Test *)&ringbuffer_tests; }
Test *tests_nanocoap_tests(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture(test_nanocoap__hdr), }; EMB_UNIT_TESTCALLER(nanocoap_tests, NULL, NULL, fixtures); return (Test *)&nanocoap_tests; }
Test *tests_fmt_tests(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture(test_fmt_byte_hex), new_TestFixture(test_fmt_bytes_hex_reverse), new_TestFixture(test_fmt_u32_hex), new_TestFixture(test_fmt_u64_hex), new_TestFixture(test_fmt_u32_dec), new_TestFixture(test_fmt_u16_dec), new_TestFixture(test_fmt_s32_dec), new_TestFixture(test_fmt_strlen), new_TestFixture(test_fmt_str), new_TestFixture(test_scn_u32_dec), }; EMB_UNIT_TESTCALLER(fmt_tests, NULL, NULL, fixtures); return (Test *)&fmt_tests; }
/*embunit:impl=- */ TestRef ULOGFSTests_tests(void) { EMB_UNIT_TESTFIXTURES(fixtures) { /*embunit:fixtures=+ */ new_TestFixture("testInit",testInit), /*embunit:fixtures=- */ }; EMB_UNIT_TESTCALLER(ULOGFSTests,"ULOGFSTests",setUp,tearDown,fixtures); return (TestRef)&ULOGFSTests; };
TestRef PersonTest_tests(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("testfullname",testfullname), new_TestFixture("testfirstname",testfirstname), new_TestFixture("testlastname",testlastname), new_TestFixture("testsetfullname",testsetfullname), new_TestFixture("testsetfirstname",testsetfirstname), new_TestFixture("testsetlastname",testsetlastname), new_TestFixture("testnullcharfullname",testnullcharfullname), new_TestFixture("testnullpointerfullname",testnullpointerfullname), new_TestFixture("testnosepfullname",testnosepfullname), }; EMB_UNIT_TESTCALLER(PersonTest,"PersonTest",setUp,tearDown,fixtures); return (TestRef)&PersonTest; }
Test *tests_base64_tests(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture(test_base64_01_encode_string), new_TestFixture(test_base64_02_decode_base64), new_TestFixture(test_base64_03_single_character), new_TestFixture(test_base64_04_free_conversion), new_TestFixture(test_base64_05_decode_larger), new_TestFixture(test_base64_06_stream_encode), new_TestFixture(test_base64_07_stream_decode), new_TestFixture(test_base64_08_encode_16_bytes), new_TestFixture(test_base64_09_encode_size_determination), }; EMB_UNIT_TESTCALLER(base64_tests, NULL, NULL, fixtures); return (Test *)&base64_tests; }
static void test_sht1x_conversion(void) { const uint8_t vdds[] = { SHT1X_VDD_5_0V, SHT1X_VDD_4_0V, SHT1X_VDD_3_5V, SHT1X_VDD_3_0V, SHT1X_VDD_2_5V, }; const uint8_t confs[] = { SHT1X_CONF_LOW_RESOLUTION, 0 }; const uint16_t max_raw_temps[] = { 0xfff, 0x3fff }; const uint16_t max_raw_hums[] = { 0xff, 0xfff }; sht1x_dev_t dev = { .conf = 0 }; for (size_t i_res = 0; i_res < sizeof(confs) / sizeof(confs[0]); i_res++) { dev.conf = confs[i_res]; uint16_t max_raw_temp = max_raw_temps[i_res]; uint16_t max_raw_hum = max_raw_hums[i_res]; for (size_t i_vdd = 0; i_vdd < sizeof(vdds) / sizeof(vdds[0]); i_vdd++) { dev.vdd = vdds[i_vdd]; for (uint16_t raw_temp = 0; raw_temp <= max_raw_temp; raw_temp++) { int16_t got_temp = sht1x_temperature(&dev, raw_temp); int16_t exp_temp = expected_temp(&dev, raw_temp); TEST_ASSERT(((got_temp - max_diff_temp) <= exp_temp) && ((got_temp + max_diff_temp) >= exp_temp)); } } /* Testing for temperatures in -10.00°C and 65.00°C in steps of 0.13°C */ for (int16_t temp = -1000; temp < 6500; temp += 13) { for (uint16_t raw_hum = 0; raw_hum <= max_raw_hum; raw_hum++) { int16_t exp_hum = expected_hum(&dev, raw_hum, temp); if ((exp_hum < 0) || (exp_hum > 10000)) { /* Result out of range, ignore it */ continue; } int16_t got_hum = sht1x_humidity(&dev, raw_hum, temp); TEST_ASSERT(((got_hum - max_diff_hum) <= exp_hum) && ((got_hum + max_diff_hum) >= exp_hum)); } } } } Test *tests_sht1x_tests(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture(test_sht1x_conversion), }; EMB_UNIT_TESTCALLER(sht1x_tests, NULL, NULL, fixtures); return (Test *)&sht1x_tests; }
TestRef evcpe_cookie_test_case(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("cookie_test_init", test_init), new_TestFixture("cookie_test_set", test_set), new_TestFixture("cookie_test_set_from_header1", test_set_from_header1), new_TestFixture("cookie_test_set_from_header2", test_set_from_header2), new_TestFixture("cookie_test_set_from_header3", test_set_from_header3), new_TestFixture("cookie_test_set_from_header4", test_set_from_header4), new_TestFixture("cookie_test_set_from_header5", test_set_from_header5), }; EMB_UNIT_TESTCALLER(evcpe_cookie_test_case, "cookie_test_case", test_setup, test_teardown, fixtures); return (TestRef)&evcpe_cookie_test_case; }
Test *tests_pkt_tests(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture(test_pkt_len__NULL), new_TestFixture(test_pkt_len__1_elem__size_MAX), new_TestFixture(test_pkt_len__1_elem__size_0), new_TestFixture(test_pkt_len__1_elem__size_data), new_TestFixture(test_pkt_len__2_elem), new_TestFixture(test_pkt_len__2_elem__overflow), new_TestFixture(test_pkt_len__3_elem), }; EMB_UNIT_TESTCALLER(pkt_tests, NULL, NULL, fixtures); return (Test *)&pkt_tests; }
Test *tests_nanocoap_tests(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture(test_nanocoap__hdr), new_TestFixture(test_nanocoap__get_req), new_TestFixture(test_nanocoap__put_req), new_TestFixture(test_nanocoap__get_multi_path), new_TestFixture(test_nanocoap__get_root_path), new_TestFixture(test_nanocoap__get_max_path), new_TestFixture(test_nanocoap__get_path_too_long), }; EMB_UNIT_TESTCALLER(nanocoap_tests, NULL, NULL, fixtures); return (Test *)&nanocoap_tests; }
Test *tests_hashes_sha256_hmac_tests(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture(test_hashes_hmac_sha256_hash_sequence), new_TestFixture(test_hashes_hmac_sha256_hash_PRF1), new_TestFixture(test_hashes_hmac_sha256_hash_PRF2), new_TestFixture(test_hashes_hmac_sha256_hash_PRF3), new_TestFixture(test_hashes_hmac_sha256_hash_PRF4), new_TestFixture(test_hashes_hmac_sha256_hash_PRF5), new_TestFixture(test_hashes_hmac_sha256_hash_PRF6), }; EMB_UNIT_TESTCALLER(hashes_sha256_tests, NULL, NULL, fixtures); return (Test *)&hashes_sha256_tests; }
TestRef assertTest_tests(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture("testASSERT_EQUAL_STRING",testASSERT_EQUAL_STRING), new_TestFixture("testASSERT_EQUAL_INT",testASSERT_EQUAL_INT), new_TestFixture("testASSERT_NULL",testASSERT_NULL), new_TestFixture("testASSERT_NOT_NULL",testASSERT_NOT_NULL), new_TestFixture("testASSERT_MESSAGE",testASSERT_MESSAGE), new_TestFixture("testASSERT",testASSERT), }; EMB_UNIT_TESTCALLER(AssertTest,"AssertTest",setUp,tearDown,fixtures); return (TestRef)&AssertTest; }
Test *tests_pktqueue_tests(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture(test_pktqueue_remove_head_empty), new_TestFixture(test_pktqueue_remove_head_one), new_TestFixture(test_pktqueue_add_one), new_TestFixture(test_pktqueue_add_two_equal), new_TestFixture(test_pktqueue_add_two_distinct), new_TestFixture(test_pktqueue_remove_one), }; EMB_UNIT_TESTCALLER(pktqueue_tests, set_up, NULL, fixtures); return (Test *)&pktqueue_tests; }
Test *tests_core_atomic_tests(void) { EMB_UNIT_TESTFIXTURES(fixtures) { new_TestFixture(test_atomic_set_return_null_null), new_TestFixture(test_atomic_set_return_one_null), new_TestFixture(test_atomic_set_return_null_one), new_TestFixture(test_atomic_set_return_limit_null), new_TestFixture(test_atomic_set_return_null_limit), new_TestFixture(test_atomic_set_return_null_random), }; EMB_UNIT_TESTCALLER(core_atomic_tests, NULL, NULL, fixtures); return (Test *)&core_atomic_tests; }