Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cellular: add cellular network tests #7269

Merged
merged 3 commits into from
Jun 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
418 changes: 418 additions & 0 deletions features/cellular/TESTS/api/cellular_network/main.cpp

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions features/cellular/UNITTESTS/at/at_cellularnetwork/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ COMPONENT_NAME = AT_CellularNetwork_unit

#This must be changed manually
SRC_FILES = \
../../../framework/AT/AT_CellularNetwork.cpp
../../../framework/AT/AT_CellularNetwork.cpp \
../../../framework/AT/AT_CellularStack.cpp \
../../../framework/common/CellularUtil.cpp \

TEST_SRC_FILES = \
main.cpp \
Expand All @@ -15,9 +17,11 @@ TEST_SRC_FILES = \
../../stubs/EventQueue_stub.cpp \
../../stubs/FileHandle_stub.cpp \
../../stubs/NetworkInterface_stub.cpp \
../../stubs/CellularUtil_stub.cpp \
../../stubs/NetworkStack_stub.cpp \
../../stubs/us_ticker_stub.cpp \
../../stubs/mbed_assert_stub.cpp \
../../stubs/SocketAddress_stub.cpp \
../../stubs/randLIB_stub.cpp \

include ../../MakefileWorker.mk

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
#include "CppUTest/TestHarness.h"
#include "test_at_cellularnetwork.h"
#include "ATHandler_stub.h"

TEST_GROUP(AT_CellularNetwork)
{
Expand All @@ -24,6 +25,9 @@ TEST_GROUP(AT_CellularNetwork)
void setup()
{
unit = new Test_AT_CellularNetwork();
ATHandler_stub::int_count = kRead_int_table_size;
ATHandler_stub::read_string_index = kRead_string_table_size;
ATHandler_stub::resp_stop_success_count = kResp_stop_count_default;
}

void teardown()
Expand All @@ -42,11 +46,21 @@ TEST(AT_CellularNetwork, test_AT_CellularNetwork_constructor)
unit->test_AT_CellularNetwork_constructor();
}

TEST(AT_CellularNetwork, test_AT_CellularNetwork_init)
{
unit->test_AT_CellularNetwork_init();
}

TEST(AT_CellularNetwork, test_AT_CellularNetwork_set_credentials)
{
unit->test_AT_CellularNetwork_set_credentials();
}

TEST(AT_CellularNetwork, test_AT_CellularNetwork_activate_context)
{
unit->test_AT_CellularNetwork_activate_context();
}

TEST(AT_CellularNetwork, test_AT_CellularNetwork_connect)
{
unit->test_AT_CellularNetwork_connect();
Expand All @@ -72,6 +86,16 @@ TEST(AT_CellularNetwork, test_AT_CellularNetwork_get_registration_status)
unit->test_AT_CellularNetwork_get_registration_status();
}

TEST(AT_CellularNetwork, test_AT_CellularNetwork_get_network_registering_mode)
{
unit->test_AT_CellularNetwork_get_network_registering_mode();
}

TEST(AT_CellularNetwork, test_AT_CellularNetwork_set_registration_urc)
{
unit->test_AT_CellularNetwork_set_registration_urc();
}

TEST(AT_CellularNetwork, test_AT_CellularNetwork_set_attach)
{
unit->test_AT_CellularNetwork_set_attach();
Expand Down Expand Up @@ -107,6 +131,11 @@ TEST(AT_CellularNetwork, test_AT_CellularNetwork_set_access_technology)
unit->test_AT_CellularNetwork_set_access_technology();
}

TEST(AT_CellularNetwork, test_AT_CellularNetwork_get_access_technology)
{
unit->test_AT_CellularNetwork_get_access_technology();
}

TEST(AT_CellularNetwork, test_AT_CellularNetwork_scan_plmn)
{
unit->test_AT_CellularNetwork_scan_plmn();
Expand Down Expand Up @@ -166,3 +195,19 @@ TEST(AT_CellularNetwork, test_AT_CellularNetwork_get_operator_names)
{
unit->test_AT_CellularNetwork_get_operator_names();
}

TEST(AT_CellularNetwork, test_AT_CellularNetwork_attach)
{
unit->test_AT_CellularNetwork_attach();
}

TEST(AT_CellularNetwork, test_get_connection_status)
{
unit->test_get_connection_status();
}

TEST(AT_CellularNetwork, test_set_blocking)
{
unit->test_set_blocking();
}

Loading