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)
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
diff --git a/docs/pages/hdmi_cec_emulator_design.md b/docs/pages/hdmi_cec_emulator_design.md
new file mode 100644
index 0000000..2d72efd
--- /dev/null
+++ b/docs/pages/hdmi_cec_emulator_design.md
@@ -0,0 +1,451 @@
+# 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`
+```
+
+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
+ - 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
+ - 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]
+ - [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]
+
+ #HDMI CEC Version supported by device
+ 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 of the device
+ power_status: &power_status
+ - on
+ - off
+ - standby
+
+ #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: #Variable sized array of Ports belonging to Emulated device
+ - id: *port_id
+ #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
+ type: *port_type
+ cec_supported: !!bool
+ arc_supported: !!bool
+ number_devices: !!int
+ 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
+ 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
+
+ # Variable sized array of links between end points
+ # This represents the network of devices
+ links:
+ - *link
+ - *link
+ - *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 port_info {
+ uint8_t id;
+ uint16_t physical_address;
+ port_type_t type;
+ bool cec_supported;
+ bool arc_supported;
+} port_info_t;
+
+typedef struct device {
+ 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];
+}
+
+
+
+---
+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
+```
+
+
+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
+```
+
diff --git a/profiles/hdmiCECExtendedEnumsNotSupported.yaml b/profiles/hdmiCECExtendedEnumsNotSupported.yaml
new file mode 100644
index 0000000..8d85638
--- /dev/null
+++ b/profiles/hdmiCECExtendedEnumsNotSupported.yaml
@@ -0,0 +1,4 @@
+---
+hdmicec:
+ features:
+ extendedEnumsSupported: false
\ No newline at end of file
diff --git a/src/test_l1_hdmi_cec_driver.c b/src/test_l1_hdmi_cec_driver.c
index 1afb6e3..c6f5538 100644
--- a/src/test_l1_hdmi_cec_driver.c
+++ b/src/test_l1_hdmi_cec_driver.c
@@ -67,7 +67,8 @@
#include
#include
-#include "ut_log.h"
+#include
+#include
#include "hdmi_cec_driver.h"
/**
@@ -85,6 +86,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 +108,17 @@ static int gTestID = 1;
HdmiCecClose( handle );\
}
+#define CHECK_FOR_EXTENDED_ERROR_CODE( result, enhanced, old )\
+{\
+ if ( extendedEnumsSupported == true )\
+ {\
+ UT_ASSERT_EQUAL( enhanced, result );\
+ }\
+ else\
+ {\
+ UT_ASSERT_EQUAL( old, result );\
+ }\
+}
/**
@@ -246,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 );
- if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("open failed"); }
+ 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 );
- if (HDMI_CEC_IO_ALREADY_OPEN != result) { UT_FAIL("open failed"); }
+ 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"); }
@@ -341,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 );
- if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL_FATAL("close failed"); }
+ 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);
@@ -378,20 +391,19 @@ void test_hdmicec_hal_l1_close_negative( void )
UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID);
result = HdmiCecClose( handle );
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("close failed"); }
-
+ 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 );
- if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("close failed"); }
+ 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 );
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("close failed"); }
-
+ 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);
}
@@ -475,15 +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);
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); }
-
+ 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);
- if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); }
+ 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"); }
@@ -504,8 +515,7 @@ void test_hdmicec_hal_l1_getPhysicalAddress_negative( void )
//Calling API after close,
result = HdmiCecGetPhysicalAddress(handle, &physicalAddress);
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetPhysicalAddress failed"); }
-
+ 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);
}
@@ -596,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 );
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); }
+ 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
@@ -604,23 +614,22 @@ void test_hdmicec_hal_l1_addLogicalAddress_sinkDevice_negative( void )
result = HdmiCecAddLogicalAddress( 0, logicalAddress );
- if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); }
+ 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"); }
+ CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_ARGUMENT,HDMI_CEC_IO_GENERAL_ERROR);
result = HdmiCecAddLogicalAddress( handle, 0x3 );
- if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); }
+ CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_ARGUMENT,HDMI_CEC_IO_GENERAL_ERROR);
result = HdmiCecAddLogicalAddress( handle, 0xF );
- if (HDMI_CEC_IO_INVALID_ARGUMENT != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); }
+ 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 );
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); }
-
+ 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);
}
@@ -712,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 );
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); }
-
+ 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 );
- if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); }
+ 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"); }
@@ -738,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 );
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecAddLogicalAddress failed"); }
+ 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);
@@ -829,15 +838,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 );
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); }
-
+ 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 );
- if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); }
-
+ 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"); }
@@ -848,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 );
- if (HDMI_CEC_IO_ALREADY_REMOVED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); }
+ 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"); }
@@ -857,14 +866,14 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sinkDevice_negative( void )
if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); }
result = HdmiCecRemoveLogicalAddress( handle, logicalAddress );
- if (HDMI_CEC_IO_ALREADY_REMOVED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); }
+ 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 );
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); }
-
+ 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);
}
@@ -954,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 );
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); }
+ 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
@@ -964,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 );
- if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); }
+ CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT);
logicalAddress = 0xF;
result = HdmiCecRemoveLogicalAddress( handle, 0xF );
@@ -978,8 +987,8 @@ void test_hdmicec_hal_l1_removeLogicalAddress_sourceDevice( void )
if (HDMI_CEC_IO_SUCCESS != result) { UT_FAIL_FATAL("close failed"); }
result = HdmiCecRemoveLogicalAddress(handle, logicalAddress );
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecRemoveLogicalAddress failed"); }
-
+ 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);
}
@@ -1024,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);
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); }
+ 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);
- if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); }
+ 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"); }
@@ -1066,7 +1075,7 @@ void test_hdmicec_hal_l1_getLogicalAddress_sinkDevice_negative( void )
//Calling API after close, should give invalid argument
result = HdmiCecGetLogicalAddress(handle, &logicalAddress);
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); }
+ 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);
}
@@ -1162,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);
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); }
+ 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);
- if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); }
+ 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"); }
@@ -1186,7 +1195,7 @@ void test_hdmicec_hal_l1_getLogicalAddress_sourceDevice_negative( void )
//Calling API after close, should give invalid argument
result = HdmiCecGetLogicalAddress(handle, &logicalAddress);
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecGetLogicalAddress failed"); }
+ 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);
}
@@ -1271,7 +1280,7 @@ void test_hdmicec_hal_l1_setRxCallback_negative ( void )
//Calling API before open, should pass
result = HdmiCecSetRxCallback(handle, DriverReceiveCallback, (void*)0xDEADBEEF);
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecSetRxCallback failed"); }
+ CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT);
/* Positive result */
result = HdmiCecOpen (&handle);
@@ -1279,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);
- if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecSetRxCallback failed"); }
+ CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT);
/*calling hdmicec_close should pass */
result = HdmiCecClose (handle);
@@ -1287,7 +1296,7 @@ void test_hdmicec_hal_l1_setRxCallback_negative ( void )
//Calling API after close, should return success
result = HdmiCecSetRxCallback(handle, DriverReceiveCallback, 0);
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecSetRxCallback failed"); }
+ 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);
}
@@ -1372,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 );
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecSetTxCallback failed"); }
+ 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);
- if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecSetTxCallback failed"); }
-
+ 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 );
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecSetTxCallback failed"); }
+ 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);
}
@@ -1483,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);
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTx failed"); }
+ CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT);
/* Positive result */
result = HdmiCecOpen (&handle);
@@ -1516,7 +1525,7 @@ void test_hdmicec_hal_l1_hdmiCecTx_sinkDevice_negative( void )
/* Invalid input */
result = HdmiCecTx(0, buf, len, &ret);
- if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecTx failed"); }
+ 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);
@@ -1528,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);
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTx failed"); }
+ 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);
}
@@ -1654,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);
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTx failed"); }
+ CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT);
/* Positive result */
result = HdmiCecOpen (&handle);
@@ -1677,7 +1686,7 @@ void test_hdmicec_hal_l1_hdmiCecTx_sourceDevice_negative( void )
/* Invalid input */
result = HdmiCecTx(0, buf, len, &ret);
- if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecTx failed"); }
+ 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);
@@ -1689,8 +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);
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTx failed"); }
-
+ 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);
}
@@ -1801,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
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTxAsync failed"); }
+ CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT);
/* Positive result */
result = HdmiCecOpen (&handle);
@@ -1834,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);
- if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecTxAsync failed"); }
+ CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT);
/* Invalid input */
result = HdmiCecTxAsync(handle, buf, INT_MIN);
@@ -1849,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);
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTxAsync failed"); }
+ 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);
}
@@ -1971,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
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTxAsync failed"); }
+ CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_NOT_OPENED,HDMI_CEC_IO_INVALID_ARGUMENT);
/* Positive result */
result = HdmiCecOpen (&handle);
@@ -1993,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);
- if (HDMI_CEC_IO_INVALID_HANDLE != result) { UT_FAIL("HdmiCecTxAsync failed"); }
+ CHECK_FOR_EXTENDED_ERROR_CODE(result,HDMI_CEC_IO_INVALID_HANDLE,HDMI_CEC_IO_INVALID_ARGUMENT);
/* Invalid input */
result = HdmiCecTxAsync(handle, buf, INT_MIN);
@@ -2007,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);
- if (HDMI_CEC_IO_NOT_OPENED != result) { UT_FAIL("HdmiCecTxAsync failed"); }
+ 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);
}
@@ -2265,7 +2273,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;
}