-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix network and util ut #8229
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
Fix network and util ut #8229
Conversation
@@ -1048,7 +1047,7 @@ TEST_F(TestAT_CellularNetwork, test_AT_CellularNetwork_get_operator_params) | |||
EXPECT_TRUE(NSAPI_ERROR_OK == cn.get_operator_params(format, ops)); | |||
EXPECT_TRUE(format == 0); | |||
EXPECT_TRUE(strcmp(ops.op_long, "12345") == 0); | |||
EXPECT_TRUE(strlen(ops.op_short) == 0); | |||
EXPECT_EQ(strlen(ops.op_short), 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesnt make sense but in my env it was failing EXPECT_TRUE style but not when using EXPECT_EQ.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strlen expects NULL terminated value, so check that code is doing it.
Some compilers auto assing to \0 and some don't so your failing case is actually a bug in the code
Don't fix unit test but the actual code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added initialisation in constructor for the char arrays of operator_t. Problem solved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check that read_string is putting trailing '\0' for buffer in all cases (seems that it is partially working now
a8fce77
to
30da9c1
Compare
/morph build |
Build : SUCCESSBuild number : 3155 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 2759 |
/morph test |
/morph test |
Description
Fix for cellular network and cellular util unit tests.
Pull request type