RDKEMW-19229 : Improve L1 Coverage for tr69hostif and Fix Errors - #503
Open
madhubabutt wants to merge 1 commit into
Open
RDKEMW-19229 : Improve L1 Coverage for tr69hostif and Fix Errors#503madhubabutt wants to merge 1 commit into
madhubabutt wants to merge 1 commit into
Conversation
Code Coverage Summary |
1 similar comment
Code Coverage Summary |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR focuses on increasing L1 unit-test coverage for tr69hostif by adding Google Test cases that exercise additional error-handling and edge-condition paths across hostIf utils, DeviceInfo profile logic, parodusClient data-model helpers, and the HTTP server request handler test suite.
Changes:
- Added new negative/edge-case tests for utilities (e.g., unexpected BS update source, invalid NTP date parsing).
- Added DeviceInfo tests for MemInsight Trigger setter validation paths.
- Added multiple new tests in parodusClient and httpserver suites to cover additional boundary/error scenarios.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
src/hostif/src/gtest/gtest_src.cpp |
Adds coverage for unexpected BS update sources and invalid NTP date formatting. |
src/hostif/profiles/DeviceInfo/gtest/gtest_main.cpp |
Adds tests for MemInsight Trigger setter error handling (but currently introduces a duplicate test name). |
src/hostif/parodusClient/gtest/dm_test.cpp |
Adds coverage for freeDataModelParam, time delta negative case, notification payload bounds, and validation scenarios (but currently introduces a duplicate test name). |
src/hostif/httpserver/src/gtest/gtest_httpserver.cpp |
Adds several new request-handler tests and conversion-path tests (but currently includes non-compiling uses of req_struct/get_req_t and incorrect calls to convertAndAssignParamValue). |
| EXPECT_EQ(param.faultCode, fcInvalidParameterType); | ||
| } | ||
|
|
||
| TEST(deviceTest, set_Device_DeviceInfo_X_RDKCENTRAL_COM_MemInsight_Trigger_InvalidType) { |
Comment on lines
+1038
to
+1049
| TEST(HTTPServerTest, handleRFCRequest_SET_InvalidParam_ReturnsError) { | ||
| req_struct reqSt; | ||
| memset(&reqSt, 0, sizeof(req_struct)); | ||
| reqSt.request.type = WDMP_SET; | ||
| reqSt.request.u.setReq = nullptr; | ||
|
|
||
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } | ||
| } |
Comment on lines
+1051
to
+1068
| TEST(HTTPServerTest, handleRFCRequest_GET_EmptyParam_ReturnsError) { | ||
| req_struct reqSt; | ||
| memset(&reqSt, 0, sizeof(req_struct)); | ||
| reqSt.request.type = WDMP_GET; | ||
| reqSt.request.u.getReq = (get_req_t *)malloc(sizeof(get_req_t)); | ||
| if (reqSt.request.u.getReq) { | ||
| memset(reqSt.request.u.getReq, 0, sizeof(get_req_t)); | ||
| reqSt.request.u.getReq->paramCount = 0; | ||
| reqSt.request.u.getReq->paramNames = nullptr; | ||
|
|
||
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0); | ||
| wdmp_free_res_struct(respSt); | ||
| } | ||
| free(reqSt.request.u.getReq); | ||
| } | ||
| } |
Comment on lines
+1070
to
+1094
| TEST(HTTPServerTest, handleRFCRequest_REPLACE_ValidParam) { | ||
| req_struct reqSt; | ||
| memset(&reqSt, 0, sizeof(req_struct)); | ||
| reqSt.request.type = WDMP_REPLACE; | ||
| reqSt.request.u.setReq = (set_req_t *)malloc(sizeof(set_req_t)); | ||
| if (reqSt.request.u.setReq) { | ||
| memset(reqSt.request.u.setReq, 0, sizeof(set_req_t)); | ||
| reqSt.request.u.setReq->paramCount = 1; | ||
| reqSt.request.u.setReq->param = (param_t *)malloc(sizeof(param_t)); | ||
| memset(reqSt.request.u.setReq->param, 0, sizeof(param_t)); | ||
| reqSt.request.u.setReq->param[0].name = strdup("Device.DeviceInfo.SerialNumber"); | ||
| reqSt.request.u.setReq->param[0].value = strdup("TestSN"); | ||
| reqSt.request.u.setReq->param[0].type = WDMP_STRING; | ||
|
|
||
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt > 0); | ||
| wdmp_free_res_struct(respSt); | ||
| } | ||
| free(reqSt.request.u.setReq->param[0].name); | ||
| free(reqSt.request.u.setReq->param[0].value); | ||
| free(reqSt.request.u.setReq->param); | ||
| free(reqSt.request.u.setReq); | ||
| } | ||
| } |
Comment on lines
+1155
to
+1168
| TEST(HTTPServerTest, convertAndAssignParamValue_BoolType) { | ||
| param_t param; | ||
| memset(¶m, 0, sizeof(param_t)); | ||
| param.type = WDMP_BOOLEAN; | ||
| param.value = (char*)"true"; | ||
| param.name = (char*)"Device.Test.Param"; | ||
|
|
||
| HOSTIF_MsgData_t msgData; | ||
| memset(&msgData, 0, sizeof(HOSTIF_MsgData_t)); | ||
| strncpy(msgData.paramName, param.name, TR69HOSTIFMGR_MAX_PARAM_LEN - 1); | ||
|
|
||
| int ret = convertAndAssignParamValue(&msgData, param); | ||
| EXPECT_TRUE(ret == 0 || ret == -1); | ||
| } |
Comment on lines
+1170
to
+1183
| TEST(HTTPServerTest, convertAndAssignParamValue_IntType) { | ||
| param_t param; | ||
| memset(¶m, 0, sizeof(param_t)); | ||
| param.type = WDMP_INT; | ||
| param.value = (char*)"42"; | ||
| param.name = (char*)"Device.Test.IntParam"; | ||
|
|
||
| HOSTIF_MsgData_t msgData; | ||
| memset(&msgData, 0, sizeof(HOSTIF_MsgData_t)); | ||
| strncpy(msgData.paramName, param.name, TR69HOSTIFMGR_MAX_PARAM_LEN - 1); | ||
|
|
||
| int ret = convertAndAssignParamValue(&msgData, param); | ||
| EXPECT_TRUE(ret == 0 || ret == -1); | ||
| } |
Comment on lines
+1185
to
+1205
| TEST(HTTPServerTest, handleRFCRequest_ATTRS_UnknownParam_ReturnsNone) { | ||
| req_struct reqSt; | ||
| memset(&reqSt, 0, sizeof(req_struct)); | ||
| reqSt.request.type = WDMP_ATTR; | ||
| reqSt.request.u.getReq = (get_req_t *)malloc(sizeof(get_req_t)); | ||
| if (reqSt.request.u.getReq) { | ||
| memset(reqSt.request.u.getReq, 0, sizeof(get_req_t)); | ||
| reqSt.request.u.getReq->paramCount = 1; | ||
| reqSt.request.u.getReq->paramNames = (char **)malloc(sizeof(char*)); | ||
| reqSt.request.u.getReq->paramNames[0] = strdup("Device.Unknown.UnknownParam"); | ||
|
|
||
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0); | ||
| wdmp_free_res_struct(respSt); | ||
| } | ||
| free(reqSt.request.u.getReq->paramNames[0]); | ||
| free(reqSt.request.u.getReq->paramNames); | ||
| free(reqSt.request.u.getReq); | ||
| } | ||
| } |
Comment on lines
+4262
to
+4280
| TEST(deviceTest, set_Device_DeviceInfo_X_RDKCENTRAL_COM_MemInsight_Trigger_InvalidType) { | ||
| int instanceNumber = 0; | ||
| HOSTIF_MsgData_t param = { 0 }; | ||
| memset(¶m, 0, sizeof(HOSTIF_MsgData_t)); | ||
| param.reqType = HOSTIF_SET; | ||
| strncpy(param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.MemInsight.Trigger", TR69HOSTIFMGR_MAX_PARAM_LEN - 1); | ||
| param.bsUpdate = HOSTIF_NONE; | ||
| param.requestor = HOSTIF_SRC_RFC; | ||
| put_boolean(param.paramValue, true); | ||
| param.paramtype = hostIf_BooleanType; | ||
| param.paramLen = sizeof(hostIf_BooleanType); | ||
|
|
||
| hostIf_DeviceInfo *pIface = hostIf_DeviceInfo::getInstance(instanceNumber); | ||
| ASSERT_NE(pIface, nullptr); | ||
|
|
||
| int ret = pIface->set_Device_DeviceInfo_X_RDKCENTRAL_COM_MemInsight_Trigger(¶m); | ||
| EXPECT_EQ(ret, NOK); | ||
| EXPECT_EQ(param.faultCode, fcInvalidParameterType); | ||
| } |
Comment on lines
+1038
to
+1049
| TEST(HTTPServerTest, handleRFCRequest_SET_InvalidParam_ReturnsError) { | ||
| req_struct reqSt; | ||
| memset(&reqSt, 0, sizeof(req_struct)); | ||
| reqSt.request.type = WDMP_SET; | ||
| reqSt.request.u.setReq = nullptr; | ||
|
|
||
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } | ||
| } |
Comment on lines
+1051
to
+1068
| TEST(HTTPServerTest, handleRFCRequest_GET_EmptyParam_ReturnsError) { | ||
| req_struct reqSt; | ||
| memset(&reqSt, 0, sizeof(req_struct)); | ||
| reqSt.request.type = WDMP_GET; | ||
| reqSt.request.u.getReq = (get_req_t *)malloc(sizeof(get_req_t)); | ||
| if (reqSt.request.u.getReq) { | ||
| memset(reqSt.request.u.getReq, 0, sizeof(get_req_t)); | ||
| reqSt.request.u.getReq->paramCount = 0; | ||
| reqSt.request.u.getReq->paramNames = nullptr; | ||
|
|
||
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0); | ||
| wdmp_free_res_struct(respSt); | ||
| } | ||
| free(reqSt.request.u.getReq); | ||
| } | ||
| } |
Comment on lines
+1070
to
+1094
| TEST(HTTPServerTest, handleRFCRequest_REPLACE_ValidParam) { | ||
| req_struct reqSt; | ||
| memset(&reqSt, 0, sizeof(req_struct)); | ||
| reqSt.request.type = WDMP_REPLACE; | ||
| reqSt.request.u.setReq = (set_req_t *)malloc(sizeof(set_req_t)); | ||
| if (reqSt.request.u.setReq) { | ||
| memset(reqSt.request.u.setReq, 0, sizeof(set_req_t)); | ||
| reqSt.request.u.setReq->paramCount = 1; | ||
| reqSt.request.u.setReq->param = (param_t *)malloc(sizeof(param_t)); | ||
| memset(reqSt.request.u.setReq->param, 0, sizeof(param_t)); | ||
| reqSt.request.u.setReq->param[0].name = strdup("Device.DeviceInfo.SerialNumber"); | ||
| reqSt.request.u.setReq->param[0].value = strdup("TestSN"); | ||
| reqSt.request.u.setReq->param[0].type = WDMP_STRING; | ||
|
|
||
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt > 0); | ||
| wdmp_free_res_struct(respSt); | ||
| } | ||
| free(reqSt.request.u.setReq->param[0].name); | ||
| free(reqSt.request.u.setReq->param[0].value); | ||
| free(reqSt.request.u.setReq->param); | ||
| free(reqSt.request.u.setReq); | ||
| } | ||
| } |
Comment on lines
+1130
to
+1153
| TEST(HTTPServerTest, validateDataModel_REPLACE_WithNoAttr) { | ||
| req_struct reqSt; | ||
| memset(&reqSt, 0, sizeof(req_struct)); | ||
| reqSt.request.type = WDMP_REPLACE; | ||
| reqSt.request.u.setReq = (set_req_t *)malloc(sizeof(set_req_t)); | ||
| if (reqSt.request.u.setReq) { | ||
| memset(reqSt.request.u.setReq, 0, sizeof(set_req_t)); | ||
| reqSt.request.u.setReq->paramCount = 1; | ||
| reqSt.request.u.setReq->param = (param_t *)malloc(sizeof(param_t)); | ||
| memset(reqSt.request.u.setReq->param, 0, sizeof(param_t)); | ||
| reqSt.request.u.setReq->param[0].name = strdup("Device.DeviceInfo.ModelName"); | ||
| reqSt.request.u.setReq->param[0].value = strdup("NewModel"); | ||
| reqSt.request.u.setReq->param[0].type = WDMP_STRING; | ||
|
|
||
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| ASSERT_NE(respSt, nullptr); | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt >= 0); | ||
| wdmp_free_res_struct(respSt); | ||
| free(reqSt.request.u.setReq->param[0].name); | ||
| free(reqSt.request.u.setReq->param[0].value); | ||
| free(reqSt.request.u.setReq->param); | ||
| free(reqSt.request.u.setReq); | ||
| } | ||
| } |
Comment on lines
+1185
to
+1205
| TEST(HTTPServerTest, handleRFCRequest_ATTRS_UnknownParam_ReturnsNone) { | ||
| req_struct reqSt; | ||
| memset(&reqSt, 0, sizeof(req_struct)); | ||
| reqSt.request.type = WDMP_ATTR; | ||
| reqSt.request.u.getReq = (get_req_t *)malloc(sizeof(get_req_t)); | ||
| if (reqSt.request.u.getReq) { | ||
| memset(reqSt.request.u.getReq, 0, sizeof(get_req_t)); | ||
| reqSt.request.u.getReq->paramCount = 1; | ||
| reqSt.request.u.getReq->paramNames = (char **)malloc(sizeof(char*)); | ||
| reqSt.request.u.getReq->paramNames[0] = strdup("Device.Unknown.UnknownParam"); | ||
|
|
||
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0); | ||
| wdmp_free_res_struct(respSt); | ||
| } | ||
| free(reqSt.request.u.getReq->paramNames[0]); | ||
| free(reqSt.request.u.getReq->paramNames); | ||
| free(reqSt.request.u.getReq); | ||
| } | ||
| } |
madhubabutt
force-pushed
the
topic/RDKEMW-19229
branch
from
June 30, 2026 10:36
5b373b6 to
d919f0f
Compare
Code Coverage Summary |
1 similar comment
Code Coverage Summary |
madhubabutt
force-pushed
the
topic/RDKEMW-19229
branch
from
June 30, 2026 10:52
09a00f2 to
174c10b
Compare
Comment on lines
+1075
to
+1079
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1053
to
+1057
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1098
to
+1102
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1129
to
+1133
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1157
to
+1160
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| ASSERT_NE(respSt, nullptr); | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); |
Comment on lines
+1198
to
+1202
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Code Coverage Summary |
madhubabutt
force-pushed
the
topic/RDKEMW-19229
branch
from
June 30, 2026 11:05
174c10b to
e2c51bd
Compare
Code Coverage Summary |
1 similar comment
Code Coverage Summary |
madhubabutt
force-pushed
the
topic/RDKEMW-19229
branch
from
June 30, 2026 11:17
62bb770 to
c543c31
Compare
Comment on lines
+1053
to
+1057
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1075
to
+1079
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1098
to
+1102
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1129
to
+1133
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1157
to
+1160
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| ASSERT_NE(respSt, nullptr); | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); |
Comment on lines
+1173
to
+1174
| convertAndAssignParamValueFunc()(&msgData, (char*)"true"); | ||
| EXPECT_EQ(0, 0); |
Comment on lines
+1183
to
+1184
| convertAndAssignParamValueFunc()(&msgData, (char*)"42"); | ||
| EXPECT_EQ(0, 0); |
Comment on lines
+408
to
+412
| TEST(datamodelTest, freeDataModelParam_EmptyStruct) { | ||
| DataModelParam dmParam = {0}; | ||
| freeDataModelParam(dmParam); | ||
| EXPECT_EQ(0, 0); | ||
| } |
Code Coverage Summary |
Comment on lines
+1075
to
+1079
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1098
to
+1102
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1129
to
+1133
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1157
to
+1160
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| ASSERT_NE(respSt, nullptr); | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); |
Code Coverage Summary |
madhubabutt
force-pushed
the
topic/RDKEMW-19229
branch
from
July 1, 2026 11:10
97a66ee to
0307a04
Compare
Code Coverage Summary |
madhubabutt
force-pushed
the
topic/RDKEMW-19229
branch
from
July 6, 2026 11:03
8e310a8 to
6f3b60c
Compare
Comment on lines
245
to
+254
| TEST(srcTest, isWebpaReady) { | ||
| bool ret = isWebpaReady(); | ||
| EXPECT_EQ(ret, true); | ||
| } | ||
|
|
||
| TEST(srcTest, isWebpaReadyFalseWhenFileMissing) { | ||
| std::remove("/tmp/webpa/start_time"); | ||
| bool ret = isWebpaReady(); | ||
| EXPECT_EQ(ret, false); | ||
| } |
Comment on lines
256
to
+265
| TEST(srcTest, isNtpTimeFilePresent) { | ||
| bool ret = isNtpTimeFilePresent(); | ||
| EXPECT_EQ(ret, true); | ||
| } | ||
|
|
||
| TEST(srcTest, isNtpTimeFilePresentFalseWhenFileMissing) { | ||
| std::remove("/tmp/timeReceivedNTP"); | ||
| bool ret = isNtpTimeFilePresent(); | ||
| EXPECT_EQ(ret, false); | ||
| } |
Comment on lines
+99
to
+106
| soup_message_body_append(reqBody, SOUP_MEMORY_COPY, body, strlen(body)); | ||
| soup_message_body_complete(reqBody); | ||
| // Ensure tests provide non-empty request data even when body helpers do not materialize it immediately. | ||
| if ((reqBody->data == nullptr || reqBody->length == 0) && strlen(body) > 0) | ||
| { | ||
| reqBody->data = static_cast<char*>(g_strdup(body)); | ||
| reqBody->length = strlen(body); | ||
| } |
Comment on lines
+1228
to
+1232
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1251
to
+1255
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1282
to
+1286
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1310
to
+1313
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| ASSERT_NE(respSt, nullptr); | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); |
Code Coverage Summary |
Code Coverage Summary |
Comment on lines
245
to
248
| TEST(srcTest, isWebpaReady) { | ||
| bool ret = isWebpaReady(); | ||
| EXPECT_EQ(ret, true); | ||
| } |
Comment on lines
256
to
259
| TEST(srcTest, isNtpTimeFilePresent) { | ||
| bool ret = isNtpTimeFilePresent(); | ||
| EXPECT_EQ(ret, true); | ||
| } |
Comment on lines
+284
to
+287
| TEST(datamodelTest, isParamEndsWithInstance_NonInstanceSuffix) { | ||
| int instance = isParamEndsWithInstance("Device.IP.Interface.1."); | ||
| EXPECT_NE(instance, 0); | ||
| } |
Comment on lines
+1251
to
+1255
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1310
to
+1313
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| ASSERT_NE(respSt, nullptr); | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); |
Comment on lines
+151
to
+161
| TEST(httpserverTest, HTTPServerStartThread_WithoutDataModel_ReturnsNull) { | ||
| // This test intentionally runs before any loadDataModel() invocation. | ||
| argList.httpServerPort = 0; | ||
| std::remove("/tmp/.tr69hostif_http_server_ready"); | ||
|
|
||
| void *thread_result = HTTPServerStartThread(nullptr); | ||
| EXPECT_EQ(thread_result, nullptr); | ||
|
|
||
| std::ifstream ready_file("/tmp/.tr69hostif_http_server_ready"); | ||
| EXPECT_FALSE(ready_file.good()); | ||
| } |
madhubabutt
force-pushed
the
topic/RDKEMW-19229
branch
from
July 6, 2026 11:21
160d9fb to
1ed03bd
Compare
Code Coverage Summary |
1 similar comment
Code Coverage Summary |
madhubabutt
force-pushed
the
topic/RDKEMW-19229
branch
from
July 6, 2026 11:37
228cf61 to
7455782
Compare
Code Coverage Summary |
Comment on lines
245
to
248
| TEST(srcTest, isWebpaReady) { | ||
| bool ret = isWebpaReady(); | ||
| EXPECT_EQ(ret, true); | ||
| } |
Comment on lines
256
to
259
| TEST(srcTest, isNtpTimeFilePresent) { | ||
| bool ret = isNtpTimeFilePresent(); | ||
| EXPECT_EQ(ret, true); | ||
| } |
| { | ||
| setResetState((eSTBResetState)999); | ||
| triggerResetScript(); | ||
| EXPECT_EQ(0, 0); |
Comment on lines
+422
to
+426
| TEST(datamodelTest, freeDataModelParam_EmptyStruct) { | ||
| DataModelParam dmParam = {0}; | ||
| freeDataModelParam(dmParam); | ||
| EXPECT_EQ(0, 0); | ||
| } |
Comment on lines
+145
to
+155
| TEST(httpserverTest, HTTPServerStartThread_WithoutDataModel_ReturnsNull) { | ||
| // This test intentionally runs before any loadDataModel() invocation. | ||
| argList.httpServerPort = 0; | ||
| std::remove("/tmp/.tr69hostif_http_server_ready"); | ||
|
|
||
| void *thread_result = HTTPServerStartThread(nullptr); | ||
| EXPECT_EQ(thread_result, nullptr); | ||
|
|
||
| std::ifstream ready_file("/tmp/.tr69hostif_http_server_ready"); | ||
| EXPECT_FALSE(ready_file.good()); | ||
| } |
Comment on lines
+1246
to
+1250
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1277
to
+1281
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1305
to
+1308
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| ASSERT_NE(respSt, nullptr); | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); |
| msgData.paramtype = hostIf_BooleanType; | ||
|
|
||
| convertAndAssignParamValueFunc()(&msgData, (char*)"true"); | ||
| EXPECT_EQ(0, 0); |
| msgData.paramtype = hostIf_IntegerType; | ||
|
|
||
| convertAndAssignParamValueFunc()(&msgData, (char*)"42"); | ||
| EXPECT_EQ(0, 0); |
Code Coverage Summary |
Comment on lines
+1223
to
+1227
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1246
to
+1250
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1277
to
+1281
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1305
to
+1308
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| ASSERT_NE(respSt, nullptr); | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); |
Comment on lines
+1201
to
+1205
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
madhubabutt
force-pushed
the
topic/RDKEMW-19229
branch
from
July 6, 2026 12:23
6b7480a to
c4b0915
Compare
Code Coverage Summary |
madhubabutt
force-pushed
the
topic/RDKEMW-19229
branch
from
July 6, 2026 12:39
c4b0915 to
a2e6f97
Compare
Code Coverage Summary |
Comment on lines
+108
to
+129
| static SoupServerMessage* createServerMessage(const char* method, const char* uri, const char* body) | ||
| { | ||
| (void)method; | ||
| (void)uri; | ||
| SoupServerMessage* msg = static_cast<SoupServerMessage*>(g_object_new(SOUP_TYPE_SERVER_MESSAGE, NULL)); | ||
| if (!msg) | ||
| { | ||
| return nullptr; | ||
| } | ||
|
|
||
| if (body != nullptr) | ||
| { | ||
| SoupMessageBody* reqBody = soup_server_message_get_request_body(msg); | ||
| if (reqBody) | ||
| { | ||
| soup_message_body_append(reqBody, SOUP_MEMORY_COPY, body, strlen(body)); | ||
| soup_message_body_complete(reqBody); | ||
| } | ||
| } | ||
|
|
||
| return msg; | ||
| } |
Comment on lines
+1225
to
+1229
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1247
to
+1251
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] != WDMP_SUCCESS || respSt->paramCnt == 0); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1267
to
+1274
| reqSt.reqType = REPLACE_ROWS; | ||
| reqSt.u.setReq = setReq; | ||
|
|
||
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+1298
to
+1305
| reqSt.reqType = REPLACE_ROWS; | ||
| reqSt.u.setReq = setReq; | ||
|
|
||
| res_struct* respSt = handleRequest("rfc", &reqSt); | ||
| if (respSt) { | ||
| EXPECT_TRUE(respSt->retStatus[0] == WDMP_SUCCESS || respSt->retStatus[0] != WDMP_SUCCESS); | ||
| wdmp_free_res_struct(respSt); | ||
| } |
Comment on lines
+250
to
+254
| TEST(srcTest, isWebpaReadyFalseWhenFileMissing) { | ||
| std::remove("/tmp/webpa/start_time"); | ||
| bool ret = isWebpaReady(); | ||
| EXPECT_EQ(ret, false); | ||
| } |
Comment on lines
+261
to
+265
| TEST(srcTest, isNtpTimeFilePresentFalseWhenFileMissing) { | ||
| std::remove("/tmp/timeReceivedNTP"); | ||
| bool ret = isNtpTimeFilePresent(); | ||
| EXPECT_EQ(ret, false); | ||
| } |
Comment on lines
+395
to
+398
| const char* attrValue = "Device.WiFi.SSID.{i}."; | ||
| char* paramName = (char*)"Device.WiFi.SSID.12."; | ||
| int ret = 0; | ||
| int retValue = checkMatchingParameter(attrValue, paramName, &ret); |
Comment on lines
+4249
to
+4253
| param.requestor = HOSTIF_SRC_RFC; | ||
| put_boolean(param.paramValue, true); | ||
| param.paramtype = hostIf_BooleanType; | ||
| param.paramLen = sizeof(hostIf_BooleanType); | ||
|
|
Comment on lines
+285
to
+289
| TEST(srcTest, get_system_manageble_ntp_time_MissingFileReturnsZero) { | ||
| std::remove("/tmp/timeReceivedNTP"); | ||
| unsigned long ret = get_system_manageble_ntp_time(); | ||
| EXPECT_EQ(ret, 0UL); | ||
| } |
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.