forked from ARMmbed/mbed-os
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FHSS unit tests: Implemented FHSS common unit tests
- Loading branch information
Jarkko Paso
committed
Mar 6, 2018
1 parent
2188af4
commit f973986
Showing
7 changed files
with
496 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
include ../../makefile_defines.txt | ||
|
||
COMPONENT_NAME = fhss_common_unit | ||
|
||
#This must be changed manually | ||
SRC_FILES = \ | ||
../../../../../source/Service_Libs/fhss/fhss_common.c \ | ||
|
||
|
||
TEST_SRC_FILES = \ | ||
main.cpp \ | ||
fhsscommontest.cpp \ | ||
test_fhss_common.c \ | ||
../../stub/mbed_trace_stub.c \ | ||
../../stub/nsdynmemLIB_stub.c \ | ||
../../stub/event_stub.c \ | ||
../../stub/ns_timer_stub.c \ | ||
../../stub/fhss_stub.c \ | ||
../../stub/fhss_config_stub.c \ | ||
../../stub/fhss_platform_stub.c \ | ||
../../stub/fhss_callbacks_stub.c \ | ||
|
||
include ../../MakefileWorker.mk | ||
|
||
CPPUTESTFLAGS += -DFEA_TRACE_SUPPORT | ||
|
92 changes: 92 additions & 0 deletions
92
test/nanostack/unittest/service_libs/fhss_common/fhsscommontest.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* Copyright (c) 2016 ARM. All rights reserved. | ||
*/ | ||
#include "CppUTest/TestHarness.h" | ||
#include "test_fhss_common.h" | ||
|
||
|
||
TEST_GROUP(fhss_common) | ||
{ | ||
void setup() | ||
{ | ||
} | ||
|
||
void teardown() | ||
{ | ||
} | ||
}; | ||
|
||
TEST(fhss_common, test_fhss_allocate_instance) | ||
{ | ||
CHECK(test_fhss_allocate_instance()); | ||
} | ||
|
||
TEST(fhss_common, test_fhss_free_instance) | ||
{ | ||
CHECK(test_fhss_free_instance()); | ||
} | ||
|
||
TEST(fhss_common, test_fhss_set_datarate) | ||
{ | ||
CHECK(test_fhss_set_datarate()); | ||
} | ||
|
||
TEST(fhss_common, test_fhss_get_object_with_api) | ||
{ | ||
CHECK(test_fhss_get_object_with_api()); | ||
} | ||
|
||
TEST(fhss_common, test_fhss_disable) | ||
{ | ||
CHECK(test_fhss_disable()); | ||
} | ||
|
||
TEST(fhss_common, test_fhss_start_timer) | ||
{ | ||
CHECK(test_fhss_start_timer()); | ||
} | ||
|
||
TEST(fhss_common, test_fhss_timeout_start) | ||
{ | ||
CHECK(test_fhss_timeout_start()); | ||
} | ||
|
||
TEST(fhss_common, test_fhss_timeout_stop) | ||
{ | ||
CHECK(test_fhss_timeout_stop()); | ||
} | ||
|
||
TEST(fhss_common, test_fhss_update_synch_parent_address) | ||
{ | ||
CHECK(test_fhss_update_synch_parent_address()); | ||
} | ||
|
||
TEST(fhss_common, test_fhss_trig_event) | ||
{ | ||
CHECK(test_fhss_trig_event()); | ||
} | ||
|
||
TEST(fhss_common, test_fhss_compare_with_synch_parent_address) | ||
{ | ||
CHECK(test_fhss_compare_with_synch_parent_address()); | ||
} | ||
|
||
TEST(fhss_common, test_fhss_use_broadcast_queue_cb) | ||
{ | ||
CHECK(test_fhss_use_broadcast_queue_cb()); | ||
} | ||
|
||
TEST(fhss_common, test_fhss_read_timestamp_cb) | ||
{ | ||
CHECK(test_fhss_read_timestamp_cb()); | ||
} | ||
|
||
TEST(fhss_common, test_fhss_init_callbacks_cb) | ||
{ | ||
CHECK(test_fhss_init_callbacks_cb()); | ||
} | ||
|
||
TEST(fhss_common, test_fhss_clear_active_event) | ||
{ | ||
CHECK(test_fhss_clear_active_event()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright (c) 2016 ARM. All rights reserved. | ||
*/ | ||
|
||
#include "CppUTest/CommandLineTestRunner.h" | ||
#include "CppUTest/TestPlugin.h" | ||
#include "CppUTest/TestRegistry.h" | ||
#include "CppUTestExt/MockSupportPlugin.h" | ||
int main(int ac, char** av) | ||
{ | ||
return CommandLineTestRunner::RunAllTests(ac, av); | ||
} | ||
|
||
IMPORT_TEST_GROUP(fhss_common); | ||
|
Oops, something went wrong.