Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Build artifacts
*.o
*.lo
*.a
*.la
*.Po
*.Tpo
*.gcno
*.gcda
*.gcov

# Autotools build artifacts
/unittest/Makefile
/unittest/Makefile.in
/unittest/aclocal.m4
/unittest/autom4te.cache/
/unittest/compile
/unittest/config.guess
/unittest/config.log
/unittest/config.status
/unittest/config.sub
/unittest/configure
/unittest/depcomp
/unittest/install-sh
/unittest/libtool
/unittest/ltmain.sh
/unittest/missing
/unittest/.deps/
/unittest/mocks/.deps/
/unittest/deviceutils/.deps/

# Dependency tracking directories
**/.deps/

# Build binaries
/unittest/rdkfw_device_status_gtest
/unittest/rdkfw_deviceutils_gtest
/unittest/rdkfw_main_gtest
/unittest/rdkfw_interface_gtest
/unittest/rdkfwupdatemgr_main_flow_gtest
/unittest/rdkFwupdateMgr_handlers_gtest
/unittest/dbus_handlers_gtest
/unittest/rdkFwupdateMgr_async_refcount_gtest
/unittest/rdkFwupdateMgr_async_stress_gtest
/unittest/rdkFwupdateMgr_async_cleanup_gtest
/unittest/rdkFwupdateMgr_async_signal_gtest
/unittest/rdkFwupdateMgr_async_threadsafety_gtest

# Coverage reports
/src/coverage.info
/src/coverage.filtered.info
/src/out/
40 changes: 40 additions & 0 deletions unittest/fwdl_interface_gtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,46 @@ TEST_F(InterfaceTestFixture, TestName_isDebugServicesEnableSuccess)
EXPECT_CALL(*g_InterfaceMock, getRFCParameter(_, _, _)).Times(1).WillOnce(Return(1));
EXPECT_EQ(isDebugServicesEnabled(), true);
}
TEST_F(InterfaceTestFixture, TestName_getDeviceTypeRFCReadFailure)
{
char deviceType[32] = {0};
EXPECT_CALL(*g_InterfaceMock, getRFCParameter(_, _, _)).Times(1).WillOnce(Return(0));
getDeviceTypeRFC(deviceType, sizeof(deviceType));
EXPECT_STREQ(deviceType, "unknown");
}
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");
}
TEST_F(InterfaceTestFixture, TestName_getDeviceTypeRFCTest)
{
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", "test");
return 1;
}));
getDeviceTypeRFC(deviceType, sizeof(deviceType));
EXPECT_STREQ(deviceType, "test");
}
TEST_F(InterfaceTestFixture, TestName_getDeviceTypeRFCUnknown)
{
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", "staging");
return 1;
}));
getDeviceTypeRFC(deviceType, sizeof(deviceType));
EXPECT_STREQ(deviceType, "unknown");
}
TEST_F(InterfaceTestFixture, TestName_isIncremetalCDLEnableSuccess)
{
EXPECT_CALL(*g_InterfaceMock, getRFCParameter(_, _, _)).Times(1).WillOnce(Return(1));
Expand Down