From 84741c312dfc3b9ff96ec79ad1a93e2fd1e2565a Mon Sep 17 00:00:00 2001 From: sramani-metro <71630728+sramani-metro@users.noreply.github.com> Date: Tue, 30 Apr 2024 22:21:21 +0530 Subject: [PATCH 01/15] Create hdmi_cec_emulator_design.md Initial design of the emulator. Thoughts on YAML configuration. --- docs/pages/hdmi_cec_emulator_design.md | 385 +++++++++++++++++++++++++ 1 file changed, 385 insertions(+) create mode 100644 docs/pages/hdmi_cec_emulator_design.md diff --git a/docs/pages/hdmi_cec_emulator_design.md b/docs/pages/hdmi_cec_emulator_design.md new file mode 100644 index 0000000..383d69c --- /dev/null +++ b/docs/pages/hdmi_cec_emulator_design.md @@ -0,0 +1,385 @@ +# HAL Emulator for HDMI CEC + +- The HDMI CEC HAL interface test shall be enhanced to support an emulator that can be used as a Virtual device. +- Currently, rdk-halif-test-hdmi_cec supports a skeleton (stubbed out) implementation of the interface defined in rdk-halif-hdmi_cec. This shall be enhanced to support an emulator that mimics operations of a real device. +- The Emulator implementation shall replace the Skeleton implementation as the default. +- A Common emulator interface with Intitialize and Deinitialize methods shall be defined. +- Emulator shall be built as a separate binary (shared lib). + +When the emulator process is started, emulator_initialize shall be called with YAML configuration file passed into it using the '--profile' parameter. The configuration for the control plane shall be passed in through the '--config' parameter + +``` +`./run --profile skyglass_sink_5_sources.yml --config xyz.yml` +``` + +A Sample profile config in YAML with a network of devices representing a TV as the root device (Sink), connected with an Audio System connected on the HDMI port 1. The Audio system has a DVR Settop on its HDMI port 1 and a chromecast connected on its port 2. + +```yaml +--- +hdmicec: + device_type: &device_type + - TV + - STB_1 + - STB_2 + - DVR_1 + - DVR_2 + - Chromecast + - HomeTheatre + - GamingConsole_1 + - GamingConsole_2 + - DVDPlayer_1 + - DVDPlayer_2 + - AVR_1 + - AVR_2 + - Switcher_1 + - Switcher_2 + - Camera_1 + - Camera_2 + - SpecialPurpose_1 + - SpecialPurpose_2 + - Unregistered_1 + - Unregistered_2 + + port_id: &port_id + !!int + port_type: &port_type + - in + - out + + vendor: &vendor + - [TOSHIBA, 0x000039] + - [SAMSUNG, 0x0000F0] + - [DENON, 0x0005CD] + - [MARANTZ, 0x000678] + - [LOEWE, 0x000982] + - [ONKYO, 0x0009B0] + - [MEDION, 0x000CB8] + - [TOSHIBA2, 0x000CE7] + - [APPLE, 0x0010FA] + - [HARMAN_KARDON2, 0x001950] + - [GOOGLE, 0x001A11] + - [AKAI, 0x0020C7] + - [AOC, 0x002467] + - [PANASONIC, 0x008045] + - [PHILIPS, 0x00903E] + - [DAEWOO, 0x009053] + - [YAMAHA, 0x00A0DE] + - [GRUNDIG, 0x00D0D5] + - [PIONEER, 0x00E036] + - [LG, 0x00E091] + - [SHARP, 0x08001F] + - [SONY, 0x080046] + - [BROADCOM, 0x18C086] + - [SHARP2, 0x534850] + - [VIZIO, 0x6B746D] + - [BENQ, 0x8065E9] + - [HARMAN_KARDON, 0x9C645E] + - [UNKNOWN, 0] + + cec_version: &cec_version + - 0 #Unknown + - 1 #1.2 + - 2 #1.2A + - 3 #1.3 + - 4 #1.3A + - 5 #1.4 + - 6 #2.0 + + power_status: &power_status + - on + - off + - standby + + endpoint: &endpoint + name: !!str + id: *port_id + type: *port_type + + link: &link + - *endpoint + - *endpoint + + version: *cec_version + type: *device_type + active_source: !!bool + vendor_info: *vendor + pwr_status: *power_status + name: !!str + number_ports: !!int + ports: + - id: *port_id + type: *port_type + cec_supported: !!bool + arc_supported: !!bool + - id: *port_id + type: *port_type + cec_supported: !!bool + arc_supported: !!bool + number_devices: !!int + devices: + - type: *device_type + version: *cec_version + active_source: !!bool + vendor_info: *vendor + pwr_status: *power_status + name: !!str + + - type: *device_type + version: *cec_version + active_source: !!bool + vendor_info: *vendor + pwr_status: *power_status + name: !!str + + - type: *device_type + version: *cec_version + active_source: !!bool + vendor_info: *vendor + pwr_status: *power_status + name: !!str + + - type: *device_type + version: *cec_version + active_source: !!bool + vendor_info: *vendor + pwr_status: *power_status + name: !!str + + links: + type: array + items: *link + +``` + +A sample configuration file for the control plane + +```yaml +--- +controlplane: + ws: + port: 8091 + url: /hdmicec + +``` + +The Emulator will have a common interface that needs to be implemented along with the HAL driver interface functions. + +`emulator.h` + +``` +int emulator_initialise(const char* profile, const char* config); + +int emulator_deinitialise(void) +``` + +emulator_initialise will use the YAML decoding functionality via the Key-Value Pair (KVP) module available currently as part of the ut_core to read the profile parameters and create the initial state machine with number of HDMI Ports and the network of devices attached on the CEC bus. In addition, emulator will also intialise the control plane with the websocket parameters passed via '--config'. + +The control plane inititialise function may look like this. This will setup the websocket server. + +``` +ut_kvp_instance_t conf_instance = ut_kvp_createInstance(); +ut_kvp_status_t status = ut_kvp_read(&conf_instance, config); +uint16_t port = ut_kvp_getUInt32Field(&conf_instance, "controlplane.ws.port"); +char* url = ut_kvp_getStringField(&conf_instance, "controlplane.ws.url"); + +controlPlane_initialise(port, url); + +``` + +The emulator will also register with the control plane to receive callbacks when there is a command trigger from the Test user. These are YAML messages over Websocket. The register mechanism shall look like below, + +``` +controlPlane_register_callbackOnMessage("hdmicec.command", &myCallback); +``` + +The state machine of the Hdmi CEC hal is setup by populating its data structures by retreiving from the profile config. Below is an example of information about HDMI ports populated. The info on devices connected to the CEC bus is populated in a similar way to set up the initial state machine. + +``` +#define MAX_OSD_NAME_LENGTH 16 + +typedef enum { + INPUT, + OUTPUT +} port_type_t; + +tyedef enum { + ON, + STANDBY, + OFF +}power_status_t; + +typedef struct { + uint8_t id; + uint16_t physical_address; + port_type_t type; + bool cec_supported; + bool arc_supported; +} port_info_t; + +typedef struct { + uint32_t version; + uint16_t physical_address; + uint8_t logical_address; + bool active_source; + uint32_t vendor_id; + power_status_t power_status; + char osd_name[MAX_OSD_NAME_LENGTH]; +} device_t + + + +--- +ut_kvp_instance_t kvp_instance = ut_kvp_createInstance(); +ut_kvp_status_t status = ut_kvp_read(&kvp_instance, profile); +uint32_t num_ports = ut_kvp_getUInt32Field(&kvp_instance, "hdmicec.num_ports"); + +port_info_t *ports = (port_info_t*)malloc(size(port_info_t) * num_ports); + +char prefix_name[] = "hdmicec.ports."; +for(int i = 0; i < ports; i++) +{ + +} +--- + + +``` + +The emulator also sets up the data structures to manage HdmiCec Tx and Rx callbacks when the respective interface function is called. This includes the threading mechanisms required to trigger callbacks to caller of HdmiCec driver. Below diagram depicts a typical call sequence with emulator handling commands from Test user and triggering HdmiCec Rx callback. + +```mermaid +sequenceDiagram + emulator_main->>+emulator_lib: emulator_init(profile, config) + emulator_lib->>+control_plane: controlPlane_initialise(port, url) + control_plane-->>-emulator_lib: return + emulator_lib-->>-emulator_main: return + Note over control_plane: Setup Websocket server + emulator_lib->>+control_plane: controlPlane_register_callbackOnMessage + control_plane-->>-emulator_lib: return + Note over emulator_lib: Get KVP parameters, Setup device network + hal_user->>+emulator_lib: HdmiCecOpen + emulator_lib-->>-hal_user: return + hal_user->>+emulator_lib: HdmiCecSetRxCallback + emulator_lib-->>-hal_user: return + hal_user->>+emulator_lib: HdmiCecGetLogicalAddress + emulator_lib-->>-hal_user: return + hal_user->+emulator_lib: HdmiCecGetPhysicalAddress + emulator_lib-->>-hal_user: return + hal_user->>+emulator_lib: HdmiCeTx + emulator_lib-->>-hal_user: return + Note over Test User: hdmicec:
command: hotplug
port:10
on: true + Test User->>control_plane: YAML Message with Command + control_plane->>+emulator_lib: Command Callback + emulator_lib->>+hal_user: HdmiCecRxCallback triggered + hal_user-->-emulator_lib: return + emulator_lib-->-control_plane: return + + +``` + +Some sample commands from control plane + +Command to trigger a hotplug event from device connected in Port 2: + +```yaml +hdmicec: + command: hotplug + port: 2 + on: true +``` + +Command to make device connected in port 2 as active_source: + +```yaml +--- +hdmicec: + command: one_touch_play + port: 2 +``` + +The above command should trigger 2 call backs from the emulator to hal user. The emulator should be able to translate the commands received from test user into CEC message payload and trigger the call back. + +```mermaid +sequenceDiagram +Note over Test User: hdmicec:
command: one_touch_play
port: 2 +Test User->>+control_plane: command +control_plane->>+emulator_lib: command callback +emulator_lib->>+hal_user: HdmiCecRxCallback (IMAGE_VIEW_ON msg) +hal_user->>-emulator_lib: return +emulator_lib->>+hal_user: HdmiCecRxCallback (ACTIVE_SOURCE msg) +hal_user->>-emulator_lib: return + +``` + +Command to trigger a Broadcast message from Playback Device 1 to put all devices to standby (toggle) + +```yaml +--- +hdmicec: + command: system_standby + source: 4 # Logical address of Playback Device 1 + destination: F # Broadcast Logical address +``` + +Command to trigger a Device Menu Control command from Playback Device 2 to mute. + +```yaml +--- +hdmicec: + command: user_control + source: 8 # Logical address of Playback Device 1 + destination: 0 # Logical address of TV + ui_command: 43 # Mute +``` + +Test user can also trigger a re-configuration of the initial profile with which the emulator state machine was set up, like the device type (Sink or Source) and the list of devices in the network etc. + +Command to trigger a re-configuration of the initial state. The following config represents that the emulated device is Playback Device 1 and is connected to a TV on its Port. The TV also has a Chromecast connected to it on port 2. + +```yaml +--- +hdmicec: + config: + version: 4 + type: STB_1 + active_source: true + vendor: [SAMSUNG, 0x0000F0] + power_status: on + name: sky_xione + number_ports: 1 + ports: + - id: 1 + type: out + cec_supported: true + arc_supported: false + number_devices: 2 + devices: + - type: TV + version: 4 + active_source: false + vendor_info: [SONY, 0x080046] + pwr_status: on + name: Sony TV + - type: Chromecast + version: 4 + active_source: false + vendor_info: [GOOGLE, 0x001A11] + power_status: on + name: Chromecast + + links: + - - name: Sony TV + id: 1 + type: in + - name: sky_xione + id: 1 + type: out + - - name: Sony TV + id: 2 + type: in + - name: Chromecast + id: 1 + type: out +``` + +This will trigger a complete reconfiguration of the emulator state machine by deleting and reconstructing its internal data base. From 04a3f30017662723ae20ddfd1545a73cb7ebb6b8 Mon Sep 17 00:00:00 2001 From: akhilbhas <13413713+akhilbhas@users.noreply.github.com> Date: Thu, 9 May 2024 17:05:34 +0530 Subject: [PATCH 02/15] Adding MACRO ENABLE_ENHANCED_ERROR_CODE Rebasing the branch to latest develop --- src/test_l1_hdmi_cec_driver.c | 73 ++++++++++++++++++++++++++++------- 1 file changed, 60 insertions(+), 13 deletions(-) diff --git a/src/test_l1_hdmi_cec_driver.c b/src/test_l1_hdmi_cec_driver.c index 1afb6e3..27a387d 100644 --- a/src/test_l1_hdmi_cec_driver.c +++ b/src/test_l1_hdmi_cec_driver.c @@ -245,14 +245,19 @@ void test_hdmicec_hal_l1_open_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); //Check Null even before calling the positive case +#ifdef ENABLE_ENHANCED_ERROR_CODE result = HdmiCecOpen( NULL ); if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("open failed"); } - +#endif result = HdmiCecOpen( &handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("open failed"); } result = HdmiCecOpen( &handle ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_ALREADY_OPEN != result) { UT_FAIL("open failed"); } +#else + if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL("open failed"); } +#endif result = HdmiCecClose( handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } @@ -377,21 +382,27 @@ void test_hdmicec_hal_l1_close_negative( void ) gTestID = 4; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); +#ifdef ENABLE_ENHANCED_ERROR_CODE result = HdmiCecClose( handle ); if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("close failed"); } - +#endif result = HdmiCecOpen( &handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("open failed"); } result = HdmiCecClose( 0 ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("close failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("close failed"); } +#endif result = HdmiCecClose( handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } +#ifdef ENABLE_ENHANCED_ERROR_CODE result = HdmiCecClose( handle ); if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("close failed"); } - +#endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -474,16 +485,21 @@ void test_hdmicec_hal_l1_getPhysicalAddress_negative( void ) gTestID = 6; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); +#ifdef ENABLE_ENHANCED_ERROR_CODE result = HdmiCecGetPhysicalAddress(handle, &physicalAddress); if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); } - +#endif result = HdmiCecOpen (&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecGetPhysicalAddress(0, &physicalAddress); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); } +#endif result = HdmiCecGetPhysicalAddress(handle, NULL); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); } @@ -502,10 +518,11 @@ void test_hdmicec_hal_l1_getPhysicalAddress_negative( void ) result = HdmiCecClose (handle); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } +#ifdef ENABLE_ENHANCED_ERROR_CODE //Calling API after close, result = HdmiCecGetPhysicalAddress(handle, &physicalAddress); if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); } - +#endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -595,8 +612,10 @@ void test_hdmicec_hal_l1_addLogicalAddress_sinkDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); +#ifdef EHNCAGED_CHECKS_ENABLED result = HdmiCecAddLogicalAddress( handle, logicalAddress ); if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } +#endif result = HdmiCecOpen (&handle); //if init is failed no need to proceed further @@ -604,23 +623,39 @@ void test_hdmicec_hal_l1_addLogicalAddress_sinkDevice_negative( void ) result = HdmiCecAddLogicalAddress( 0, logicalAddress ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } +#endif result = HdmiCecAddLogicalAddress( handle, -1 ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } +#else + if (HDMI_CEC_IO_GENERAL_ERROR != result) { UT_FAIL ("HdmiCecAddLogicalAddress failed"); } +#endif result = HdmiCecAddLogicalAddress( handle, 0x3 ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } +#else + if (HDMI_CEC_IO_GENERAL_ERROR != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } +#endif result = HdmiCecAddLogicalAddress( handle, 0xF ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } +#else + if (HDMI_CEC_IO_GENERAL_ERROR != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } +#endif result = HdmiCecClose( handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } +#ifdef EHNCAGED_CHECKS_ENABLED result = HdmiCecAddLogicalAddress( handle, logicalAddress ); if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } - +#endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -828,9 +863,10 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sinkDevice_negative( void ) gTestID = 12; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); +#ifdef ENABLE_ENHANCED_ERROR_CODE result = HdmiCecRemoveLogicalAddress(handle, logicalAddress ); if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } - +#endif result = HdmiCecOpen(&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); @@ -857,14 +893,19 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sinkDevice_negative( void ) if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } result = HdmiCecRemoveLogicalAddress( handle, logicalAddress ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_ALREADY_REMOVED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } +#else + if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } +#endif result = HdmiCecClose(handle); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } +#ifdef ENABLE_ENHANCED_ERROR_CODE result = HdmiCecRemoveLogicalAddress(handle, logicalAddress ); if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } - +#endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1023,8 +1064,10 @@ void test_hdmicec_hal_l1_getLogicalAddress_sinkDevice_negative( void ) gTestID = 15; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); +#ifdef ENABLE_ENHANCED_ERROR_CODE result = HdmiCecGetLogicalAddress(handle, &logicalAddress); if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } +#endif result = HdmiCecOpen (&handle); //if init is failed no need to proceed further @@ -1064,10 +1107,11 @@ void test_hdmicec_hal_l1_getLogicalAddress_sinkDevice_negative( void ) result = HdmiCecClose (handle); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("HdmiCecClose failed"); } +#ifdef ENABLE_ENHANCED_ERROR_CODE //Calling API after close, should give invalid argument result = HdmiCecGetLogicalAddress(handle, &logicalAddress); if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } - +#endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1269,10 +1313,11 @@ void test_hdmicec_hal_l1_setRxCallback_negative ( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); +#ifdef ENABLE_ENHANCED_ERROR_CODE //Calling API before open, should pass result = HdmiCecSetRxCallback(handle, DriverReceiveCallback, (void*)0xDEADBEEF); if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecSetRxCallback failed"); } - +#endif /* Positive result */ result = HdmiCecOpen (&handle); //if init is failed no need to proceed further @@ -1371,9 +1416,10 @@ void test_hdmicec_hal_l1_setTxCallback_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); +#ifdef ENABLE_ENHANCED_ERROR_CODE result = HdmiCecSetTxCallback( handle, DriverTransmitCallback, (void*)0xDEADBEEF ); if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecSetTxCallback failed"); } - +#endif result = HdmiCecOpen ( &handle ); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); @@ -1481,10 +1527,11 @@ void test_hdmicec_hal_l1_hdmiCecTx_sinkDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); +#ifdef ENABLE_ENHANCED_ERROR_CODE //Calling API before open, should give invalid argument result = HdmiCecTx(handle, buf, len, &ret); if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTx failed"); } - +#endif /* Positive result */ result = HdmiCecOpen (&handle); //if init is failed no need to proceed further From a77ad32447a7dbc07cfcd8e8b5b1be9906afcf42 Mon Sep 17 00:00:00 2001 From: akhilbhas <13413713+akhilbhas@users.noreply.github.com> Date: Mon, 13 May 2024 06:38:19 +0000 Subject: [PATCH 03/15] Adding MACRO ENABLE_ENHANCED_ERROR_CODE * Addressing review commnets * Adding Macro to 1.0.4 version. --- src/test_l1_hdmi_cec_driver.c | 184 ++++++++++++++++++++++++++++------ 1 file changed, 151 insertions(+), 33 deletions(-) diff --git a/src/test_l1_hdmi_cec_driver.c b/src/test_l1_hdmi_cec_driver.c index 27a387d..a82c64f 100644 --- a/src/test_l1_hdmi_cec_driver.c +++ b/src/test_l1_hdmi_cec_driver.c @@ -346,7 +346,11 @@ void test_hdmicec_hal_l1_open_logical_address_unavailable_source ( void ) //Here handle = 0 since open failed and close should fail. result = HdmiCecClose( handle ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL_FATAL("close failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL_FATAL("close failed"); } +#endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); @@ -382,9 +386,11 @@ void test_hdmicec_hal_l1_close_negative( void ) gTestID = 4; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); -#ifdef ENABLE_ENHANCED_ERROR_CODE result = HdmiCecClose( handle ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("close failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("close failed"); } #endif result = HdmiCecOpen( &handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("open failed"); } @@ -399,9 +405,11 @@ void test_hdmicec_hal_l1_close_negative( void ) result = HdmiCecClose( handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } -#ifdef ENABLE_ENHANCED_ERROR_CODE result = HdmiCecClose( handle ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("close failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("close failed"); } #endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -485,9 +493,11 @@ void test_hdmicec_hal_l1_getPhysicalAddress_negative( void ) gTestID = 6; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); -#ifdef ENABLE_ENHANCED_ERROR_CODE result = HdmiCecGetPhysicalAddress(handle, &physicalAddress); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); } +#else + if (HDMI_CEC_IO_GENERAL_ERROR != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); } #endif result = HdmiCecOpen (&handle); @@ -518,10 +528,12 @@ void test_hdmicec_hal_l1_getPhysicalAddress_negative( void ) result = HdmiCecClose (handle); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } -#ifdef ENABLE_ENHANCED_ERROR_CODE //Calling API after close, result = HdmiCecGetPhysicalAddress(handle, &physicalAddress); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); } +#else + if (HDMI_CEC_IO_GENERAL_ERROR != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); } #endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -612,9 +624,11 @@ void test_hdmicec_hal_l1_addLogicalAddress_sinkDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); -#ifdef EHNCAGED_CHECKS_ENABLED result = HdmiCecAddLogicalAddress( handle, logicalAddress ); +#ifdef EHNCAGED_CHECKS_ENABLED if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } #endif result = HdmiCecOpen (&handle); @@ -652,9 +666,11 @@ void test_hdmicec_hal_l1_addLogicalAddress_sinkDevice_negative( void ) result = HdmiCecClose( handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } -#ifdef EHNCAGED_CHECKS_ENABLED result = HdmiCecAddLogicalAddress( handle, logicalAddress ); +#ifdef EHNCAGED_CHECKS_ENABLED if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } #endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); @@ -747,15 +763,21 @@ void test_hdmicec_hal_l1_addLogicalAddress_sourceDevice( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecAddLogicalAddress( handle, logicalAddress ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } +#endif result = HdmiCecOpen (&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL(result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecAddLogicalAddress( 0, logicalAddress ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } +#endif result = HdmiCecAddLogicalAddress( handle, -1 ); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } @@ -773,8 +795,11 @@ void test_hdmicec_hal_l1_addLogicalAddress_sourceDevice( void ) if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("Close failed"); } result = HdmiCecAddLogicalAddress( handle, logicalAddress ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } +#endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -863,17 +888,22 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sinkDevice_negative( void ) gTestID = 12; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); -#ifdef ENABLE_ENHANCED_ERROR_CODE result = HdmiCecRemoveLogicalAddress(handle, logicalAddress ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } #endif result = HdmiCecOpen(&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecRemoveLogicalAddress( 0, logicalAddress ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } +#endif result = HdmiCecRemoveLogicalAddress( handle, 0xF ); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } @@ -884,7 +914,11 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sinkDevice_negative( void ) if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } result = HdmiCecRemoveLogicalAddress( handle, logicalAddress ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_ALREADY_REMOVED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } +#else + if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } +#endif result = HdmiCecAddLogicalAddress( handle, logicalAddress ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } @@ -902,9 +936,11 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sinkDevice_negative( void ) result = HdmiCecClose(handle); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } -#ifdef ENABLE_ENHANCED_ERROR_CODE result = HdmiCecRemoveLogicalAddress(handle, logicalAddress ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } #endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); @@ -995,8 +1031,11 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sourceDevice( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecRemoveLogicalAddress(handle, logicalAddress ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } +#endif result = HdmiCecOpen(&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); @@ -1005,7 +1044,11 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sourceDevice( void ) if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } result = HdmiCecRemoveLogicalAddress( 0, logicalAddress ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } +#endif logicalAddress = 0xF; result = HdmiCecRemoveLogicalAddress( handle, 0xF ); @@ -1019,8 +1062,11 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sourceDevice( void ) if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } result = HdmiCecRemoveLogicalAddress(handle, logicalAddress ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } +#endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1064,9 +1110,11 @@ void test_hdmicec_hal_l1_getLogicalAddress_sinkDevice_negative( void ) gTestID = 15; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); -#ifdef ENABLE_ENHANCED_ERROR_CODE result = HdmiCecGetLogicalAddress(handle, &logicalAddress); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } #endif result = HdmiCecOpen (&handle); @@ -1074,7 +1122,11 @@ void test_hdmicec_hal_l1_getLogicalAddress_sinkDevice_negative( void ) UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecGetLogicalAddress(0, &logicalAddress); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } +#endif result = HdmiCecGetLogicalAddress(handle, NULL); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } @@ -1107,10 +1159,12 @@ void test_hdmicec_hal_l1_getLogicalAddress_sinkDevice_negative( void ) result = HdmiCecClose (handle); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("HdmiCecClose failed"); } -#ifdef ENABLE_ENHANCED_ERROR_CODE //Calling API after close, should give invalid argument result = HdmiCecGetLogicalAddress(handle, &logicalAddress); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } #endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1206,14 +1260,21 @@ void test_hdmicec_hal_l1_getLogicalAddress_sourceDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecGetLogicalAddress(handle, &logicalAddress); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } +#endif result = HdmiCecOpen (&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecGetLogicalAddress(0, &logicalAddress); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } +#endif result = HdmiCecGetLogicalAddress(handle, NULL); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } @@ -1230,8 +1291,11 @@ void test_hdmicec_hal_l1_getLogicalAddress_sourceDevice_negative( void ) //Calling API after close, should give invalid argument result = HdmiCecGetLogicalAddress(handle, &logicalAddress); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } +#endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1313,10 +1377,12 @@ void test_hdmicec_hal_l1_setRxCallback_negative ( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); -#ifdef ENABLE_ENHANCED_ERROR_CODE //Calling API before open, should pass result = HdmiCecSetRxCallback(handle, DriverReceiveCallback, (void*)0xDEADBEEF); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecSetRxCallback failed"); } +#endif + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecSetRxCallback failed"); } #endif /* Positive result */ result = HdmiCecOpen (&handle); @@ -1324,7 +1390,11 @@ void test_hdmicec_hal_l1_setRxCallback_negative ( void ) UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecSetRxCallback(0, DriverReceiveCallback, (void*)0xDEADBEEF); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecSetRxCallback failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecSetRxCallback failed"); } +#endif /*calling hdmicec_close should pass */ result = HdmiCecClose (handle); @@ -1332,8 +1402,11 @@ void test_hdmicec_hal_l1_setRxCallback_negative ( void ) //Calling API after close, should return success result = HdmiCecSetRxCallback(handle, DriverReceiveCallback, 0); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecSetRxCallback failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecSetRxCallback failed"); } +#endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1416,23 +1489,32 @@ void test_hdmicec_hal_l1_setTxCallback_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); -#ifdef ENABLE_ENHANCED_ERROR_CODE result = HdmiCecSetTxCallback( handle, DriverTransmitCallback, (void*)0xDEADBEEF ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecSetTxCallback failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecSetTxCallback failed"); } #endif result = HdmiCecOpen ( &handle ); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecSetTxCallback(0, NULL, (void*)0xDEADBEEF); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecSetTxCallback failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecSetTxCallback failed"); } +#endif result = HdmiCecClose( handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("HdmiCecClose failed"); } result = HdmiCecSetTxCallback( handle, DriverTransmitCallback, (void*)0xDEADBEEF ); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecSetTxCallback failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecSetTxCallback failed"); } +#endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1527,10 +1609,12 @@ void test_hdmicec_hal_l1_hdmiCecTx_sinkDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); -#ifdef ENABLE_ENHANCED_ERROR_CODE //Calling API before open, should give invalid argument result = HdmiCecTx(handle, buf, len, &ret); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTx failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTx failed"); } #endif /* Positive result */ result = HdmiCecOpen (&handle); @@ -1563,8 +1647,11 @@ void test_hdmicec_hal_l1_hdmiCecTx_sinkDevice_negative( void ) /* Invalid input */ result = HdmiCecTx(0, buf, len, &ret); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecTx failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTx failed"); } +#endif /* Invalid input */ result = HdmiCecTx(handle, buf, INT_MIN, &ret); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTx failed"); } @@ -1575,8 +1662,11 @@ void test_hdmicec_hal_l1_hdmiCecTx_sinkDevice_negative( void ) //Calling API after close, should give invalid argument result = HdmiCecTx(handle, buf, len, &ret); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTx failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTx failed"); } +#endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1701,8 +1791,11 @@ void test_hdmicec_hal_l1_hdmiCecTx_sourceDevice_negative( void ) //Calling API before open, should give not open error result = HdmiCecTx(handle, buf, len, &ret); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTx failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTx failed"); } +#endif /* Positive result */ result = HdmiCecOpen (&handle); //if init is failed no need to proceed further @@ -1724,8 +1817,11 @@ void test_hdmicec_hal_l1_hdmiCecTx_sourceDevice_negative( void ) /* Invalid input */ result = HdmiCecTx(0, buf, len, &ret); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecTx failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTx failed"); } +#endif /* Invalid input */ result = HdmiCecTx(handle, buf, INT_MIN, &ret); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTx failed"); } @@ -1736,8 +1832,11 @@ void test_hdmicec_hal_l1_hdmiCecTx_sourceDevice_negative( void ) //Calling API after close, should give invalid argument result = HdmiCecTx(handle, buf, len, &ret); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTx failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTx failed"); } +#endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1848,8 +1947,11 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sinkDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); //Calling API before open, should give invalid argument result = HdmiCecTxAsync(handle, buf, len); //Code crash here +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTxAsync failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } +#endif /* Positive result */ result = HdmiCecOpen (&handle); //if init is failed no need to proceed further @@ -1881,8 +1983,11 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sinkDevice_negative( void ) if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } result = HdmiCecTxAsync(0, buf, len); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecTxAsync failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } +#endif /* Invalid input */ result = HdmiCecTxAsync(handle, buf, INT_MIN); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } @@ -1896,8 +2001,11 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sinkDevice_negative( void ) //Calling API after close, should give invalid argument result = HdmiCecTxAsync(handle, buf, len); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTxAsync failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } +#endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -2018,8 +2126,11 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sourceDevice_negative( void ) //Calling API before open, should give invalid argument result = HdmiCecTxAsync(handle, buf, len); //Code crash here +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTxAsync failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } +#endif /* Positive result */ result = HdmiCecOpen (&handle); //if init is failed no need to proceed further @@ -2040,7 +2151,11 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sourceDevice_negative( void ) if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } result = HdmiCecTxAsync(0, buf, len); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecTxAsync failed"); } +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } +#endif /* Invalid input */ result = HdmiCecTxAsync(handle, buf, INT_MIN); @@ -2054,8 +2169,11 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sourceDevice_negative( void ) //Calling API after close, should give invalid argument result = HdmiCecTxAsync(handle, buf, len); +#ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTxAsync failed"); } - +#else + if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } +#endif UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } From 4da399e4fe81299002778e2ca12862f9c38398e3 Mon Sep 17 00:00:00 2001 From: akhilbhas <13413713+akhilbhas@users.noreply.github.com> Date: Mon, 13 May 2024 08:13:28 +0000 Subject: [PATCH 04/15] Adding MACRO ENABLE_ENHANCED_ERROR_CODE Correcting build issues found. --- src/test_l1_hdmi_cec_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_l1_hdmi_cec_driver.c b/src/test_l1_hdmi_cec_driver.c index a82c64f..5d1d27b 100644 --- a/src/test_l1_hdmi_cec_driver.c +++ b/src/test_l1_hdmi_cec_driver.c @@ -1381,7 +1381,7 @@ void test_hdmicec_hal_l1_setRxCallback_negative ( void ) result = HdmiCecSetRxCallback(handle, DriverReceiveCallback, (void*)0xDEADBEEF); #ifdef ENABLE_ENHANCED_ERROR_CODE if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecSetRxCallback failed"); } -#endif +#else if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecSetRxCallback failed"); } #endif /* Positive result */ From cd02d1c6d56cf2c3c7d6dc09ee7f571a4040ebac Mon Sep 17 00:00:00 2001 From: Santhosh Ramani Date: Tue, 14 May 2024 16:25:53 +0530 Subject: [PATCH 05/15] gh #7 Update design document --- docs/pages/hdmi_cec_emulator_design.md | 156 ++++++++++++++++++------- 1 file changed, 111 insertions(+), 45 deletions(-) diff --git a/docs/pages/hdmi_cec_emulator_design.md b/docs/pages/hdmi_cec_emulator_design.md index 383d69c..2d72efd 100644 --- a/docs/pages/hdmi_cec_emulator_design.md +++ b/docs/pages/hdmi_cec_emulator_design.md @@ -12,11 +12,12 @@ When the emulator process is started, emulator_initialize shall be called with Y `./run --profile skyglass_sink_5_sources.yml --config xyz.yml` ``` -A Sample profile config in YAML with a network of devices representing a TV as the root device (Sink), connected with an Audio System connected on the HDMI port 1. The Audio system has a DVR Settop on its HDMI port 1 and a chromecast connected on its port 2. +Given below is a configuration template which provides all possible fields and it's intended values. The configuration template is intened to serve as a validation schema for the emulated device config. ```yaml --- hdmicec: + #Device logical types - Hints for emulator to auto allocate logical address device_type: &device_type - TV - STB_1 @@ -28,24 +29,29 @@ hdmicec: - GamingConsole_1 - GamingConsole_2 - DVDPlayer_1 - - DVDPlayer_2 + - DVDPlayer_2 - AVR_1 - AVR_2 - Switcher_1 - Switcher_2 - Camera_1 - Camera_2 - - SpecialPurpose_1 - - SpecialPurpose_2 - - Unregistered_1 - - Unregistered_2 - + - SpecialPurpose + - Unregistered + + #Port ID - Integer [1 to 15] port_id: &port_id !!int + + #Enum specifying port type + #All references shown in the configuration templates are intended to provide possible values for the given type. + #In practice, the below field would be defined as, + # port_type: in port_type: &port_type - in - out + #Vendor Info - Name and IEEE RAC vendor code vendor: &vendor - [TOSHIBA, 0x000039] - [SAMSUNG, 0x0000F0] @@ -76,7 +82,8 @@ hdmicec: - [HARMAN_KARDON, 0x9C645E] - [UNKNOWN, 0] - cec_version: &cec_version + #HDMI CEC Version supported by device + cec_version: &cec_version - 0 #Unknown - 1 #1.2 - 2 #1.2A @@ -85,30 +92,38 @@ hdmicec: - 5 #1.4 - 6 #2.0 + #Power Status of the device power_status: &power_status - on - off - standby - endpoint: &endpoint - name: !!str - id: *port_id - type: *port_type - - link: &link - - *endpoint - - *endpoint - - version: *cec_version - type: *device_type - active_source: !!bool - vendor_info: *vendor - pwr_status: *power_status - name: !!str + #Endpoint information + endpoint: &endpoint + name: !!str # Name of the Device in the network + id: *port_id # Port number + type: *port_type # Type of Port from &port_type + + #Link represents a connection between 2 endpoints + #Physical addresses will be based on links + link: &link + - *endpoint + - *endpoint + + # Emulated Device's Information + version: *cec_version #Value from enum &cec_version + type: *device_type #Type of device from device_type list + active_source: !!bool #Whether the device will start as active source + vendor_info: *vendor #Vendor info value pair from &vendor + pwr_status: *power_status #Initial Power status from enum &power_status + name: !!str #Name of the device number_ports: !!int - ports: + ports: #Variable sized array of Ports belonging to Emulated device - id: *port_id - type: *port_type + #All references shown in the configuration templates are intended to provide possible values for the given type. + #In practice, the below field would be defined as, + # port_type: in + type: *port_type # Type of Port from &port_type cec_supported: !!bool arc_supported: !!bool - id: *port_id @@ -116,8 +131,8 @@ hdmicec: cec_supported: !!bool arc_supported: !!bool number_devices: !!int - devices: - - type: *device_type + devices: # Variable sized array of Connected devices + - type: *device_type #Type of device from device_type list version: *cec_version active_source: !!bool vendor_info: *vendor @@ -145,9 +160,12 @@ hdmicec: pwr_status: *power_status name: !!str + # Variable sized array of links between end points + # This represents the network of devices links: - type: array - items: *link + - *link + - *link + - *link ``` @@ -208,7 +226,7 @@ tyedef enum { OFF }power_status_t; -typedef struct { +typedef struct port_info { uint8_t id; uint16_t physical_address; port_type_t type; @@ -216,7 +234,7 @@ typedef struct { bool arc_supported; } port_info_t; -typedef struct { +typedef struct device { uint32_t version; uint16_t physical_address; uint8_t logical_address; @@ -224,7 +242,7 @@ typedef struct { uint32_t vendor_id; power_status_t power_status; char osd_name[MAX_OSD_NAME_LENGTH]; -} device_t +} @@ -355,7 +373,7 @@ hdmicec: number_devices: 2 devices: - type: TV - version: 4 + version: 4 active_source: false vendor_info: [SONY, 0x080046] pwr_status: on @@ -368,18 +386,66 @@ hdmicec: name: Chromecast links: - - - name: Sony TV - id: 1 - type: in - - name: sky_xione - id: 1 - type: out - - - name: Sony TV - id: 2 - type: in - - name: Chromecast - id: 1 - type: out + - - name: Sony TV + id: 1 + type: in + - name: sky_xione + id: 1 + type: out + - - name: Sony TV + id: 2 + type: in + - name: Chromecast + id: 1 + type: out +``` + + +The above configuration yaml instructs the emulator about the following devices connected. + +```mermaid +mindmap + root[Sony TV - 0.0.0.0] + id[sky_xione - 1.0.0.0] + id[Chromecast - 2.0.0.0] ``` + + + + This will trigger a complete reconfiguration of the emulator state machine by deleting and reconstructing its internal data base. + + +## Tasks Breakdown for MVP + +```mermaid +mindmap + root((HDMI CEC Emulator)) + Library + Init/Deinit + Load values from Profile config + KVP + Makery - Build/Install + ::icon(fa fa-wrench) + Setup State machine + Local data structures + Build device network topology + Threading for callbacks + Auto allocate logical addresses + Process + Main driver to start Emulator + Makery - Build/Install + ::icon(fa fa-wrench) + Sample Profile config YAMLs + Test Menus - Emulator init and basic CEC + User Triggers + ::icon(fa fa-user) + Initialize control plane with endpoint + id)User Commands( + Active Source Request + Add/Remove devices + Catalogue of Commands + Dynamic base config change +``` + From 117c8d40d14b9a63f188cc894e2f192e40253ed6 Mon Sep 17 00:00:00 2001 From: akhilbhas <13413713+akhilbhas@users.noreply.github.com> Date: Wed, 22 May 2024 18:16:14 +0530 Subject: [PATCH 06/15] Handling Enhanced error code with kvp profile Adding KVP Profiling feature to enable and disable Enhanced Error Code check --- src/test_l1_hdmi_cec_driver.c | 336 +++++++++------------------------- 1 file changed, 91 insertions(+), 245 deletions(-) diff --git a/src/test_l1_hdmi_cec_driver.c b/src/test_l1_hdmi_cec_driver.c index 5d1d27b..0e3734a 100644 --- a/src/test_l1_hdmi_cec_driver.c +++ b/src/test_l1_hdmi_cec_driver.c @@ -85,6 +85,7 @@ static int gTestGroup = 1; static int gTestID = 1; +static bool extendedEnumsSupported=false; #define CEC_GET_CEC_VERSION (0x9F) #define CEC_DEVICE_VENDOR_ID (0x87) @@ -106,6 +107,17 @@ static int gTestID = 1; HdmiCecClose( handle );\ } +#define CHECK_FOR_EXTENDED_ERROR_CODE( result, enhanced, old )\ +{\ + if ( extendedEnumsSupported == true )\ + {\ + UT_ASSERT_EQUALS( enhanced, result );\ + }\ + else\ + {\ + UT_ASSERT_EQUALS( old, result );\ + }\ +} /** @@ -245,19 +257,14 @@ void test_hdmicec_hal_l1_open_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); //Check Null even before calling the positive case -#ifdef ENABLE_ENHANCED_ERROR_CODE result = HdmiCecOpen( NULL ); - if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("open failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + result = HdmiCecOpen( &handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("open failed"); } result = HdmiCecOpen( &handle ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_ALREADY_OPEN != result) { UT_FAIL("open failed"); } -#else - if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL("open failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_ALREADY_OPEN,HDMI_CEC_IO_SUCCESS) result = HdmiCecClose( handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } @@ -346,11 +353,7 @@ void test_hdmicec_hal_l1_open_logical_address_unavailable_source ( void ) //Here handle = 0 since open failed and close should fail. result = HdmiCecClose( handle ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL_FATAL("close failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL_FATAL("close failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); @@ -387,30 +390,19 @@ void test_hdmicec_hal_l1_close_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecClose( handle ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("close failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("close failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + result = HdmiCecOpen( &handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("open failed"); } result = HdmiCecClose( 0 ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("close failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("close failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) result = HdmiCecClose( handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } result = HdmiCecClose( handle ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("close failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("close failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -494,22 +486,14 @@ void test_hdmicec_hal_l1_getPhysicalAddress_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecGetPhysicalAddress(handle, &physicalAddress); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); } -#else - if (HDMI_CEC_IO_GENERAL_ERROR != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_GENERAL_ERROR) result = HdmiCecOpen (&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecGetPhysicalAddress(0, &physicalAddress); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_HANDLE) result = HdmiCecGetPhysicalAddress(handle, NULL); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); } @@ -530,11 +514,7 @@ void test_hdmicec_hal_l1_getPhysicalAddress_negative( void ) //Calling API after close, result = HdmiCecGetPhysicalAddress(handle, &physicalAddress); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); } -#else - if (HDMI_CEC_IO_GENERAL_ERROR != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_GENERAL_ERROR) UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -637,41 +617,22 @@ void test_hdmicec_hal_l1_addLogicalAddress_sinkDevice_negative( void ) result = HdmiCecAddLogicalAddress( 0, logicalAddress ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + result = HdmiCecAddLogicalAddress( handle, -1 ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_GENERAL_ERROR != result) { UT_FAIL ("HdmiCecAddLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_ARGUMENT,HDMI_CEC_IO_GENERAL_ERROR) result = HdmiCecAddLogicalAddress( handle, 0x3 ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_GENERAL_ERROR != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_ARGUMENT,HDMI_CEC_IO_GENERAL_ERROR) result = HdmiCecAddLogicalAddress( handle, 0xF ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_GENERAL_ERROR != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_ARGUMENT,HDMI_CEC_IO_GENERAL_ERROR) result = HdmiCecClose( handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } result = HdmiCecAddLogicalAddress( handle, logicalAddress ); -#ifdef EHNCAGED_CHECKS_ENABLED - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -763,21 +724,15 @@ void test_hdmicec_hal_l1_addLogicalAddress_sourceDevice( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecAddLogicalAddress( handle, logicalAddress ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + result = HdmiCecOpen (&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL(result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecAddLogicalAddress( 0, logicalAddress ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + result = HdmiCecAddLogicalAddress( handle, -1 ); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } @@ -795,11 +750,8 @@ void test_hdmicec_hal_l1_addLogicalAddress_sourceDevice( void ) if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("Close failed"); } result = HdmiCecAddLogicalAddress( handle, logicalAddress ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -889,21 +841,15 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sinkDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecRemoveLogicalAddress(handle, logicalAddress ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + result = HdmiCecOpen(&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecRemoveLogicalAddress( 0, logicalAddress ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + result = HdmiCecRemoveLogicalAddress( handle, 0xF ); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } @@ -914,11 +860,7 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sinkDevice_negative( void ) if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } result = HdmiCecRemoveLogicalAddress( handle, logicalAddress ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_ALREADY_REMOVED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_ALREADY_REMOVED,HDMI_CEC_IO_SUCCESS) result = HdmiCecAddLogicalAddress( handle, logicalAddress ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } @@ -927,21 +869,14 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sinkDevice_negative( void ) if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } result = HdmiCecRemoveLogicalAddress( handle, logicalAddress ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_ALREADY_REMOVED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_ALREADY_REMOVED,HDMI_CEC_IO_SUCCESS) result = HdmiCecClose(handle); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } result = HdmiCecRemoveLogicalAddress(handle, logicalAddress ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1031,11 +966,8 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sourceDevice( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecRemoveLogicalAddress(handle, logicalAddress ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + result = HdmiCecOpen(&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); @@ -1044,11 +976,7 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sourceDevice( void ) if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } result = HdmiCecRemoveLogicalAddress( 0, logicalAddress ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) logicalAddress = 0xF; result = HdmiCecRemoveLogicalAddress( handle, 0xF ); @@ -1062,11 +990,8 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sourceDevice( void ) if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } result = HdmiCecRemoveLogicalAddress(handle, logicalAddress ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1111,22 +1036,14 @@ void test_hdmicec_hal_l1_getLogicalAddress_sinkDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecGetLogicalAddress(handle, &logicalAddress); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) result = HdmiCecOpen (&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecGetLogicalAddress(0, &logicalAddress); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) result = HdmiCecGetLogicalAddress(handle, NULL); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } @@ -1161,11 +1078,8 @@ void test_hdmicec_hal_l1_getLogicalAddress_sinkDevice_negative( void ) //Calling API after close, should give invalid argument result = HdmiCecGetLogicalAddress(handle, &logicalAddress); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1260,21 +1174,14 @@ void test_hdmicec_hal_l1_getLogicalAddress_sourceDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecGetLogicalAddress(handle, &logicalAddress); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + result = HdmiCecOpen (&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecGetLogicalAddress(0, &logicalAddress); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) result = HdmiCecGetLogicalAddress(handle, NULL); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } @@ -1291,11 +1198,8 @@ void test_hdmicec_hal_l1_getLogicalAddress_sourceDevice_negative( void ) //Calling API after close, should give invalid argument result = HdmiCecGetLogicalAddress(handle, &logicalAddress); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1379,22 +1283,15 @@ void test_hdmicec_hal_l1_setRxCallback_negative ( void ) //Calling API before open, should pass result = HdmiCecSetRxCallback(handle, DriverReceiveCallback, (void*)0xDEADBEEF); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecSetRxCallback failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecSetRxCallback failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + /* Positive result */ result = HdmiCecOpen (&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecSetRxCallback(0, DriverReceiveCallback, (void*)0xDEADBEEF); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecSetRxCallback failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecSetRxCallback failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) /*calling hdmicec_close should pass */ result = HdmiCecClose (handle); @@ -1402,11 +1299,8 @@ void test_hdmicec_hal_l1_setRxCallback_negative ( void ) //Calling API after close, should return success result = HdmiCecSetRxCallback(handle, DriverReceiveCallback, 0); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecSetRxCallback failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecSetRxCallback failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1490,31 +1384,21 @@ void test_hdmicec_hal_l1_setTxCallback_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecSetTxCallback( handle, DriverTransmitCallback, (void*)0xDEADBEEF ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecSetTxCallback failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecSetTxCallback failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + result = HdmiCecOpen ( &handle ); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecSetTxCallback(0, NULL, (void*)0xDEADBEEF); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecSetTxCallback failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecSetTxCallback failed"); } -#endif - + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + result = HdmiCecClose( handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("HdmiCecClose failed"); } result = HdmiCecSetTxCallback( handle, DriverTransmitCallback, (void*)0xDEADBEEF ); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecSetTxCallback failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecSetTxCallback failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1611,11 +1495,8 @@ void test_hdmicec_hal_l1_hdmiCecTx_sinkDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); //Calling API before open, should give invalid argument result = HdmiCecTx(handle, buf, len, &ret); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTx failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTx failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + /* Positive result */ result = HdmiCecOpen (&handle); //if init is failed no need to proceed further @@ -1647,11 +1528,8 @@ void test_hdmicec_hal_l1_hdmiCecTx_sinkDevice_negative( void ) /* Invalid input */ result = HdmiCecTx(0, buf, len, &ret); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecTx failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTx failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + /* Invalid input */ result = HdmiCecTx(handle, buf, INT_MIN, &ret); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTx failed"); } @@ -1662,11 +1540,8 @@ void test_hdmicec_hal_l1_hdmiCecTx_sinkDevice_negative( void ) //Calling API after close, should give invalid argument result = HdmiCecTx(handle, buf, len, &ret); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTx failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTx failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1791,11 +1666,8 @@ void test_hdmicec_hal_l1_hdmiCecTx_sourceDevice_negative( void ) //Calling API before open, should give not open error result = HdmiCecTx(handle, buf, len, &ret); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTx failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTx failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + /* Positive result */ result = HdmiCecOpen (&handle); //if init is failed no need to proceed further @@ -1817,11 +1689,8 @@ void test_hdmicec_hal_l1_hdmiCecTx_sourceDevice_negative( void ) /* Invalid input */ result = HdmiCecTx(0, buf, len, &ret); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecTx failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTx failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + /* Invalid input */ result = HdmiCecTx(handle, buf, INT_MIN, &ret); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTx failed"); } @@ -1832,11 +1701,7 @@ void test_hdmicec_hal_l1_hdmiCecTx_sourceDevice_negative( void ) //Calling API after close, should give invalid argument result = HdmiCecTx(handle, buf, len, &ret); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTx failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTx failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1947,11 +1812,8 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sinkDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); //Calling API before open, should give invalid argument result = HdmiCecTxAsync(handle, buf, len); //Code crash here -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTxAsync failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + /* Positive result */ result = HdmiCecOpen (&handle); //if init is failed no need to proceed further @@ -1983,11 +1845,8 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sinkDevice_negative( void ) if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } result = HdmiCecTxAsync(0, buf, len); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecTxAsync failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + /* Invalid input */ result = HdmiCecTxAsync(handle, buf, INT_MIN); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } @@ -2001,11 +1860,8 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sinkDevice_negative( void ) //Calling API after close, should give invalid argument result = HdmiCecTxAsync(handle, buf, len); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTxAsync failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -2126,11 +1982,8 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sourceDevice_negative( void ) //Calling API before open, should give invalid argument result = HdmiCecTxAsync(handle, buf, len); //Code crash here -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTxAsync failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + /* Positive result */ result = HdmiCecOpen (&handle); //if init is failed no need to proceed further @@ -2151,11 +2004,7 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sourceDevice_negative( void ) if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } result = HdmiCecTxAsync(0, buf, len); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecTxAsync failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) /* Invalid input */ result = HdmiCecTxAsync(handle, buf, INT_MIN); @@ -2169,11 +2018,8 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sourceDevice_negative( void ) //Calling API after close, should give invalid argument result = HdmiCecTxAsync(handle, buf, len); -#ifdef ENABLE_ENHANCED_ERROR_CODE - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTxAsync failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -2430,7 +2276,7 @@ int test_hdmicec_hal_l1_register( void ) UT_add_test( pSuite_stb, "TxAsyncSource_negative", test_hdmicec_hal_l1_hdmiCecTxAsync_sourceDevice_negative); //UT_add_test( pSuite_stb, "open_logical_address_unavailable_source", test_hdmicec_hal_l1_open_logical_address_unavailable_source); //UT_add_test( pSuiteHdmiDisConnected, "portDisconnectedSource", test_hdmicec_hal_l1_portDisconnected_source); - + extendedEnumsSupported = ut_kvp_getBoolField( ut_kvp_profile_getInstance(), ""hdmicec/features/extendedEnumsSupported" ); return 0; } From 7ca87447b3c88d9d89f562142c9c0aded1e8ff00 Mon Sep 17 00:00:00 2001 From: akhilbhas <13413713+akhilbhas@users.noreply.github.com> Date: Wed, 22 May 2024 18:24:08 +0530 Subject: [PATCH 07/15] Enhaced Error Code check using KVP Profiling * Addressing Build issue --- src/test_l1_hdmi_cec_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test_l1_hdmi_cec_driver.c b/src/test_l1_hdmi_cec_driver.c index 0e3734a..4d8363a 100644 --- a/src/test_l1_hdmi_cec_driver.c +++ b/src/test_l1_hdmi_cec_driver.c @@ -111,11 +111,11 @@ static bool extendedEnumsSupported=false; {\ if ( extendedEnumsSupported == true )\ {\ - UT_ASSERT_EQUALS( enhanced, result );\ + UT_ASSERT_EQUAL( enhanced, result );\ }\ else\ {\ - UT_ASSERT_EQUALS( old, result );\ + UT_ASSERT_EQUAL( old, result );\ }\ } From 6212850ba856612ad1e772207ab4764f7953d21f Mon Sep 17 00:00:00 2001 From: akhilbhas <13413713+akhilbhas@users.noreply.github.com> Date: Wed, 22 May 2024 18:37:29 +0530 Subject: [PATCH 08/15] Enhaced Error Code check using KVP Profiling * Addressing Build issue --- src/test_l1_hdmi_cec_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_l1_hdmi_cec_driver.c b/src/test_l1_hdmi_cec_driver.c index 4d8363a..8c600e7 100644 --- a/src/test_l1_hdmi_cec_driver.c +++ b/src/test_l1_hdmi_cec_driver.c @@ -2276,7 +2276,7 @@ int test_hdmicec_hal_l1_register( void ) UT_add_test( pSuite_stb, "TxAsyncSource_negative", test_hdmicec_hal_l1_hdmiCecTxAsync_sourceDevice_negative); //UT_add_test( pSuite_stb, "open_logical_address_unavailable_source", test_hdmicec_hal_l1_open_logical_address_unavailable_source); //UT_add_test( pSuiteHdmiDisConnected, "portDisconnectedSource", test_hdmicec_hal_l1_portDisconnected_source); - extendedEnumsSupported = ut_kvp_getBoolField( ut_kvp_profile_getInstance(), ""hdmicec/features/extendedEnumsSupported" ); + extendedEnumsSupported = ut_kvp_getBoolField( ut_kvp_profile_getInstance(), "hdmicec/features/extendedEnumsSupported" ); return 0; } From b48fb614b7b448104d755c23f47f3411bffec1e1 Mon Sep 17 00:00:00 2001 From: akhilbhas <13413713+akhilbhas@users.noreply.github.com> Date: Thu, 23 May 2024 13:59:23 +0530 Subject: [PATCH 09/15] Enhanced Error Code kvp Profiler * Adding Profile configuration yaml --- ut/profile/hdmiCECExtendedEnumsNotSupported.yaml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 ut/profile/hdmiCECExtendedEnumsNotSupported.yaml diff --git a/ut/profile/hdmiCECExtendedEnumsNotSupported.yaml b/ut/profile/hdmiCECExtendedEnumsNotSupported.yaml new file mode 100644 index 0000000..e40c24c --- /dev/null +++ b/ut/profile/hdmiCECExtendedEnumsNotSupported.yaml @@ -0,0 +1,3 @@ +hdmicec: + features: + extendedEnumsSupported: false \ No newline at end of file From 749d16f4121563a65bccf17f7ce8215a0dd09383 Mon Sep 17 00:00:00 2001 From: akhilbhas <13413713+akhilbhas@users.noreply.github.com> Date: Thu, 23 May 2024 14:37:16 +0530 Subject: [PATCH 10/15] Enahnced Error code in Profile * Moving YAML file * Updated YAML file with verified content --- {ut/profile => profile}/hdmiCECExtendedEnumsNotSupported.yaml | 1 + 1 file changed, 1 insertion(+) rename {ut/profile => profile}/hdmiCECExtendedEnumsNotSupported.yaml (93%) diff --git a/ut/profile/hdmiCECExtendedEnumsNotSupported.yaml b/profile/hdmiCECExtendedEnumsNotSupported.yaml similarity index 93% rename from ut/profile/hdmiCECExtendedEnumsNotSupported.yaml rename to profile/hdmiCECExtendedEnumsNotSupported.yaml index e40c24c..8d85638 100644 --- a/ut/profile/hdmiCECExtendedEnumsNotSupported.yaml +++ b/profile/hdmiCECExtendedEnumsNotSupported.yaml @@ -1,3 +1,4 @@ +--- hdmicec: features: extendedEnumsSupported: false \ No newline at end of file From 015437a6d9b427893462c17cc6566cef7373b91d Mon Sep 17 00:00:00 2001 From: akhilbhas <13413713+akhilbhas@users.noreply.github.com> Date: Thu, 23 May 2024 15:44:36 +0530 Subject: [PATCH 11/15] gh #11 Enhanced error Code Profile * Adding header file for kvp profile * renaming yaml path --- {profile => profiles}/hdmiCECExtendedEnumsNotSupported.yaml | 0 src/test_l1_hdmi_cec_driver.c | 1 + 2 files changed, 1 insertion(+) rename {profile => profiles}/hdmiCECExtendedEnumsNotSupported.yaml (100%) diff --git a/profile/hdmiCECExtendedEnumsNotSupported.yaml b/profiles/hdmiCECExtendedEnumsNotSupported.yaml similarity index 100% rename from profile/hdmiCECExtendedEnumsNotSupported.yaml rename to profiles/hdmiCECExtendedEnumsNotSupported.yaml diff --git a/src/test_l1_hdmi_cec_driver.c b/src/test_l1_hdmi_cec_driver.c index 8c600e7..9bb9bfa 100644 --- a/src/test_l1_hdmi_cec_driver.c +++ b/src/test_l1_hdmi_cec_driver.c @@ -68,6 +68,7 @@ #include #include "ut_log.h" +#include "ut_kvp_profile.h" #include "hdmi_cec_driver.h" /** From 3d2a78ca12331165393a621bcf2136531f2718aa Mon Sep 17 00:00:00 2001 From: akhilbhas <13413713+akhilbhas@users.noreply.github.com> Date: Fri, 24 May 2024 15:46:50 +0530 Subject: [PATCH 12/15] gh #11 Enhanced Error Code profile Addressing Review comments * changing include file line from local to pre-desiganted path * Adding the CHECK_FOR_EXTENDED_ERROR_CODE macro function to missed line --- src/test_l1_hdmi_cec_driver.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/test_l1_hdmi_cec_driver.c b/src/test_l1_hdmi_cec_driver.c index 9bb9bfa..6845fdd 100644 --- a/src/test_l1_hdmi_cec_driver.c +++ b/src/test_l1_hdmi_cec_driver.c @@ -67,8 +67,8 @@ #include #include -#include "ut_log.h" -#include "ut_kvp_profile.h" +#include +#include #include "hdmi_cec_driver.h" /** @@ -606,11 +606,7 @@ void test_hdmicec_hal_l1_addLogicalAddress_sinkDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecAddLogicalAddress( handle, logicalAddress ); -#ifdef EHNCAGED_CHECKS_ENABLED - if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } -#else - if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } -#endif + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) result = HdmiCecOpen (&handle); //if init is failed no need to proceed further From e680963fb17b6ca1330c2d998536b65d14885c9d Mon Sep 17 00:00:00 2001 From: akhilbhas <13413713+akhilbhas@users.noreply.github.com> Date: Wed, 29 May 2024 13:14:48 +0530 Subject: [PATCH 13/15] gh #11 Enhanced Error Code profile Addressing Review comments *Addressing semicolon at end of Macro function call --- src/test_l1_hdmi_cec_driver.c | 100 +++++++++++++++++----------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/src/test_l1_hdmi_cec_driver.c b/src/test_l1_hdmi_cec_driver.c index 6845fdd..c6f5538 100644 --- a/src/test_l1_hdmi_cec_driver.c +++ b/src/test_l1_hdmi_cec_driver.c @@ -259,13 +259,13 @@ void test_hdmicec_hal_l1_open_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); //Check Null even before calling the positive case result = HdmiCecOpen( NULL ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT); result = HdmiCecOpen( &handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("open failed"); } result = HdmiCecOpen( &handle ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_ALREADY_OPEN,HDMI_CEC_IO_SUCCESS) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_ALREADY_OPEN,HDMI_CEC_IO_SUCCESS); result = HdmiCecClose( handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } @@ -354,7 +354,7 @@ void test_hdmicec_hal_l1_open_logical_address_unavailable_source ( void ) //Here handle = 0 since open failed and close should fail. result = HdmiCecClose( handle ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT); UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); @@ -391,19 +391,19 @@ void test_hdmicec_hal_l1_close_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecClose( handle ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); result = HdmiCecOpen( &handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("open failed"); } result = HdmiCecClose( 0 ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT); result = HdmiCecClose( handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } result = HdmiCecClose( handle ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -487,14 +487,14 @@ void test_hdmicec_hal_l1_getPhysicalAddress_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecGetPhysicalAddress(handle, &physicalAddress); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_GENERAL_ERROR) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_GENERAL_ERROR); result = HdmiCecOpen (&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecGetPhysicalAddress(0, &physicalAddress); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_HANDLE) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_HANDLE); result = HdmiCecGetPhysicalAddress(handle, NULL); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); } @@ -515,7 +515,7 @@ void test_hdmicec_hal_l1_getPhysicalAddress_negative( void ) //Calling API after close, result = HdmiCecGetPhysicalAddress(handle, &physicalAddress); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_GENERAL_ERROR) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_GENERAL_ERROR); UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -606,7 +606,7 @@ void test_hdmicec_hal_l1_addLogicalAddress_sinkDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecAddLogicalAddress( handle, logicalAddress ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); result = HdmiCecOpen (&handle); //if init is failed no need to proceed further @@ -614,22 +614,22 @@ void test_hdmicec_hal_l1_addLogicalAddress_sinkDevice_negative( void ) result = HdmiCecAddLogicalAddress( 0, logicalAddress ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT); result = HdmiCecAddLogicalAddress( handle, -1 ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_ARGUMENT,HDMI_CEC_IO_GENERAL_ERROR) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_ARGUMENT,HDMI_CEC_IO_GENERAL_ERROR); result = HdmiCecAddLogicalAddress( handle, 0x3 ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_ARGUMENT,HDMI_CEC_IO_GENERAL_ERROR) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_ARGUMENT,HDMI_CEC_IO_GENERAL_ERROR); result = HdmiCecAddLogicalAddress( handle, 0xF ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_ARGUMENT,HDMI_CEC_IO_GENERAL_ERROR) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_ARGUMENT,HDMI_CEC_IO_GENERAL_ERROR); result = HdmiCecClose( handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } result = HdmiCecAddLogicalAddress( handle, logicalAddress ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -721,14 +721,14 @@ void test_hdmicec_hal_l1_addLogicalAddress_sourceDevice( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecAddLogicalAddress( handle, logicalAddress ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); result = HdmiCecOpen (&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL(result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecAddLogicalAddress( 0, logicalAddress ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT); result = HdmiCecAddLogicalAddress( handle, -1 ); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } @@ -747,7 +747,7 @@ void test_hdmicec_hal_l1_addLogicalAddress_sourceDevice( void ) if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("Close failed"); } result = HdmiCecAddLogicalAddress( handle, logicalAddress ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); @@ -838,14 +838,14 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sinkDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecRemoveLogicalAddress(handle, logicalAddress ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); result = HdmiCecOpen(&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecRemoveLogicalAddress( 0, logicalAddress ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT); result = HdmiCecRemoveLogicalAddress( handle, 0xF ); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } @@ -857,7 +857,7 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sinkDevice_negative( void ) if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } result = HdmiCecRemoveLogicalAddress( handle, logicalAddress ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_ALREADY_REMOVED,HDMI_CEC_IO_SUCCESS) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_ALREADY_REMOVED,HDMI_CEC_IO_SUCCESS); result = HdmiCecAddLogicalAddress( handle, logicalAddress ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); } @@ -866,13 +866,13 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sinkDevice_negative( void ) if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } result = HdmiCecRemoveLogicalAddress( handle, logicalAddress ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_ALREADY_REMOVED,HDMI_CEC_IO_SUCCESS) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_ALREADY_REMOVED,HDMI_CEC_IO_SUCCESS); result = HdmiCecClose(handle); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } result = HdmiCecRemoveLogicalAddress(handle, logicalAddress ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); @@ -963,7 +963,7 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sourceDevice( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecRemoveLogicalAddress(handle, logicalAddress ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); result = HdmiCecOpen(&handle); //if init is failed no need to proceed further @@ -973,7 +973,7 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sourceDevice( void ) if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); } result = HdmiCecRemoveLogicalAddress( 0, logicalAddress ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT); logicalAddress = 0xF; result = HdmiCecRemoveLogicalAddress( handle, 0xF ); @@ -987,7 +987,7 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sourceDevice( void ) if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); } result = HdmiCecRemoveLogicalAddress(handle, logicalAddress ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); @@ -1033,14 +1033,14 @@ void test_hdmicec_hal_l1_getLogicalAddress_sinkDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecGetLogicalAddress(handle, &logicalAddress); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); result = HdmiCecOpen (&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecGetLogicalAddress(0, &logicalAddress); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT); result = HdmiCecGetLogicalAddress(handle, NULL); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } @@ -1075,7 +1075,7 @@ void test_hdmicec_hal_l1_getLogicalAddress_sinkDevice_negative( void ) //Calling API after close, should give invalid argument result = HdmiCecGetLogicalAddress(handle, &logicalAddress); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1171,14 +1171,14 @@ void test_hdmicec_hal_l1_getLogicalAddress_sourceDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecGetLogicalAddress(handle, &logicalAddress); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); result = HdmiCecOpen (&handle); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecGetLogicalAddress(0, &logicalAddress); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT); result = HdmiCecGetLogicalAddress(handle, NULL); if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); } @@ -1195,7 +1195,7 @@ void test_hdmicec_hal_l1_getLogicalAddress_sourceDevice_negative( void ) //Calling API after close, should give invalid argument result = HdmiCecGetLogicalAddress(handle, &logicalAddress); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1280,7 +1280,7 @@ void test_hdmicec_hal_l1_setRxCallback_negative ( void ) //Calling API before open, should pass result = HdmiCecSetRxCallback(handle, DriverReceiveCallback, (void*)0xDEADBEEF); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); /* Positive result */ result = HdmiCecOpen (&handle); @@ -1288,7 +1288,7 @@ void test_hdmicec_hal_l1_setRxCallback_negative ( void ) UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecSetRxCallback(0, DriverReceiveCallback, (void*)0xDEADBEEF); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT); /*calling hdmicec_close should pass */ result = HdmiCecClose (handle); @@ -1296,7 +1296,7 @@ void test_hdmicec_hal_l1_setRxCallback_negative ( void ) //Calling API after close, should return success result = HdmiCecSetRxCallback(handle, DriverReceiveCallback, 0); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1381,20 +1381,20 @@ void test_hdmicec_hal_l1_setTxCallback_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); result = HdmiCecSetTxCallback( handle, DriverTransmitCallback, (void*)0xDEADBEEF ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); result = HdmiCecOpen ( &handle ); //if init is failed no need to proceed further UT_ASSERT_EQUAL_FATAL( result, HDMI_CEC_IO_SUCCESS ); result = HdmiCecSetTxCallback(0, NULL, (void*)0xDEADBEEF); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT); result = HdmiCecClose( handle ); if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("HdmiCecClose failed"); } result = HdmiCecSetTxCallback( handle, DriverTransmitCallback, (void*)0xDEADBEEF ); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1492,7 +1492,7 @@ void test_hdmicec_hal_l1_hdmiCecTx_sinkDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); //Calling API before open, should give invalid argument result = HdmiCecTx(handle, buf, len, &ret); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); /* Positive result */ result = HdmiCecOpen (&handle); @@ -1525,7 +1525,7 @@ void test_hdmicec_hal_l1_hdmiCecTx_sinkDevice_negative( void ) /* Invalid input */ result = HdmiCecTx(0, buf, len, &ret); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT); /* Invalid input */ result = HdmiCecTx(handle, buf, INT_MIN, &ret); @@ -1537,7 +1537,7 @@ void test_hdmicec_hal_l1_hdmiCecTx_sinkDevice_negative( void ) //Calling API after close, should give invalid argument result = HdmiCecTx(handle, buf, len, &ret); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1663,7 +1663,7 @@ void test_hdmicec_hal_l1_hdmiCecTx_sourceDevice_negative( void ) //Calling API before open, should give not open error result = HdmiCecTx(handle, buf, len, &ret); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); /* Positive result */ result = HdmiCecOpen (&handle); @@ -1686,7 +1686,7 @@ void test_hdmicec_hal_l1_hdmiCecTx_sourceDevice_negative( void ) /* Invalid input */ result = HdmiCecTx(0, buf, len, &ret); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT); /* Invalid input */ result = HdmiCecTx(handle, buf, INT_MIN, &ret); @@ -1698,7 +1698,7 @@ void test_hdmicec_hal_l1_hdmiCecTx_sourceDevice_negative( void ) //Calling API after close, should give invalid argument result = HdmiCecTx(handle, buf, len, &ret); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1809,7 +1809,7 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sinkDevice_negative( void ) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); //Calling API before open, should give invalid argument result = HdmiCecTxAsync(handle, buf, len); //Code crash here - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); /* Positive result */ result = HdmiCecOpen (&handle); @@ -1842,7 +1842,7 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sinkDevice_negative( void ) if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } result = HdmiCecTxAsync(0, buf, len); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT); /* Invalid input */ result = HdmiCecTxAsync(handle, buf, INT_MIN); @@ -1857,7 +1857,7 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sinkDevice_negative( void ) //Calling API after close, should give invalid argument result = HdmiCecTxAsync(handle, buf, len); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } @@ -1979,7 +1979,7 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sourceDevice_negative( void ) //Calling API before open, should give invalid argument result = HdmiCecTxAsync(handle, buf, len); //Code crash here - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); /* Positive result */ result = HdmiCecOpen (&handle); @@ -2001,7 +2001,7 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sourceDevice_negative( void ) if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecTxAsync failed"); } result = HdmiCecTxAsync(0, buf, len); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT); /* Invalid input */ result = HdmiCecTxAsync(handle, buf, INT_MIN); @@ -2015,7 +2015,7 @@ void test_hdmicec_hal_l1_hdmiCecTxAsync_sourceDevice_negative( void ) //Calling API after close, should give invalid argument result = HdmiCecTxAsync(handle, buf, len); - CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT) + CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT); UT_LOG("\n Exit %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); } From b95ad35a6a62cdbf69ef0df4832d2032041c7e09 Mon Sep 17 00:00:00 2001 From: hari22yuva <56021398+hari22yuva@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:44:43 +0100 Subject: [PATCH 14/15] Updated README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f2d5af0..f1177d1 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,5 @@ This repository contains the Unit Test Suites (L1) for HDMI CEC `HAL`. - All APIs need to be implemented in this current version. If any API is not supported, please add stub implementation with return type HDMI_CEC_IO_OPERATION_NOT_SUPPORTED for the same. - Building against the actual library may introduce SOC dependencies. Hence, a template SKELETON library is created without SOC dependencies. On the real platform (target), it can be mounted, copied and bound with the actual library. +- When running the binary, remember to include a profile file as an argument for designated test cases. The following example illustrates this: `./hal_test -p hdmiCECExtendedEnumsNotSupported.yaml` +- Profiles file available in [profile yaml file](./profiles/hdmiCECExtendedEnumsNotSupported.yaml) \ No newline at end of file From 6763f8fd774eb007fa9cfa36db20caf1f0b53c75 Mon Sep 17 00:00:00 2001 From: hari22yuva <56021398+hari22yuva@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:45:27 +0100 Subject: [PATCH 15/15] Bumped CHANGELOG.md - 1.1.0 --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28ed3f5..019d4ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,18 @@ 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.1.0](https://github.com/rdkcentral/rdk-halif-test-hdmi_cec/compare/1.0.4...1.1.0) + +- gh #11 hdmi_cec: Test Profile: Adding MACRO ENABLE_ENHANCED_ERROR_CODE to enalbe/disable the enhanced error code tests [`#12`](https://github.com/rdkcentral/rdk-halif-test-hdmi_cec/pull/12) +- Capture the YAML Template and design for CEC Emulator [`#8`](https://github.com/rdkcentral/rdk-halif-test-hdmi_cec/pull/8) +- Create hdmi_cec_emulator_design.md [`84741c3`](https://github.com/rdkcentral/rdk-halif-test-hdmi_cec/commit/84741c312dfc3b9ff96ec79ad1a93e2fd1e2565a) +- Handling Enhanced error code with kvp profile [`117c8d4`](https://github.com/rdkcentral/rdk-halif-test-hdmi_cec/commit/117c8d40d14b9a63f188cc894e2f192e40253ed6) +- Adding MACRO ENABLE_ENHANCED_ERROR_CODE [`a77ad32`](https://github.com/rdkcentral/rdk-halif-test-hdmi_cec/commit/a77ad32447a7dbc07cfcd8e8b5b1be9906afcf42) + #### [1.0.4](https://github.com/rdkcentral/rdk-halif-test-hdmi_cec/compare/1.0.3...1.0.4) +> 11 May 2024 + - fixing the usage of UT core functions [`#10`](https://github.com/rdkcentral/rdk-halif-test-hdmi_cec/pull/10) - gh #1 Updated UT version2 and removed unnecessary clean up [`284ac93`](https://github.com/rdkcentral/rdk-halif-test-hdmi_cec/commit/284ac9356a676fbd78e9e2702530830e06f4dca4) - gh #1 replace UT fatal to non fatal & updated the test suite [`bb6bc68`](https://github.com/rdkcentral/rdk-halif-test-hdmi_cec/commit/bb6bc687212201d78ae17f1322f211eaef64143b)