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

Merged
merged 2 commits into from Sep 25, 2018

Conversation

Projects
None yet
7 participants
@mirelachirica
Contributor

mirelachirica commented Sep 24, 2018

Description

Fix for cellular network and cellular util unit tests.

Pull request type

[ x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Breaking change
@@ -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);

This comment has been minimized.

@mirelachirica

mirelachirica Sep 24, 2018

Contributor

This doesnt make sense but in my env it was failing EXPECT_TRUE style but not when using EXPECT_EQ.

This comment has been minimized.

@AnttiKauppila

AnttiKauppila Sep 24, 2018

Contributor

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.

This comment has been minimized.

@mirelachirica

mirelachirica Sep 24, 2018

Contributor

Added initialisation in constructor for the char arrays of operator_t. Problem solved.

@0xc0170 0xc0170 requested a review from ARMmbed/mbed-os-wan Sep 24, 2018

@jarvte

jarvte approved these changes Sep 24, 2018

@AnttiKauppila

Check that read_string is putting trailing '\0' for buffer in all cases (seems that it is partially working now

@0xc0170 0xc0170 added needs: work and removed needs: review labels Sep 24, 2018

@mirelachirica mirelachirica force-pushed the mirelachirica:fix_network_and_util_ut branch from a8fce77 to 30da9c1 Sep 24, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Sep 24, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Sep 24, 2018

Build : SUCCESS

Build number : 3155
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8229/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Sep 25, 2018

/morph test

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Sep 25, 2018

/morph test

@mbed-ci

This comment has been minimized.

@cmonr cmonr merged commit 3bec1b7 into ARMmbed:master Sep 25, 2018

15 checks passed

ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/cloud_client_smoke_test Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Passed, 612 files
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9139 cycles (+87 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8372B (+0.00%)
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details

@cmonr cmonr removed the needs: CI label Sep 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment