Skip to content

Comments

Add test coverage for RDKLOG_FORMAT_WITH_TID, RDKLOG_FORMAT_WITH_TS_TID, and RDKLOG_FORMAT_DETAIL_WITHOUT_TS formats#50

Merged
karuna2git merged 19 commits intotopic/LogHugeDatafrom
copilot/sub-pr-49
Feb 22, 2026
Merged

Add test coverage for RDKLOG_FORMAT_WITH_TID, RDKLOG_FORMAT_WITH_TS_TID, and RDKLOG_FORMAT_DETAIL_WITHOUT_TS formats#50
karuna2git merged 19 commits intotopic/LogHugeDatafrom
copilot/sub-pr-49

Conversation

Copy link

Copilot AI commented Feb 20, 2026

PR #49 added three new log format enums (RDKLOG_FORMAT_WITH_TID, RDKLOG_FORMAT_WITH_TS_TID, RDKLOG_FORMAT_DETAIL_WITHOUT_TS) without corresponding test coverage in rdkLoggerRotationTest.cpp.

Changes

  • Added three test cases to rdkLoggerRotationTest.cpp:

    • FormatWithTID: Validates thread ID inclusion in log output
    • FormatWithTSTID: Validates both timestamp and thread ID in log output
    • FormatDetailWithoutTS: Validates detailed format without timestamp
  • Each test:

    • Initializes logger with specific format via rdk_logger_ext_init()
    • Generates 15 messages with 150-char payloads (exceeds 512B rotation threshold)
    • Reads log file to verify format-specific content (thread IDs, timestamps, module names)
    • Uses existing RUN_IN_FORK pattern for test isolation
  • Added .gitignore for autotools build artifacts

// Example: FormatWithTID test validates thread ID presence
config.format = RDKLOG_FORMAT_WITH_TID;
rdk_logger_ext_init(&config);

// Generate logs and verify
FILE* logFile = fopen(logFilePath, "r");
if (strstr(line, "TID") != NULL || strchr(line, '[') != NULL) {
    foundThreadId = true;
}
EXPECT_TRUE(foundThreadId) << "Log should contain thread ID information";

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 5 commits February 20, 2026 01:44
Co-authored-by: karuna2git <48997923+karuna2git@users.noreply.github.com>
…tation

Co-authored-by: karuna2git <48997923+karuna2git@users.noreply.github.com>
Co-authored-by: karuna2git <48997923+karuna2git@users.noreply.github.com>
Co-authored-by: karuna2git <48997923+karuna2git@users.noreply.github.com>
Co-authored-by: karuna2git <48997923+karuna2git@users.noreply.github.com>
Copilot AI changed the title [WIP] Add test cases for new formats in rdkLoggerRotationTest.cpp Add test coverage for RDKLOG_FORMAT_WITH_TID, RDKLOG_FORMAT_WITH_TS_TID, and RDKLOG_FORMAT_DETAIL_WITHOUT_TS formats Feb 20, 2026
Copilot AI requested a review from karuna2git February 20, 2026 01:49
@github-actions
Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the CLA.
✅ (karuna2git)[https://github.com/karuna2git]
❌ @Copilot
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@karuna2git karuna2git marked this pull request as ready for review February 20, 2026 02:01
@karuna2git karuna2git requested a review from a team as a code owner February 20, 2026 02:01
Copilot AI review requested due to automatic review settings February 20, 2026 02:01
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

This pull request adds test coverage for three log format enums that were introduced in PR #49 but lacked corresponding tests. The tests validate that the logger correctly applies thread ID, timestamp, and detailed formatting options.

Changes:

  • Added three new test cases to rdkLoggerRotationTest.cpp to validate RDKLOG_FORMAT_WITH_TID, RDKLOG_FORMAT_WITH_TS_TID, and RDKLOG_FORMAT_DETAIL_WITHOUT_TS formats
  • Each test follows the existing pattern using RUN_IN_FORK for process isolation, initializes the logger with a specific format, generates test logs, and validates the output
  • Tests verify format-specific content by reading log files and checking for expected elements (thread IDs, timestamps, module names)

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

karuna2git and others added 9 commits February 19, 2026 22:28
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@karuna2git karuna2git merged commit d26306d into topic/LogHugeData Feb 22, 2026
1 of 3 checks passed
@karuna2git karuna2git deleted the copilot/sub-pr-49 branch February 22, 2026 05:13
@github-actions github-actions bot locked and limited conversation to collaborators Feb 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants