Skip to content

Fixed lorawan unittests valgrind issues #8453

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

Merged
merged 1 commit into from
Oct 17, 2018

Conversation

AnttiKauppila
Copy link

Description

LoRaWAN unit tests are having lots of valgrind issues because of unitialized variables
Those are now fixed

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

@AnttiKauppila
Copy link
Author

@hasnainvirk please review

@@ -64,7 +65,9 @@ TEST_F(Test_LoRaMac, initialize)
object->bind_phy(phy);

lorawan_connect_t conn;
memset(&conn, 0, sizeof(conn));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more elegantly and correctly done as lorawan_connect_t conn = { 0 };, although GCC sometimes annoyingly and pointlessly complains about missing braces.

In C++98 you can also do lorawan_connect_t conn = lorawan_connect_t();

C++11 would allow the terser lorawan_connect_t conn{};

Copy link
Contributor

@hasnainvirk hasnainvirk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@cmonr
Copy link
Contributor

cmonr commented Oct 17, 2018

/morph build

@cmonr
Copy link
Contributor

cmonr commented Oct 17, 2018

@AnttiKauppila Thanks for the fix!
Puts into the context the quick fix that @hasnainvirk was able to do yesterday.

@hasnainvirk
Copy link
Contributor

@cmonr Yesterday we had 1 hour for the fix. So made sure that valgrind warnings were not fatal. And today Antti completes the task with zero warnings. Thanks for the support.

@mbed-ci
Copy link

mbed-ci commented Oct 17, 2018

@cmonr
Copy link
Contributor

cmonr commented Oct 17, 2018

IAR network license issues.
/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 17, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Oct 17, 2018

@mbed-ci
Copy link

mbed-ci commented Oct 17, 2018

@cmonr cmonr merged commit c8ada37 into ARMmbed:master Oct 17, 2018
@AnttiKauppila AnttiKauppila deleted the valgrind_fixes branch October 18, 2018 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants