Skip to content

Conversation

@rosemarybennyy
Copy link
Contributor

Reason for change: Adding L1 unit test cases for reportgenand commonlib
Test Procedure: Tested and verified
Risks: Medium
Priority: P1

Copilot AI review requested due to automatic review settings February 3, 2026 15:34
@rosemarybennyy rosemarybennyy requested a review from a team as a code owner February 3, 2026 15:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds additional L1 unit tests for reportgen and commonlib behavior, including error/edge branches that were previously untested.

Changes:

  • Added reportgen unit tests covering realloc-failure handling in prepareHttpUrl, additional trim/regex branches in encodeParamResultInJSON, and a positive regex-match path for applyRegexToValue via callback.
  • Added commonlib unit tests for t2_event_* cache-enabled/disabled paths and additional getParamValue boolean handling.
  • Introduced #ifdef GTEST_ENABLE helper hooks in telemetry_busmessage_sender.c to expose internal state and a callback to the internal event-marker population function for testing.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
source/test/reportgen/reportgenTest.cpp Adds new reportgen unit tests, including realloc-failure injection and additional regex/trim coverage.
source/test/commonlib/TelemetryBusMsgSender.cpp Adds commonlib unit tests for event sending paths and boolean parameter retrieval, plus use of new test hooks.
source/commonlib/telemetry_busmessage_sender.c Adds GTEST-only exported helpers to access internal flags and the internal marker-list function for unit tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Reason for change: Adding L1 unit test cases for reportgenand commonlib
Test Procedure:  Tested and verified
Risks: Medium
Priority: P1

Signed-off-by: Rose Mary Benny <RoseMary_Benny@comcast.com>
Copy link

Copilot AI commented Feb 11, 2026

@shibu-kv I've opened a new pull request, #261, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI review requested due to automatic review settings February 11, 2026 19:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +412 to +425
CURL* curl = (CURL*) 0xffee;
char* profile = strdup("RDK_Profile");

// Prepare the expectations for Curl and our mock functions
EXPECT_CALL(*m_reportgenMock, curl_easy_init())
.Times(1)
.WillOnce(Return(curl));
EXPECT_CALL(*m_reportgenMock, curl_easy_escape(_,_,_))
.Times(1)
.WillOnce(Return(profile));
EXPECT_CALL(*m_reportgenMock, curl_free(profile))
.Times(1);
EXPECT_CALL(*m_reportgenMock, curl_easy_cleanup(curl))
.Times(1);
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

In prepareHttpUrl_ReallocFails, profile is allocated via strdup but never freed. Since curl_free is mocked, it won’t actually free this memory unless you add an action (e.g., invoke free) or explicitly free(profile) after the call. This keeps the test leak-free under sanitizers/valgrind.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants