diff --git a/.github/workflows/component-release.yml b/.github/workflows/component-release.yml index cccabf8..f05845f 100644 --- a/.github/workflows/component-release.yml +++ b/.github/workflows/component-release.yml @@ -4,10 +4,6 @@ permissions: contents: write on: - pull_request: - types: [opened, edited, ready_for_review, closed] - branches: - - develop workflow_dispatch: inputs: tag: diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c07183..ae5edb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,62 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [1.0.8](https://github.com/rdkcentral/entservices-testframework/compare/1.0.7...1.0.8) + +- RDKEMW-18828: Fix for Native build and l1 test failure [`#26`](https://github.com/rdkcentral/entservices-testframework/pull/26) +- Merge tag '1.0.7' into develop [`11140ab`](https://github.com/rdkcentral/entservices-testframework/commit/11140ab44c0cecec91cc89f288c8b3f42e4fc8b0) + +#### [1.0.7](https://github.com/rdkcentral/entservices-testframework/compare/1.0.6...1.0.7) + +> 18 May 2026 + +- RDKEMW-9659: Implement the Non-Thunder client using libds methods in DisplaySettings [`#17`](https://github.com/rdkcentral/entservices-testframework/pull/17) +- 1.0.7 release change log updates [`630fccb`](https://github.com/rdkcentral/entservices-testframework/commit/630fccb99082c4cf828ab8adf7088239296efd9f) +- Merge tag '1.0.6' into develop [`981bc00`](https://github.com/rdkcentral/entservices-testframework/commit/981bc00e8fd63065d84397b14ebc2d085955f19d) +- Resolved compilation error dsVideoCodecHevcProfiles_t [`19d2a27`](https://github.com/rdkcentral/entservices-testframework/commit/19d2a27ae3081007a389b0a257cad08a9840dd61) + +#### [1.0.6](https://github.com/rdkcentral/entservices-testframework/compare/1.0.5...1.0.6) + +> 30 April 2026 + +- RDKEMW-16778: ENT Service API for retrieving previous reboot info [`#8`](https://github.com/rdkcentral/entservices-testframework/pull/8) +- 1.0.6 release changelog updates [`070316a`](https://github.com/rdkcentral/entservices-testframework/commit/070316a21a4ccf30c6d8f6935f796425b069b6ac) +- Merge tag '1.0.5' into develop [`c96ae85`](https://github.com/rdkcentral/entservices-testframework/commit/c96ae851d2e22b6e33f664c5819954b53ede55bb) + +#### [1.0.5](https://github.com/rdkcentral/entservices-testframework/compare/1.0.4...1.0.5) + +> 28 April 2026 + +- RDKEMW-14961 - Unit tests for Iarmmgr [`#5`](https://github.com/rdkcentral/entservices-testframework/pull/5) +- 1.0.5 release changelog updates [`18bfa7a`](https://github.com/rdkcentral/entservices-testframework/commit/18bfa7af0cd47ba7d32e8e1a911abb90737a3459) +- Merge tag '1.0.4' into develop [`4ec3a2d`](https://github.com/rdkcentral/entservices-testframework/commit/4ec3a2ddb430dc4be729dff1fde5a94fd568c03b) + +#### [1.0.4](https://github.com/rdkcentral/entservices-testframework/compare/1.0.3...1.0.4) + +> 20 April 2026 + +- RDKEMW-16428: Add cmdline entry into proc_t to fix build error in UT [`#14`](https://github.com/rdkcentral/entservices-testframework/pull/14) +- 1.0.4 release change log updates [`2472ff5`](https://github.com/rdkcentral/entservices-testframework/commit/2472ff552281c20ebc859b5e862a68a4f80474d0) +- Merge tag '1.0.3' into develop [`84a45b3`](https://github.com/rdkcentral/entservices-testframework/commit/84a45b33bf3f68ef26de6b080703e2f45b523810) + +#### [1.0.3](https://github.com/rdkcentral/entservices-testframework/compare/1.0.2...1.0.3) + +> 17 April 2026 + +- RDKEMW - Remove pr dependency on this workflow [`#13`](https://github.com/rdkcentral/entservices-testframework/pull/13) +- Feature/rdkemw 17153 [`#12`](https://github.com/rdkcentral/entservices-testframework/pull/12) +- 1.0.3 release changelog updates [`24204e8`](https://github.com/rdkcentral/entservices-testframework/commit/24204e8b8687fdc580503dd37d593a221cc02918) +- Merge tag '1.0.2' into develop [`7eb1841`](https://github.com/rdkcentral/entservices-testframework/commit/7eb1841706384b114628baf14906a0e2c2a448a5) + #### [1.0.2](https://github.com/rdkcentral/entservices-testframework/compare/1.0.1...1.0.2) +> 15 April 2026 + - feature/RDKEMW-17153 - Update component release yml file [`#10`](https://github.com/rdkcentral/entservices-testframework/pull/10) - RDKE-767 : [OSCR SCAN] RDKE - entservices-testframework [`#9`](https://github.com/rdkcentral/entservices-testframework/pull/9) - RDKEMW-15693: Add API to clear CDN access token for AuthService plugin [`#6`](https://github.com/rdkcentral/entservices-testframework/pull/6) - Update CODEOWNERS file [`#3`](https://github.com/rdkcentral/entservices-testframework/pull/3) +- 1.0.2 release changelog updates [`abcdc7e`](https://github.com/rdkcentral/entservices-testframework/commit/abcdc7e65613f03cad2e5a125a06103487323839) - Update CODEOWNERS [`a27e8e7`](https://github.com/rdkcentral/entservices-testframework/commit/a27e8e7f63082514797dd1ee00a1aaefba301925) - Merge tag '1.0.1' into develop [`e62bfcd`](https://github.com/rdkcentral/entservices-testframework/commit/e62bfcdf2da3c85138b2c55a59633e96a0129dde) diff --git a/Tests/mocks/DeviceDiagnosticsMock.h b/Tests/mocks/DeviceDiagnosticsMock.h index c8e7d13..e76137b 100644 --- a/Tests/mocks/DeviceDiagnosticsMock.h +++ b/Tests/mocks/DeviceDiagnosticsMock.h @@ -39,6 +39,7 @@ class DeviceDiagnosticsMock : public IDeviceDiagnostics { MOCK_METHOD(void, AddRef, (), (const, override)); MOCK_METHOD(uint32_t, Release, (), (const, override)); MOCK_METHOD(void*, QueryInterface, (const uint32_t interfacenumber), (override)); + MOCK_METHOD(hresult, GetPreviousRebootInfo, (RebootInfo& rebootInfo, bool& success),(override)); }; class DeviceDiagnosticsNotificationMock : public IDeviceDiagnostics::INotification { diff --git a/Tests/mocks/Iarm.cpp b/Tests/mocks/Iarm.cpp index f99fc88..844c7dc 100755 --- a/Tests/mocks/Iarm.cpp +++ b/Tests/mocks/Iarm.cpp @@ -98,6 +98,27 @@ IARM_Result_t IarmBus::IARM_Bus_RegisterCall(const char* methodName, IARM_BusCal return impl->IARM_Bus_RegisterCall(methodName, handler); } +IARM_Result_t IarmBus::IARM_Bus_Disconnect() +{ + TEST_LOG("Inside IARM_Bus_Disconnect"); + EXPECT_NE(impl, nullptr); + return impl->IARM_Bus_Disconnect(); +} + +IARM_Result_t IarmBus::IARM_Bus_Term() +{ + TEST_LOG("Inside IARM_Bus_Term"); + EXPECT_NE(impl, nullptr); + return impl->IARM_Bus_Term(); +} + +IARM_Result_t IarmBus::IARM_Bus_RegisterEvent(IARM_EventId_t maxEventId) +{ + TEST_LOG("Inside IARM_Bus_RegisterEvent"); + EXPECT_NE(impl, nullptr); + return impl->IARM_Bus_RegisterEvent(maxEventId); +} + IARM_Result_t IarmBus::IARM_Bus_Call_with_IPCTimeout(const char *ownerName, const char *methodName, void *arg, size_t argLen, int timeout) { EXPECT_NE(impl, nullptr); @@ -106,6 +127,8 @@ IARM_Result_t IarmBus::IARM_Bus_Call_with_IPCTimeout(const char *ownerName, con IARM_Result_t (*IARM_Bus_Init)(const char*) = &IarmBus::IARM_Bus_Init; IARM_Result_t (*IARM_Bus_Connect)() = &IarmBus::IARM_Bus_Connect; +IARM_Result_t (*IARM_Bus_Disconnect)() = &IarmBus::IARM_Bus_Disconnect; +IARM_Result_t (*IARM_Bus_Term)() = &IarmBus::IARM_Bus_Term; IARM_Result_t (*IARM_Bus_IsConnected)(const char*,int*) = &IarmBus::IARM_Bus_IsConnected; IARM_Result_t (*IARM_Bus_RegisterEventHandler)(const char*,IARM_EventId_t,IARM_EventHandler_t) = &IarmBus::IARM_Bus_RegisterEventHandler; IARM_Result_t (*IARM_Bus_UnRegisterEventHandler)(const char*,IARM_EventId_t) = &IarmBus::IARM_Bus_UnRegisterEventHandler; @@ -113,5 +136,6 @@ IARM_Result_t (*IARM_Bus_RemoveEventHandler)(const char*,IARM_EventId_t,IARM_Eve IARM_Result_t (*IARM_Bus_Call)(const char*,const char*,void*,size_t) = &IarmBus::IARM_Bus_Call; IARM_Result_t (*IARM_Bus_BroadcastEvent)(const char *ownerName, IARM_EventId_t eventId, void *arg, size_t argLen) = &IarmBus::IARM_Bus_BroadcastEvent; IARM_Result_t (*IARM_Bus_RegisterCall)(const char*,IARM_BusCall_t) = &IarmBus::IARM_Bus_RegisterCall; +IARM_Result_t (*IARM_Bus_RegisterEvent)(IARM_EventId_t) = &IarmBus::IARM_Bus_RegisterEvent; IARM_Result_t (*IARM_Bus_Call_with_IPCTimeout)(const char*,const char*,void*,size_t,int) = &IarmBus::IARM_Bus_Call_with_IPCTimeout; diff --git a/Tests/mocks/Iarm.h b/Tests/mocks/Iarm.h index cc18ea3..b40d309 100644 --- a/Tests/mocks/Iarm.h +++ b/Tests/mocks/Iarm.h @@ -54,6 +54,7 @@ class IarmBusImpl { virtual IARM_Result_t IARM_Bus_Call(const char* ownerName, const char* methodName, void* arg, size_t argLen) = 0; virtual IARM_Result_t IARM_Bus_BroadcastEvent(const char *ownerName, IARM_EventId_t eventId, void *arg, size_t argLen) = 0; virtual IARM_Result_t IARM_Bus_RegisterCall(const char* methodName, IARM_BusCall_t handler) = 0; + virtual IARM_Result_t IARM_Bus_RegisterEvent(IARM_EventId_t maxEventId) = 0; virtual IARM_Result_t IARM_Bus_Call_with_IPCTimeout(const char *ownerName, const char *methodName, void *arg, size_t argLen, int timeout) = 0; }; @@ -75,6 +76,7 @@ class IarmBus { static IARM_Result_t IARM_Bus_Call(const char* ownerName, const char* methodName, void* arg, size_t argLen); static IARM_Result_t IARM_Bus_BroadcastEvent(const char *ownerName, IARM_EventId_t eventId, void *arg, size_t argLen) ; static IARM_Result_t IARM_Bus_RegisterCall(const char* methodName, IARM_BusCall_t handler); + static IARM_Result_t IARM_Bus_RegisterEvent(IARM_EventId_t maxEventId); static IARM_Result_t IARM_Bus_Call_with_IPCTimeout(const char *ownerName, const char *methodName, void *arg, size_t argLen, int timeout); }; @@ -89,6 +91,7 @@ extern IARM_Result_t (*IARM_Bus_RemoveEventHandler)(const char*,IARM_EventId_t,I extern IARM_Result_t (*IARM_Bus_Call)(const char*,const char*,void*,size_t); extern IARM_Result_t (*IARM_Bus_BroadcastEvent)(const char *,IARM_EventId_t,void *,size_t); extern IARM_Result_t (*IARM_Bus_RegisterCall)(const char*,IARM_BusCall_t); +extern IARM_Result_t (*IARM_Bus_RegisterEvent)(IARM_EventId_t); extern IARM_Result_t (*IARM_Bus_Call_with_IPCTimeout)(const char*,const char*,void*,size_t,int); #define IARM_BUS_COMMON_API_SysModeChange "SysModeChange" @@ -249,11 +252,14 @@ typedef struct _IARM_Bus_MFRLib_SetBLPattern_Param_t { mfrBlPattern_t pattern; } IARM_Bus_MFRLib_SetBLPattern_Param_t; +#ifndef IARM_BUS_MFRLIB_GETSERIALIZEDDATA_DEFINED +#define IARM_BUS_MFRLIB_GETSERIALIZEDDATA_DEFINED typedef struct _IARM_Bus_MFRLib_GetSerializedData_Param_t { mfrSerializedType_t type; char buffer[1280]; int bufLen; } IARM_Bus_MFRLib_GetSerializedData_Param_t; +#endif /* IARM_BUS_MFRLIB_GETSERIALIZEDDATA_DEFINED */ #define PWRMGR_MAX_REBOOT_REASON_LENGTH 100 @@ -434,6 +440,11 @@ typedef struct _IARM_BUS_PWRMgr_WareHouseOpn_EventData_t { #define IARM_BUS_PWRMGR_API_SetWakeupSrcConfig "setWakeupSrcConfig" #define IARM_BUS_PWRMGR_API_GetWakeupSrcConfig "getWakeupSrcConfig" /*!< gets wakup configuration*/ +/* The block below duplicates types from sysMgr/include/sysMgr.h. + * Guard it so that when sysMgr.h is included first (e.g. in sysmgr tests) + * the compiler sees only one definition of each type. */ +#ifndef _IARM_BUS_SYSMGR_H + #define IARM_BUS_SYSMGR_NAME "SYSMgr" #define IARM_BUS_SYSMGR_API_GetSystemStates "GetSystemStates" @@ -518,6 +529,7 @@ typedef enum _SYSMgr_SystemState_t { IARM_BUS_SYSMGR_SYSSTATE_FIRMWARE_UPDATE_STATE, //43, Added as part of RDK-19978, As the IARM IARM_BUS_SYSMGR_SYSSTATE_USB_DETECTED, //44 IARM_BUS_SYSMGR_SYSSTATE_LOG_UPLOAD, //45 + IARM_BUS_SYSMGR_SYSSTATE_RED_RECOV_UPDATE_STATE, //46 } IARM_Bus_SYSMgr_SystemState_t; typedef enum _SYSMgr_FirmwareUpdateState_t { @@ -624,11 +636,15 @@ typedef struct _IARM_Bus_SYSMgr_GetSystemStates_Param_t { state_property bootup; state_property dst_offset; state_property rf_connected; + state_property partnerid_changed; state_property ip_mode; state_property qam_ready_status; state_property firmware_update_state; + state_property red_recov_state; } IARM_Bus_SYSMgr_GetSystemStates_Param_t; +#endif /* !_IARM_BUS_SYSMGR_H */ + #define IARM_BUS_DSMGR_NAME "DSMgr" /*! Events published from DS Mananger */ diff --git a/Tests/mocks/IarmBusMock.h b/Tests/mocks/IarmBusMock.h index b3b64a6..1ec4f11 100644 --- a/Tests/mocks/IarmBusMock.h +++ b/Tests/mocks/IarmBusMock.h @@ -86,6 +86,7 @@ class IarmBusImplMock : public IarmBusImpl { MOCK_METHOD(IARM_Result_t, IARM_Bus_RemoveEventHandler, (const char* ownerName, IARM_EventId_t eventId, IARM_EventHandler_t handler), (override)); MOCK_METHOD(IARM_Result_t, IARM_Bus_Call, (const char* ownerName, const char* methodName, void* arg, size_t argLen), (override)); MOCK_METHOD(IARM_Result_t, IARM_Bus_RegisterCall, (const char* methodName, IARM_BusCall_t handler), (override)); + MOCK_METHOD(IARM_Result_t, IARM_Bus_RegisterEvent, (IARM_EventId_t maxEventId), (override)); MOCK_METHOD(IARM_Result_t, IARM_Bus_BroadcastEvent, (const char *ownerName, IARM_EventId_t eventId, void *arg, size_t argLen), (override)); MOCK_METHOD(IARM_Result_t, IARM_Bus_Call_with_IPCTimeout, (const char *ownerName, const char *methodName, void *arg, size_t argLen, int timeout), (override)); }; diff --git a/Tests/mocks/NetworkManagerMock.h b/Tests/mocks/NetworkManagerMock.h index 37191e2..d3c37a5 100644 --- a/Tests/mocks/NetworkManagerMock.h +++ b/Tests/mocks/NetworkManagerMock.h @@ -44,6 +44,7 @@ class MockINetworkManager : public INetworkManager MOCK_METHOD(uint32_t, GetKnownSSIDs, (IStringIterator*& ssids), (override)); MOCK_METHOD(uint32_t, AddToKnownSSIDs, (const WiFiConnectTo& ssid), (override)); MOCK_METHOD(uint32_t, RemoveKnownSSID, (const string& ssid), (override)); + MOCK_METHOD(uint32_t, ConnectToKnownSSID, (const string& ssid), (override)); MOCK_METHOD(uint32_t, WiFiConnect, (const WiFiConnectTo& ssid), (override)); MOCK_METHOD(uint32_t, WiFiDisconnect, (), (override)); MOCK_METHOD(uint32_t, GetConnectedSSID, (WiFiSSIDInfo& ssidInfo), (override)); diff --git a/Tests/mocks/Telemetry.cpp b/Tests/mocks/Telemetry.cpp index cdef6c7..b811387 100755 --- a/Tests/mocks/Telemetry.cpp +++ b/Tests/mocks/Telemetry.cpp @@ -54,7 +54,14 @@ T2ERROR TelemetryApi::t2_event_d(const char* marker, int value) EXPECT_NE(impl, nullptr); return impl->t2_event_d(marker, value); } + +T2ERROR TelemetryApi::t2_event_f(char* marker, double value) +{ + EXPECT_NE(impl, nullptr); + return impl->t2_event_f(marker, value); +} void (*t2_init)(char*) = &TelemetryApi::t2_init; void (*t2_uninit)(void) = &TelemetryApi::t2_uninit; T2ERROR (*t2_event_s)(const char*,const char*) = &TelemetryApi::t2_event_s; T2ERROR (*t2_event_d)(const char*,int) = &TelemetryApi::t2_event_d; +T2ERROR (*t2_event_f)(char*,double) = &TelemetryApi::t2_event_f; diff --git a/Tests/mocks/Telemetry.h b/Tests/mocks/Telemetry.h index 4ae4133..efce9e8 100644 --- a/Tests/mocks/Telemetry.h +++ b/Tests/mocks/Telemetry.h @@ -39,6 +39,7 @@ class TelemetryApiImpl { virtual void t2_uninit(void) = 0; virtual T2ERROR t2_event_s(const char* marker, const char* value) = 0; virtual T2ERROR t2_event_d(const char* marker, int value) = 0; + virtual T2ERROR t2_event_f(char* marker, double value) = 0; }; class TelemetryApi { @@ -52,10 +53,12 @@ class TelemetryApi { static void t2_uninit(void); static T2ERROR t2_event_s(const char* marker, const char* value); static T2ERROR t2_event_d(const char* marker, int value); + static T2ERROR t2_event_f(char* marker, double value); }; extern void (*t2_init)(char*); extern void (*t2_uninit)(void); extern T2ERROR (*t2_event_s)(const char*,const char*); extern T2ERROR (*t2_event_d)(const char*,int); +extern T2ERROR (*t2_event_f)(char*,double); diff --git a/Tests/mocks/TelemetryMock.h b/Tests/mocks/TelemetryMock.h index 5129f0a..997b8c6 100644 --- a/Tests/mocks/TelemetryMock.h +++ b/Tests/mocks/TelemetryMock.h @@ -35,6 +35,7 @@ class TelemetryApiImplMock : public TelemetryApiImpl, public ITelemetry { MOCK_METHOD(void, t2_uninit, (), (override)); MOCK_METHOD(T2ERROR, t2_event_s, (const char* marker, const char* value), (override)); MOCK_METHOD(T2ERROR, t2_event_d, (const char* marker, int value), (override)); + MOCK_METHOD(T2ERROR, t2_event_f, (char* marker, double value), (override)); MOCK_METHOD(hresult, Register, (INotification *notification), (override)); MOCK_METHOD(hresult, Unregister, (INotification *notification), (override)); diff --git a/Tests/mocks/Wraps.cpp b/Tests/mocks/Wraps.cpp index 0cc1443..c6ec1fd 100755 --- a/Tests/mocks/Wraps.cpp +++ b/Tests/mocks/Wraps.cpp @@ -243,6 +243,16 @@ extern "C" FILE *__wrap_fopen(const char *pathname, const char *mode) return Wraps::getInstance().fopen(pathname, mode); } +extern "C" int __wrap_fclose(FILE *stream) +{ + return Wraps::getInstance().fclose(stream); +} + +extern "C" char *__wrap_fgets(char *s, int size, FILE *stream) +{ + return Wraps::getInstance().fgets(s, size, stream); +} + WrapsImpl* Wraps::impl = nullptr; @@ -530,3 +540,15 @@ FILE *Wraps::fopen(const char *pathname, const char *mode) return result; } +int Wraps::fclose(FILE *stream) +{ + EXPECT_NE(impl, nullptr); + return impl->fclose(stream); +} + +char *Wraps::fgets(char *s, int size, FILE *stream) +{ + EXPECT_NE(impl, nullptr); + return impl->fgets(s, size, stream); +} + diff --git a/Tests/mocks/Wraps.h b/Tests/mocks/Wraps.h index cfa5405..99e9b3a 100755 --- a/Tests/mocks/Wraps.h +++ b/Tests/mocks/Wraps.h @@ -59,6 +59,8 @@ class WrapsImpl { virtual int stat(const char* path, struct stat* info) =0; virtual int open(const char* pathname, int flags, mode_t mode) = 0; virtual FILE *fopen(const char *pathname, const char *mode) = 0; + virtual int fclose(FILE *stream) = 0; + virtual char *fgets(char *s, int size, FILE *stream) = 0; virtual int umount(const char* path) = 0; virtual int rmdir(const char* pathname) = 0; virtual time_t time(time_t* arg) = 0; @@ -119,6 +121,8 @@ class Wraps { static int stat(const char* path, struct stat* info); static int open(const char* pathname, int flags, mode_t mode); FILE *fopen(const char *pathname, const char *mode); + int fclose(FILE *stream); + char *fgets(char *s, int size, FILE *stream); static int umount(const char* path); static int rmdir(const char* pathname); static time_t time(time_t* arg); diff --git a/Tests/mocks/WrapsMock.h b/Tests/mocks/WrapsMock.h index 1cd3327..9011e3e 100755 --- a/Tests/mocks/WrapsMock.h +++ b/Tests/mocks/WrapsMock.h @@ -72,6 +72,8 @@ class WrapsImplMock : public WrapsImpl { MOCK_METHOD(int, stat, (const char* path, struct stat* info), (override)); MOCK_METHOD(int, open, (const char* pathname, int flags, mode_t mode),(override)); MOCK_METHOD(FILE*, fopen, (const char *pathname, const char *mode),(override)); + MOCK_METHOD(int, fclose, (FILE *stream), (override)); + MOCK_METHOD(char*, fgets, (char *s, int size, FILE *stream), (override)); MOCK_METHOD(int, umount, (const char* path), (override)); MOCK_METHOD(int, rmdir, (const char* pathname), (override)); MOCK_METHOD(time_t, time, (time_t* arg), (override)); diff --git a/Tests/mocks/devicesettings.cpp b/Tests/mocks/devicesettings.cpp index 2dcbe18..ce428c6 100755 --- a/Tests/mocks/devicesettings.cpp +++ b/Tests/mocks/devicesettings.cpp @@ -442,6 +442,30 @@ void AudioOutputPort::setStereoMode(const std::string &mode, bool persist) return impl->setStereoMode(mode, persist); } +void AudioOutputPort::setAudioDucking(dsAudioDuckingAction_t action, dsAudioDuckingType_t type, const unsigned char level) +{ + EXPECT_NE(impl, nullptr); + impl->setAudioDucking(action, type, level); +} + +const AudioEncoding& AudioOutputPort::getEncoding() const +{ + EXPECT_NE(impl, nullptr); + return impl->getEncoding(); +} + +void AudioOutputPort::setEncoding(const int encoding) +{ + EXPECT_NE(impl, nullptr); + impl->setEncoding(encoding); +} + +void AudioOutputPort::setEncoding(const std::string& encoding) +{ + EXPECT_NE(impl, nullptr); + impl->setEncoding(encoding); +} + CompositeInputImpl* CompositeInput::impl = nullptr; CompositeInput::CompositeInput() {} @@ -807,6 +831,11 @@ void Display::setAVIScanInformation(int scanInfo) { EXPECT_NE(impl, nullptr); impl->setAVIScanInformation(scanInfo); } +const AspectRatio& Display::getAspectRatio() +{ + EXPECT_NE(impl, nullptr); + return impl->getAspectRatio(); +} VideoOutputPortImpl* VideoOutputPort::impl = nullptr; @@ -923,6 +952,24 @@ bool VideoOutputPort::isActive() { return impl->isActive(); } +bool VideoOutputPort::isEnabled() const +{ + EXPECT_NE(impl, nullptr); + return impl->isEnabled(); +} + +void VideoOutputPort::enable() +{ + EXPECT_NE(impl, nullptr); + impl->enable(); +} + +void VideoOutputPort::disable() +{ + EXPECT_NE(impl, nullptr); + impl->disable(); +} + VideoOutputPortConfigImpl* VideoOutputPortConfig::impl = nullptr; VideoOutputPortConfig::VideoOutputPortConfig() {} @@ -1442,6 +1489,16 @@ void VideoDevice::setDFC(std::string zoomSetting) EXPECT_NE(impl, nullptr); return impl->setDFC(zoomSetting); } +unsigned int VideoDevice::getSupportedVideoCodingFormats() const +{ + EXPECT_NE(impl, nullptr); + return impl->getSupportedVideoCodingFormats(); +} +dsVideoCodecInfo_t VideoDevice::getVideoCodecInfo(dsVideoCodingFormat_t format) const +{ + EXPECT_NE(impl, nullptr); + return impl->getVideoCodecInfo(format); +} void VideoOutputPort::setResolution(std::string resolution, bool persist, bool isIgnoreEdid) { EXPECT_NE(impl, nullptr); diff --git a/Tests/mocks/devicesettings.h b/Tests/mocks/devicesettings.h index c6a797e..c78d66d 100644 --- a/Tests/mocks/devicesettings.h +++ b/Tests/mocks/devicesettings.h @@ -164,6 +164,27 @@ typedef enum _dsAudioInput_t dsAUDIO_INPUT_MAX /**< Out of range */ } dsAudioInput_t; +typedef enum _dsAudioEncoding_t{ + dsAUDIO_ENC_NONE = 0, ///< No digital audio output + dsAUDIO_ENC_DISPLAY, ///< Platform-selected digital audio encoding format + dsAUDIO_ENC_PCM, ///< PCM digital audio encoding format + dsAUDIO_ENC_AC3, ///< AC-3 digital audio encoding format + dsAUDIO_ENC_EAC3, ///< DD+/E-AC-3 digital audio encoding format + dsAUDIO_ENC_MAX ///< Out of range +} dsAudioEncoding_t; + +typedef enum _dsAudioDuckingAction_t{ + dsAUDIO_DUCKINGACTION_START, ///< Audio ducking start + dsAUDIO_DUCKINGACTION_STOP, ///< Audio ducking stop + dsAudio_DUCKINGACTION_MAX, ///< Out of range +} dsAudioDuckingAction_t; + +typedef enum _dsAudioDuckingType_t{ + dsAUDIO_DUCKINGTYPE_ABSOLUTE, ///< Audio ducking absolute + dsAUDIO_DUCKINGTYPE_RELATIVE, ///< Audio ducking relative + dsAudio_DUCKINGTYPE_MAX, ///< Out of range +} dsAudioDuckingType_t; + typedef enum _dsHdcpProtocolVersion_t { dsHDCP_VERSION_1X = 0, /**< HDCP Protocol version 1.x */ dsHDCP_VERSION_2X, /**< HDCP Protocol version 2.x */ @@ -285,6 +306,34 @@ typedef struct _dsVideoPortResolution_t { bool interlaced; /**< The associated scan mode(@a true if interlaced, @a false if progressive). */ } dsVideoPortResolution_t; +typedef enum +{ + dsVIDEO_CODEC_MPEGHPART2 = (0x01 << 0), /*!< Also known HEVC, H.265 */ + dsVIDEO_CODEC_MPEG4PART10 = (0x01 << 1), /*!< Also known as H.264, MPEG4 AVC */ + dsVIDEO_CODEC_MPEG2 = (0x01 << 2), /*!< Also known as H.222/H.262 */ + dsVIDEO_CODEC_MAX = (0x01 << 3) /*!< Out of range */ +} dsVideoCodingFormat_t; + +typedef enum +{ + dsVIDEO_CODEC_HEVC_PROFILE_MAIN = (0x01 << 0), /*!< 8-bit HEVC video profile. */ + dsVIDEO_CODEC_HEVC_PROFILE_MAIN10 = (0x01 << 1), /*!< 10-bit HEVC video profile. */ + dsVIDEO_CODEC_HEVC_PROFILE_MAINSTILLPICTURE = (0x01 << 2), /*!< HECV Main Still Picture profile */ + dsVIDEO_CODEC_HEVC_MAX = (0x01 << 3) /*!< Out of range */ +} dsVideoCodecHevcProfiles_t; + +typedef struct +{ + dsVideoCodecHevcProfiles_t profile; /*!< HEVC Profiles. See dsVideoCodecHevcProfiles_t */ + float level; /*!< level for the specieis HEVC profile */ +} dsVideoCodecProfileSupport_t; + +typedef struct +{ + unsigned int num_entries; /*!< Number of entries */ + dsVideoCodecProfileSupport_t entries[10]; /*!< Contains a list of the supported Codex profiles */ +} dsVideoCodecInfo_t; + typedef enum _dsHDRStandard_t { dsHDRSTANDARD_NONE = 0x0, dsHDRSTANDARD_HDR10 = 0x01, @@ -722,6 +771,26 @@ class AudioStereoMode { AudioStereoMode(int id); }; +class AudioEncoding { +public: + AudioEncoding() : _id(dsAUDIO_ENC_NONE) {} + explicit AudioEncoding(int id) : _id(id) {} + int getId() const { return _id; } +private: + int _id; +}; + +class AspectRatio { +public: + AspectRatio() : _id(dsVIDEO_ASPECT_RATIO_16x9), _name("16x9") {} + AspectRatio(int id, const std::string& name) : _id(id), _name(name) {} + int getId() const { return _id; } + const std::string& getName() const { return _name; } +private: + int _id; + std::string _name; +}; + } namespace device { @@ -842,6 +911,10 @@ class AudioOutputPortImpl { virtual void setStereoMode(const std::string &mode, bool persist) = 0; + virtual void setAudioDucking(dsAudioDuckingAction_t action, dsAudioDuckingType_t type, const unsigned char level) = 0; + virtual const AudioEncoding& getEncoding() const = 0; + virtual void setEncoding(const int encoding) = 0; + virtual void setEncoding(const std::string& encoding) = 0; }; @@ -935,6 +1008,11 @@ class AudioOutputPort { uint32_t getDolbyVolumeMode() const; void setStereoMode(const std::string &mode, bool persist); + void setAudioDucking(dsAudioDuckingAction_t action, dsAudioDuckingType_t type, const unsigned char level); + const AudioEncoding& getEncoding() const; + void setEncoding(const int encoding); + void setEncoding(const std::string& encoding); + @@ -1097,6 +1175,8 @@ class VideoDeviceImpl { virtual const VideoDFC& getDFC() = 0; virtual void getHDRCapabilities(int* capabilities) = 0; virtual void getSettopSupportedResolutions(std::list& resolutions) = 0; + virtual unsigned int getSupportedVideoCodingFormats() const = 0; + virtual dsVideoCodecInfo_t getVideoCodecInfo(dsVideoCodingFormat_t format) const = 0; }; class VideoDevice { @@ -1118,7 +1198,8 @@ class VideoDevice { void setDFC(std::string zoomSetting); void getHDRCapabilities(int* capabilities); void getSettopSupportedResolutions(std::list& resolutions); - + unsigned int getSupportedVideoCodingFormats() const; + dsVideoCodecInfo_t getVideoCodecInfo(dsVideoCodingFormat_t format) const; }; } @@ -1268,6 +1349,7 @@ namespace device{ virtual void setAllmEnabled(bool enable) = 0; virtual void setAVIContentType(int contentType) = 0; virtual void setAVIScanInformation(int scanInfo) = 0; + virtual const AspectRatio& getAspectRatio() = 0; }; class Display { protected: @@ -1283,6 +1365,7 @@ namespace device{ void setAllmEnabled(bool enable); void setAVIContentType(int contentType); void setAVIScanInformation(int scanInfo); + const AspectRatio& getAspectRatio(); }; @@ -1330,6 +1413,10 @@ class VideoOutputPortImpl { virtual int getQuantizationRange() const = 0; virtual bool IsOutputHDR() = 0; + virtual bool isEnabled() const = 0; + virtual void enable() = 0; + virtual void disable() = 0; + }; @@ -1375,6 +1462,9 @@ class VideoOutputPort { int getColorDepth() const; int getQuantizationRange() const; bool IsOutputHDR(); + bool isEnabled() const; + void enable(); + void disable(); }; diff --git a/Tests/mocks/devicesettings/AudioOutputPortMock.h b/Tests/mocks/devicesettings/AudioOutputPortMock.h index 148ac73..a04f13b 100644 --- a/Tests/mocks/devicesettings/AudioOutputPortMock.h +++ b/Tests/mocks/devicesettings/AudioOutputPortMock.h @@ -111,6 +111,10 @@ class AudioOutputPortMock : public device::AudioOutputPortImpl { MOCK_METHOD(const device::AudioOutputPortType&, getType, (), (const, override)); + MOCK_METHOD(void, setAudioDucking, (dsAudioDuckingAction_t action, dsAudioDuckingType_t type, const unsigned char level), (override)); + MOCK_METHOD(const device::AudioEncoding&, getEncoding, (), (const, override)); + MOCK_METHOD(void, setEncoding, (const int encoding), (override)); + MOCK_METHOD(void, setEncoding, (const std::string& encoding), (override)); diff --git a/Tests/mocks/devicesettings/DisplayMock.h b/Tests/mocks/devicesettings/DisplayMock.h index af818a1..8e21a47 100644 --- a/Tests/mocks/devicesettings/DisplayMock.h +++ b/Tests/mocks/devicesettings/DisplayMock.h @@ -33,4 +33,5 @@ class DisplayMock : public device::DisplayImpl { MOCK_METHOD(void, setAllmEnabled, (bool enable), (override)); MOCK_METHOD(void, setAVIContentType, (int contentType), (override)); MOCK_METHOD(void, setAVIScanInformation, (int scanInfo), (override)); + MOCK_METHOD(const device::AspectRatio&, getAspectRatio, (), (override)); }; diff --git a/Tests/mocks/devicesettings/VideoDeviceMock.h b/Tests/mocks/devicesettings/VideoDeviceMock.h index 09cc3e3..bdea846 100644 --- a/Tests/mocks/devicesettings/VideoDeviceMock.h +++ b/Tests/mocks/devicesettings/VideoDeviceMock.h @@ -36,4 +36,6 @@ class VideoDeviceMock : public device::VideoDeviceImpl { MOCK_METHOD(void, setDFC, (std::string zoomSetting), (override)); // MOCK_METHOD(const VideoDFC&, getDFC, (), (const, override)); MOCK_METHOD(const device::VideoDFC&, getDFC, (), (override)); + MOCK_METHOD(unsigned int, getSupportedVideoCodingFormats, (), (const, override)); + MOCK_METHOD(dsVideoCodecInfo_t, getVideoCodecInfo, (dsVideoCodingFormat_t format), (const, override)); }; diff --git a/Tests/mocks/devicesettings/VideoOutputPortMock.h b/Tests/mocks/devicesettings/VideoOutputPortMock.h index 5296bd4..110a399 100644 --- a/Tests/mocks/devicesettings/VideoOutputPortMock.h +++ b/Tests/mocks/devicesettings/VideoOutputPortMock.h @@ -58,4 +58,7 @@ class VideoOutputPortMock : public device::VideoOutputPortImpl { MOCK_METHOD(int, getColorDepth, (), (const, override)); MOCK_METHOD(int, getQuantizationRange, (), (const, override)); MOCK_METHOD(bool, IsOutputHDR, (), (override)); + MOCK_METHOD(bool, isEnabled, (), (const, override)); + MOCK_METHOD(void, enable, (), (override)); + MOCK_METHOD(void, disable, (), (override)); }; diff --git a/Tests/mocks/readprocMockInterface.h b/Tests/mocks/readprocMockInterface.h index 2bd6bc1..222b8d1 100755 --- a/Tests/mocks/readprocMockInterface.h +++ b/Tests/mocks/readprocMockInterface.h @@ -26,6 +26,7 @@ #define PROC_FILLSTATUS 0x0020 // read status #define PROC_FILLMEM 0x0001 // read statm #define PROC_FILLSTAT 0x0040 // read stat +#define PROC_FILLCOM 0x0200 // fill cmdline typedef struct proc_t { // 1st 16 bytes @@ -34,6 +35,7 @@ int ppid; // stat,status pid of parent process char cmd[16]; // stat,status basename of executable file in call to exec(2) +char **cmdline; // cmdline the complete command line for the process, including arguments (see also: comm) } proc_t; @@ -66,8 +68,4 @@ class ProcImpl { extern PROCTAB* (*openproc)(int, ...); extern void (*closeproc)(PROCTAB*); -extern proc_t* (*readproc)(PROCTAB*, proc_t*); - - - - +extern proc_t* (*readproc)(PROCTAB*, proc_t*); \ No newline at end of file