Skip to content

RDK-59038: Improve L1 test coverage#176

Merged
shibu-kv merged 24 commits intodevelopfrom
topic/RDK-59038
Sep 30, 2025
Merged

RDK-59038: Improve L1 test coverage#176
shibu-kv merged 24 commits intodevelopfrom
topic/RDK-59038

Conversation

@dharshini555
Copy link
Contributor

No description provided.

Signed-off-by: PriyaDharshini_Kathiravan <priyakathiravan05@gmail.com>
Signed-off-by: PriyaDharshini_Kathiravan <priyakathiravan05@gmail.com>
@dharshini555 dharshini555 requested a review from a team as a code owner September 22, 2025 17:08
#include "ccspinterface.h"
#include "vector.h"
#include "telemetry2_0.h"
#if 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar comments. Please remove unused code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 45 to 54
return T2ERROR_SUCCESS;
}

// Forward declarations for functions we want to test
extern bool isRbusEnabled(void);
extern T2ERROR getParameterValue(const char* paramName, char **paramValue);
extern T2ERROR registerForTelemetryEvents(TelemetryEventCallback eventCB);
extern T2ERROR unregisterForTelemetryEvents(void);
extern T2ERROR busUninit(void);
extern T2ERROR getRbusParameterVal(const char* paramName, char **paramValue);
extern T2ERROR getCCSPParamVal(const char* paramName, char **paramValue);
extern void resetBusState(void);
rbusError_t t2TriggerConditionGetHandler(rbusHandle_t handle, rbusProperty_t property, rbusGetHandlerOptions_t* opts);
void triggerCondtionReceiveHandler(rbusHandle_t handle, rbusEvent_t const* event, rbusEventSubscription_t* subscription);
void reportEventHandler(rbusHandle_t handle, rbusEvent_t const* event, rbusEventSubscription_t* subscription);
rbusError_t t2PropertyDataSetHandler(rbusHandle_t handle, rbusProperty_t prop, rbusSetHandlerOptions_t* opts);
rbusError_t t2PropertyDataGetHandler(rbusHandle_t handle, rbusProperty_t prop, rbusGetHandlerOptions_t* opts);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Are these stubs going away as we are now getting the actual rbus.h from the native container ?

rdkconfigMock *g_rdkconfigMock = nullptr;
extern VectorMock *g_vectorMock;
extern CcspInterfaceMock *g_ccspInterfaceMock;
//extern CcspInterfaceMock *g_ccspInterfaceMock;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}
#endif

/*
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any specific reason for diabling an existing test case ?

Vector* profileValueList = getProfileParameterValues(paramlist, 2);

EXPECT_NE(profileValueList, nullptr);
Vector_Destroy(paramlist, free);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please check the allocations and freeing strategy in the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Replaced with correct free function.


//t2PropertyDataGetHandler cases

TEST_F(CcspInterfaceTest, t2PropertyDataGetHandler_Success_1)
Copy link
Contributor

Choose a reason for hiding this comment

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

In general, could you please add short comments above the tests giving very high level of hints regarding the scenarios that we are testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

EXPECT_EQ(ret, 0);
}

/*TEST_F(TelemetryBusmessageSenderTest, t2_event_s_iscachingenabled_true_1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please do avoid commented/unused code to the best possible extend.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@rdkcmf-jenkins
Copy link
Contributor

rdkcmf-jenkins commented Sep 30, 2025

Coverity Issue - Check of thread-shared field evades lock acquisition

Thread1 sets "initialized" to a new value. Now the two threads have an inconsistent view of "initialized" and updates to fields correlated with "initialized" may be lost.

High Impact, CWE-543
LOCK_EVASION

How to fix

Guard the modification of "initialized" and the read used to decide whether to modify "initialized" with the same set of locks.

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
source/bulkdata/profilexconf.c:732

shibu-kv
shibu-kv previously approved these changes Sep 30, 2025
@shibu-kv shibu-kv changed the title Topic/rdk 59038 RDK-59038: Improve L1 test coverage Sep 30, 2025
@shibu-kv shibu-kv merged commit cfb628a into develop Sep 30, 2025
14 of 17 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 30, 2025
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.

3 participants