Feature/rdk 60236 comma#188
Open
Abhinavpv28 wants to merge 76 commits intodevelopfrom
Open
Conversation
Code Coverage Summary |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 8 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
src/unittest/rrdUnitTestRunner.cpp:3777
- This test builds a
data_buf rbufwithout zero-initializing it (fields likeappendMode,dsEventare left uninitialized) and allocatesrbuf.mdata,rbuf.suffix, andmsgHdr.mbodywithout freeing them afterRRDEventThreadFunc()returns. Since the EVENT_MSG path does not free the received buffer, this can cause leaks and test flakiness depending on the garbage values in the struct. Initializerbuf(e.g.,data_buf rbuf = {};/RRD_data_buff_init) and explicitly freemsgHdr.mbodyand any owned allocations after the call (or adjust the code under test to own/free them consistently).
data_buf rbuf;
rbuf.mtype = EVENT_MSG;
rbuf.mdata = strdup("Test");
rbuf.inDynamic = true;
rbuf.jsonPath = nullptr;
rbuf.suffix = strdup("_search_b675-657-556-656");
ASSERT_NE(rbuf.suffix, nullptr);
msgRRDHdr msgHdr;
msgHdr.mbody = malloc(sizeof(data_buf));
ASSERT_NE(msgHdr.mbody, nullptr);
memcpy(msgHdr.mbody, &rbuf, sizeof(data_buf));
ASSERT_NE(msgsnd(msqid, &msgHdr, sizeof(void *), 0), -1);
Code Coverage Summary |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/unittest/rrdUnitTestRunner.cpp:3775
- This test constructs a
data_bufwithout zero-initializing it (leaving fields likeappendMode/dsEventindeterminate) and allocatesrbuf.suffixwithout a clear ownership/freeing path in the test. Please initialize the struct (e.g., value-initialize or callRRD_data_buff_initand then set the fields you need) and ensure any heap allocations made by the test are released (or assert that the code under test takes ownership and frees them).
data_buf rbuf;
rbuf.mtype = EVENT_MSG;
rbuf.mdata = strdup("Test");
rbuf.inDynamic = true;
rbuf.jsonPath = nullptr;
rbuf.suffix = strdup("_search_b675-657-556-656");
msgRRDHdr msgHdr;
msgHdr.mbody = malloc(sizeof(data_buf));
ASSERT_NE(msgHdr.mbody, nullptr);
memcpy(msgHdr.mbody, &rbuf, sizeof(data_buf));
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Code Coverage Summary |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Code Coverage Summary |
Code Coverage Summary |
Code Coverage Summary |
Code Coverage Summary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.