Skip to content

Commit

Permalink
fix: do not overwrite ret value during tear down in functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyTubongbanua committed Dec 23, 2024
1 parent 7a0d22d commit fb8fb71
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions tests/functional_tests/tests/test_atclient_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ int main() {

goto exit;
exit: {
if ((ret = functional_tests_tear_down_sharedenckeys(&atclient1, ATKEY_SHAREDWITH)) != 0) {
ret = 1;
if ((functional_tests_tear_down_sharedenckeys(&atclient1, ATKEY_SHAREDWITH)) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to tear down sharedenckeys: %d\n", ret);
}
atclient_atkeys_free(&atkeys_sharedby);
Expand Down
2 changes: 1 addition & 1 deletion tests/functional_tests/tests/test_atclient_notify.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static int test_1_notify(atclient *atclient, char *notification_id) {
goto exit;

exit: {
if ((ret = functional_tests_tear_down_sharedenckeys(atclient, ATKEY_SHAREDWITH)) != 0) {
if (functional_tests_tear_down_sharedenckeys(atclient, ATKEY_SHAREDWITH) != 0) {
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "Failed to tear down sharedenckeys: %d\n", ret);
}
atclient_notify_params_free(&params);
Expand Down
2 changes: 0 additions & 2 deletions tests/functional_tests/tests/test_atclient_sharedkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,9 @@ int main(int argc, char *argv[]) {

exit: {
if (functional_tests_tear_down_sharedenckeys(&atclient1, SECOND_ATSIGN) != 0) {
ret = 1;
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "tear_down: %d\n", ret);
}
if (functional_tests_tear_down_sharedenckeys(&atclient2, FIRST_ATSIGN) != 0) {
ret = 1;
atlogger_log(TAG, ATLOGGER_LOGGING_LEVEL_ERROR, "tear_down: %d\n", ret);
}
atclient_free(&atclient1);
Expand Down

0 comments on commit fb8fb71

Please sign in to comment.