Skip to content

Add unit tests for getDeviceTypeRFC()#220

Draft
Copilot wants to merge 3 commits into
topic/RDKEMW-13335from
copilot/sub-pr-205-please-work
Draft

Add unit tests for getDeviceTypeRFC()#220
Copilot wants to merge 3 commits into
topic/RDKEMW-13335from
copilot/sub-pr-205-please-work

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 17, 2026

getDeviceTypeRFC() introduced RFC-to-device-type mapping logic ("prod", "test", "unknown") with no unit test coverage. Adds tests to fwdl_interface_gtest.cpp using the existing InterfaceTestFixture and g_InterfaceMock.

New tests

  • TestName_getDeviceTypeRFCReadFailuregetRFCParameter returns WDMP_FAILURE; expects "unknown"
  • TestName_getDeviceTypeRFCProd — RFC value "prod", expects "prod"
  • TestName_getDeviceTypeRFCTest — RFC value "test", expects "test"
  • TestName_getDeviceTypeRFCUnknown — Unrecognized RFC value ("staging"), expects "unknown"

Invoke lambdas override param->value to inject specific RFC strings through the existing mock chain:

TEST_F(InterfaceTestFixture, TestName_getDeviceTypeRFCProd)
{
    char deviceType[32] = {0};
    EXPECT_CALL(*g_InterfaceMock, getRFCParameter(_, _, _)).Times(1)
        .WillOnce(Invoke([](char* /*type*/, const char* /*key*/, RFC_ParamData_t *param) {
            snprintf(param->value, sizeof(param->value), "%s", "prod");
            return 1;
        }));
    getDeviceTypeRFC(deviceType, sizeof(deviceType));
    EXPECT_STREQ(deviceType, "prod");
}

Also adds a .gitignore to prevent autotools/build artifacts from polluting future commits.


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI and others added 2 commits March 17, 2026 07:54
…od, test, and unknown cases

Co-authored-by: KTirumalaSrihari <102281309+KTirumalaSrihari@users.noreply.github.com>
Co-authored-by: KTirumalaSrihari <102281309+KTirumalaSrihari@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Mar 17, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Copilot AI changed the title [WIP] [WIP] Address feedback on unlocking debug service mechanism Add unit tests for getDeviceTypeRFC() Mar 17, 2026
Copilot AI requested a review from KTirumalaSrihari March 17, 2026 07:56
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.

2 participants