Skip to content

Commit 8346498

Browse files
Mirela Chiricaadbridge
authored andcommitted
Cellular: Fix greentea network set credentials test case
1 parent 2ca0f74 commit 8346498

File tree

1 file changed

+6
-3
lines changed
  • features/cellular/TESTS/api/cellular_network

1 file changed

+6
-3
lines changed

features/cellular/TESTS/api/cellular_network/main.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,13 @@ static void test_connect()
206206

207207
static void test_credentials()
208208
{
209-
TEST_ASSERT(nw->set_credentials(NULL, "username", "pass") == NSAPI_ERROR_OK);
209+
nsapi_error_t err = nw->set_credentials(NULL, "username", "pass");
210+
TEST_ASSERT(err == NSAPI_ERROR_OK || err == NSAPI_ERROR_UNSUPPORTED);
211+
err = nw->set_credentials("internet", "user", NULL);
212+
TEST_ASSERT(err == NSAPI_ERROR_OK || err == NSAPI_ERROR_UNSUPPORTED);
213+
err = nw->set_credentials("internet", CellularNetwork::NOAUTH, "user", "pass");
214+
TEST_ASSERT(err == NSAPI_ERROR_OK || err == NSAPI_ERROR_UNSUPPORTED);
210215
TEST_ASSERT(nw->set_credentials("internet", NULL, "pass") == NSAPI_ERROR_OK);
211-
TEST_ASSERT(nw->set_credentials("internet", "user", NULL) == NSAPI_ERROR_OK);
212-
TEST_ASSERT(nw->set_credentials("internet", CellularNetwork::NOAUTH, "user", "pass") == NSAPI_ERROR_OK);
213216
}
214217

215218
static void test_other()

0 commit comments

Comments
 (0)