From 0b06defd89b87f6ddba2efd78f38334b4014bcb2 Mon Sep 17 00:00:00 2001 From: anbukannadhasan <154507930+Anbukannadhasan@users.noreply.github.com> Date: Thu, 29 Feb 2024 09:25:11 +0000 Subject: [PATCH 01/38] Adding testing scope changes for composite test spec --- docs/pages/dsComposite_test_spec.md | 185 ++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 docs/pages/dsComposite_test_spec.md diff --git a/docs/pages/dsComposite_test_spec.md b/docs/pages/dsComposite_test_spec.md new file mode 100644 index 00000000..37488e1b --- /dev/null +++ b/docs/pages/dsComposite_test_spec.md @@ -0,0 +1,185 @@ +# CompositeIn Test Document + +## Version History + +| Date(DD/MM/YY) | Comment | Version | +| -------------- | ------------- | ------- | +| 18/03/2024 | First Release | 1.0.0 | + +## Table of Contents + +- [Acronyms, Terms and Abbreviations](#acronyms-terms-and-abbreviations) +- [Introduction](#introduction) +- [Module Description](#module-description) +- [Testing Scope](#testing-scope) + +## Acronyms, Terms and Abbreviations + +- `HAL` - Hardware Abstraction layer +- `SOC` - System On a Chip +- `EDID` - Extended Display Identification +- `API` - Application programming interface +- `CPU` - Central processing unit +- `RDK` - Reference Design Kit +- `dsComposite` - Device Settings Composite + +## Introduction + +This document provides an overview of the testing requirements for the `dsComposite` module. It outlines the scope of testing, objectives, testing levels and approaches, specific test requirements, emulator requirements, control plane requirements and expected deliverables. + +Interface of the test is available in this link - [https://github.com/rdkcentral/rdk-halif-device_settings/blob/main/include/dsCompositeIn.h](https://github.com/rdkcentral/rdk-halif-device_settings/blob/main/include/dsCompositeIn.h) + +## Module Description + +High level overview: + +- `dsComposite` provides a variety of APIs for accessing information regarding the Composite Inputs on sink devices. +- It facilitates interaction with Composite Input ports, aiding in their configuration and utilization within the system. This information is then passed to the caller. +- For the sink devices, to retrieve the available Composite Input information, an external device must be connected. + +## Testing Scope + +|#|Test Functionality|Test Description| +|-|------------------|----------------| +|1|[Get Number of Inputs](#get_number_of_inputs)|The test aims to verify the availability of Composite Input ports by confirming the number present.| +|2|[Get the Input Status](#get_the_input_status)|The test is to verify the status of all Composite Input Status| +|3|[Set the Composite port](#set_the_composite_port)|The test is to set the Composite Input port for Presentation| +|4|[Scale the Composite Input Video](#scale_the_composite_input_video)|The test scales the COMPOSITE input video, ensuring that the width and height, determined by the x and y coordinates respectively, do not surpass the current resolution limits of the device.| +|5|[Callback for connection Status](#callback_for_connection_status)|The test aims to verify the Callback function used for notifying applications of the COMPOSITE In hot plug status.| +|6|[Callback for Signal Change](#callback_for_signal_change)|The test aims to verify the callback function used to inform applications about changes in the signal status of the Composite In.(NoSignal/UnstableSignal/NotSupportedSignal/StableSignal)| +|7|[Callback for Status Change](#callback_for_status_change)|The test validates the functionality of the callback function designed to notify applications of Composite Input status change events.(Port,IsPresented flag status)| +----------- + +## Get Number of Inputs + +|Description|L2|L3| +|-----------|--|--| +|Verify that the function returns the expected COMPOSITE Input ports.|Y|N| + +### Test Startup Requirement - Get Number of Inputs + +The test begins with the configured composite input port details. + +### Emulator Requirement - Get Number of Inputs + +Emulator will boot with the port informations coming from the configuration file. + +### Control Plane Requirement - Get Number of Inputs + +None + +## Get the Input Status + +|Description|L2|L3| +|-----------|--|--| +|Verify the status of the Composite Input by ensuring it is in disable status.|Y|N| +|Verify the status of the Composite Input by ensuring it is enabled, connected to the source, and that the composite input port is active.|N|Y| + +### Test Startup Requirement - Get the Input Status + +Connection of the source device with the CompositeIn. + +### Emulator Requirement - Get the Input Status + +Emulator will boot with the port informations coming from the configuration file. + +### Control Plane Requirement - Get the Input Status + +The handling of connecting and disconnecting source devices in the CompositeIn will be managed by the Control Plane. + +## Set the Composite port + +|Description|L2|L3| +|-----------|--|--| +|verify that the function successfully sets the specified COMPOSITE Input port as active for presentation and check the port information using "Get status".|Y|Y| +|Evaluate the function's response when called with a port ID that is already selected as active, ensuring it does not introduce any unintended changes.|N|Y| + +### Test Startup Requirement - Set the Composite port + +The test begins with the configured composite input port numbers. + +### Emulator Requirement - Set the Composite port + +Emulator will boot with the port informations coming from the configuration file. + +### Control Plane Requirement - Set the Composite port + +The Control Plane must monitor the external device (Video analyzer) to detect any video glitches. + +## Scale the Composite Input Video + +|Description|L2|L3| +|-----------|--|--| +|Verify that the function successfully scales the COMPOSITE input video when valid coordinates and dimensions are provided within the current resolution limits. Based on video resolution need to check whether the coordinates are in range|N|Y| + +### Test Startup Requirement - Scale the Composite Input Video + +The test begins by setting up the video analyzer, and the video should be played. + +### Emulator Requirement - Scale the Composite Input Video + +Emulator will boot with the port informations coming from the configuration file. + +### Control Plane Requirement - Scale the Composite Input Video + +The handling of connecting and disconnecting source devices in the CompositeIn will be managed by the Control Plane. + +## Callback for connection Status + +|Description|L2|L3| +|-----------|--|--| +|Verify that the callback function properly notifies the application when a COMPOSITE Input port is connected or disconnected.|N|Y| +|Validate that the callback function updates the isPortConnected status correctly based on the connection state provided.|N|Y| +|Verify that the callback function properly updates the isPresented status in ::dsCompositeInStatus_t if the connected port is active and presents video after being connected.|N|Y| + +### Test Startup Requirement - Callback for connection Status + +Connection of the source device with the CompositeIn. + +### Emulator Requirement - Callback for connection Status + +Emulator will boot with the port information coming from the configuration file. + +### Control Plane Requirement - Callback for connection Status + +The handling of connecting and disconnecting source devices in the CompositeIn will be managed by the Control Plane. + +## Callback for Signal Change + +|Description|L2|L3| +|-----------|--|--| +|Verify that the callback function properly handles different signal statuses (e.g., NoSignal, UnstableSignal, NotSupportedSignal, StableSignal) and updates the application accordingly.|N|Y| +|Validate that the callback function updates the sigStatus parameter correctly based on the signal status provided.|N|Y| + +### Test Startup Requirement - Callback for Signal Change + +Connection of the source device with the CompositeIn. + +### Emulator Requirement - Callback for Signal Change + +Emulator will boot with the port informations coming from the configuration file. + +### Control Plane Requirement - Callback for Signal Change + +The handling of connecting and disconnecting source devices in the CompositeIn will be managed by the Control Plane. +Provide resolution changes or configurations changes on the connected device that affects the output signal. + +## Callback for Status Change + +|Description|L2|L3| +|-----------|--|--| +|Verify that the callback function properly notifies the application of the Composite Input status change event.|N|Y| +|Validate that the callback function updates the inputStatus parameter correctly based on the status change provided.|N|Y| +|Verify that the callback function properly triggers whenever the dsCompositeInStatus_t is updated|N|Y| + +### Test Startup Requirement - Callback for Status Change + +Connection of the source device with the CompositeIn. + +### Emulator Requirement - Callback for Status Change + +Emulator will boot with the port informations coming from the configuration file. + +### Control Plane Requirement - Callback for Status Change + +The handling of connecting and disconnecting source devices in the CompositeIn will be managed by the Control Plane. From bf572ba59c43ce2cb392c840a7b33aa610f4aaac Mon Sep 17 00:00:00 2001 From: anbukannadhasan <154507930+Anbukannadhasan@users.noreply.github.com> Date: Thu, 29 Feb 2024 09:42:29 +0000 Subject: [PATCH 02/38] Adding test scenario details for display test spec --- docs/pages/dsDisplay_TestSpecificaion.md | 121 +++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 docs/pages/dsDisplay_TestSpecificaion.md diff --git a/docs/pages/dsDisplay_TestSpecificaion.md b/docs/pages/dsDisplay_TestSpecificaion.md new file mode 100644 index 00000000..ebe60aee --- /dev/null +++ b/docs/pages/dsDisplay_TestSpecificaion.md @@ -0,0 +1,121 @@ +# Display Test Document + +## Version History + +| Date(DD/MM/YY) | Comment | Version | +| -------------- | ------------- | ------- | +| 05/03/2024 | First Release | 1.0.0 | + +## Table of Contents + +- [Acronyms, Terms and Abbreviations](#acronyms-terms-and-abbreviations) +- [References](#references) +- [Introduction](#introduction) +- [Module Description](#module-description) +- [Testing Scope](#test-scope) + +## Acronyms, Terms and Abbreviations + +- `HAL` - Hardware Abstraction layer +- `SOC` - System On a Chip +- `EDID` - Extended Display Identification +- `API` - Application programming interface +- `CPU` - Central processing unit +- `RDK` - Reference Design Kit +- `dsDisplay` - Device Settings Display + +## References + +- `EDID` Specifications [https://en.wikipedia.org/wiki/Extended_Display_Identification_Data](https://en.wikipedia.org/wiki/Extended_Display_Identification_Data) +- Python `EDID` decoder library is available here - [https://pypi.org/project/pyedid/](https://en.wikipedia.org/wiki/Extended_Display_Identification_Data) + +## Introduction + +This document provides an overview of the testing requirements for the dsDisplay module. It outlines the scope of testing, objectives, testing levels and approaches, specific test requirements, emulator requirements, control plane requirements and expected deliverables. + +Interface of the test is available in this link - [https://github.com/rdkcentral/rdk-halif-device_settings/blob/main/include/dsDisplay.h](https://github.com/rdkcentral/rdk-halif-device_settings/blob/main/include/dsDisplay.h) + +## Module Description + +High level overview: + +- `dsDisplay` offers a range of APIs for retrieving information about the Display Device. +- Data is retrieved from the Display Device and HDMI. This data is passed to the caller. +- In order to retrieve HDMI information, an external device must be connected. + +## Testing Scope + +|#|Test Functionality|Test Description| +|-|------------------|----------------| +|1|[Get EDID Information](#get-edid-information)|Test validates the accuracy and functionality of the display device module's functions (dsGetEDID and dsGetEDIDBytes) in retrieving the Extended Display Identification Data (EDID) from connected display devices| +|2|[Get Aspect Ratio](#get-aspect-ratio)| Test provides the aspect ratio of the display device| +|3|[Callback Registration for Display Related Events](#callback-registration-for-display-related-events)|To verify the callback registration for display related events. The display events are Dislay connected event, Display disconnected event, Rx Sense ON event, Rx Sense OFF event, HDCP protocol version change event| +----------- + +## Get EDID Information + +|Description|L2|L3|Source|Sink| +|-----------|--|--|------|----| +|The Get EDID Information test aims to verify the functionality of the display device module's dsGetEDID and dsGetEDIDBytes functions, which are responsible for retrieving the Extended Display Identification Data (EDID) from connected display devices. This test ensures that the module can accurately retrieve and interpret EDID information, providing essential data about the display's capabilities and characteristics.|N|Y|Y|Y| +|For sink devices, validate the predefined the EDID value coming from the TV HDMI port1 EDID |Y|Y|Y|Y| + +### Test Startup Requirement - Get EDID Information + +Launch the test with the predefined configuration set of results. + +### Emulator Requirement - Get EDID Information + +Emulator will boot with the EDID coming from the configuration file. + +|#|Description| +|-|-----------| +|1|EDID for a panel TV| + +TODO: Generate a list of sample list for 5 to 6 different TV's. +Generate a list of TV's from the office for the different EDIDs and store the binaries of the test. It can use it as samples. + +### Control Plane Requirement - Get EDID Information + +None + +## Get Aspect Ratio + +|Description|L2|L3|Source|Sink| +|-----------|--|--|------|----| +|Test the aspect ratio returned by the dsGetDisplayAspectRatio() function for the specified display device handle.|N|Y|Y|N +|Adjust and test the aspect ratio to ensure it is providing the expected aspect ratio.|N|Y|Y|N| + +### Test Startup Requirement - Get Aspect Ratio + +Launch the test with the predefined configuration set of results. + +### Emulator Requirement - Get Aspect Ratio + +Emulator will boot with the Aspect ratio coming from the configuration file. + +### Control Plane Requirement - Get Aspect Ratio + +Maintains the configuration of various aspect ratios and provides them whenever a user is supposed to make a change. + +## Callback Registration for Display Related Events + +|Description|L2|L3|Source|Sink| +|-----------|--|--|------|----| +|Test the 'Display connected' event. Upon connecting the display device, the callback should trigger the event|N|Y|Y|Y| +|Test the 'Display disconnected' event. Upon disconnecting the display device, the callback should trigger the event|N|Y|Y|Y| +|Test the 'Rx Sense ON' event by verifying the presence of a signal from the receiving device; the callback should be triggered when the signal is detected|N|Y|N|Y| +|Test the 'Rx Sense OFF' event by verifying the absense of a signal from the receiving device; the callback should be triggered when the signal is detected|N|Y|N|Y| +|Test the 'HDCP protocol version change' event by verifying if there is a change in the HDCP protocol version used for content protection; the callback should be triggered upon detection of the protocol change.|N|Y|N|Y| + + +### Test Startup Requirement -Callback Registration for Display Related Events + +Launch the test with the predefined set of configured HDCP 1.x and HDCP 2.x keys. + +### Emulator Requirement - Callback Registration for Display Related Events + +Emulator will boot with the HDCP keys coming from the configuration file. + +### Control Plane Requirement - Callback Registration for Display Related Events + +The control plane will generate events for HDMI connection and disconnection. It also supplies signals to the receiving devices to initiate the Rx Sense ON/Rx Sense OFF events. \ No newline at end of file From 09910beced34ce8db90639c7853dd6cc3060a930 Mon Sep 17 00:00:00 2001 From: drissya-k <167057835+drissya-k@users.noreply.github.com> Date: Thu, 9 May 2024 16:47:58 +0530 Subject: [PATCH 03/38] Adding Enhanced Error Code Flag Support --- src/test_l1_dsHdmiIn.c | 150 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 146 insertions(+), 4 deletions(-) diff --git a/src/test_l1_dsHdmiIn.c b/src/test_l1_dsHdmiIn.c index 4332bb8b..7bd5fae6 100644 --- a/src/test_l1_dsHdmiIn.c +++ b/src/test_l1_dsHdmiIn.c @@ -155,7 +155,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInInit(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Call dsHdmiInInit() again without terminating the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInInit(), dsERR_ALREADY_INITIALIZED); + #endif // Step 3: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -223,7 +225,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInTerm(void) { gTestID = 4; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInTerm() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -232,7 +236,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInTerm(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 4: Call dsHdmiInTerm() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -306,19 +312,25 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetNumberOfInputs(void) { uint8_t numInputs; // Step 1: Call dsHdmiInGetNumberOfInputs() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInGetNumberOfInputs(&numInputs), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsHdmiInGetNumberOfInputs() with NULL as the parameter + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetNumberOfInputs(NULL), dsERR_INVALID_PARAM); + #endif // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInGetNumberOfInputs() after termination of the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInGetNumberOfInputs(&numInputs), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -400,19 +412,25 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetStatus(void) { dsHdmiInStatus_t status; // Step 1: Call dsHdmiInGetStatus() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInGetStatus(&status), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsHdmiInGetStatus() with NULL as the parameter + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetStatus(NULL), dsERR_INVALID_PARAM); + #endif // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInGetStatus() after terminating the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInGetStatus(&status), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -483,8 +501,10 @@ void test_l1_dsHdmiIn_negative_dsHdmiInSelectPort(void) { gTestID = 10; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInSelectPort() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false), dsERR_NOT_INITIALIZED); - + #endif + // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -498,7 +518,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInSelectPort(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 6: Call dsHdmiInSelectPort() after terminating the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -574,7 +596,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInScaleVideo(void) { gTestID = 12; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInScaleVideo() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInScaleVideo(0, 0, 800, 600), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -604,7 +628,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInScaleVideo(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 11: dsHdmiInScaleVideo() after terminating the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInScaleVideo(0, 0, 800, 600), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -633,10 +659,12 @@ void test_l1_dsHdmiIn_positive_dsHdmiInSelectZoomMode(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Loop through all dsVideoZoom_t values and call dsHdmiInSelectZoomMode() + #ifdef ENABLE_ENHANCED_ERROR_CODE for (int i = dsVIDEO_ZOOM_NONE; i < dsVIDEO_ZOOM_MAX; i++) { dsVideoZoom_t zoomMode = i; DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInSelectZoomMode(zoomMode), dsERR_NONE); } + #endif // Step 3: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -669,19 +697,25 @@ void test_l1_dsHdmiIn_negative_dsHdmiInSelectZoomMode(void) { gTestID = 14; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInSelectZoomMode() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_NONE), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsHdmiInSelectZoomMode() with invalid value (dsVIDEO_ZOOM_MAX) + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_MAX), dsERR_INVALID_PARAM); + #endif // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInSelectZoomMode() without terminating the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_NONE), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -763,19 +797,25 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetCurrentVideoMode(void) { UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInGetCurrentVideoMode() without initializing the HDMI input sub-system dsVideoPortResolution_t resolution; + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInGetCurrentVideoMode(&resolution), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: dsHdmiInGetCurrentVideoMode() with NULL `resolution` pointer + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetCurrentVideoMode(NULL), dsERR_INVALID_PARAM); - + #endif + // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInGetCurrentVideoMode() after terminating the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInGetCurrentVideoMode(&resolution), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -841,7 +881,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterConnectCB(void) { gTestID = 18; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInRegisterConnectCB() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterConnectCB(mockConnectCallback), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -853,7 +895,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterConnectCB(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInRegisterConnectCB() after termination the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterConnectCB(mockConnectCallback), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -919,7 +963,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterSignalChangeCB(void) { gTestID = 20; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInRegisterSignalChangeCB() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterSignalChangeCB(mockSignalCallback), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -931,7 +977,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterSignalChangeCB(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInRegisterSignalChangeCB() after terminating the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterSignalChangeCB(mockSignalCallback), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -997,7 +1045,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterStatusChangeCB(void) { gTestID = 22; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInRegisterStatusChangeCB() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterStatusChangeCB(mockStatusChangeCallback), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -1009,7 +1059,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterStatusChangeCB(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInRegisterStatusChangeCB() after terminating the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterStatusChangeCB(mockStatusChangeCallback), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1075,7 +1127,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterVideoModeUpdateCB(void) { gTestID = 24; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInRegisterVideoModeUpdateCB() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterVideoModeUpdateCB(mockVideoModeUpdateCallback), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -1087,8 +1141,10 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterVideoModeUpdateCB(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInRegisterVideoModeUpdateCB() after terminating the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterVideoModeUpdateCB(mockVideoModeUpdateCallback), dsERR_NOT_INITIALIZED); - + #endif + UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1154,7 +1210,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAllmChangeCB(void) { gTestID = 26; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInRegisterAllmChangeCB() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterAllmChangeCB(mockALLMChangeCallback), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -1166,7 +1224,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAllmChangeCB(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInRegisterAllmChangeCB() after terminating the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterAllmChangeCB(mockALLMChangeCallback), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1231,7 +1291,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAVLatencyChangeCB(void) { gTestID = 28; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInRegisterAVLatencyChangeCB() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterAVLatencyChangeCB(mockLatencyChangeCallback), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -1243,7 +1305,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAVLatencyChangeCB(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInRegisterAVLatencyChangeCB() after terminating the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterAVLatencyChangeCB(mockLatencyChangeCallback), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1310,7 +1374,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAviContentTypeChangeCB(void) { gTestID = 30; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInRegisterAviContentTypeChangeCB() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterAviContentTypeChangeCB(mockAviContentCallback), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -1322,7 +1388,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAviContentTypeChangeCB(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInRegisterAviContentTypeChangeCB() after terminating the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterAviContentTypeChangeCB(mockAviContentCallback), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1403,7 +1471,9 @@ void test_l1_dsHdmiIn_negative_dsIsHdmiARCPort(void) { gTestID = 32; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsIsHdmiARCPort() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, NULL), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -1411,16 +1481,22 @@ void test_l1_dsHdmiIn_negative_dsIsHdmiARCPort(void) { bool isArcPort; // Step 3: Call dsIsHdmiARCPort() with invalid value (dsHDMI_IN_PORT_MAX) + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_MAX, &isArcPort), dsERR_INVALID_PARAM); + #endif // Step 4: Call dsIsHdmiARCPort() with invalid value (dsHDMI_IN_PORT_0) and NULL pointer + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); + #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 6: Call dsIsHdmiARCPort() after terminating the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, &isArcPort), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1521,25 +1597,35 @@ void test_l1_dsHdmiIn_negative_dsGetEDIDBytesInfo(void) { int edidSize; // Step 1: Call dsGetEDIDBytesInfo() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, &edidSize), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsGetEDIDBytesInfo() with invalid value (dsHDMI_IN_PORT_MAX) + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_MAX, edidBytes, &edidSize), dsERR_INVALID_PARAM); + #endif // Step 4: Call dsGetEDIDBytesInfo() with invalid value (NULL pointer) + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, NULL, &edidSize), dsERR_INVALID_PARAM); + #endif // Step 5: Call dsGetEDIDBytesInfo() with invalid value (NULL pointer) + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, NULL), dsERR_INVALID_PARAM); + #endif // Step 6: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 7: Call dsGetEDIDBytesInfo() after terminating the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, &edidSize), dsERR_NOT_INITIALIZED); + #endif free(edidBytes); @@ -1633,22 +1719,30 @@ void test_l1_dsHdmiIn_negative_dsGetHDMISPDInfo(void) { unsigned char* spdInfo1 = (unsigned char*) malloc(sizeof(struct dsSpd_infoframe_st)); // Step 1: Call dsGetHDMISPDInfo() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, spdInfo1), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsGetHDMISPDInfo() with invalid values (dsHDMI_IN_PORT_MAX) + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_MAX, spdInfo1), dsERR_INVALID_PARAM); + #endif // Step 4: Call dsGetHDMISPDInfo() with invalid values (NULL pointer) + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); + #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 6: Call dsGetHDMISPDInfo() after terminating the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, spdInfo1), dsERR_NOT_INITIALIZED); + #endif free(spdInfo1); @@ -1725,22 +1819,30 @@ void test_l1_dsHdmiIn_negative_dsSetEdidVersion(void) { gTestID = 38; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsSetEdidVersion() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_14), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsSetEdidVersion() with invalid inputs (dsHDMI_IN_PORT_MAX) + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdidVersion(dsHDMI_IN_PORT_MAX, HDMI_EDID_VER_14), dsERR_INVALID_PARAM); + #endif // Step 4: Call dsSetEdidVersion() with invalid inputs (HDMI_EDID_VER_MAX) + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_MAX), dsERR_INVALID_PARAM); + #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 6: Call dsSetEdidVersion() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_14), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1812,22 +1914,30 @@ void test_l1_dsHdmiIn_negative_dsGetEdidVersion(void) { UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsGetEdidVersion() without initializing the HDMI input sub-system tv_hdmi_edid_version_t edid_version; + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, &edid_version), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsGetEdidVersion() with invalid inputs (dsHDMI_IN_PORT_MAX) + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdidVersion(dsHDMI_IN_PORT_MAX, &edid_version), dsERR_INVALID_PARAM); + #endif // Step 4: Call dsGetEdidVersion() with invalid inputs (NULL) + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); + #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 6: Call dsGetEdidVersion() without initializing the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, &edid_version), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1909,22 +2019,30 @@ void test_l1_dsHdmiIn_negative_dsGetAllmStatus(void) { UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsGetAllmStatus() without initializing the HDMI input sub-system bool allm_status; + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, &allm_status), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsGetAllmStatus() without valid inputs (dsHDMI_IN_PORT_MAX) + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAllmStatus(dsHDMI_IN_PORT_MAX, &allm_status), dsERR_INVALID_PARAM); + #endif // Step 4: Call dsGetAllmStatus() without valid inputs (NULL) + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); + #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 6: Call dsGetAllmStatus() after termination the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, &allm_status), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1998,19 +2116,25 @@ void test_l1_dsHdmiIn_negative_dsGetSupportedGameFeaturesList(void) { UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsGetSupportedGameFeaturesList() without initializing the HDMI input sub-system dsSupportedGameFeatureList_t supported_features; + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetSupportedGameFeaturesList(&supported_features), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsGetSupportedGameFeaturesList() with invalid input (NULL) + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetSupportedGameFeaturesList(NULL), dsERR_INVALID_PARAM); + #endif // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsGetSupportedGameFeaturesList() after terminating the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetSupportedGameFeaturesList(&supported_features), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2079,22 +2203,30 @@ void test_l1_dsHdmiIn_negative_dsGetAVLatency(void) { UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsGetAVLatency() without initializing the HDMI input sub-system int audioLatency, videoLatency; + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetAVLatency(&audioLatency, &videoLatency), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsGetAVLatency() with valid inputs (NULL, int*) + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAVLatency(NULL, &videoLatency), dsERR_INVALID_PARAM); + #endif // Step 4: Call dsGetAVLatency() with valid inputs (int*, NULL) + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAVLatency(&audioLatency, NULL), dsERR_INVALID_PARAM); + #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 6: Call dsGetAVLatency() after terminating the HDMI input sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetAVLatency(&audioLatency, &videoLatency), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2162,19 +2294,25 @@ void test_l1_dsHdmiIn_negative_dsSetEdid2AllmSupport(void) { gTestID = 48; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsSetEdid2AllmSupport() without prior initialization of HDMI input + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_0, true), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize HDMI input using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsSetEdid2AllmSupport() with an invalid HDMI port + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_MAX, true), dsERR_INVALID_PARAM); + #endif // Step 4: Terminate the HDMI input using dsHdmiInTerm() UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsSetEdid2AllmSupport() after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_0, true), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2248,7 +2386,9 @@ void test_l1_dsHdmiIn_negative_dsGetEdid2AllmSupport(void) { gTestID = 50; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); bool allmSupport; + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_0, &allmSupport), dsERR_NOT_INITIALIZED); + #endif // Step 2: Initialize HDMI input using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -2263,7 +2403,9 @@ void test_l1_dsHdmiIn_negative_dsGetEdid2AllmSupport(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 6: Call dsGetEdid2AllmSupport() without initializing the HDMI input sub-system again + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_0, &allmSupport), dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2350,4 +2492,4 @@ int test_l1_dsHdmiIn_register ( void ) /** @} */ // End of DS_HDMIIn_HALTEST /** @} */ // End of Device_Settings_HALTEST /** @} */ // End of Device_Settings -/** @} */ // End of HPK \ No newline at end of file +/** @} */ // End of HPK From 48ac052d75097b1c0db06a347e63af34bccec97e Mon Sep 17 00:00:00 2001 From: ishthiyaqahmed <167058902+ishthiyaqahmed@users.noreply.github.com> Date: Thu, 9 May 2024 16:59:54 +0530 Subject: [PATCH 04/38] Updated with enhanced error code disabled check in test_l1_dsAudio.c --- src/test_l1_dsAudio.c | 607 ++++++++++++++++++++++++++++++++---------- 1 file changed, 462 insertions(+), 145 deletions(-) diff --git a/src/test_l1_dsAudio.c b/src/test_l1_dsAudio.c index 9cd2309e..647836b7 100644 --- a/src/test_l1_dsAudio.c +++ b/src/test_l1_dsAudio.c @@ -160,9 +160,10 @@ void test_l1_dsAudio_negative_dsAudioPortInit (void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 02: Call dsAudioPortInit() Attempt to initialize dsAudio again + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_ALREADY_INITIALIZED); - + #endif // Step 03: Call dsAudioPortTerm() Terminate dsAudio result = dsAudioPortTerm(); @@ -245,9 +246,11 @@ void test_l1_dsAudio_negative_dsAudioPortTerm (void) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 01: dsAudioPortTerm() Attempt to terminate dsAudio without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE dsError_t result = dsAudioPortTerm(); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: dsAudioPortInit() Initialize dsAudio result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -257,8 +260,10 @@ void test_l1_dsAudio_negative_dsAudioPortTerm (void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: dsAudioPortTerm() Attempt to terminate dsAudio again + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsAudioPortTerm(); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n",__FUNCTION__); } @@ -353,9 +358,11 @@ void test_l1_dsAudio_negative_dsGetAudioPort(void) { intptr_t handle[NUM_OF_PORTS]={INT_ARRAY_INIT}; // Step 01: Attempt to get the Audio Port handle without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioPort(kPorts[0].id.type, kPorts[0].id.index, &handle[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -384,9 +391,11 @@ void test_l1_dsAudio_negative_dsGetAudioPort(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get the audio port handle after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioPort(kPorts[0].id.type, kPorts[0].id.index, &handle[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -493,9 +502,11 @@ void test_l1_dsAudio_negative_dsGetAudioEncoding(void) { dsAudioEncoding_t encoding[NUM_OF_PORTS]; // Step 01: Get audio encoding without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioEncoding(-1, &encoding[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -520,9 +531,11 @@ void test_l1_dsAudio_negative_dsGetAudioEncoding(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get the audio encoding type after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioEncoding(handle[0], &encoding[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -632,9 +645,11 @@ void test_l1_dsAudio_negative_dsSetAudioEncoding(void) { intptr_t handle[NUM_OF_PORTS]={INT_ARRAY_INIT}; // Step 01: Attempt to set Audio Encoding without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioEncoding(-1 , kSupportedSPEAKEREncodings[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -659,9 +674,11 @@ void test_l1_dsAudio_negative_dsSetAudioEncoding(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to set Audio Encoding after termination + #ifdef ENABLE_ENHANCED_TESTS result = dsSetAudioEncoding(handle[0], kSupportedSPEAKEREncodings[0]); // Replace with valid handle and encoding UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -766,9 +783,11 @@ void test_l1_dsAudio_negative_dsGetAudioFormat(void) { dsAudioFormat_t audioFormat[NUM_OF_PORTS]; // Step 01: Attempt to get audio format without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioFormat(-1, &audioFormat[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -793,9 +812,11 @@ void test_l1_dsAudio_negative_dsGetAudioFormat(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get audio format after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioFormat(handle[0], &audioFormat[0]); // Replace with valid handle UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -894,9 +915,11 @@ void test_l1_dsAudio_negative_dsGetAudioCompression(void) { int compression[NUM_OF_PORTS]; // Step 01: Attempt to get audio compression without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioCompression(-1, &compression[0]); // Replace with valid handle UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -923,9 +946,11 @@ void test_l1_dsAudio_negative_dsGetAudioCompression(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get audio compression after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioCompression(handle[0], &compression[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1025,9 +1050,11 @@ void test_l1_dsAudio_negative_dsSetAudioCompression(void) { int max_compression = 10, out_of_range_pos = 20, out_of_range_neg = -10; // Step 01: Attempt to set audio compression with an invalid handle + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioCompression(-1, max_compression); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -1056,9 +1083,11 @@ void test_l1_dsAudio_negative_dsSetAudioCompression(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Attempt to set audio compression after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioCompression(handle[0], max_compression); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1150,9 +1179,11 @@ void test_l1_dsAudio_negative_dsGetDialogEnhancement(void) { int dialogEnhancementLevel[NUM_OF_PORTS]; // Step 01: Attempt to get dialog enhancement without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDialogEnhancement(-1, &dialogEnhancementLevel[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -1177,9 +1208,11 @@ void test_l1_dsAudio_negative_dsGetDialogEnhancement(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get dialog enhancement after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDialogEnhancement(handle[0], &dialogEnhancementLevel[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1280,8 +1313,10 @@ void test_l1_dsAudio_negative_dsSetDialogEnhancement(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Attempt to set dialog enhancement without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDialogEnhancement(-1, valid_de_level); // Assume INVALID_HANDLE is an invalid handle UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -1311,9 +1346,11 @@ void test_l1_dsAudio_negative_dsSetDialogEnhancement(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Attempt to set dialog enhancement after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDialogEnhancement(handle[0], valid_de_level); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1404,9 +1441,11 @@ void test_l1_dsAudio_negative_dsGetDolbyVolumeMode(void) { bool dolbyVolumeMode[NUM_OF_PORTS]; // Step 01: Attempt to get Dolby Volume mode without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDolbyVolumeMode(-1, &dolbyVolumeMode[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -1431,9 +1470,11 @@ void test_l1_dsAudio_negative_dsGetDolbyVolumeMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get Dolby Volume mode after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDolbyVolumeMode(handle[0], &dolbyVolumeMode[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1522,9 +1563,11 @@ void test_l1_dsAudio_negative_dsSetDolbyVolumeMode(void) { bool validMode = true; // Assuming 'true' as a valid mode // Step 01: Attempt to set the Dolby Volume Mode without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDolbyVolumeMode(-1, validMode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -1545,9 +1588,11 @@ void test_l1_dsAudio_negative_dsSetDolbyVolumeMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Attempt to set Dolby Volume Mode after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDolbyVolumeMode(handle[0], validMode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1637,9 +1682,11 @@ void test_l1_dsAudio_negative_dsGetIntelligentEqualizerMode(void) { int intelligentEqualizerMode[NUM_OF_PORTS]; // Step 01: Attempt to get Intelligent Equalizer Mode without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetIntelligentEqualizerMode(-1, &intelligentEqualizerMode[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -1664,9 +1711,11 @@ void test_l1_dsAudio_negative_dsGetIntelligentEqualizerMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get Intelligent Equalizer Mode after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetIntelligentEqualizerMode(handle[0], &intelligentEqualizerMode[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1756,9 +1805,11 @@ void test_l1_dsAudio_negative_dsSetIntelligentEqualizerMode(void) { int valid_mode = 0, invalid_mode = -1; // Step 01: Attempt to set Intelligent Equalizer Mode without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetIntelligentEqualizerMode(-1, valid_mode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -1783,9 +1834,11 @@ void test_l1_dsAudio_negative_dsSetIntelligentEqualizerMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to set Intelligent Equalizer Mode after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetIntelligentEqualizerMode(handle[0], valid_mode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1874,9 +1927,11 @@ void test_l1_dsAudio_negative_dsGetVolumeLeveller(void) { dsVolumeLeveller_t volLeveller[NUM_OF_PORTS]; // Step 01: Attempt to get Volume Leveller settings without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVolumeLeveller(-1, &volLeveller[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -1903,9 +1958,11 @@ void test_l1_dsAudio_negative_dsGetVolumeLeveller(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get Volume Leveller settings after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVolumeLeveller(handle[0], &volLeveller[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2003,11 +2060,13 @@ void test_l1_dsAudio_negative_dsSetVolumeLeveller(void) { int valid_mode = 2, valid_level = 10, invalid_mode = -1, invalid_level = 20; // Step 01: Attempt to set Volume Leveller without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE volLeveller.mode = valid_mode; volLeveller.level = valid_level; result = dsSetVolumeLeveller(-1, volLeveller); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -2045,11 +2104,13 @@ void test_l1_dsAudio_negative_dsSetVolumeLeveller(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Attempt to set Volume Leveller after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE volLeveller.mode = valid_mode; volLeveller.level = valid_level; result = dsSetVolumeLeveller(handle[0],volLeveller); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2148,9 +2209,11 @@ void test_l1_dsAudio_negative_dsGetBassEnhancer(void) { int boost; // Step 01: Attempt to get Bass Enhancer without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetBassEnhancer(-1, &boost); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -2175,9 +2238,11 @@ void test_l1_dsAudio_negative_dsGetBassEnhancer(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get Bass Enhancer after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetBassEnhancer(handle[0], &boost); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2272,9 +2337,11 @@ void test_l1_dsAudio_negative_dsSetBassEnhancer(void) { int boost = 75, invalidBoost_pos = 101, invalidBoost_neg = -20; // Step 01: Attempt to set Bass Enhancer without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetBassEnhancer(-1, boost); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -2302,9 +2369,11 @@ void test_l1_dsAudio_negative_dsSetBassEnhancer(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to set Bass Enhancer after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetBassEnhancer(handle[0], boost); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2393,9 +2462,11 @@ void test_l1_dsAudio_negative_dsIsSurroundDecoderEnabled(void) { bool surroundDecoderEnabled; // Step 01: Attempt to check Surround Decoder status without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsSurroundDecoderEnabled(-1, &surroundDecoderEnabled); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -2420,9 +2491,11 @@ void test_l1_dsAudio_negative_dsIsSurroundDecoderEnabled(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to check Surround Decoder status after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsSurroundDecoderEnabled(handle[0], &surroundDecoderEnabled); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2511,9 +2584,11 @@ void test_l1_dsAudio_negative_dsEnableSurroundDecoder(void) { bool enabled = true; // Step 01: Attempt to enable Surround Decoder without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableSurroundDecoder(-1, enabled); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -2534,9 +2609,11 @@ void test_l1_dsAudio_negative_dsEnableSurroundDecoder(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Attempt to enable Surround Decoder after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableSurroundDecoder(handle[0], enabled); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2639,9 +2716,11 @@ void test_l1_dsAudio_negative_dsGetDRCMode(void) { int drcMode; // Step 01: Attempt to get DRC Mode without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDRCMode(-1, &drcMode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -2666,9 +2745,11 @@ void test_l1_dsAudio_negative_dsGetDRCMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get DRC Mode after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDRCMode(handle[0], &drcMode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2758,9 +2839,11 @@ void test_l1_dsAudio_negative_dsSetDRCMode(void) { int validMode = 1, invalidMode = 2; // Step 01: Attempt to set DRC Mode without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDRCMode(-1, validMode); // Assume INVALID_HANDLE is an invalid handle UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -2785,9 +2868,11 @@ void test_l1_dsAudio_negative_dsSetDRCMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Attempt to set DRC Mode after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDRCMode(handle[0], validMode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2892,9 +2977,11 @@ void test_l1_dsAudio_negative_dsGetSurroundVirtualizer(void) { dsSurroundVirtualizer_t virtualizerLevel; // Step 01: Attempt to get Surround Virtualizer without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSurroundVirtualizer(-1, &virtualizerLevel); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -2919,9 +3006,11 @@ void test_l1_dsAudio_negative_dsGetSurroundVirtualizer(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get Surround Virtualizer after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSurroundVirtualizer(handle[0], &virtualizerLevel); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3028,11 +3117,13 @@ void test_l1_dsAudio_negative_dsSetSurroundVirtualizer(void) { int valid_mode = 2, valid_boost = 96, invalid_mode = -1, invalid_boost = 100; // Step 01: Attempt to set Surround Virtualizer without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE virtualizer.mode = valid_mode; virtualizer.boost = valid_boost; result = dsSetSurroundVirtualizer(-1, virtualizer); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -3066,11 +3157,13 @@ void test_l1_dsAudio_negative_dsSetSurroundVirtualizer(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Attempt to set Surround Virtualizer after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE virtualizer.mode = valid_mode; virtualizer.boost = valid_boost; result = dsSetSurroundVirtualizer(handle[0], virtualizer); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3174,9 +3267,11 @@ void test_l1_dsAudio_negative_dsGetMISteering(void) { bool miSteeringEnabled; // Step 01: Attempt to get MI Steering without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetMISteering(-1, &miSteeringEnabled); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -3201,9 +3296,11 @@ void test_l1_dsAudio_negative_dsGetMISteering(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get MI Steering after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetMISteering(handle[0], &miSteeringEnabled); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3290,16 +3387,18 @@ void test_l1_dsAudio_negative_dsSetMISteering(void) { bool enabled = true; // Step 01: Attempt to set MI Steering without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetMISteering(-1, enabled); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 03: Attempt to set MI Steering using an invalid handle result = dsSetMISteering(handle[0], enabled); - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 04: Get the port handle for all supported audio ports for (int i = 0; i < NUM_OF_PORTS; i++) { @@ -3313,9 +3412,11 @@ void test_l1_dsAudio_negative_dsSetMISteering(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Attempt to set MI Steering after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetMISteering(handle[0], enabled); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3420,9 +3521,11 @@ void test_l1_dsAudio_negative_dsGetGraphicEqualizerMode(void) { int graphicEqMode; // Step 01: Attempt to get Graphic Equalizer Mode without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetGraphicEqualizerMode(-1, &graphicEqMode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -3447,9 +3550,11 @@ void test_l1_dsAudio_negative_dsGetGraphicEqualizerMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get Graphic Equalizer Mode after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetGraphicEqualizerMode(handle[0], &graphicEqMode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3540,9 +3645,11 @@ void test_l1_dsAudio_negative_dsSetGraphicEqualizerMode(void) { int valid_mode = 2, invalid_mode_neg = -1, invalid_mode_pos = 4; // Step 01: Attempt to set Graphic Equalizer Mode without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetGraphicEqualizerMode(-1, valid_mode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -3570,9 +3677,11 @@ void test_l1_dsAudio_negative_dsSetGraphicEqualizerMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to set Graphic Equalizer Mode after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetGraphicEqualizerMode(handle[0], valid_mode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3687,9 +3796,11 @@ void test_l1_dsAudio_negative_dsGetMS12AudioProfileList(void) { dsMS12AudioProfileList_t profileList; // Step 01: Attempt to get MS12 Audio Profile List without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetMS12AudioProfileList(-1, &profileList); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -3714,9 +3825,11 @@ void test_l1_dsAudio_negative_dsGetMS12AudioProfileList(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get MS12 Audio Profile List after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetMS12AudioProfileList(handle[0], &profileList); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3816,9 +3929,11 @@ void test_l1_dsAudio_negative_dsGetMS12AudioProfile(void) { char currentProfile[MAX_PROFILE_NAME_LEN]; // Step 01: Attempt to get MS12 Audio Profile without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetMS12AudioProfile(-1, currentProfile); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -3845,9 +3960,11 @@ void test_l1_dsAudio_negative_dsGetMS12AudioProfile(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get MS12 Audio Profile after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetMS12AudioProfile(handle[0], currentProfile); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3945,9 +4062,11 @@ void test_l1_dsAudio_negative_dsGetStereoMode(void) { dsAudioStereoMode_t stereoMode; // Step 01: Attempt to get stereo mode without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetStereoMode(-1, &stereoMode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -3972,9 +4091,11 @@ void test_l1_dsAudio_negative_dsGetStereoMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get stereo mode again after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetStereoMode(handle[0], &stereoMode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4063,9 +4184,11 @@ void test_l1_dsAudio_negative_dsSetStereoMode(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Attempt to set stereo mode without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetStereoMode(-1, dsAUDIO_STEREO_SURROUND); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -4089,9 +4212,11 @@ void test_l1_dsAudio_negative_dsSetStereoMode(void) { result = dsAudioPortTerm(); UT_ASSERT_EQUAL(result, dsERR_NONE); + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetStereoMode(handle[0], dsAUDIO_STEREO_SURROUND); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4188,9 +4313,11 @@ void test_l1_dsAudio_negative_dsGetStereoAuto(void) { int autoMode; // Step 01: Attempt to get stereo auto without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetStereoAuto(-1, &autoMode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -4215,9 +4342,11 @@ void test_l1_dsAudio_negative_dsGetStereoAuto(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); //Step 07: Attempt to get Stereo Auto after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetStereoAuto(handle[0], &autoMode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4306,9 +4435,11 @@ void test_l1_dsAudio_negative_dsSetStereoAuto(void) { int autoMode = 1, invalidAutoMode = -1; // Step 01: Attempt to set stereo auto without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetStereoAuto(-1, autoMode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -4334,9 +4465,11 @@ void test_l1_dsAudio_negative_dsSetStereoAuto(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to set auto mode after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetStereoAuto(handle[0], autoMode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4435,9 +4568,11 @@ void test_l1_dsAudio_negative_dsGetAudioGain(void) { float gain; // Step 01: Attempt to get audio gain without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioGain(-1, &gain); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -4462,9 +4597,11 @@ void test_l1_dsAudio_negative_dsGetAudioGain(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get the Audio Gain after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioGain(handle[0], &gain); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4559,9 +4696,11 @@ void test_l1_dsAudio_negative_dsSetAudioGain(void) { float gainValue = 200, invalid_gain_neg = -3000, invalid_gain_pos = 500; // Step 01: Attempt to set audio gain without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioGain(-1, gainValue); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -4589,9 +4728,11 @@ void test_l1_dsAudio_negative_dsSetAudioGain(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt t set audio gain after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioGain(handle[0], gainValue); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4692,9 +4833,11 @@ void test_l1_dsAudio_negative_dsGetAudioDB(void) { float db; // Step 01: Attempt to call dsGetAudioDB without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioDB(-1, &db); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -4719,9 +4862,11 @@ void test_l1_dsAudio_negative_dsGetAudioDB(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to call dsGetAudioDB after audio ports have been terminated + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioDB(handle[0], &db); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4816,9 +4961,11 @@ void test_l1_dsAudio_negative_dsSetAudioDB(void) { float valid_db = 100, invalid_db_neg = -1500, invalid_db_pos = 200; // Step 01: Attempt to call dsSetAudioDB without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioDB(-1, valid_db); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -4846,9 +4993,11 @@ void test_l1_dsAudio_negative_dsSetAudioDB(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to call dsSetAudioDB after audio ports have been terminated + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioDB(handle[0], valid_db); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4952,9 +5101,11 @@ void test_l1_dsAudio_negative_dsGetAudioLevel(void) { float audioLevel; // Step 01: Attempt to get audio level without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioLevel(-1, &audioLevel); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -4979,9 +5130,11 @@ void test_l1_dsAudio_negative_dsGetAudioLevel(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get audio level after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioLevel(handle[0], &audioLevel); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5074,9 +5227,11 @@ void test_l1_dsAudio_negative_dsSetAudioLevel(void) { float audio_level = 50, invalid_audio_level_neg = -10, invalid_audio_level_pos = 120; // Step 01: Attempt to set audio level without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioLevel(-1, audio_level); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -5104,9 +5259,11 @@ void test_l1_dsAudio_negative_dsSetAudioLevel(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to set audio level after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioLevel(handle[0], audio_level); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5207,9 +5364,11 @@ void test_l1_dsAudio_negative_dsGetAudioMaxDB(void) { float maxDb; // Step 01: Attempt to get max dB without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioMaxDB(-1, &maxDb); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -5234,9 +5393,11 @@ void test_l1_dsAudio_negative_dsGetAudioMaxDB(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get max dB after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioMaxDB(handle[0], &maxDb); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5337,8 +5498,10 @@ void test_l1_dsAudio_negative_dsGetAudioMinDB(void) { float minDb; // Step 01: Attempt to get min dB without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioMinDB(-1, &minDb); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -5364,9 +5527,11 @@ void test_l1_dsAudio_negative_dsGetAudioMinDB(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get min dB after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioMinDB(handle[0], &minDb); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5465,9 +5630,11 @@ void test_l1_dsAudio_negative_dsGetAudioOptimalLevel(void) { float optimalLevel; // Step 01: Attempt to get optimal dB without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioOptimalLevel(-1, &optimalLevel); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -5492,9 +5659,11 @@ void test_l1_dsAudio_negative_dsGetAudioOptimalLevel(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get optimal dB after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioOptimalLevel(handle[0], &optimalLevel); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5595,9 +5764,11 @@ void test_l1_dsAudio_negative_dsGetAudioDelay(void) { uint32_t audioDelay; // Step 01: Attempt to get audio delay without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioDelay(-1, &audioDelay); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -5622,9 +5793,11 @@ void test_l1_dsAudio_negative_dsGetAudioDelay(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get audio delay after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioDelay(handle[0], &audioDelay); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5719,9 +5892,11 @@ void test_l1_dsAudio_negative_dsSetAudioDelay(void) { uint32_t audio_delay = 100, invalid_audio_delay = 300; // Step 01: Attempt to set audio delay without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioDelay(-1, audio_delay); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -5745,8 +5920,10 @@ void test_l1_dsAudio_negative_dsSetAudioDelay(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 05: Attempt to set audio delay after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioDelay(handle[0], audio_delay); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -5846,9 +6023,11 @@ void test_l1_dsAudio_negative_dsGetAudioDelayOffset(void) { uint32_t audioDelayOffsetMs; // Step 01: Attempt to retrieve audio delay offset without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioDelayOffset(-1, &audioDelayOffsetMs); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -5873,9 +6052,11 @@ void test_l1_dsAudio_negative_dsGetAudioDelayOffset(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to retrieve audio delay offset after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioDelayOffset(handle[0], &audioDelayOffsetMs); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5963,9 +6144,11 @@ void test_l1_dsAudio_negative_dsSetAudioDelayOffset(void) { uint32_t audio_delay_offset = 200 , invalid_audio_delay_offset= 300; // Step 01: Attempt to set audio delay offset without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioDelayOffset(-1, audio_delay_offset); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -5990,9 +6173,11 @@ void test_l1_dsAudio_negative_dsSetAudioDelayOffset(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to set audio delay offset after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioDelayOffset(handle[0], audio_delay_offset); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -6084,9 +6269,11 @@ void test_l1_dsAudio_negative_dsSetAudioAtmosOutputMode(void) { bool valid_value = true; // Step 01: Attempt to set ATMOS Output mode without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioAtmosOutputMode(-1, valid_value); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -6107,8 +6294,10 @@ void test_l1_dsAudio_negative_dsSetAudioAtmosOutputMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Attempt to set ATMOS Output mode after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioAtmosOutputMode(handle[0], valid_value); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6208,8 +6397,10 @@ void test_l1_dsAudio_negative_dsGetSinkDeviceAtmosCapability(void) { dsATMOSCapability_t atmosCapability; // Step 01: Attempt to get ATMOS capability without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSinkDeviceAtmosCapability(-1, &atmosCapability); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6236,9 +6427,11 @@ void test_l1_dsAudio_negative_dsGetSinkDeviceAtmosCapability(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get ATMOS capability after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSinkDeviceAtmosCapability(handle[0], &atmosCapability); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -6337,8 +6530,10 @@ void test_l1_dsAudio_negative_dsIsAudioLoopThru(void) { bool loopThru; // Step 01: Attempt to check Loop-Thru status without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioLoopThru(-1, &loopThru); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6360,9 +6555,11 @@ void test_l1_dsAudio_negative_dsIsAudioLoopThru(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to check Loop-Thru status after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioLoopThru(handle[0], &loopThru); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -6460,8 +6657,10 @@ void test_l1_dsAudio_negative_dsIsAudioMute(void) { bool muted; // Step 01: Attempt to check Mute status without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioMute(-1, &muted); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6483,9 +6682,11 @@ void test_l1_dsAudio_negative_dsIsAudioMute(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to check Mute status after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioMute(handle[0], &muted); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -6583,9 +6784,11 @@ void test_l1_dsAudio_negative_dsIsAudioPortEnabled(void) { bool isEnabled; // Step 01: Attempt to check Enabled status without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioPortEnabled(-1, &isEnabled); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -6606,9 +6809,11 @@ void test_l1_dsAudio_negative_dsIsAudioPortEnabled(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to check Enabled status after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioPortEnabled(handle[0], &isEnabled); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -6711,9 +6916,11 @@ void test_l1_dsAudio_negative_dsEnableAudioPort(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Attempt to enable/disable audio ports without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableAudioPort(-1, true); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -6734,8 +6941,10 @@ void test_l1_dsAudio_negative_dsEnableAudioPort(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Attempt to enable/disable after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableAudioPort(handle[0], true); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6831,9 +7040,11 @@ void test_l1_dsAudio_negative_dsEnableMS12Config(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Attempt to enable MS12 Configs without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableMS12Config(-1, dsMS12FEATURE_DAPV2 , true); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -6858,9 +7069,11 @@ void test_l1_dsAudio_negative_dsEnableMS12Config(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to enable MS12 Configs after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableMS12Config(handle[0], dsMS12FEATURE_DAPV2, true); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -6947,9 +7160,11 @@ void test_l1_dsAudio_negative_dsEnableLEConfig(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Attempt to enable LE without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableLEConfig(-1, true); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -6970,8 +7185,10 @@ void test_l1_dsAudio_negative_dsEnableLEConfig(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Attempt to enable LE after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableLEConfig(handle[0], false); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -7071,8 +7288,10 @@ void test_l1_dsAudio_negative_dsGetLEConfig(void) { bool enable; // Step 01: Attempt to get LE Config without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetLEConfig(-1, &enable); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7098,9 +7317,11 @@ void test_l1_dsAudio_negative_dsGetLEConfig(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get LE Config after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetLEConfig(handle[0], &enable); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -7191,8 +7412,10 @@ void test_l1_dsAudio_negative_dsSetMS12AudioProfile(void) { char *validProfile = "YourValidMS12Profile"; // Replace with a valid profile from _dsMS12AudioProfileList_t // Step 01: Attempt to set MS12 Audio Profile without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetMS12AudioProfile(-1, validProfile); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7218,9 +7441,11 @@ void test_l1_dsAudio_negative_dsSetMS12AudioProfile(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to set MS12 Audio Profile after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetMS12AudioProfile(handle[0], validProfile); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -7323,9 +7548,11 @@ void test_l1_dsAudio_negative_dsSetAudioDucking(void) { unsigned char valid_level = 100; // Step 01: Attempt to set Audio Ducking without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioDucking(-1, valid_action, vaild_type, valid_level); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -7359,9 +7586,11 @@ void test_l1_dsAudio_negative_dsSetAudioDucking(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 09: Attempt to set Audio Ducking after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioDucking(handle[0], valid_action, vaild_type, valid_level); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -7453,8 +7682,10 @@ void test_l1_dsAudio_negative_dsEnableLoopThru(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Attempt to enable loop-through without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableLoopThru(-1, true); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7476,8 +7707,10 @@ void test_l1_dsAudio_negative_dsEnableLoopThru(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Attempt to enable loop-through after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableLoopThru(handle[0], true); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -7572,8 +7805,10 @@ void test_l1_dsAudio_negative_dsSetAudioMute(void) { bool valid_value = true; // Step 01: Attempt to set mute without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioMute(-1, valid_value); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7595,9 +7830,11 @@ void test_l1_dsAudio_negative_dsSetAudioMute(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Attempt to set mute after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioMute(handle[0], true); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -7686,9 +7923,11 @@ void test_l1_dsAudio_negative_dsIsAudioMSDecode(void) { bool hasMS11Decode; // Step 01: Attempt to check MS11 Decode without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioMSDecode(-1, &hasMS11Decode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -7714,9 +7953,11 @@ void test_l1_dsAudio_negative_dsIsAudioMSDecode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to check MS11 Decode after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioMSDecode(handle[0], &hasMS11Decode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -7805,9 +8046,11 @@ void test_l1_dsAudio_negative_dsIsAudioMS12Decode(void) { bool hasMS12Decode; // Step 01: Attempt to check MS12 Decode without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioMS12Decode(-1, &hasMS12Decode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -7832,9 +8075,11 @@ void test_l1_dsAudio_negative_dsIsAudioMS12Decode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to check MS12 Decode after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioMS12Decode(handle[0], &hasMS12Decode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -7923,9 +8168,11 @@ void test_l1_dsAudio_negative_dsAudioOutIsConnected(void) { bool isConnected; // Step 01: Attempt to check connection status without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsAudioOutIsConnected(-1, &isConnected); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -7950,9 +8197,11 @@ void test_l1_dsAudio_negative_dsAudioOutIsConnected(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to check connection status after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsAudioOutIsConnected(handle[0], &isConnected); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -8031,9 +8280,11 @@ void test_l1_dsAudio_negative_dsAudioOutRegisterConnectCB(void) { int result; // Step 01: Attempt to register callback without initializing ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsAudioOutRegisterConnectCB(NULL); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -8125,9 +8376,11 @@ void test_l1_dsAudio_negative_dsAudioFormatUpdateRegisterCB(void) { int result; // Step 01: Attempt to register callback without initializing ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsAudioFormatUpdateRegisterCB(NULL); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -8234,9 +8487,11 @@ void test_l1_dsAudio_negative_dsGetAudioCapabilities(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioCapabilities(-1, &capabilities); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -8261,9 +8516,11 @@ void test_l1_dsAudio_negative_dsGetAudioCapabilities(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call again after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioCapabilities(handle[0], &capabilities); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -8362,9 +8619,11 @@ void test_l1_dsAudio_negative_dsGetMS12Capabilities(void) { int ms12Capabilities; // Step 01: Call without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetMS12Capabilities(-1, &ms12Capabilities); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -8389,9 +8648,11 @@ void test_l1_dsAudio_negative_dsGetMS12Capabilities(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call again after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetMS12Capabilities(handle[0], &ms12Capabilities); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -8477,9 +8738,11 @@ void test_l1_dsAudio_negative_dsResetDialogEnhancement(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsResetDialogEnhancement(-1); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -8501,9 +8764,11 @@ void test_l1_dsAudio_negative_dsResetDialogEnhancement(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 05: Call again after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsResetDialogEnhancement(handle[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -8590,9 +8855,11 @@ void test_l1_dsAudio_negative_dsResetBassEnhancer(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsResetBassEnhancer(-1); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -8613,9 +8880,11 @@ void test_l1_dsAudio_negative_dsResetBassEnhancer(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Call again after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsResetBassEnhancer(handle[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -8700,9 +8969,11 @@ void test_l1_dsAudio_negative_dsResetSurroundVirtualizer(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsResetSurroundVirtualizer(-1); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -8723,9 +8994,11 @@ void test_l1_dsAudio_negative_dsResetSurroundVirtualizer(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Call again after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsResetSurroundVirtualizer(handle[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -8811,9 +9084,11 @@ void test_l1_dsAudio_negative_dsResetVolumeLeveller(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsResetVolumeLeveller(-1); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -8834,9 +9109,11 @@ void test_l1_dsAudio_negative_dsResetVolumeLeveller(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Call again after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsResetVolumeLeveller(handle[0]); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -8926,9 +9203,11 @@ void test_l1_dsAudio_negative_dsSetAssociatedAudioMixing(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAssociatedAudioMixing(-1, true); // Example invalid handle UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -8949,9 +9228,11 @@ void test_l1_dsAudio_negative_dsSetAssociatedAudioMixing(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Call again after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAssociatedAudioMixing(handle[0], true); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -9050,9 +9331,11 @@ void test_l1_dsAudio_negative_dsGetAssociatedAudioMixing(void) { bool mixing; // Step 01: Call without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAssociatedAudioMixing(-1, &mixing); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -9077,9 +9360,11 @@ void test_l1_dsAudio_negative_dsGetAssociatedAudioMixing(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call again after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAssociatedAudioMixing(handle[0], &mixing); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -9173,10 +9458,12 @@ void test_l1_dsAudio_negative_dsSetFaderControl(void) { int invalidMixerBalance = 100; // invalid mixer balance value // Step 01: Call without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE int mixerBalance = 0; //valid value result = dsSetFaderControl(-1, mixerBalance); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -9201,9 +9488,11 @@ void test_l1_dsAudio_negative_dsSetFaderControl(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call again after terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetFaderControl(handle[0], mixerBalance); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -9302,9 +9591,11 @@ void test_l1_dsAudio_negative_dsGetFaderControl(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call dsGetFaderControl() without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetFaderControl(-1, &mixerBalance); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -9329,9 +9620,11 @@ void test_l1_dsAudio_negative_dsGetFaderControl(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetFaderControl() after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetFaderControl(handle[0], &mixerBalance); // using last valid handle obtained UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -9421,9 +9714,11 @@ void test_l1_dsAudio_negative_dsSetPrimaryLanguage(void) { const char *invalidLanguage = "XYZ"; // Assuming "XYZ" is an invalid language code // Step 01: Call without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetPrimaryLanguage(-1, "ENG"); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -9452,9 +9747,11 @@ void test_l1_dsAudio_negative_dsSetPrimaryLanguage(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetPrimaryLanguage(handle[0], "ENG"); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -9553,9 +9850,11 @@ void test_l1_dsAudio_negative_dsGetPrimaryLanguage(void) { char primaryLanguage[4]; // Step 01: Call without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetPrimaryLanguage(-1, primaryLanguage); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -9580,9 +9879,11 @@ void test_l1_dsAudio_negative_dsGetPrimaryLanguage(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetPrimaryLanguage(handle[0], primaryLanguage); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -9670,9 +9971,11 @@ void test_l1_dsAudio_negative_dsSetSecondaryLanguage(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetSecondaryLanguage(-1, "ENG"); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -9701,9 +10004,11 @@ void test_l1_dsAudio_negative_dsSetSecondaryLanguage(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Call after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetSecondaryLanguage(handle[0], "ENG"); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -9802,9 +10107,11 @@ void test_l1_dsAudio_negative_dsGetSecondaryLanguage(void) { char languageCode[4]; // Step 01: Call without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSecondaryLanguage(-1, languageCode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -9829,9 +10136,11 @@ void test_l1_dsAudio_negative_dsGetSecondaryLanguage(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSecondaryLanguage(handle[0], languageCode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -9907,9 +10216,11 @@ void test_l1_dsAudio_negative_dsGetHDMIARCPortId(void) { int result; // Step 01: Call without initializing audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetHDMIARCPortId(NULL); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -9923,9 +10234,11 @@ void test_l1_dsAudio_negative_dsGetHDMIARCPortId(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 05: Call after terminating audio ports + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetHDMIARCPortId(NULL); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -10024,9 +10337,11 @@ void test_l1_dsAudio_negative_dsSetAudioMixerLevels(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call dsSetAudioMixerLevels() without prior initialization of Audio Port + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioMixerLevels((intptr_t)NULL, dsAUDIO_INPUT_PRIMARY, valid_vol_level); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // Step 02: Initialize Audio Port using dsAudioPortInit() result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -10058,9 +10373,11 @@ void test_l1_dsAudio_negative_dsSetAudioMixerLevels(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Call dsSetAudioMixerLevels() after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioMixerLevels(handle[0], dsAUDIO_INPUT_PRIMARY, valid_vol_level); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - + #endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } From 153a78733db5c6afc40924c89a5b499aa798c0d5 Mon Sep 17 00:00:00 2001 From: drissya-k <167057835+drissya-k@users.noreply.github.com> Date: Thu, 9 May 2024 17:09:20 +0530 Subject: [PATCH 05/38] Enhanced Error Code Flag Support From c35b93c64f6799c8a8ff21ac2438dffd3586088b Mon Sep 17 00:00:00 2001 From: drissya-k <167057835+drissya-k@users.noreply.github.com> Date: Thu, 9 May 2024 17:13:30 +0530 Subject: [PATCH 06/38] Adding Enhanced Error Code Flag Support From 8fd2214556af7dc47fcc627b9d9248ce2b12ed7d Mon Sep 17 00:00:00 2001 From: drissya-k <167057835+drissya-k@users.noreply.github.com> Date: Thu, 9 May 2024 17:21:05 +0530 Subject: [PATCH 07/38] Adding Enhanced Error Code Flag Support --- src/test_l1_dsVideoDevice.c | 80 +++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/src/test_l1_dsVideoDevice.c b/src/test_l1_dsVideoDevice.c index 392b8609..6556faac 100644 --- a/src/test_l1_dsVideoDevice.c +++ b/src/test_l1_dsVideoDevice.c @@ -165,8 +165,10 @@ void test_l1_dsVideoDevice_negative_dsVideoDeviceInit(void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 02: Try initializing again without terminating + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsVideoDeviceInit(); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_ALREADY_INITIALIZED); + #endif // Step 03: De-initialize the video devices for cleanup result = dsVideoDeviceTerm(); @@ -243,8 +245,10 @@ void test_l1_dsVideoDevice_negative_dsVideoDeviceTerm(void) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 01: Call de-initialization without prior initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE int result = dsVideoDeviceTerm(); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -255,8 +259,10 @@ void test_l1_dsVideoDevice_negative_dsVideoDeviceTerm(void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: Call de-initialization again without re-initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsVideoDeviceTerm(); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -330,28 +336,36 @@ void test_l1_dsVideoDevice_negative_dsGetVideoDevice(void) // Step 01: Get the video device handle without prior initialization intptr_t handle = -1; + #ifdef ENABLE_ENHANCED_ERROR_CODE int result = dsGetVideoDevice(0, &handle); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video devices result = dsVideoDeviceInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 03: Get the video device handle with invalid index + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoDevice(-1, &handle); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + #endif // Step 04: Get the video device handle with valid index but null pointer for handle + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoDevice(0, NULL); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + #endif // Step 05: De-initialize the video devices result = dsVideoDeviceTerm(); UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Get the video device handle after prior termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoDevice(0, &handle); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -448,8 +462,10 @@ void test_l1_dsVideoDevice_negative_dsSetDFC (void) intptr_t handle = -1; // 01: Call dsSetDFC() without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDFC(-1, dsVIDEO_ZOOM_NONE); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // 02: Initialize video devices result = dsVideoDeviceInit(); @@ -461,20 +477,26 @@ void test_l1_dsVideoDevice_negative_dsSetDFC (void) UT_ASSERT_TRUE(handle >= 0); // 04: Call dsSetDFC() with an invalid handle + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDFC(-1, dsVIDEO_ZOOM_NONE); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + #endif // 05: Call dsSetDFC() with an invalid zoom mode + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDFC(handle, dsVIDEO_ZOOM_MAX); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + #endif // 06: De-initialize video devices result = dsVideoDeviceTerm(); UT_ASSERT_EQUAL(result, dsERR_NONE); // 07: Call dsSetDFC() after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDFC(handle, dsVIDEO_ZOOM_NONE); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -571,8 +593,10 @@ void test_l1_dsVideoDevice_negative_dsGetDFC(void) dsVideoZoom_t dfc_mode; // Step 01: Call dsGetDFC() without prior initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDFC(handle, &dfc_mode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -596,8 +620,10 @@ void test_l1_dsVideoDevice_negative_dsGetDFC(void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetDFC() after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDFC(handle, &dfc_mode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -695,8 +721,10 @@ void test_l1_dsVideoDevice_negative_dsGetHDRCapabilities(void) int hdr_capabilities; // Step 01: Call dsGetHDRCapabilities() without prior initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetHDRCapabilities(handle, &hdr_capabilities); // Note: using handle for HDR capabilities for this error case UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -708,20 +736,26 @@ void test_l1_dsVideoDevice_negative_dsGetHDRCapabilities(void) DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); // Step 04: Call dsGetHDRCapabilities() with an invalid handle + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetHDRCapabilities(-1, &hdr_capabilities); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + #endif // Step 05: Call dsGetHDRCapabilities() with a null parameter + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetHDRCapabilities(handle, NULL); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + #endif // Step 06: De-initialize the video devices result = dsVideoDeviceTerm(); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); // Step 07: Call dsGetHDRCapabilities() after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetHDRCapabilities(handle, &hdr_capabilities); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -818,8 +852,10 @@ void test_l1_dsVideoDevice_negative_dsGetSupportedVideoCodingFormats(void) unsigned int supported_formats; // Step 01: Call dsGetSupportedVideoCodingFormats() without prior initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSupportedVideoCodingFormats(handle, &supported_formats); // Note: using handle for supported formats for this error case UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -831,20 +867,26 @@ void test_l1_dsVideoDevice_negative_dsGetSupportedVideoCodingFormats(void) DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); // Step 04: Call dsGetSupportedVideoCodingFormats() with an invalid handle + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSupportedVideoCodingFormats(-1, &supported_formats); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + #endif // Step 05: Call dsGetSupportedVideoCodingFormats() with a null value + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSupportedVideoCodingFormats(handle, NULL); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + #endif // Step 06: De-initialize the video devices result = dsVideoDeviceTerm(); UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetSupportedVideoCodingFormats() after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSupportedVideoCodingFormats(handle, &supported_formats); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -890,20 +932,28 @@ void test_l1_dsVideoDevice_positive_dsGetVideoCodecInfo(void) DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); // Step 03: Get video codec information with dsVIDEO_CODEC_MPEGHPART2 + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEGHPART2, &codecInfo); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + #endif // Step 04: Get video codec information with dsVIDEO_CODEC_MPEG4PART10 + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEG4PART10, &codecInfo); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + #endif // Step 05: Get video codec information with dsVIDEO_CODEC_MPEG2 + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEG2, &codecInfo); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + #endif // Step 06: Get video codec information with dsVIDEO_CODEC_MPEG2 (again to replicate the provided test case) + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEG2, &codecInfo); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + #endif // Step 07: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -948,8 +998,10 @@ void test_l1_dsVideoDevice_negative_dsGetVideoCodecInfo(void) dsVideoCodecInfo_t codecInfo; // Step 01: Call dsGetVideoCodecInfo() without prior initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEGHPART2, &codecInfo); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -961,24 +1013,32 @@ void test_l1_dsVideoDevice_negative_dsGetVideoCodecInfo(void) DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); // Step 04: Call dsGetVideoCodecInfo() with an invalid handle + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(-1, dsVIDEO_CODEC_MPEGHPART2, &codecInfo); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + #endif // Step 05: Call dsGetVideoCodecInfo() with an invalid coding format + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MAX, &codecInfo); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + #endif // Step 06: Call dsGetVideoCodecInfo() with a null parameter + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEGHPART2, NULL); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + #endif // Step 07: De-initialize the video devices result = dsVideoDeviceTerm(); UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Call dsGetVideoCodecInfo() after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEGHPART2, &codecInfo); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1069,8 +1129,10 @@ void test_l1_dsVideoDevice_negative_dsForceDisableHDRSupport(void) intptr_t handle = -1; // Step 01: Call dsForceDisableHDRSupport() without prior initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsForceDisableHDRSupport(handle, true); // Note: uninitialized 'handle' used here UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -1090,8 +1152,10 @@ void test_l1_dsVideoDevice_negative_dsForceDisableHDRSupport(void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Call dsForceDisableHDRSupport() after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsForceDisableHDRSupport(handle, true); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1179,8 +1243,10 @@ void test_l1_dsVideoDevice_negative_dsSetFRFMode(void) intptr_t handle = -1; // Step 01: Call dsSetFRFMode() without prior initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetFRFMode(handle, 60); // Note: uninitialized 'handle' used here UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -1204,8 +1270,10 @@ void test_l1_dsVideoDevice_negative_dsSetFRFMode(void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsSetFRFMode() after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetFRFMode(handle, 60); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1304,8 +1372,10 @@ void test_l1_dsVideoDevice_negative_dsGetFRFMode(void) int fetchedFRFMode; // Step 01: Call dsGetFRFMode() without prior initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetFRFMode(handle, &fetchedFRFMode); // Note: uninitialized 'handle' used here UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -1329,8 +1399,10 @@ void test_l1_dsVideoDevice_negative_dsGetFRFMode(void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetFRFMode() after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetFRFMode(handle, &fetchedFRFMode); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1429,8 +1501,10 @@ void test_l1_dsVideoDevice_negative_dsGetCurrentDisplayframerate(void) char fetchedFramerate[50]; // Assuming a buffer size, modify as necessary. // Step 01: Call dsGetCurrentDisplayframerate() without prior initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetCurrentDisplayframerate(handle, fetchedFramerate); // Note: uninitialized 'handle' used here UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -1454,8 +1528,10 @@ void test_l1_dsVideoDevice_negative_dsGetCurrentDisplayframerate(void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetCurrentDisplayframerate() after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetCurrentDisplayframerate(handle, fetchedFramerate); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1544,8 +1620,10 @@ void test_l1_dsVideoDevice_negative_dsSetDisplayframerate(void) intptr_t handle = -1; // Step 01: Call dsSetDisplayframerate() without prior initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDisplayframerate(handle, "30fps"); // Note: uninitialized 'handle' used here UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -1573,8 +1651,10 @@ void test_l1_dsVideoDevice_negative_dsSetDisplayframerate(void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Call dsSetDisplayframerate() after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDisplayframerate(handle, "30fps"); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } From 83695a0ade4c643842db434613598b5501345203 Mon Sep 17 00:00:00 2001 From: thanushreevani <157587255+thanushreevani@users.noreply.github.com> Date: Thu, 9 May 2024 17:24:52 +0530 Subject: [PATCH 08/38] Update test_l1_dsVideoPort.c enhanced error code disable --- src/test_l1_dsVideoPort.c | 136 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/src/test_l1_dsVideoPort.c b/src/test_l1_dsVideoPort.c index 50f26c07..1e1ae0bd 100644 --- a/src/test_l1_dsVideoPort.c +++ b/src/test_l1_dsVideoPort.c @@ -170,8 +170,10 @@ void test_l1_dsVideoPort_negative_dsVideoPortInit(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 02: Attempt to initialize again without terminating the first initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsVideoPortInit(); DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_ALREADY_INITIALIZED); + #endif // Step 03: Terminate video port system status = dsVideoPortTerm(); @@ -258,8 +260,10 @@ void test_l1_dsVideoPort_negative_dsVideoPortTerm(void) { dsError_t status; // Step 01: Attempt to terminate the video port without prior initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsVideoPortTerm(); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize the video port system status = dsVideoPortInit(); @@ -270,8 +274,10 @@ void test_l1_dsVideoPort_negative_dsVideoPortTerm(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 04: Attempt to terminate the video port again after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsVideoPortTerm(); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -371,8 +377,10 @@ void test_l1_dsVideoPort_negative_dsGetVideoPort(void) { intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; // Step 01: Attempt to get the Video Port handle without initializing + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetVideoPort(kPorts[0].id.type, kPorts[0].id.index, &(handle[0])); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -381,7 +389,11 @@ void test_l1_dsVideoPort_negative_dsGetVideoPort(void) { // Step 03: Attempt to get the Video Port handle with invalid port type for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(dsVIDEOPORT_TYPE_MAX, kPorts[i].id.index, &(handle[i])); + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_OPERATION_NOT_SUPPORTED); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + #endif } // Step 04: Attempt to get the Video Port handle invalid port index @@ -401,8 +413,10 @@ void test_l1_dsVideoPort_negative_dsGetVideoPort(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get the video port handle again after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetVideoPort(kPorts[0].id.type, kPorts[0].id.index, &(handle[0])); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -512,8 +526,10 @@ void test_l1_dsVideoPort_negative_dsIsVideoPortEnabled(void) { bool enabled[NUM_OF_PORTS]; // Step 01: Attempt to check enabled status without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsVideoPortEnabled(-1, &enabled[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -541,8 +557,10 @@ void test_l1_dsVideoPort_negative_dsIsVideoPortEnabled(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Check enabled status after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsVideoPortEnabled(handle[0], &enabled[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -651,8 +669,10 @@ void test_l1_dsVideoPort_negative_dsIsDisplayConnected(void) { bool connected[NUM_OF_PORTS]; // Step 01: Attempt to check connection status without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsDisplayConnected(-1 , &(connected[0])); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -679,8 +699,10 @@ void test_l1_dsVideoPort_negative_dsIsDisplayConnected(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Check connection status after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsDisplayConnected(handle[0], &connected[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -816,8 +838,10 @@ void test_l1_dsVideoPort_negative_dsIsDisplaySurround(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Check audio surround support after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsDisplaySurround(handle[0], &surround[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -927,8 +951,10 @@ void test_l1_dsVideoPort_negative_dsGetSurroundMode(void) { int surroundMode[NUM_OF_PORTS]; // Step 01: Attempt to get surround mode without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetSurroundMode(-1, &surroundMode[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -955,8 +981,10 @@ void test_l1_dsVideoPort_negative_dsGetSurroundMode(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get surround mode after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetSurroundMode(handle[0], &surroundMode[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1067,8 +1095,10 @@ void test_l1_dsVideoPort_negative_dsIsVideoPortActive(void) { bool active[NUM_OF_PORTS]; // Step 01: Attempt to check active status without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsVideoPortActive(-1, &active[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -1095,8 +1125,10 @@ void test_l1_dsVideoPort_negative_dsIsVideoPortActive(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to check active status after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsVideoPortActive(handle[0], &active[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1191,8 +1223,10 @@ void test_l1_dsVideoPort_negative_dsEnableDTCP(void) { bool enableDTCP = true; // Flag to enable/disable DTCP // Step 01: Attempt to enable DTCP without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsEnableDTCP(-1, enableDTCP); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -1213,8 +1247,10 @@ void test_l1_dsVideoPort_negative_dsEnableDTCP(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 06: Attempt to enable DTCP after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsEnableDTCP(handle[0], enableDTCP); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1314,8 +1350,10 @@ void test_l1_dsVideoPort_negative_dsEnableHDCP(void) { int keySize = HDCP_KEY_MAX_SIZE; // Step 01: Attempt to enable HDCP without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsEnableHDCP(-1, enableHDCP, hdcpKey, keySize); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -1344,8 +1382,10 @@ void test_l1_dsVideoPort_negative_dsEnableHDCP(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 08: Attempt to enable HDCP after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsEnableHDCP(handle[0], enableHDCP, hdcpKey, keySize); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1454,8 +1494,10 @@ void test_l1_dsVideoPort_negative_dsIsDTCPEnabled(void) { bool isDTCPEnabled[NUM_OF_PORTS]; // Step 01: Attempt to get DTCP status without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsDTCPEnabled(-1, &isDTCPEnabled[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -1482,8 +1524,10 @@ void test_l1_dsVideoPort_negative_dsIsDTCPEnabled(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get DTCP status after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsDTCPEnabled(handle[0], &isDTCPEnabled[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1592,8 +1636,10 @@ void test_l1_dsVideoPort_negative_dsIsHDCPEnabled(void) { bool contentProtected[NUM_OF_PORTS]; // Step 01: Attempt to get HDCP status without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsHDCPEnabled(-1, &(contentProtected[0])); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -1620,8 +1666,10 @@ void test_l1_dsVideoPort_negative_dsIsHDCPEnabled(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get HDCP status after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsHDCPEnabled(handle[0], &(contentProtected[0])); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1714,8 +1762,10 @@ void test_l1_dsVideoPort_negative_dsEnableVideoPort(void) { bool enabled = true; // Example value for enabling/disabling the port // Step 01: Attempt to enable/disable video port without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsEnableVideoPort(-1, enabled); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -1736,8 +1786,10 @@ void test_l1_dsVideoPort_negative_dsEnableVideoPort(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 06: Attempt to enable/disable video port after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsEnableVideoPort(handle[0], enabled); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1835,8 +1887,10 @@ void test_l1_dsVideoPort_negative_dsSetResolution(void) { // Step 01: Attempt to set resolution without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsSetResolution(-1, &(kResolutions[0])); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -1870,8 +1924,10 @@ void test_l1_dsVideoPort_negative_dsSetResolution(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 08: Attempt to set resolution after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsSetResolution(handle[0], &(kResolutions[0])); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1985,8 +2041,10 @@ void test_l1_dsVideoPort_negative_dsGetResolution(void) { dsVideoPortResolution_t resolution[NUM_OF_PORTS]; // Step 01: Attempt to get resolution without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetResolution(-1, &(resolution[0])); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -2013,8 +2071,10 @@ void test_l1_dsVideoPort_negative_dsGetResolution(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get resolution after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetResolution(handle[0], &(resolution[0])); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2105,8 +2165,10 @@ void test_l1_dsVideoPort_negative_dsSetActiveSource(void) { intptr_t handle [NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; // Step 01: Attempt to set active source without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsSetActiveSource(-1); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -2127,8 +2189,10 @@ void test_l1_dsVideoPort_negative_dsSetActiveSource(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 06: Attempt to set active source after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsSetActiveSource(handle[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2212,8 +2276,10 @@ void test_l1_dsVideoPort_negative_dsVideoFormatUpdateRegisterCB(void) { dsError_t status; // Step 01: Attempt to register callback without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsVideoFormatUpdateRegisterCB(mockVideoFormatCallback); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -2228,8 +2294,10 @@ void test_l1_dsVideoPort_negative_dsVideoFormatUpdateRegisterCB(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 05: Attempt to register callback after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsVideoFormatUpdateRegisterCB(mockVideoFormatCallback); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2331,8 +2399,10 @@ void test_l1_dsVideoPort_negative_dsRegisterHdcpStatusCallback(void) { dsHDCPStatusCallback_t validHdcpStatusCallback = myHdcpStatusCallbackFunction; // Step 01: Attempt to register HDCP status callback without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsRegisterHdcpStatusCallback(-1, validHdcpStatusCallback); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -2358,8 +2428,10 @@ void test_l1_dsVideoPort_negative_dsRegisterHdcpStatusCallback(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to register HDCP status callback after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsRegisterHdcpStatusCallback(handle[0], validHdcpStatusCallback); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2469,8 +2541,10 @@ void test_l1_dsVideoPort_negative_dsGetHDCPStatus(void) { dsHdcpStatus_t hdcpStatus[NUM_OF_PORTS]; // Step 01: Attempt to get HDCP status without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHDCPStatus(-1, &(hdcpStatus[0])); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -2497,8 +2571,10 @@ void test_l1_dsVideoPort_negative_dsGetHDCPStatus(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get HDCP status after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHDCPStatus(handle[0], &(hdcpStatus[0])); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2608,8 +2684,10 @@ void test_l1_dsVideoPort_negative_dsGetHDCPProtocol(void) { dsHdcpProtocolVersion_t protocolVersion[NUM_OF_PORTS]; // Step 01: Attempt to get HDCP protocol without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHDCPProtocol(-1, &(protocolVersion[0])); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -2636,8 +2714,10 @@ void test_l1_dsVideoPort_negative_dsGetHDCPProtocol(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get HDCP protocol after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHDCPProtocol(handle[0], &protocolVersion[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2748,8 +2828,10 @@ void test_l1_dsVideoPort_negative_dsGetHDCPReceiverProtocol(void) { dsHdcpProtocolVersion_t receiverProtocolVersion[NUM_OF_PORTS]; // Step 01: Attempt to get Receiver HDCP protocol without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHDCPReceiverProtocol(-1, &receiverProtocolVersion[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -2776,8 +2858,10 @@ void test_l1_dsVideoPort_negative_dsGetHDCPReceiverProtocol(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get Receiver HDCP protocol after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHDCPReceiverProtocol(handle[0], &receiverProtocolVersion[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2887,8 +2971,10 @@ void test_l1_dsVideoPort_negative_dsGetHDCPCurrentProtocol(void) { dsHdcpProtocolVersion_t currentProtocolVersion[NUM_OF_PORTS]; // Step 01: Attempt to get current negotiated HDCP protocol without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHDCPCurrentProtocol(-1, ¤tProtocolVersion[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -2915,8 +3001,10 @@ void test_l1_dsVideoPort_negative_dsGetHDCPCurrentProtocol(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get current negotiated HDCP protocol after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHDCPCurrentProtocol(handle[0], ¤tProtocolVersion[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3026,8 +3114,10 @@ void test_l1_dsVideoPort_negative_dsGetTVHDRCapabilities(void) { int capabilities[NUM_OF_PORTS]; // Step 01: Attempt to get HDR capabilities without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetTVHDRCapabilities(-1, &capabilities[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -3054,8 +3144,10 @@ void test_l1_dsVideoPort_negative_dsGetTVHDRCapabilities(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get HDR capabilities after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetTVHDRCapabilities(handle[0], &capabilities[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3165,8 +3257,10 @@ void test_l1_dsVideoPort_negative_dsSupportedTvResolutions(void) { int resolutions[NUM_OF_PORTS]; // Step 01: Attempt to get supported resolutions without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsSupportedTvResolutions(-1, &resolutions[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -3193,8 +3287,10 @@ void test_l1_dsVideoPort_negative_dsSupportedTvResolutions(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get supported resolutions after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsSupportedTvResolutions(handle[0], &resolutions[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3561,8 +3657,10 @@ void test_l1_dsVideoPort_negative_dsGetVideoEOTF(void) { dsHDRStandard_t eotf[NUM_OF_PORTS]; // Step 01: Attempt to get EOTF without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetVideoEOTF(-1, &eotf[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -3589,8 +3687,10 @@ void test_l1_dsVideoPort_negative_dsGetVideoEOTF(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get EOTF after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetVideoEOTF(handle[0], &eotf[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3700,8 +3800,10 @@ void test_l1_dsVideoPort_negative_dsGetMatrixCoefficients(void) { dsDisplayMatrixCoefficients_t matrixCoefficients[NUM_OF_PORTS]; // Step 01: Attempt to get matrix coefficients without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetMatrixCoefficients(-1, &matrixCoefficients[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -3728,8 +3830,10 @@ void test_l1_dsVideoPort_negative_dsGetMatrixCoefficients(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get matrix coefficients after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetMatrixCoefficients(handle[0], &matrixCoefficients[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3839,8 +3943,10 @@ void test_l1_dsVideoPort_negative_dsGetColorDepth(void) { unsigned int colorDepth[NUM_OF_PORTS]; // To store the color depth // Step 01: Attempt to get color depth without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetColorDepth(-1, &colorDepth[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -3867,8 +3973,10 @@ void test_l1_dsVideoPort_negative_dsGetColorDepth(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get color depth after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetColorDepth(handle[0], &colorDepth[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3977,8 +4085,10 @@ void test_l1_dsVideoPort_negative_dsGetColorSpace(void) { dsDisplayColorSpace_t colorSpace[NUM_OF_PORTS]; // Step 01: Attempt to get color space without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetColorSpace(-1, &colorSpace[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -4005,8 +4115,10 @@ void test_l1_dsVideoPort_negative_dsGetColorSpace(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get color space after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetColorSpace(handle[0], &colorSpace[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4114,8 +4226,10 @@ void test_l1_dsVideoPort_negative_dsGetQuantizationRange(void) { dsDisplayQuantizationRange_t quantizationRange[NUM_OF_PORTS]; // Step 01: Attempt to get quantization range without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetQuantizationRange(-1, &quantizationRange[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -4142,8 +4256,10 @@ void test_l1_dsVideoPort_negative_dsGetQuantizationRange(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get quantization range after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetQuantizationRange(handle[0], &quantizationRange[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4274,9 +4390,11 @@ void test_l1_dsVideoPort_negative_dsGetCurrentOutputSettings(void) { dsDisplayQuantizationRange_t quant_rangearray[NUM_OF_PORTS]; // Step 01: Attempt to get output settings without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetCurrentOutputSettings(-1, &hdrstandardarray[0], &matrixcoefarray[0], &colorspacearray[0],\ &colordeptharray[0], &quant_rangearray[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -4333,9 +4451,11 @@ void test_l1_dsVideoPort_negative_dsGetCurrentOutputSettings(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 11: Attempt to get output settings after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetCurrentOutputSettings(handle[0], &hdrstandardarray[0], &matrixcoefarray[0], &colorspacearray[0],\ &colordeptharray[0], &quant_rangearray[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4446,8 +4566,10 @@ void test_l1_dsVideoPort_negative_dsIsOutputHDR(void) { bool hdrStatus[NUM_OF_PORTS]; // Step 01: Attempt to check HDR status without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsOutputHDR(-1, &hdrStatus[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -4474,8 +4596,10 @@ void test_l1_dsVideoPort_negative_dsIsOutputHDR(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to check HDR status after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsOutputHDR(handle[0], &hdrStatus[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4554,8 +4678,10 @@ void test_l1_dsVideoPort_negative_dsResetOutputToSDR(void) { dsError_t status; // Step 01: Attempt reset without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsResetOutputToSDR(); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -4566,8 +4692,10 @@ void test_l1_dsVideoPort_negative_dsResetOutputToSDR(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 04: Attempt reset after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsResetOutputToSDR(); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4665,8 +4793,10 @@ void test_l1_dsVideoPort_negative_dsSetHdmiPreference(void) { dsHdcpProtocolVersion_t in_range = dsHDCP_VERSION_1X , out_range = dsHDCP_VERSION_MAX; // Step 01: Attempt set HDMI preference without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsSetHdmiPreference(-1, &in_range); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -4693,8 +4823,10 @@ void test_l1_dsVideoPort_negative_dsSetHdmiPreference(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt set HDMI preference after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsSetHdmiPreference(handle[0], &in_range); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4804,8 +4936,10 @@ void test_l1_dsVideoPort_negative_dsGetHdmiPreference(void) { dsHdcpProtocolVersion_t hdcpCurrentProtocol[NUM_OF_PORTS]; // Step 01: Attempt to get HDMI preference without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHdmiPreference(-1, &hdcpCurrentProtocol[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -4832,8 +4966,10 @@ void test_l1_dsVideoPort_negative_dsGetHdmiPreference(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get HDMI preference after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHdmiPreference(handle[0], &hdcpCurrentProtocol[0]); UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } From 622c8ee90e70bc5bda819281bf2db040ff8e28b0 Mon Sep 17 00:00:00 2001 From: Sumip98 <167012926+Sumip98@users.noreply.github.com> Date: Thu, 9 May 2024 18:58:06 +0530 Subject: [PATCH 09/38] Device settings host Update --- src/test_l1_dsHost.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/test_l1_dsHost.c b/src/test_l1_dsHost.c index bee76779..850e1487 100644 --- a/src/test_l1_dsHost.c +++ b/src/test_l1_dsHost.c @@ -173,9 +173,11 @@ void test_l1_dsHost_negative_dsHostInit(void) { UT_LOG("Step 01: Initialize dsHost -> Expected: dsERR_NONE, Got: %d\n", result); // Step 02: Call dsHostInit() Attempt to initialize dsHost again + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsHostInit(); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_ALREADY_INITIALIZED); UT_LOG("Step 02: Attempt to initialize dsHost again -> Expected: dsERR_ALREADY_INITIALIZED, Got: %d\n", result); + #endif // Step 03: Call dsHostTerm() Terminate dsHost result = dsHostTerm(); @@ -258,9 +260,11 @@ void test_l1_dsHost_negative_dsHostTerm(void) { UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 01: dsHostTerm() Attempt to terminate dsHost without initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE dsError_t result = dsHostTerm(); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); UT_LOG("Step 01: Attempt to terminate dsHost without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); + #endif // Step 02: dsHostInit() Initialize dsHost result = dsHostInit(); @@ -273,9 +277,11 @@ void test_l1_dsHost_negative_dsHostTerm(void) { UT_LOG("Step 03: Terminate dsHost after initialization -> Expected: dsERR_NONE, Got: %d\n", result); // Step 04: dsHostTerm() Attempt to terminate dsHost again + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsHostTerm(); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); UT_LOG("Step 04: Attempt to terminate dsHost again -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); + #endif UT_LOG("\n Out %s\n",__FUNCTION__); } @@ -358,9 +364,11 @@ void test_l1_dsHost_negative_dsGetCPUTemperature(void) { float temperatureValue; // Step 01: dsGetCPUTemperature() Call without prior initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE dsError_t result = dsGetCPUTemperature(&temperatureValue); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); UT_LOG("Step 01: Fetch CPU Temperature without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); + #endif // Step 02: dsHostInit() Initialize dsHost result = dsHostInit(); @@ -368,9 +376,11 @@ void test_l1_dsHost_negative_dsGetCPUTemperature(void) { UT_LOG("Step 02: Initialize dsHost -> Expected: dsERR_NONE, Got: %d\n", result); // Step 03: dsGetCPUTemperature() Call with NULL pointer + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetCPUTemperature(NULL); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); UT_LOG("Step 03: Fetch CPU Temperature with NULL pointer -> Expected: dsERR_INVALID_PARAM, Got: %d\n", result); + #endif // Step 04: dsHostTerm() Terminate dsHost result = dsHostTerm(); @@ -378,9 +388,11 @@ void test_l1_dsHost_negative_dsGetCPUTemperature(void) { UT_LOG("Step 04: Terminate dsHost -> Expected: dsERR_NONE, Got: %d\n", result); // Step 05: dsGetCPUTemperature() Call after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetCPUTemperature(&temperatureValue); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); UT_LOG("Step 05: Fetch CPU Temperature after termination -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); + #endif UT_LOG("\n Out %s\n",__FUNCTION__); } @@ -470,9 +482,11 @@ void test_l1_dsHost_negative_dsGetSocIDFromSDK(void) { char socID[1024] = {0}; // Step 01: dsGetSocIDFromSDK() Call without prior initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE dsError_t result = dsGetSocIDFromSDK(socID); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); UT_LOG("Step 01: Fetch SOC ID without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); + #endif // Step 02: dsHostInit() Initialize dsHost result = dsHostInit(); @@ -490,9 +504,11 @@ void test_l1_dsHost_negative_dsGetSocIDFromSDK(void) { UT_LOG("Step 04: Terminate dsHost -> Expected: dsERR_NONE, Got: %d\n", result); // Step 05: dsGetSocIDFromSDK() Call after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSocIDFromSDK(socID); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); UT_LOG("Step 05: Fetch SOC ID after termination -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); + #endif UT_LOG("\n Out %s\n",__FUNCTION__); } @@ -586,9 +602,11 @@ void test_l1_dsHost_negative_dsGetHostEDID(void) { int length; // Step 01: dsGetHostEDID() Call without prior initialization + #ifdef ENABLE_ENHANCED_ERROR_CODE dsError_t result = dsGetHostEDID(edid, &length); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); UT_LOG("Step 01: Fetch Host EDID without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); + #endif // Step 02: dsHostInit() Initialize dsHost result = dsHostInit(); @@ -611,9 +629,11 @@ void test_l1_dsHost_negative_dsGetHostEDID(void) { UT_LOG("Step 04: Terminate dsHost -> Expected: dsERR_NONE, Got: %d\n", result); // Step 06: dsGetHostEDID() Call after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetHostEDID(edid, &length); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); UT_LOG("Step 05: Fetch Host EDID after termination -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); + #endif UT_LOG("\n Out %s\n",__FUNCTION__); } From 85a14e9ef0c16e2a402ec7a0f6f8cfdd0c2b1993 Mon Sep 17 00:00:00 2001 From: Sumip98 <167012926+Sumip98@users.noreply.github.com> Date: Thu, 9 May 2024 19:21:33 +0530 Subject: [PATCH 10/38] Adding Enhanced Error Code Flag Support --- src/test_l1_dsDisplay.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/test_l1_dsDisplay.c b/src/test_l1_dsDisplay.c index 5c064a5b..68153536 100644 --- a/src/test_l1_dsDisplay.c +++ b/src/test_l1_dsDisplay.c @@ -183,9 +183,12 @@ void test_l1_dsDisplay_negative_dsDisplayInit(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 02: Attempt to initialize the display module again + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsDisplayInit(); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_ALREADY_INITIALIZED); + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_ALREADY_INITIALIZED); + #endif + // Step 03: Terminate the display module result = dsDisplayTerm(); @@ -278,9 +281,11 @@ void test_l1_dsDisplay_negative_dsDisplayTerm(void) { int result; // Step 01: Call dsDisplayTerm() without initializing the display sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsDisplayTerm(); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize the display sub-system result = dsDisplayInit(); @@ -293,9 +298,11 @@ void test_l1_dsDisplay_negative_dsDisplayTerm(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: Call dsDisplayTerm() again after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsDisplayTerm(); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -401,9 +408,11 @@ void test_l1_dsDisplay_negative_dsGetDisplay(void) { intptr_t displayHandle; // Step 01: Call dsGetDisplay() without initializing the display sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDisplay(kSupportedPortTypes[0], 0, &displayHandle); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize the display sub-system result = dsDisplayInit(); @@ -431,9 +440,11 @@ void test_l1_dsDisplay_negative_dsGetDisplay(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetDisplay() again after termination + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDisplay(kSupportedPortTypes[0], 0, &displayHandle); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -558,9 +569,11 @@ void test_l1_dsDisplay_negative_dsGetEDID(void) { dsDisplayEDID_t *edid = {0}; // Step 01: Call dsGetEDID() without initializing the display sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetEDID(displayHandle, edid); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize the display sub-system result = dsDisplayInit(); @@ -587,9 +600,11 @@ void test_l1_dsDisplay_negative_dsGetEDID(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetEDID() without initializing the display sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetEDID(displayHandle, edid); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -727,6 +742,7 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { int length = 0; // Step 01: Call dsGetEDIDBytes() without initializing or obtaining a handle + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetEDIDBytes(displayHandle, edid, &length); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); if(result != dsERR_NOT_INITIALIZED) @@ -735,7 +751,7 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { free(edid); return; } - + #endif // Step 02: Initialize the display sub-system result = dsDisplayInit(); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); @@ -792,6 +808,7 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { } // Step 08: Call dsGetEDIDBytes() without initializing or obtaining a handle + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetEDIDBytes(displayHandle, edid, &length); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); if(result != dsERR_NOT_INITIALIZED) @@ -802,6 +819,7 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { } free(edid); + #endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -909,9 +927,11 @@ void test_l1_dsDisplay_negative_dsGetDisplayAspectRatio(void) { dsVideoAspectRatio_t aspectRatio; // Step 01: Call dsGetDisplayAspectRatio() without initializing the display sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDisplayAspectRatio(displayHandle, &aspectRatio); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize the display sub-system result = dsDisplayInit(); @@ -938,9 +958,11 @@ void test_l1_dsDisplay_negative_dsGetDisplayAspectRatio(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetDisplayAspectRatio() without initializing the display sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDisplayAspectRatio(displayHandle, &aspectRatio); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1041,9 +1063,11 @@ void test_l1_dsDisplay_negative_dsRegisterDisplayEventCallback(void) { const int portCount = sizeof(kSupportedPortTypes) / sizeof(kSupportedPortTypes[0]); // Step 01: Call dsRegisterDisplayEventCallback() without initializing the display sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsRegisterDisplayEventCallback(displayHandle, testDisplayCallback); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // Step 02: Initialize the display sub-system result = dsDisplayInit(); @@ -1071,9 +1095,11 @@ void test_l1_dsDisplay_negative_dsRegisterDisplayEventCallback(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Call dsRegisterDisplayEventCallback() without reinitializing the display sub-system + #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsRegisterDisplayEventCallback(displayHandle, testDisplayCallback); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1122,4 +1148,4 @@ int test_l1_dsDisplay_register ( void ) /** @} */ // End of DS_Display_HALTEST /** @} */ // End of Device_Settings_HALTEST /** @} */ // End of Device_Settings -/** @} */ // End of HPK \ No newline at end of file +/** @} */ // End of HPK From e725eb013ff83a8f65aabf4f4736259257725a80 Mon Sep 17 00:00:00 2001 From: drissya-k <167057835+drissya-k@users.noreply.github.com> Date: Mon, 13 May 2024 14:41:03 +0530 Subject: [PATCH 11/38] Adding Enhanced Error code support --- src/test_l1_dsHdmiIn.c | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/test_l1_dsHdmiIn.c b/src/test_l1_dsHdmiIn.c index 7bd5fae6..ea2fbe2a 100644 --- a/src/test_l1_dsHdmiIn.c +++ b/src/test_l1_dsHdmiIn.c @@ -322,6 +322,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetNumberOfInputs(void) { // Step 3: Call dsHdmiInGetNumberOfInputs() with NULL as the parameter #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetNumberOfInputs(NULL), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetNumberOfInputs(NULL), dsERR_NONE); #endif // Step 4: Call dsHdmiInTerm() to ensure deinitialization @@ -422,6 +424,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetStatus(void) { // Step 3: Call dsHdmiInGetStatus() with NULL as the parameter #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetStatus(NULL), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetStatus(NULL), dsERR_GENERAL); #endif // Step 4: Call dsHdmiInTerm() to ensure deinitialization @@ -664,6 +668,10 @@ void test_l1_dsHdmiIn_positive_dsHdmiInSelectZoomMode(void) { dsVideoZoom_t zoomMode = i; DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInSelectZoomMode(zoomMode), dsERR_NONE); } + #else + for (int i = dsVIDEO_ZOOM_NONE; i < dsVIDEO_ZOOM_MAX; i++) { + dsVideoZoom_t zoomMode = i; + DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInSelectZoomMode(zoomMode), dsERR_GENERAL); #endif // Step 3: Call dsHdmiInTerm() to ensure deinitialization @@ -707,6 +715,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInSelectZoomMode(void) { // Step 3: Call dsHdmiInSelectZoomMode() with invalid value (dsVIDEO_ZOOM_MAX) #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_MAX), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_MAX), dsERR_GENERAL); #endif // Step 4: Call dsHdmiInTerm() to ensure deinitialization @@ -807,6 +817,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetCurrentVideoMode(void) { // Step 3: dsHdmiInGetCurrentVideoMode() with NULL `resolution` pointer #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetCurrentVideoMode(NULL), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetCurrentVideoMode(NULL), dsERR_GENERAL); #endif // Step 4: Call dsHdmiInTerm() to ensure deinitialization @@ -1483,11 +1495,15 @@ void test_l1_dsHdmiIn_negative_dsIsHdmiARCPort(void) { // Step 3: Call dsIsHdmiARCPort() with invalid value (dsHDMI_IN_PORT_MAX) #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_MAX, &isArcPort), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_MAX, &isArcPort), dsERR_NONE); #endif // Step 4: Call dsIsHdmiARCPort() with invalid value (dsHDMI_IN_PORT_0) and NULL pointer #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, NULL), dsERR_NONE); #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization @@ -1607,16 +1623,22 @@ void test_l1_dsHdmiIn_negative_dsGetEDIDBytesInfo(void) { // Step 3: Call dsGetEDIDBytesInfo() with invalid value (dsHDMI_IN_PORT_MAX) #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_MAX, edidBytes, &edidSize), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_MAX, edidBytes, &edidSize), dsERR_GENERAL); #endif // Step 4: Call dsGetEDIDBytesInfo() with invalid value (NULL pointer) #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, NULL, &edidSize), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, NULL, &edidSize), dsERR_GENERAL); #endif // Step 5: Call dsGetEDIDBytesInfo() with invalid value (NULL pointer) #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, NULL), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, NULL), dsERR_GENERAL); #endif // Step 6: Call dsHdmiInTerm() to ensure deinitialization @@ -1729,11 +1751,15 @@ void test_l1_dsHdmiIn_negative_dsGetHDMISPDInfo(void) { // Step 3: Call dsGetHDMISPDInfo() with invalid values (dsHDMI_IN_PORT_MAX) #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_MAX, spdInfo1), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_MAX, spdInfo1), dsERR_GENERAL); #endif // Step 4: Call dsGetHDMISPDInfo() with invalid values (NULL pointer) #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, NULL), dsERR_GENERAL); #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization @@ -1829,11 +1855,15 @@ void test_l1_dsHdmiIn_negative_dsSetEdidVersion(void) { // Step 3: Call dsSetEdidVersion() with invalid inputs (dsHDMI_IN_PORT_MAX) #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdidVersion(dsHDMI_IN_PORT_MAX, HDMI_EDID_VER_14), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdidVersion(dsHDMI_IN_PORT_MAX, HDMI_EDID_VER_14), dsERR_GENERAL); #endif // Step 4: Call dsSetEdidVersion() with invalid inputs (HDMI_EDID_VER_MAX) #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_MAX), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_MAX), dsERR_GENERAL); #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization @@ -1924,11 +1954,15 @@ void test_l1_dsHdmiIn_negative_dsGetEdidVersion(void) { // Step 3: Call dsGetEdidVersion() with invalid inputs (dsHDMI_IN_PORT_MAX) #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdidVersion(dsHDMI_IN_PORT_MAX, &edid_version), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdidVersion(dsHDMI_IN_PORT_MAX, &edid_version), dsERR_GENERAL); #endif // Step 4: Call dsGetEdidVersion() with invalid inputs (NULL) #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, NULL), dsERR_GENERAL); #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization @@ -2029,11 +2063,15 @@ void test_l1_dsHdmiIn_negative_dsGetAllmStatus(void) { // Step 3: Call dsGetAllmStatus() without valid inputs (dsHDMI_IN_PORT_MAX) #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAllmStatus(dsHDMI_IN_PORT_MAX, &allm_status), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAllmStatus(dsHDMI_IN_PORT_MAX, &allm_status), dsERR_GENERAL); #endif // Step 4: Call dsGetAllmStatus() without valid inputs (NULL) #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, NULL), dsERR_GENERAL); #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization @@ -2126,6 +2164,8 @@ void test_l1_dsHdmiIn_negative_dsGetSupportedGameFeaturesList(void) { // Step 3: Call dsGetSupportedGameFeaturesList() with invalid input (NULL) #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetSupportedGameFeaturesList(NULL), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetSupportedGameFeaturesList(NULL), dsERR_GENERAL); #endif // Step 4: Call dsHdmiInTerm() to ensure deinitialization @@ -2213,11 +2253,15 @@ void test_l1_dsHdmiIn_negative_dsGetAVLatency(void) { // Step 3: Call dsGetAVLatency() with valid inputs (NULL, int*) #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAVLatency(NULL, &videoLatency), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAVLatency(NULL, &videoLatency), dsERR_NONE); #endif // Step 4: Call dsGetAVLatency() with valid inputs (int*, NULL) #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAVLatency(&audioLatency, NULL), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAVLatency(&audioLatency, NULL), dsERR_NONE); #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization @@ -2304,6 +2348,8 @@ void test_l1_dsHdmiIn_negative_dsSetEdid2AllmSupport(void) { // Step 3: Call dsSetEdid2AllmSupport() with an invalid HDMI port #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_MAX, true), dsERR_INVALID_PARAM); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_MAX, true), dsERR_GENERAL); #endif // Step 4: Terminate the HDMI input using dsHdmiInTerm() From 407ca9ae195d8aa52fa3b3d74df0a4ad3b60c672 Mon Sep 17 00:00:00 2001 From: drissya-k <167057835+drissya-k@users.noreply.github.com> Date: Mon, 13 May 2024 15:44:22 +0530 Subject: [PATCH 12/38] Adding Enhanced Error code support --- src/test_l1_dsVideoDevice.c | 138 +++++++++++++++++++++++------------- 1 file changed, 87 insertions(+), 51 deletions(-) diff --git a/src/test_l1_dsVideoDevice.c b/src/test_l1_dsVideoDevice.c index 6556faac..87c430b0 100644 --- a/src/test_l1_dsVideoDevice.c +++ b/src/test_l1_dsVideoDevice.c @@ -165,9 +165,11 @@ void test_l1_dsVideoDevice_negative_dsVideoDeviceInit(void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 02: Try initializing again without terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsVideoDeviceInit(); + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_ALREADY_INITIALIZED); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); #endif // Step 03: De-initialize the video devices for cleanup @@ -245,9 +247,11 @@ void test_l1_dsVideoDevice_negative_dsVideoDeviceTerm(void) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 01: Call de-initialization without prior initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE int result = dsVideoDeviceTerm(); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // Step 02: Initialize video devices @@ -259,9 +263,11 @@ void test_l1_dsVideoDevice_negative_dsVideoDeviceTerm(void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: Call de-initialization again without re-initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsVideoDeviceTerm(); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -336,9 +342,11 @@ void test_l1_dsVideoDevice_negative_dsGetVideoDevice(void) // Step 01: Get the video device handle without prior initialization intptr_t handle = -1; - #ifdef ENABLE_ENHANCED_ERROR_CODE int result = dsGetVideoDevice(0, &handle); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // Step 02: Initialize video devices @@ -346,25 +354,23 @@ void test_l1_dsVideoDevice_negative_dsGetVideoDevice(void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 03: Get the video device handle with invalid index - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoDevice(-1, &handle); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); - #endif // Step 04: Get the video device handle with valid index but null pointer for handle - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoDevice(0, NULL); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); - #endif // Step 05: De-initialize the video devices result = dsVideoDeviceTerm(); UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Get the video device handle after prior termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoDevice(0, &handle); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -462,9 +468,11 @@ void test_l1_dsVideoDevice_negative_dsSetDFC (void) intptr_t handle = -1; // 01: Call dsSetDFC() without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDFC(-1, dsVIDEO_ZOOM_NONE); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // 02: Initialize video devices @@ -477,25 +485,23 @@ void test_l1_dsVideoDevice_negative_dsSetDFC (void) UT_ASSERT_TRUE(handle >= 0); // 04: Call dsSetDFC() with an invalid handle - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDFC(-1, dsVIDEO_ZOOM_NONE); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); - #endif // 05: Call dsSetDFC() with an invalid zoom mode - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDFC(handle, dsVIDEO_ZOOM_MAX); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); - #endif // 06: De-initialize video devices result = dsVideoDeviceTerm(); UT_ASSERT_EQUAL(result, dsERR_NONE); // 07: Call dsSetDFC() after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDFC(handle, dsVIDEO_ZOOM_NONE); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -593,9 +599,11 @@ void test_l1_dsVideoDevice_negative_dsGetDFC(void) dsVideoZoom_t dfc_mode; // Step 01: Call dsGetDFC() without prior initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDFC(handle, &dfc_mode); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // Step 02: Initialize video devices @@ -620,9 +628,11 @@ void test_l1_dsVideoDevice_negative_dsGetDFC(void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetDFC() after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDFC(handle, &dfc_mode); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -721,9 +731,11 @@ void test_l1_dsVideoDevice_negative_dsGetHDRCapabilities(void) int hdr_capabilities; // Step 01: Call dsGetHDRCapabilities() without prior initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetHDRCapabilities(handle, &hdr_capabilities); // Note: using handle for HDR capabilities for this error case + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // Step 02: Initialize video devices @@ -736,25 +748,23 @@ void test_l1_dsVideoDevice_negative_dsGetHDRCapabilities(void) DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); // Step 04: Call dsGetHDRCapabilities() with an invalid handle - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetHDRCapabilities(-1, &hdr_capabilities); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); - #endif // Step 05: Call dsGetHDRCapabilities() with a null parameter - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetHDRCapabilities(handle, NULL); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); - #endif // Step 06: De-initialize the video devices result = dsVideoDeviceTerm(); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); // Step 07: Call dsGetHDRCapabilities() after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetHDRCapabilities(handle, &hdr_capabilities); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -852,9 +862,11 @@ void test_l1_dsVideoDevice_negative_dsGetSupportedVideoCodingFormats(void) unsigned int supported_formats; // Step 01: Call dsGetSupportedVideoCodingFormats() without prior initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSupportedVideoCodingFormats(handle, &supported_formats); // Note: using handle for supported formats for this error case + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // Step 02: Initialize video devices @@ -867,25 +879,23 @@ void test_l1_dsVideoDevice_negative_dsGetSupportedVideoCodingFormats(void) DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); // Step 04: Call dsGetSupportedVideoCodingFormats() with an invalid handle - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSupportedVideoCodingFormats(-1, &supported_formats); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); - #endif // Step 05: Call dsGetSupportedVideoCodingFormats() with a null value - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSupportedVideoCodingFormats(handle, NULL); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); - #endif // Step 06: De-initialize the video devices result = dsVideoDeviceTerm(); UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetSupportedVideoCodingFormats() after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSupportedVideoCodingFormats(handle, &supported_formats); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -932,27 +942,35 @@ void test_l1_dsVideoDevice_positive_dsGetVideoCodecInfo(void) DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); // Step 03: Get video codec information with dsVIDEO_CODEC_MPEGHPART2 - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEGHPART2, &codecInfo); + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_OPERATION_NOT_SUPPORTED); #endif // Step 04: Get video codec information with dsVIDEO_CODEC_MPEG4PART10 - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEG4PART10, &codecInfo); + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_OPERATION_NOT_SUPPORTED); #endif // Step 05: Get video codec information with dsVIDEO_CODEC_MPEG2 - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEG2, &codecInfo); + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_OPERATION_NOT_SUPPORTED); #endif // Step 06: Get video codec information with dsVIDEO_CODEC_MPEG2 (again to replicate the provided test case) - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEG2, &codecInfo); + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_OPERATION_NOT_SUPPORTED); #endif // Step 07: De-initialize the video devices @@ -998,9 +1016,11 @@ void test_l1_dsVideoDevice_negative_dsGetVideoCodecInfo(void) dsVideoCodecInfo_t codecInfo; // Step 01: Call dsGetVideoCodecInfo() without prior initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEGHPART2, &codecInfo); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_OPERATION_NOT_SUPPORTED); #endif // Step 02: Initialize video devices @@ -1013,31 +1033,27 @@ void test_l1_dsVideoDevice_negative_dsGetVideoCodecInfo(void) DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); // Step 04: Call dsGetVideoCodecInfo() with an invalid handle - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(-1, dsVIDEO_CODEC_MPEGHPART2, &codecInfo); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); - #endif // Step 05: Call dsGetVideoCodecInfo() with an invalid coding format - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MAX, &codecInfo); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); - #endif // Step 06: Call dsGetVideoCodecInfo() with a null parameter - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEGHPART2, NULL); DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); - #endif // Step 07: De-initialize the video devices result = dsVideoDeviceTerm(); UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Call dsGetVideoCodecInfo() after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEGHPART2, &codecInfo); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_OPERATION_NOT_SUPPORTED); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1129,9 +1145,11 @@ void test_l1_dsVideoDevice_negative_dsForceDisableHDRSupport(void) intptr_t handle = -1; // Step 01: Call dsForceDisableHDRSupport() without prior initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsForceDisableHDRSupport(handle, true); // Note: uninitialized 'handle' used here + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // Step 02: Initialize video devices @@ -1152,9 +1170,11 @@ void test_l1_dsVideoDevice_negative_dsForceDisableHDRSupport(void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Call dsForceDisableHDRSupport() after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsForceDisableHDRSupport(handle, true); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1243,9 +1263,11 @@ void test_l1_dsVideoDevice_negative_dsSetFRFMode(void) intptr_t handle = -1; // Step 01: Call dsSetFRFMode() without prior initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetFRFMode(handle, 60); // Note: uninitialized 'handle' used here + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // Step 02: Initialize video devices @@ -1270,9 +1292,11 @@ void test_l1_dsVideoDevice_negative_dsSetFRFMode(void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsSetFRFMode() after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetFRFMode(handle, 60); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1372,9 +1396,11 @@ void test_l1_dsVideoDevice_negative_dsGetFRFMode(void) int fetchedFRFMode; // Step 01: Call dsGetFRFMode() without prior initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetFRFMode(handle, &fetchedFRFMode); // Note: uninitialized 'handle' used here + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // Step 02: Initialize video devices @@ -1399,9 +1425,11 @@ void test_l1_dsVideoDevice_negative_dsGetFRFMode(void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetFRFMode() after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetFRFMode(handle, &fetchedFRFMode); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1501,9 +1529,11 @@ void test_l1_dsVideoDevice_negative_dsGetCurrentDisplayframerate(void) char fetchedFramerate[50]; // Assuming a buffer size, modify as necessary. // Step 01: Call dsGetCurrentDisplayframerate() without prior initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetCurrentDisplayframerate(handle, fetchedFramerate); // Note: uninitialized 'handle' used here + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // Step 02: Initialize video devices @@ -1528,9 +1558,11 @@ void test_l1_dsVideoDevice_negative_dsGetCurrentDisplayframerate(void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetCurrentDisplayframerate() after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetCurrentDisplayframerate(handle, fetchedFramerate); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1620,9 +1652,11 @@ void test_l1_dsVideoDevice_negative_dsSetDisplayframerate(void) intptr_t handle = -1; // Step 01: Call dsSetDisplayframerate() without prior initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDisplayframerate(handle, "30fps"); // Note: uninitialized 'handle' used here + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // Step 02: Initialize video devices @@ -1651,9 +1685,11 @@ void test_l1_dsVideoDevice_negative_dsSetDisplayframerate(void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Call dsSetDisplayframerate() after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDisplayframerate(handle, "30fps"); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); From 644a863678e046b6b27308561a4f12a72275e060 Mon Sep 17 00:00:00 2001 From: thanushreevani <157587255+thanushreevani@users.noreply.github.com> Date: Mon, 13 May 2024 15:54:49 +0530 Subject: [PATCH 13/38] gh #43 Update to address review comments --- src/test_l1_dsVideoPort.c | 332 ++++++++++++++++++++++++++++++-------- 1 file changed, 266 insertions(+), 66 deletions(-) diff --git a/src/test_l1_dsVideoPort.c b/src/test_l1_dsVideoPort.c index 1e1ae0bd..f43b0f66 100644 --- a/src/test_l1_dsVideoPort.c +++ b/src/test_l1_dsVideoPort.c @@ -170,9 +170,11 @@ void test_l1_dsVideoPort_negative_dsVideoPortInit(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 02: Attempt to initialize again without terminating the first initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsVideoPortInit(); + #ifdef ENABLE_ENHANCED_ERROR_CODE DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_ALREADY_INITIALIZED); + #else + DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_GENERAL); #endif // Step 03: Terminate video port system @@ -260,9 +262,11 @@ void test_l1_dsVideoPort_negative_dsVideoPortTerm(void) { dsError_t status; // Step 01: Attempt to terminate the video port without prior initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsVideoPortTerm(); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_NONE); #endif // Step 02: Initialize the video port system @@ -274,9 +278,11 @@ void test_l1_dsVideoPort_negative_dsVideoPortTerm(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 04: Attempt to terminate the video port again after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsVideoPortTerm(); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -377,9 +383,11 @@ void test_l1_dsVideoPort_negative_dsGetVideoPort(void) { intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; // Step 01: Attempt to get the Video Port handle without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetVideoPort(kPorts[0].id.type, kPorts[0].id.index, &(handle[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_NONE); #endif // Step 02: Initialize video port system @@ -413,9 +421,11 @@ void test_l1_dsVideoPort_negative_dsGetVideoPort(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get the video port handle again after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetVideoPort(kPorts[0].id.type, kPorts[0].id.index, &(handle[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -526,9 +536,11 @@ void test_l1_dsVideoPort_negative_dsIsVideoPortEnabled(void) { bool enabled[NUM_OF_PORTS]; // Step 01: Attempt to check enabled status without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsVideoPortEnabled(-1, &enabled[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -557,9 +569,11 @@ void test_l1_dsVideoPort_negative_dsIsVideoPortEnabled(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Check enabled status after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsVideoPortEnabled(handle[0], &enabled[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -669,9 +683,11 @@ void test_l1_dsVideoPort_negative_dsIsDisplayConnected(void) { bool connected[NUM_OF_PORTS]; // Step 01: Attempt to check connection status without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsDisplayConnected(-1 , &(connected[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -699,9 +715,11 @@ void test_l1_dsVideoPort_negative_dsIsDisplayConnected(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Check connection status after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsDisplayConnected(handle[0], &connected[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -811,7 +829,11 @@ void test_l1_dsVideoPort_negative_dsIsDisplaySurround(void) { // Step 01: Attempt to check audio surround support without initialization status = dsIsDisplaySurround(-1, &surround[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -838,9 +860,11 @@ void test_l1_dsVideoPort_negative_dsIsDisplaySurround(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Check audio surround support after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsDisplaySurround(handle[0], &surround[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -951,9 +975,11 @@ void test_l1_dsVideoPort_negative_dsGetSurroundMode(void) { int surroundMode[NUM_OF_PORTS]; // Step 01: Attempt to get surround mode without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetSurroundMode(-1, &surroundMode[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -981,9 +1007,11 @@ void test_l1_dsVideoPort_negative_dsGetSurroundMode(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get surround mode after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetSurroundMode(handle[0], &surroundMode[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1095,9 +1123,11 @@ void test_l1_dsVideoPort_negative_dsIsVideoPortActive(void) { bool active[NUM_OF_PORTS]; // Step 01: Attempt to check active status without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsVideoPortActive(-1, &active[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -1125,9 +1155,11 @@ void test_l1_dsVideoPort_negative_dsIsVideoPortActive(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to check active status after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsVideoPortActive(handle[0], &active[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1223,9 +1255,11 @@ void test_l1_dsVideoPort_negative_dsEnableDTCP(void) { bool enableDTCP = true; // Flag to enable/disable DTCP // Step 01: Attempt to enable DTCP without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsEnableDTCP(-1, enableDTCP); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -1247,9 +1281,11 @@ void test_l1_dsVideoPort_negative_dsEnableDTCP(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 06: Attempt to enable DTCP after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsEnableDTCP(handle[0], enableDTCP); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1350,9 +1386,11 @@ void test_l1_dsVideoPort_negative_dsEnableHDCP(void) { int keySize = HDCP_KEY_MAX_SIZE; // Step 01: Attempt to enable HDCP without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsEnableHDCP(-1, enableHDCP, hdcpKey, keySize); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -1382,9 +1420,11 @@ void test_l1_dsVideoPort_negative_dsEnableHDCP(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 08: Attempt to enable HDCP after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsEnableHDCP(handle[0], enableHDCP, hdcpKey, keySize); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1494,9 +1534,11 @@ void test_l1_dsVideoPort_negative_dsIsDTCPEnabled(void) { bool isDTCPEnabled[NUM_OF_PORTS]; // Step 01: Attempt to get DTCP status without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsDTCPEnabled(-1, &isDTCPEnabled[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -1524,9 +1566,11 @@ void test_l1_dsVideoPort_negative_dsIsDTCPEnabled(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get DTCP status after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsDTCPEnabled(handle[0], &isDTCPEnabled[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1636,9 +1680,11 @@ void test_l1_dsVideoPort_negative_dsIsHDCPEnabled(void) { bool contentProtected[NUM_OF_PORTS]; // Step 01: Attempt to get HDCP status without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsHDCPEnabled(-1, &(contentProtected[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -1666,9 +1712,11 @@ void test_l1_dsVideoPort_negative_dsIsHDCPEnabled(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get HDCP status after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsHDCPEnabled(handle[0], &(contentProtected[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1762,9 +1810,11 @@ void test_l1_dsVideoPort_negative_dsEnableVideoPort(void) { bool enabled = true; // Example value for enabling/disabling the port // Step 01: Attempt to enable/disable video port without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsEnableVideoPort(-1, enabled); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -1786,9 +1836,11 @@ void test_l1_dsVideoPort_negative_dsEnableVideoPort(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 06: Attempt to enable/disable video port after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsEnableVideoPort(handle[0], enabled); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1887,9 +1939,11 @@ void test_l1_dsVideoPort_negative_dsSetResolution(void) { // Step 01: Attempt to set resolution without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsSetResolution(-1, &(kResolutions[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -1924,9 +1978,11 @@ void test_l1_dsVideoPort_negative_dsSetResolution(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 08: Attempt to set resolution after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsSetResolution(handle[0], &(kResolutions[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2041,9 +2097,11 @@ void test_l1_dsVideoPort_negative_dsGetResolution(void) { dsVideoPortResolution_t resolution[NUM_OF_PORTS]; // Step 01: Attempt to get resolution without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetResolution(-1, &(resolution[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -2071,9 +2129,11 @@ void test_l1_dsVideoPort_negative_dsGetResolution(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get resolution after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetResolution(handle[0], &(resolution[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2165,9 +2225,11 @@ void test_l1_dsVideoPort_negative_dsSetActiveSource(void) { intptr_t handle [NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; // Step 01: Attempt to set active source without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsSetActiveSource(-1); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -2189,9 +2251,11 @@ void test_l1_dsVideoPort_negative_dsSetActiveSource(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 06: Attempt to set active source after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsSetActiveSource(handle[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2276,9 +2340,11 @@ void test_l1_dsVideoPort_negative_dsVideoFormatUpdateRegisterCB(void) { dsError_t status; // Step 01: Attempt to register callback without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsVideoFormatUpdateRegisterCB(mockVideoFormatCallback); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -2294,9 +2360,11 @@ void test_l1_dsVideoPort_negative_dsVideoFormatUpdateRegisterCB(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 05: Attempt to register callback after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsVideoFormatUpdateRegisterCB(mockVideoFormatCallback); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2399,9 +2467,11 @@ void test_l1_dsVideoPort_negative_dsRegisterHdcpStatusCallback(void) { dsHDCPStatusCallback_t validHdcpStatusCallback = myHdcpStatusCallbackFunction; // Step 01: Attempt to register HDCP status callback without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsRegisterHdcpStatusCallback(-1, validHdcpStatusCallback); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -2428,9 +2498,11 @@ void test_l1_dsVideoPort_negative_dsRegisterHdcpStatusCallback(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to register HDCP status callback after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsRegisterHdcpStatusCallback(handle[0], validHdcpStatusCallback); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2541,9 +2613,11 @@ void test_l1_dsVideoPort_negative_dsGetHDCPStatus(void) { dsHdcpStatus_t hdcpStatus[NUM_OF_PORTS]; // Step 01: Attempt to get HDCP status without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHDCPStatus(-1, &(hdcpStatus[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -2571,9 +2645,11 @@ void test_l1_dsVideoPort_negative_dsGetHDCPStatus(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get HDCP status after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHDCPStatus(handle[0], &(hdcpStatus[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2684,9 +2760,11 @@ void test_l1_dsVideoPort_negative_dsGetHDCPProtocol(void) { dsHdcpProtocolVersion_t protocolVersion[NUM_OF_PORTS]; // Step 01: Attempt to get HDCP protocol without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHDCPProtocol(-1, &(protocolVersion[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -2714,9 +2792,11 @@ void test_l1_dsVideoPort_negative_dsGetHDCPProtocol(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get HDCP protocol after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHDCPProtocol(handle[0], &protocolVersion[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2828,9 +2908,11 @@ void test_l1_dsVideoPort_negative_dsGetHDCPReceiverProtocol(void) { dsHdcpProtocolVersion_t receiverProtocolVersion[NUM_OF_PORTS]; // Step 01: Attempt to get Receiver HDCP protocol without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHDCPReceiverProtocol(-1, &receiverProtocolVersion[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -2858,9 +2940,11 @@ void test_l1_dsVideoPort_negative_dsGetHDCPReceiverProtocol(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get Receiver HDCP protocol after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHDCPReceiverProtocol(handle[0], &receiverProtocolVersion[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2971,9 +3055,11 @@ void test_l1_dsVideoPort_negative_dsGetHDCPCurrentProtocol(void) { dsHdcpProtocolVersion_t currentProtocolVersion[NUM_OF_PORTS]; // Step 01: Attempt to get current negotiated HDCP protocol without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHDCPCurrentProtocol(-1, ¤tProtocolVersion[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -3001,9 +3087,11 @@ void test_l1_dsVideoPort_negative_dsGetHDCPCurrentProtocol(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get current negotiated HDCP protocol after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHDCPCurrentProtocol(handle[0], ¤tProtocolVersion[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3114,9 +3202,11 @@ void test_l1_dsVideoPort_negative_dsGetTVHDRCapabilities(void) { int capabilities[NUM_OF_PORTS]; // Step 01: Attempt to get HDR capabilities without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetTVHDRCapabilities(-1, &capabilities[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -3144,9 +3234,11 @@ void test_l1_dsVideoPort_negative_dsGetTVHDRCapabilities(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get HDR capabilities after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetTVHDRCapabilities(handle[0], &capabilities[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3257,9 +3349,11 @@ void test_l1_dsVideoPort_negative_dsSupportedTvResolutions(void) { int resolutions[NUM_OF_PORTS]; // Step 01: Attempt to get supported resolutions without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsSupportedTvResolutions(-1, &resolutions[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -3287,9 +3381,11 @@ void test_l1_dsVideoPort_negative_dsSupportedTvResolutions(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get supported resolutions after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsSupportedTvResolutions(handle[0], &resolutions[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3386,7 +3482,11 @@ void test_l1_dsVideoPort_negative_dsSetForceDisable4KSupport(void) { // Step 01: Attempt to set force disable 4K support without initialization status = dsSetForceDisable4KSupport(-1, disable4K); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -3408,7 +3508,11 @@ void test_l1_dsVideoPort_negative_dsSetForceDisable4KSupport(void) { // Step 06: Attempt to set force disable 4K support after termination status = dsSetForceDisable4KSupport(handle[0], disable4K); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3519,7 +3623,11 @@ void test_l1_dsVideoPort_negative_dsGetForceDisable4KSupport(void) { // Step 01: Attempt to get 4K support status without initialization status = dsGetForceDisable4KSupport(-1, &disable4K[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -3547,7 +3655,11 @@ void test_l1_dsVideoPort_negative_dsGetForceDisable4KSupport(void) { // Step 07: Attempt to get 4K support status after termination status = dsGetForceDisable4KSupport(handle[0], &disable4K[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3657,9 +3769,11 @@ void test_l1_dsVideoPort_negative_dsGetVideoEOTF(void) { dsHDRStandard_t eotf[NUM_OF_PORTS]; // Step 01: Attempt to get EOTF without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetVideoEOTF(-1, &eotf[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -3687,9 +3801,11 @@ void test_l1_dsVideoPort_negative_dsGetVideoEOTF(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get EOTF after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetVideoEOTF(handle[0], &eotf[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3800,9 +3916,11 @@ void test_l1_dsVideoPort_negative_dsGetMatrixCoefficients(void) { dsDisplayMatrixCoefficients_t matrixCoefficients[NUM_OF_PORTS]; // Step 01: Attempt to get matrix coefficients without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetMatrixCoefficients(-1, &matrixCoefficients[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -3830,9 +3948,11 @@ void test_l1_dsVideoPort_negative_dsGetMatrixCoefficients(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get matrix coefficients after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetMatrixCoefficients(handle[0], &matrixCoefficients[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3943,9 +4063,11 @@ void test_l1_dsVideoPort_negative_dsGetColorDepth(void) { unsigned int colorDepth[NUM_OF_PORTS]; // To store the color depth // Step 01: Attempt to get color depth without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetColorDepth(-1, &colorDepth[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -3973,9 +4095,11 @@ void test_l1_dsVideoPort_negative_dsGetColorDepth(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get color depth after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetColorDepth(handle[0], &colorDepth[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4085,9 +4209,11 @@ void test_l1_dsVideoPort_negative_dsGetColorSpace(void) { dsDisplayColorSpace_t colorSpace[NUM_OF_PORTS]; // Step 01: Attempt to get color space without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetColorSpace(-1, &colorSpace[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -4115,9 +4241,11 @@ void test_l1_dsVideoPort_negative_dsGetColorSpace(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get color space after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetColorSpace(handle[0], &colorSpace[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4226,9 +4354,11 @@ void test_l1_dsVideoPort_negative_dsGetQuantizationRange(void) { dsDisplayQuantizationRange_t quantizationRange[NUM_OF_PORTS]; // Step 01: Attempt to get quantization range without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetQuantizationRange(-1, &quantizationRange[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -4256,9 +4386,11 @@ void test_l1_dsVideoPort_negative_dsGetQuantizationRange(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get quantization range after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetQuantizationRange(handle[0], &quantizationRange[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4390,10 +4522,12 @@ void test_l1_dsVideoPort_negative_dsGetCurrentOutputSettings(void) { dsDisplayQuantizationRange_t quant_rangearray[NUM_OF_PORTS]; // Step 01: Attempt to get output settings without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetCurrentOutputSettings(-1, &hdrstandardarray[0], &matrixcoefarray[0], &colorspacearray[0],\ &colordeptharray[0], &quant_rangearray[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -4451,10 +4585,12 @@ void test_l1_dsVideoPort_negative_dsGetCurrentOutputSettings(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 11: Attempt to get output settings after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetCurrentOutputSettings(handle[0], &hdrstandardarray[0], &matrixcoefarray[0], &colorspacearray[0],\ &colordeptharray[0], &quant_rangearray[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4566,9 +4702,11 @@ void test_l1_dsVideoPort_negative_dsIsOutputHDR(void) { bool hdrStatus[NUM_OF_PORTS]; // Step 01: Attempt to check HDR status without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsOutputHDR(-1, &hdrStatus[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -4596,9 +4734,11 @@ void test_l1_dsVideoPort_negative_dsIsOutputHDR(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to check HDR status after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsIsOutputHDR(handle[0], &hdrStatus[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4678,9 +4818,11 @@ void test_l1_dsVideoPort_negative_dsResetOutputToSDR(void) { dsError_t status; // Step 01: Attempt reset without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsResetOutputToSDR(); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_NONE); #endif // Step 02: Initialize video port system @@ -4692,9 +4834,11 @@ void test_l1_dsVideoPort_negative_dsResetOutputToSDR(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 04: Attempt reset after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsResetOutputToSDR(); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4793,9 +4937,11 @@ void test_l1_dsVideoPort_negative_dsSetHdmiPreference(void) { dsHdcpProtocolVersion_t in_range = dsHDCP_VERSION_1X , out_range = dsHDCP_VERSION_MAX; // Step 01: Attempt set HDMI preference without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsSetHdmiPreference(-1, &in_range); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -4823,9 +4969,11 @@ void test_l1_dsVideoPort_negative_dsSetHdmiPreference(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt set HDMI preference after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsSetHdmiPreference(handle[0], &in_range); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4936,9 +5084,11 @@ void test_l1_dsVideoPort_negative_dsGetHdmiPreference(void) { dsHdcpProtocolVersion_t hdcpCurrentProtocol[NUM_OF_PORTS]; // Step 01: Attempt to get HDMI preference without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHdmiPreference(-1, &hdcpCurrentProtocol[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif // Step 02: Initialize video port system @@ -4966,9 +5116,11 @@ void test_l1_dsVideoPort_negative_dsGetHdmiPreference(void) { UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 07: Attempt to get HDMI preference after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE status = dsGetHdmiPreference(handle[0], &hdcpCurrentProtocol[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -5080,7 +5232,11 @@ void test_l1_dsVideoPort_negative_dsGetIgnoreEDIDStatus(void) { // Step 01: Attempt to get IgnoreEDID status without initialization status = dsGetIgnoreEDIDStatus(-1, &ignoreEDIDStatus[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -5108,7 +5264,11 @@ void test_l1_dsVideoPort_negative_dsGetIgnoreEDIDStatus(void) { // Step 07: Attempt to get IgnoreEDID status after termination status = dsGetIgnoreEDIDStatus(handle[0], &ignoreEDIDStatus[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5203,7 +5363,11 @@ void test_l1_dsVideoPort_negative_dsSetBackgroundColor(void) { // Step 01: Attempt to set background color without initialization status = dsSetBackgroundColor(-1, dsVIDEO_BGCOLOR_BLUE); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -5231,7 +5395,11 @@ void test_l1_dsVideoPort_negative_dsSetBackgroundColor(void) { // Step 07: Attempt to set background color after termination status = dsSetBackgroundColor(handle[0], dsVIDEO_BGCOLOR_BLACK); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5326,7 +5494,11 @@ void test_l1_dsVideoPort_negative_dsSetForceHDRMode(void) { // Step 01: Attempt to set HDR mode without initialization status = dsSetForceHDRMode(-1, dsHDRSTANDARD_HDR10 ); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -5354,7 +5526,11 @@ void test_l1_dsVideoPort_negative_dsSetForceHDRMode(void) { // Step 07: Attempt to set HDR mode after termination status = dsSetForceHDRMode(handle[0], dsHDRSTANDARD_HDR10); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5465,7 +5641,11 @@ void test_l1_dsVideoPort_negative_dsColorDepthCapabilities(void) { // Step 01: Attempt to get capabilities without initialization status = dsColorDepthCapabilities(-1, &colorDepthCapability[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -5493,7 +5673,11 @@ void test_l1_dsVideoPort_negative_dsColorDepthCapabilities(void) { // Step 07: Attempt to get capabilities after termination status = dsColorDepthCapabilities(handle[0], &colorDepthCapability[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5604,7 +5788,11 @@ void test_l1_dsVideoPort_negative_dsGetPreferredColorDepth(void) { // Step 01: Attempt to get color depth without initialization status = dsGetPreferredColorDepth(-1, &colorDepth[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -5632,7 +5820,11 @@ void test_l1_dsVideoPort_negative_dsGetPreferredColorDepth(void) { // Step 07: Attempt to get color depth after termination status = dsGetPreferredColorDepth(handle[0], &colorDepth[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5727,7 +5919,11 @@ void test_l1_dsVideoPort_negative_dsSetPreferredColorDepth(void) { // Step 01: Attempt to set color depth without initialization status = dsSetPreferredColorDepth(-1, dsDISPLAY_COLORDEPTH_8BIT ); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -5755,7 +5951,11 @@ void test_l1_dsVideoPort_negative_dsSetPreferredColorDepth(void) { // Step 07: Attempt to set color depth after termination status = dsSetPreferredColorDepth(handle[0], dsDISPLAY_COLORDEPTH_12BIT ); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif UT_LOG("\n Out %s\n", __FUNCTION__); } From 045fea2f43856bb99d24d6c29c4826eb13065cbe Mon Sep 17 00:00:00 2001 From: drissya-k <167057835+drissya-k@users.noreply.github.com> Date: Mon, 13 May 2024 18:10:16 +0530 Subject: [PATCH 14/38] Adding Enhanced Error code support --- src/test_l1_dsHdmiIn.c | 374 +++++++++++++++++++++++++---------------- 1 file changed, 231 insertions(+), 143 deletions(-) diff --git a/src/test_l1_dsHdmiIn.c b/src/test_l1_dsHdmiIn.c index ea2fbe2a..b9e1a5b0 100644 --- a/src/test_l1_dsHdmiIn.c +++ b/src/test_l1_dsHdmiIn.c @@ -156,7 +156,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInInit(void) { // Step 2: Call dsHdmiInInit() again without terminating the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInInit(), dsERR_ALREADY_INITIALIZED); + UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_ALREADY_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); #endif // Step 3: Call dsHdmiInTerm() to ensure deinitialization @@ -227,6 +229,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInTerm(void) { // Step 1: Call dsHdmiInTerm() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() @@ -238,6 +242,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInTerm(void) { // Step 4: Call dsHdmiInTerm() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -271,13 +277,13 @@ void test_l1_dsHdmiIn_positive_dsHdmiInGetNumberOfInputs(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Call dsHdmiInGetNumberOfInputs() to fetch the number of HDMI input ports - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetNumberOfInputs(&numInputs1), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInGetNumberOfInputs(&numInputs1), dsERR_NONE); // Step 3: Call dsHdmiInGetNumberOfInputs() again to fetch the number of HDMI input ports - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetNumberOfInputs(&numInputs2), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInGetNumberOfInputs(&numInputs2), dsERR_NONE); // Step 4: Compare the results to make sure they are equal - DS_ASSERT_AUTO_TERM_NUMERICAL(numInputs1, numInputs2); + UT_ASSERT_EQUAL(numInputs1, numInputs2); // Step 5: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -314,6 +320,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetNumberOfInputs(void) { // Step 1: Call dsHdmiInGetNumberOfInputs() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInGetNumberOfInputs(&numInputs), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInGetNumberOfInputs(&numInputs), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() @@ -321,9 +329,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetNumberOfInputs(void) { // Step 3: Call dsHdmiInGetNumberOfInputs() with NULL as the parameter #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetNumberOfInputs(NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInGetNumberOfInputs(NULL), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetNumberOfInputs(NULL), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInGetNumberOfInputs(NULL), dsERR_NONE); #endif // Step 4: Call dsHdmiInTerm() to ensure deinitialization @@ -332,6 +340,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetNumberOfInputs(void) { // Step 5: Call dsHdmiInGetNumberOfInputs() after termination of the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInGetNumberOfInputs(&numInputs), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInGetNumberOfInputs(&numInputs), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -366,19 +376,19 @@ void test_l1_dsHdmiIn_positive_dsHdmiInGetStatus(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Call dsHdmiInGetStatus() - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetStatus(&status1), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInGetStatus(&status1), dsERR_NONE); // Step 3: Call dsHdmiInGetStatus() again - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetStatus(&status2), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInGetStatus(&status2), dsERR_NONE); // Step 4: Compare the returned values to make sure they are equal - DS_ASSERT_AUTO_TERM_NUMERICAL(status1.isPresented, status2.isPresented); - DS_ASSERT_AUTO_TERM_NUMERICAL(status1.activePort, status2.activePort); + UT_ASSERT_EQUAL(status1.isPresented, status2.isPresented); + UT_ASSERT_EQUAL(status1.activePort, status2.activePort); for (int i = 0; i < dsHDMI_IN_PORT_MAX; i++) { UT_LOG("\n In %s Comparing isPresented:[%d,%d]\n", __FUNCTION__, status1.isPresented, status2.isPresented); UT_LOG("\n In %s Comparing activePort:[%d,%d]\n", __FUNCTION__, status1.activePort, status2.activePort); UT_LOG("\n In %s Comparing isPortConnected:[%d,%d]\n", __FUNCTION__, status1.isPortConnected[i], status2.isPortConnected[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status1.isPortConnected[i], status2.isPortConnected[i]); + UT_ASSERT_EQUAL(status1.isPortConnected[i], status2.isPortConnected[i]); } // Step 5: Call dsHdmiInTerm() to ensure deinitialization @@ -416,6 +426,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetStatus(void) { // Step 1: Call dsHdmiInGetStatus() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInGetStatus(&status), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInGetStatus(&status), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() @@ -423,9 +435,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetStatus(void) { // Step 3: Call dsHdmiInGetStatus() with NULL as the parameter #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetStatus(NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInGetStatus(NULL), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetStatus(NULL), dsERR_GENERAL); + UT_ASSERT_EQUAL(dsHdmiInGetStatus(NULL), dsERR_GENERAL); #endif // Step 4: Call dsHdmiInTerm() to ensure deinitialization @@ -434,6 +446,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetStatus(void) { // Step 5: Call dsHdmiInGetStatus() after terminating the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInGetStatus(&status), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInGetStatus(&status), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -465,13 +479,13 @@ void test_l1_dsHdmiIn_positive_dsHdmiInSelectPort(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Call dsHdmiInSelectPort() to select Port 0 - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false), dsERR_NONE); // Step 3: Call dsHdmiInSelectPort() to select Port 1 - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_1, true, dsVideoPlane_SECONDARY, true), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_1, true, dsVideoPlane_SECONDARY, true), dsERR_NONE); // Step 4: Call dsHdmiInSelectPort() to select Port 2 - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_2, false, dsVideoPlane_PRIMARY, false), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_2, false, dsVideoPlane_PRIMARY, false), dsERR_NONE); // Step 5: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -507,16 +521,18 @@ void test_l1_dsHdmiIn_negative_dsHdmiInSelectPort(void) { // Step 1: Call dsHdmiInSelectPort() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsHdmiInSelectPort() with an invalid value - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_MAX, false, dsVideoPlane_PRIMARY, false), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_MAX, false, dsVideoPlane_PRIMARY, false), dsERR_INVALID_PARAM); // Step 4: Call dsHdmiInSelectPort() with an invalid plane value - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_MAX, false), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_MAX, false), dsERR_INVALID_PARAM); // Step 5: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -524,6 +540,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInSelectPort(void) { // Step 6: Call dsHdmiInSelectPort() after terminating the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -555,13 +573,13 @@ void test_l1_dsHdmiIn_positive_dsHdmiInScaleVideo(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Scale HDMI input video (x=0, y=0, width=800, height=600) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInScaleVideo(0, 0, 800, 600), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInScaleVideo(0, 0, 800, 600), dsERR_NONE); // Step 3: Scale HDMI input video (x=10, y=10, width=1000, height=800) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInScaleVideo(10, 10, 1000, 800), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInScaleVideo(10, 10, 1000, 800), dsERR_NONE); // Step 4: Scale HDMI input video (x=-10, y=-10, width=800, height=600) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInScaleVideo(100, 100, 800, 600), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInScaleVideo(100, 100, 800, 600), dsERR_NONE); // Step 5: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -602,31 +620,33 @@ void test_l1_dsHdmiIn_negative_dsHdmiInScaleVideo(void) { // Step 1: Call dsHdmiInScaleVideo() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInScaleVideo(0, 0, 800, 600), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInScaleVideo(0, 0, 800, 600), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: dsHdmiInScaleVideo() with invalid parameters (x=0, y=0, width=2000, height=600) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInScaleVideo(0, 0, 2000, 600), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInScaleVideo(0, 0, 2000, 600), dsERR_INVALID_PARAM); // Step 4: dsHdmiInScaleVideo() with out of bounds parameters (x=-1000, y=0, width=800, height=600) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInScaleVideo(-1000, 0, 800, 600), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInScaleVideo(-1000, 0, 800, 600), dsERR_INVALID_PARAM); // Step 5: dsHdmiInScaleVideo() with out of bounds parameters (x=0, y=0, width=-800, height=600) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInScaleVideo(0, 0, -800, 600), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInScaleVideo(0, 0, -800, 600), dsERR_INVALID_PARAM); // Step 6: dsHdmiInScaleVideo() with out of bounds parameters (x=0, y=0, width=800, height=-600) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInScaleVideo(0, 0, 800, -600), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInScaleVideo(0, 0, 800, -600), dsERR_INVALID_PARAM); // Step 7: dsHdmiInScaleVideo() with out of bounds parameters (x=0, y=-1000, width=800, height=600) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInScaleVideo(0, -1000, 800, 600), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInScaleVideo(0, -1000, 800, 600), dsERR_INVALID_PARAM); // Step 8: dsHdmiInScaleVideo() with out of bounds parameters (x=0, y=20000, width=800, height=600) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInScaleVideo(0, 20000, 800, 600), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInScaleVideo(0, 20000, 800, 600), dsERR_INVALID_PARAM); // Step 9: dsHdmiInScaleVideo() with out of bounds parameters (x=20000, y=0, width=800, height=600) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInScaleVideo(20000, 0, 800, 600), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInScaleVideo(20000, 0, 800, 600), dsERR_INVALID_PARAM); // Step 10: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -634,6 +654,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInScaleVideo(void) { // Step 11: dsHdmiInScaleVideo() after terminating the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInScaleVideo(0, 0, 800, 600), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInScaleVideo(0, 0, 800, 600), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -663,16 +685,10 @@ void test_l1_dsHdmiIn_positive_dsHdmiInSelectZoomMode(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Loop through all dsVideoZoom_t values and call dsHdmiInSelectZoomMode() - #ifdef ENABLE_ENHANCED_ERROR_CODE for (int i = dsVIDEO_ZOOM_NONE; i < dsVIDEO_ZOOM_MAX; i++) { dsVideoZoom_t zoomMode = i; - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInSelectZoomMode(zoomMode), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInSelectZoomMode(zoomMode), dsERR_NONE); } - #else - for (int i = dsVIDEO_ZOOM_NONE; i < dsVIDEO_ZOOM_MAX; i++) { - dsVideoZoom_t zoomMode = i; - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInSelectZoomMode(zoomMode), dsERR_GENERAL); - #endif // Step 3: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -707,6 +723,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInSelectZoomMode(void) { // Step 1: Call dsHdmiInSelectZoomMode() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_NONE), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_NONE), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() @@ -714,9 +732,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInSelectZoomMode(void) { // Step 3: Call dsHdmiInSelectZoomMode() with invalid value (dsVIDEO_ZOOM_MAX) #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_MAX), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_MAX), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_MAX), dsERR_GENERAL); + UT_ASSERT_EQUAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_MAX), dsERR_GENERAL); #endif // Step 4: Call dsHdmiInTerm() to ensure deinitialization @@ -725,6 +743,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInSelectZoomMode(void) { // Step 5: Call dsHdmiInSelectZoomMode() without terminating the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_NONE), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_NONE), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -758,22 +778,22 @@ void test_l1_dsHdmiIn_positive_dsHdmiInGetCurrentVideoMode(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Retrieve the current HDMI video mode using dsHdmiInGetCurrentVideoMode() - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetCurrentVideoMode(&resolution1), dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetCurrentVideoMode(&resolution2), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInGetCurrentVideoMode(&resolution1), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInGetCurrentVideoMode(&resolution2), dsERR_NONE); // Step 3: Ensure returned values are the same UT_LOG("\n In %s Name: [%d,%d]\n", __FUNCTION__, resolution1.name, resolution2.name); - DS_ASSERT_AUTO_TERM_NUMERICAL(resolution1.name, resolution2.name); + UT_ASSERT_EQUAL(resolution1.name, resolution2.name); UT_LOG("\n In %s pixelResolution: [%d,%d]\n", __FUNCTION__, resolution1.pixelResolution, resolution2.pixelResolution); - DS_ASSERT_AUTO_TERM_NUMERICAL(resolution1.pixelResolution, resolution2.pixelResolution); + UT_ASSERT_EQUAL(resolution1.pixelResolution, resolution2.pixelResolution); UT_LOG("\n In %s aspectRatio: [%d,%d]\n", __FUNCTION__, resolution1.aspectRatio, resolution2.aspectRatio); - DS_ASSERT_AUTO_TERM_NUMERICAL(resolution1.aspectRatio, resolution2.aspectRatio); + UT_ASSERT_EQUAL(resolution1.aspectRatio, resolution2.aspectRatio); UT_LOG("\n In %s stereoScopicMode: [%d,%d]\n", __FUNCTION__, resolution1.stereoScopicMode, resolution2.stereoScopicMode); - DS_ASSERT_AUTO_TERM_NUMERICAL(resolution1.stereoScopicMode, resolution2.stereoScopicMode); + UT_ASSERT_EQUAL(resolution1.stereoScopicMode, resolution2.stereoScopicMode); UT_LOG("\n In %s frameRate: [%d,%d]\n", __FUNCTION__, resolution1.frameRate, resolution2.frameRate); - DS_ASSERT_AUTO_TERM_NUMERICAL(resolution1.frameRate, resolution2.frameRate); + UT_ASSERT_EQUAL(resolution1.frameRate, resolution2.frameRate); UT_LOG("\n In %s interlaced: [%d,%d]\n", __FUNCTION__, resolution1.interlaced, resolution2.interlaced); - DS_ASSERT_AUTO_TERM_NUMERICAL(resolution1.interlaced, resolution2.interlaced); + UT_ASSERT_EQUAL(resolution1.interlaced, resolution2.interlaced); // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -809,6 +829,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetCurrentVideoMode(void) { dsVideoPortResolution_t resolution; #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInGetCurrentVideoMode(&resolution), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInGetCurrentVideoMode(&resolution), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() @@ -816,9 +838,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetCurrentVideoMode(void) { // Step 3: dsHdmiInGetCurrentVideoMode() with NULL `resolution` pointer #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetCurrentVideoMode(NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInGetCurrentVideoMode(NULL), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInGetCurrentVideoMode(NULL), dsERR_GENERAL); + UT_ASSERT_EQUAL(dsHdmiInGetCurrentVideoMode(NULL), dsERR_GENERAL); #endif // Step 4: Call dsHdmiInTerm() to ensure deinitialization @@ -827,6 +849,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetCurrentVideoMode(void) { // Step 5: Call dsHdmiInGetCurrentVideoMode() after terminating the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInGetCurrentVideoMode(&resolution), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInGetCurrentVideoMode(&resolution), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -860,7 +884,7 @@ void test_l1_dsHdmiIn_positive_dsHdmiInRegisterConnectCB(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Call dsHdmiInRegisterConnectCB() - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInRegisterConnectCB(mockConnectCallback), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInRegisterConnectCB(mockConnectCallback), dsERR_NONE); // Step 3: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -895,13 +919,15 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterConnectCB(void) { // Step 1: Call dsHdmiInRegisterConnectCB() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterConnectCB(mockConnectCallback), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInRegisterConnectCB(mockConnectCallback), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsHdmiInRegisterConnectCB() with invalid input - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInRegisterConnectCB(NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInRegisterConnectCB(NULL), dsERR_INVALID_PARAM); // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -909,6 +935,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterConnectCB(void) { // Step 5: Call dsHdmiInRegisterConnectCB() after termination the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterConnectCB(mockConnectCallback), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInRegisterConnectCB(mockConnectCallback), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -942,7 +970,7 @@ void test_l1_dsHdmiIn_positive_dsHdmiInRegisterSignalChangeCB(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Call dsHdmiInRegisterSignalChangeCB() - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInRegisterSignalChangeCB(mockSignalCallback), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInRegisterSignalChangeCB(mockSignalCallback), dsERR_NONE); // Step 3: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -977,13 +1005,15 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterSignalChangeCB(void) { // Step 1: Call dsHdmiInRegisterSignalChangeCB() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterSignalChangeCB(mockSignalCallback), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInRegisterSignalChangeCB(mockSignalCallback), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsHdmiInRegisterSignalChangeCB() with invalid input - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInRegisterSignalChangeCB(NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInRegisterSignalChangeCB(NULL), dsERR_INVALID_PARAM); // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -991,6 +1021,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterSignalChangeCB(void) { // Step 5: Call dsHdmiInRegisterSignalChangeCB() after terminating the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterSignalChangeCB(mockSignalCallback), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInRegisterSignalChangeCB(mockSignalCallback), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1024,7 +1056,7 @@ void test_l1_dsHdmiIn_positive_dsHdmiInRegisterStatusChangeCB(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Call dsHdmiInRegisterStatusChangeCB() - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInRegisterStatusChangeCB(mockStatusChangeCallback), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInRegisterStatusChangeCB(mockStatusChangeCallback), dsERR_NONE); // Step 3: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -1059,13 +1091,15 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterStatusChangeCB(void) { // Step 1: Call dsHdmiInRegisterStatusChangeCB() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterStatusChangeCB(mockStatusChangeCallback), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInRegisterStatusChangeCB(mockStatusChangeCallback), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsHdmiInRegisterStatusChangeCB() with invalid input - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInRegisterStatusChangeCB(NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInRegisterStatusChangeCB(NULL), dsERR_INVALID_PARAM); // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -1073,6 +1107,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterStatusChangeCB(void) { // Step 5: Call dsHdmiInRegisterStatusChangeCB() after terminating the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterStatusChangeCB(mockStatusChangeCallback), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInRegisterStatusChangeCB(mockStatusChangeCallback), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1106,7 +1142,7 @@ void test_l1_dsHdmiIn_positive_dsHdmiInRegisterVideoModeUpdateCB(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Call dsHdmiInRegisterVideoModeUpdateCB() - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInRegisterVideoModeUpdateCB(mockVideoModeUpdateCallback), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInRegisterVideoModeUpdateCB(mockVideoModeUpdateCallback), dsERR_NONE); // Step 3: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -1141,13 +1177,15 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterVideoModeUpdateCB(void) { // Step 1: Call dsHdmiInRegisterVideoModeUpdateCB() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterVideoModeUpdateCB(mockVideoModeUpdateCallback), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInRegisterVideoModeUpdateCB(mockVideoModeUpdateCallback), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsHdmiInRegisterVideoModeUpdateCB() with invalid input - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInRegisterVideoModeUpdateCB(NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInRegisterVideoModeUpdateCB(NULL), dsERR_INVALID_PARAM); // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -1155,8 +1193,10 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterVideoModeUpdateCB(void) { // Step 5: Call dsHdmiInRegisterVideoModeUpdateCB() after terminating the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterVideoModeUpdateCB(mockVideoModeUpdateCallback), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInRegisterVideoModeUpdateCB(mockVideoModeUpdateCallback), dsERR_NONE); #endif - + UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1189,7 +1229,7 @@ void test_l1_dsHdmiIn_positive_dsHdmiInRegisterAllmChangeCB(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Call dsHdmiInRegisterAllmChangeCB() - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInRegisterAllmChangeCB(mockALLMChangeCallback), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInRegisterAllmChangeCB(mockALLMChangeCallback), dsERR_NONE); // Step 3: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -1224,13 +1264,15 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAllmChangeCB(void) { // Step 1: Call dsHdmiInRegisterAllmChangeCB() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterAllmChangeCB(mockALLMChangeCallback), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInRegisterAllmChangeCB(mockALLMChangeCallback), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsHdmiInRegisterAllmChangeCB() with invalid input - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInRegisterAllmChangeCB(NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInRegisterAllmChangeCB(NULL), dsERR_INVALID_PARAM); // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -1238,6 +1280,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAllmChangeCB(void) { // Step 5: Call dsHdmiInRegisterAllmChangeCB() after terminating the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterAllmChangeCB(mockALLMChangeCallback), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInRegisterAllmChangeCB(mockALLMChangeCallback), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1270,7 +1314,7 @@ void test_l1_dsHdmiIn_positive_dsHdmiInRegisterAVLatencyChangeCB(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Call dsHdmiInRegisterAVLatencyChangeCB() - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInRegisterAVLatencyChangeCB(mockLatencyChangeCallback), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInRegisterAVLatencyChangeCB(mockLatencyChangeCallback), dsERR_NONE); // Step 3: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -1305,13 +1349,15 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAVLatencyChangeCB(void) { // Step 1: Call dsHdmiInRegisterAVLatencyChangeCB() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterAVLatencyChangeCB(mockLatencyChangeCallback), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInRegisterAVLatencyChangeCB(mockLatencyChangeCallback), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsHdmiInRegisterAVLatencyChangeCB() with invalid input - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInRegisterAVLatencyChangeCB(NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInRegisterAVLatencyChangeCB(NULL), dsERR_INVALID_PARAM); // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -1319,6 +1365,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAVLatencyChangeCB(void) { // Step 5: Call dsHdmiInRegisterAVLatencyChangeCB() after terminating the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterAVLatencyChangeCB(mockLatencyChangeCallback), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInRegisterAVLatencyChangeCB(mockLatencyChangeCallback), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1353,7 +1401,7 @@ void test_l1_dsHdmiIn_positive_dsHdmiInRegisterAviContentTypeChangeCB(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Call dsHdmiInRegisterAviContentTypeChangeCB() - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInRegisterAviContentTypeChangeCB(mockAviContentCallback), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInRegisterAviContentTypeChangeCB(mockAviContentCallback), dsERR_NONE); // Step 3: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -1388,13 +1436,15 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAviContentTypeChangeCB(void) { // Step 1: Call dsHdmiInRegisterAviContentTypeChangeCB() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterAviContentTypeChangeCB(mockAviContentCallback), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInRegisterAviContentTypeChangeCB(mockAviContentCallback), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsHdmiInRegisterAviContentTypeChangeCB() with invalid input - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInRegisterAviContentTypeChangeCB(NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsHdmiInRegisterAviContentTypeChangeCB(NULL), dsERR_INVALID_PARAM); // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -1402,6 +1452,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAviContentTypeChangeCB(void) { // Step 5: Call dsHdmiInRegisterAviContentTypeChangeCB() after terminating the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsHdmiInRegisterAviContentTypeChangeCB(mockAviContentCallback), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsHdmiInRegisterAviContentTypeChangeCB(mockAviContentCallback), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1437,19 +1489,19 @@ void test_l1_dsHdmiIn_positive_dsIsHdmiARCPort(void) { bool isArcPort1, isArcPort2; // Step 2: Call dsIsHdmiARCPort() with valid input (dsHDMI_IN_PORT_0) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, &isArcPort1), dsERR_NONE); + UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, &isArcPort1), dsERR_NONE); // Step 3: Call dsIsHdmiARCPort() with valid input (dsHDMI_IN_PORT_1) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_1, &isArcPort2), dsERR_NONE); + UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_1, &isArcPort2), dsERR_NONE); // Step 4: Call dsIsHdmiARCPort() with valid input (dsHDMI_IN_PORT_2) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_2, &isArcPort1), dsERR_NONE); + UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_2, &isArcPort1), dsERR_NONE); // Step 5: Call dsIsHdmiARCPort() with valid input (dsHDMI_IN_PORT_2) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_2, &isArcPort2), dsERR_NONE); + UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_2, &isArcPort2), dsERR_NONE); // Step 6: Compare the values of steps 4 and 5 to make sure they equal one another - DS_ASSERT_AUTO_TERM_NUMERICAL(isArcPort1, isArcPort2); + UT_ASSERT_EQUAL(isArcPort1, isArcPort2); // Step 7: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -1485,6 +1537,8 @@ void test_l1_dsHdmiIn_negative_dsIsHdmiARCPort(void) { // Step 1: Call dsIsHdmiARCPort() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, NULL), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, NULL), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() @@ -1494,16 +1548,16 @@ void test_l1_dsHdmiIn_negative_dsIsHdmiARCPort(void) { // Step 3: Call dsIsHdmiARCPort() with invalid value (dsHDMI_IN_PORT_MAX) #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_MAX, &isArcPort), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_MAX, &isArcPort), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_MAX, &isArcPort), dsERR_NONE); + UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_MAX, &isArcPort), dsERR_NONE); #endif // Step 4: Call dsIsHdmiARCPort() with invalid value (dsHDMI_IN_PORT_0) and NULL pointer #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, NULL), dsERR_NONE); + UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, NULL), dsERR_NONE); #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization @@ -1512,6 +1566,8 @@ void test_l1_dsHdmiIn_negative_dsIsHdmiARCPort(void) { // Step 6: Call dsIsHdmiARCPort() after terminating the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, &isArcPort), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, &isArcPort), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1554,20 +1610,20 @@ void test_l1_dsHdmiIn_positive_dsGetEDIDBytesInfo(void) { int edidSize4; // Step 2: Call dsGetEDIDBytesInfo() with valid input (dsHDMI_IN_PORT_0) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes1, &edidSize1), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes1, &edidSize1), dsERR_NONE); // Step 3: Call dsGetEDIDBytesInfo() with valid input (dsHDMI_IN_PORT_1) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_1, edidBytes2, &edidSize2), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_1, edidBytes2, &edidSize2), dsERR_NONE); // Step 4: Call dsGetEDIDBytesInfo() with valid input (dsHDMI_IN_PORT_2) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_2, edidBytes3, &edidSize3), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_2, edidBytes3, &edidSize3), dsERR_NONE); // Step 5: Call dsGetEDIDBytesInfo() with valid input (dsHDMI_IN_PORT_2) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_2, edidBytes4, &edidSize4), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_2, edidBytes4, &edidSize4), dsERR_NONE); // Step 6: Compare the results and make sure they are the same - DS_ASSERT_AUTO_TERM_NUMERICAL(edidSize3, edidSize4); - DS_ASSERT_AUTO_TERM_NUMERICAL(memcmp(edidBytes3, edidBytes4, edidSize3),0); + UT_ASSERT_EQUAL(edidSize3, edidSize4); + UT_ASSERT_EQUAL(memcmp(edidBytes3, edidBytes4, edidSize3),0); // You may want to compare the contents of the edidBytes as well, depending on your use case. @@ -1615,6 +1671,8 @@ void test_l1_dsHdmiIn_negative_dsGetEDIDBytesInfo(void) { // Step 1: Call dsGetEDIDBytesInfo() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, &edidSize), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, &edidSize), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() @@ -1622,23 +1680,23 @@ void test_l1_dsHdmiIn_negative_dsGetEDIDBytesInfo(void) { // Step 3: Call dsGetEDIDBytesInfo() with invalid value (dsHDMI_IN_PORT_MAX) #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_MAX, edidBytes, &edidSize), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_MAX, edidBytes, &edidSize), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_MAX, edidBytes, &edidSize), dsERR_GENERAL); + UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_MAX, edidBytes, &edidSize), dsERR_GENERAL); #endif // Step 4: Call dsGetEDIDBytesInfo() with invalid value (NULL pointer) #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, NULL, &edidSize), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, NULL, &edidSize), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, NULL, &edidSize), dsERR_GENERAL); + UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, NULL, &edidSize), dsERR_GENERAL); #endif // Step 5: Call dsGetEDIDBytesInfo() with invalid value (NULL pointer) #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, NULL), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, NULL), dsERR_GENERAL); + UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, NULL), dsERR_GENERAL); #endif // Step 6: Call dsHdmiInTerm() to ensure deinitialization @@ -1647,6 +1705,8 @@ void test_l1_dsHdmiIn_negative_dsGetEDIDBytesInfo(void) { // Step 7: Call dsGetEDIDBytesInfo() after terminating the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, &edidSize), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, &edidSize), dsERR_NONE); #endif free(edidBytes); @@ -1687,19 +1747,19 @@ void test_l1_dsHdmiIn_positive_dsGetHDMISPDInfo(void) { unsigned char* spdInfo4 = (unsigned char*) malloc(sizeof(struct dsSpd_infoframe_st)); // Step 2: Call dsGetHDMISPDInfo() with valid input (dsHDMI_IN_PORT_0) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, spdInfo1), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, spdInfo1), dsERR_NONE); // Step 3: Call dsGetHDMISPDInfo() with valid input (dsHDMI_IN_PORT_1) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_1, spdInfo2), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_1, spdInfo2), dsERR_NONE); // Step 4: Call dsGetHDMISPDInfo() with valid input (dsHDMI_IN_PORT_2) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_2, spdInfo3), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_2, spdInfo3), dsERR_NONE); // Step 5: Call dsGetHDMISPDInfo() with valid input (dsHDMI_IN_PORT_2) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_2, spdInfo4), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_2, spdInfo4), dsERR_NONE); // Step 6: Compare the results and make sure they are the same - DS_ASSERT_AUTO_TERM_NUMERICAL(memcmp(spdInfo3, spdInfo4,sizeof(struct dsSpd_infoframe_st)),0); + UT_ASSERT_EQUAL(memcmp(spdInfo3, spdInfo4,sizeof(struct dsSpd_infoframe_st)),0); // Step 7: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -1743,6 +1803,8 @@ void test_l1_dsHdmiIn_negative_dsGetHDMISPDInfo(void) { // Step 1: Call dsGetHDMISPDInfo() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, spdInfo1), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, spdInfo1), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() @@ -1750,16 +1812,16 @@ void test_l1_dsHdmiIn_negative_dsGetHDMISPDInfo(void) { // Step 3: Call dsGetHDMISPDInfo() with invalid values (dsHDMI_IN_PORT_MAX) #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_MAX, spdInfo1), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_MAX, spdInfo1), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_MAX, spdInfo1), dsERR_GENERAL); + UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_MAX, spdInfo1), dsERR_GENERAL); #endif // Step 4: Call dsGetHDMISPDInfo() with invalid values (NULL pointer) #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, NULL), dsERR_GENERAL); + UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, NULL), dsERR_GENERAL); #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization @@ -1768,6 +1830,8 @@ void test_l1_dsHdmiIn_negative_dsGetHDMISPDInfo(void) { // Step 6: Call dsGetHDMISPDInfo() after terminating the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, spdInfo1), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, spdInfo1), dsERR_NONE); #endif free(spdInfo1); @@ -1802,16 +1866,16 @@ void test_l1_dsHdmiIn_positive_dsSetEdidVersion(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Call dsSetEdidVersion() with valid values (dsHDMI_IN_PORT_0, HDMI_EDID_VER_14) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_14), dsERR_NONE); + UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_14), dsERR_NONE); // Step 3: Call dsSetEdidVersion() with valid values (dsHDMI_IN_PORT_0, HDMI_EDID_VER_20) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_20), dsERR_NONE); + UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_20), dsERR_NONE); // Step 4: Call dsSetEdidVersion() with valid values (dsHDMI_IN_PORT_1, HDMI_EDID_VER_14) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdidVersion(dsHDMI_IN_PORT_1, HDMI_EDID_VER_14), dsERR_NONE); + UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_1, HDMI_EDID_VER_14), dsERR_NONE); // Step 5: Call dsSetEdidVersion() with valid values (dsHDMI_IN_PORT_2, HDMI_EDID_VER_14) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdidVersion(dsHDMI_IN_PORT_2, HDMI_EDID_VER_14), dsERR_NONE); + UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_2, HDMI_EDID_VER_14), dsERR_NONE); // Step 6: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -1847,6 +1911,8 @@ void test_l1_dsHdmiIn_negative_dsSetEdidVersion(void) { // Step 1: Call dsSetEdidVersion() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_14), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_14), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() @@ -1854,16 +1920,16 @@ void test_l1_dsHdmiIn_negative_dsSetEdidVersion(void) { // Step 3: Call dsSetEdidVersion() with invalid inputs (dsHDMI_IN_PORT_MAX) #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdidVersion(dsHDMI_IN_PORT_MAX, HDMI_EDID_VER_14), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_MAX, HDMI_EDID_VER_14), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdidVersion(dsHDMI_IN_PORT_MAX, HDMI_EDID_VER_14), dsERR_GENERAL); + UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_MAX, HDMI_EDID_VER_14), dsERR_GENERAL); #endif // Step 4: Call dsSetEdidVersion() with invalid inputs (HDMI_EDID_VER_MAX) #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_MAX), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_MAX), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_MAX), dsERR_GENERAL); + UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_MAX), dsERR_GENERAL); #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization @@ -1872,6 +1938,8 @@ void test_l1_dsHdmiIn_negative_dsSetEdidVersion(void) { // Step 6: Call dsSetEdidVersion() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_14), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_14), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1903,13 +1971,13 @@ void test_l1_dsHdmiIn_positive_dsGetEdidVersion(void) { // Step 2: Call dsGetEdidVersion() with valid values (dsHDMI_IN_PORT_0, tv_hdmi_edid_version_t*) tv_hdmi_edid_version_t edid_version_1, edid_version_2; - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, &edid_version_1), dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdidVersion(dsHDMI_IN_PORT_1, &edid_version_1), dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdidVersion(dsHDMI_IN_PORT_2, &edid_version_1), dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdidVersion(dsHDMI_IN_PORT_2, &edid_version_2), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, &edid_version_1), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_1, &edid_version_1), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_2, &edid_version_1), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_2, &edid_version_2), dsERR_NONE); // Step 3: Compare the values from steps 4/5 and make sure they match - DS_ASSERT_AUTO_TERM_NUMERICAL(edid_version_1, edid_version_2); + UT_ASSERT_EQUAL(edid_version_1, edid_version_2); // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -1946,6 +2014,8 @@ void test_l1_dsHdmiIn_negative_dsGetEdidVersion(void) { tv_hdmi_edid_version_t edid_version; #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, &edid_version), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, &edid_version), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() @@ -1953,16 +2023,16 @@ void test_l1_dsHdmiIn_negative_dsGetEdidVersion(void) { // Step 3: Call dsGetEdidVersion() with invalid inputs (dsHDMI_IN_PORT_MAX) #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdidVersion(dsHDMI_IN_PORT_MAX, &edid_version), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_MAX, &edid_version), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdidVersion(dsHDMI_IN_PORT_MAX, &edid_version), dsERR_GENERAL); + UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_MAX, &edid_version), dsERR_GENERAL); #endif // Step 4: Call dsGetEdidVersion() with invalid inputs (NULL) #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, NULL), dsERR_GENERAL); + UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, NULL), dsERR_GENERAL); #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization @@ -1971,6 +2041,8 @@ void test_l1_dsHdmiIn_negative_dsGetEdidVersion(void) { // Step 6: Call dsGetEdidVersion() without initializing the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, &edid_version), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, &edid_version), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2005,20 +2077,20 @@ void test_l1_dsHdmiIn_positive_dsGetAllmStatus(void) { // Step 2: Call dsGetAllmStatus() with valid inputs (dsHDMI_IN_PORT_0, bool*) bool allm_status_1, allm_status_2; - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, &allm_status_1), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, &allm_status_1), dsERR_NONE); // Step 3: Call dsGetAllmStatus() with valid inputs (dsHDMI_IN_PORT_1, bool*) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAllmStatus(dsHDMI_IN_PORT_1, &allm_status_2), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_1, &allm_status_2), dsERR_NONE); // Step 4: Call dsGetAllmStatus() with valid inputs (dsHDMI_IN_PORT_2, bool*) bool allm_status_3; - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAllmStatus(dsHDMI_IN_PORT_2, &allm_status_3), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_2, &allm_status_3), dsERR_NONE); // Step 5: Call dsGetAllmStatus() with valid inputs (dsHDMI_IN_PORT_2, bool*) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAllmStatus(dsHDMI_IN_PORT_2, &allm_status_1), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_2, &allm_status_1), dsERR_NONE); // Step 6: Compare the results of steps 4/5 and make sure they are the same - DS_ASSERT_AUTO_TERM_NUMERICAL(allm_status_1, allm_status_3); + UT_ASSERT_EQUAL(allm_status_1, allm_status_3); // Step 7: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -2055,6 +2127,8 @@ void test_l1_dsHdmiIn_negative_dsGetAllmStatus(void) { bool allm_status; #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, &allm_status), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, &allm_status), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() @@ -2062,16 +2136,16 @@ void test_l1_dsHdmiIn_negative_dsGetAllmStatus(void) { // Step 3: Call dsGetAllmStatus() without valid inputs (dsHDMI_IN_PORT_MAX) #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAllmStatus(dsHDMI_IN_PORT_MAX, &allm_status), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_MAX, &allm_status), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAllmStatus(dsHDMI_IN_PORT_MAX, &allm_status), dsERR_GENERAL); + UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_MAX, &allm_status), dsERR_GENERAL); #endif // Step 4: Call dsGetAllmStatus() without valid inputs (NULL) #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, NULL), dsERR_GENERAL); + UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, NULL), dsERR_GENERAL); #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization @@ -2080,6 +2154,8 @@ void test_l1_dsHdmiIn_negative_dsGetAllmStatus(void) { // Step 6: Call dsGetAllmStatus() after termination the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, &allm_status), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, &allm_status), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2112,15 +2188,15 @@ void test_l1_dsHdmiIn_positive_dsGetSupportedGameFeaturesList(void) { // Step 2: Call dsGetSupportedGameFeaturesList() with valid inputs (dsSupportedGameFeatureList_t*) dsSupportedGameFeatureList_t supported_features_1, supported_features_2; - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetSupportedGameFeaturesList(&supported_features_1), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetSupportedGameFeaturesList(&supported_features_1), dsERR_NONE); // Step 3: Call dsGetSupportedGameFeaturesList() with valid inputs (dsSupportedGameFeatureList_t*) - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetSupportedGameFeaturesList(&supported_features_2), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetSupportedGameFeaturesList(&supported_features_2), dsERR_NONE); // Step 4: Compare the returns of steps 2/3 and make sure they compare // Note: You should implement a function to compare dsSupportedGameFeatureList_t objects - DS_ASSERT_AUTO_TERM_NUMERICAL(supported_features_1.gameFeatureList, supported_features_2.gameFeatureList); - DS_ASSERT_AUTO_TERM_NUMERICAL(supported_features_1.gameFeatureCount, supported_features_2.gameFeatureCount); + UT_ASSERT_EQUAL(supported_features_1.gameFeatureList, supported_features_2.gameFeatureList); + UT_ASSERT_EQUAL(supported_features_1.gameFeatureCount, supported_features_2.gameFeatureCount); // Step 5: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -2156,6 +2232,8 @@ void test_l1_dsHdmiIn_negative_dsGetSupportedGameFeaturesList(void) { dsSupportedGameFeatureList_t supported_features; #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetSupportedGameFeaturesList(&supported_features), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsGetSupportedGameFeaturesList(&supported_features), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() @@ -2163,9 +2241,9 @@ void test_l1_dsHdmiIn_negative_dsGetSupportedGameFeaturesList(void) { // Step 3: Call dsGetSupportedGameFeaturesList() with invalid input (NULL) #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetSupportedGameFeaturesList(NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsGetSupportedGameFeaturesList(NULL), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetSupportedGameFeaturesList(NULL), dsERR_GENERAL); + UT_ASSERT_EQUAL(dsGetSupportedGameFeaturesList(NULL), dsERR_GENERAL); #endif // Step 4: Call dsHdmiInTerm() to ensure deinitialization @@ -2174,6 +2252,8 @@ void test_l1_dsHdmiIn_negative_dsGetSupportedGameFeaturesList(void) { // Step 5: Call dsGetSupportedGameFeaturesList() after terminating the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetSupportedGameFeaturesList(&supported_features), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsGetSupportedGameFeaturesList(&supported_features), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2204,11 +2284,11 @@ void test_l1_dsHdmiIn_positive_dsGetAVLatency(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Call dsHdmiInSelectPort() to select Port 0 - DS_ASSERT_AUTO_TERM_NUMERICAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false), dsERR_NONE); + UT_ASSERT_EQUAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false), dsERR_NONE); // Step 3: Call dsGetAVLatency() with valid inputs (int*, int*) int audioLatency1, videoLatency1; - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAVLatency(&audioLatency1, &videoLatency1), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetAVLatency(&audioLatency1, &videoLatency1), dsERR_NONE); // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -2245,6 +2325,8 @@ void test_l1_dsHdmiIn_negative_dsGetAVLatency(void) { int audioLatency, videoLatency; #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetAVLatency(&audioLatency, &videoLatency), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsGetAVLatency(&audioLatency, &videoLatency), dsERR_NONE); #endif // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() @@ -2252,16 +2334,16 @@ void test_l1_dsHdmiIn_negative_dsGetAVLatency(void) { // Step 3: Call dsGetAVLatency() with valid inputs (NULL, int*) #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAVLatency(NULL, &videoLatency), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsGetAVLatency(NULL, &videoLatency), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAVLatency(NULL, &videoLatency), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetAVLatency(NULL, &videoLatency), dsERR_NONE); #endif // Step 4: Call dsGetAVLatency() with valid inputs (int*, NULL) #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAVLatency(&audioLatency, NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsGetAVLatency(&audioLatency, NULL), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetAVLatency(&audioLatency, NULL), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetAVLatency(&audioLatency, NULL), dsERR_NONE); #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization @@ -2270,6 +2352,8 @@ void test_l1_dsHdmiIn_negative_dsGetAVLatency(void) { // Step 6: Call dsGetAVLatency() after terminating the HDMI input sub-system #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetAVLatency(&audioLatency, &videoLatency), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsGetAVLatency(&audioLatency, &videoLatency), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2300,12 +2384,12 @@ void test_l1_dsHdmiIn_positive_dsSetEdid2AllmSupport(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Call dsSetEdid2AllmSupport() with all valid ports and enable EDID ALLM support - DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_0, true), dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_1, true), dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_2, true), dsERR_NONE); + UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_0, true), dsERR_NONE); + UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_1, true), dsERR_NONE); + UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_2, true), dsERR_NONE); // Step 3: Call dsSetEdid2AllmSupport() to disable EDID ALLM support - DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_0, false), dsERR_NONE); + UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_0, false), dsERR_NONE); // Step 4: Terminate the HDMI input using dsHdmiInTerm() UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -2340,6 +2424,8 @@ void test_l1_dsHdmiIn_negative_dsSetEdid2AllmSupport(void) { // Step 1: Call dsSetEdid2AllmSupport() without prior initialization of HDMI input #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_0, true), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_0, true), dsERR_NONE); #endif // Step 2: Initialize HDMI input using dsHdmiInInit() @@ -2347,9 +2433,9 @@ void test_l1_dsHdmiIn_negative_dsSetEdid2AllmSupport(void) { // Step 3: Call dsSetEdid2AllmSupport() with an invalid HDMI port #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_MAX, true), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_MAX, true), dsERR_INVALID_PARAM); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_MAX, true), dsERR_GENERAL); + UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_MAX, true), dsERR_GENERAL); #endif // Step 4: Terminate the HDMI input using dsHdmiInTerm() @@ -2358,6 +2444,8 @@ void test_l1_dsHdmiIn_negative_dsSetEdid2AllmSupport(void) { // Step 5: Call dsSetEdid2AllmSupport() after termination #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_0, true), dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_0, true), dsERR_NONE); #endif UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2391,13 +2479,13 @@ void test_l1_dsHdmiIn_positive_dsGetEdid2AllmSupport(void) { // Step 2: Call dsGetEdid2AllmSupport() to verify EDID ALLM support bool allmSupport1, allmSupport2; - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_0, &allmSupport1), dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_1, &allmSupport1), dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_2, &allmSupport1), dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_2, &allmSupport2), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_0, &allmSupport1), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_1, &allmSupport1), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_2, &allmSupport1), dsERR_NONE); + UT_ASSERT_EQUAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_2, &allmSupport2), dsERR_NONE); // Step 3: Compare the returned values from steps 2/3 and verify that they are the same - DS_ASSERT_AUTO_TERM_NUMERICAL(allmSupport1, allmSupport2); + UT_ASSERT_EQUAL(allmSupport1, allmSupport2); // Step 4: Terminate the HDMI input using dsHdmiInTerm() UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -2440,10 +2528,10 @@ void test_l1_dsHdmiIn_negative_dsGetEdid2AllmSupport(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsGetEdid2AllmSupport() with invalid inputs - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_MAX, &allmSupport), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_MAX, &allmSupport), dsERR_INVALID_PARAM); // Step 4: Call dsGetEdid2AllmSupport() with invalid inputs - DS_ASSERT_AUTO_TERM_NUMERICAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); // Step 5: Terminate the HDMI input using dsHdmiInTerm() UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); From 098807153c12c0183acf9d9aa1a40c2c5d418c4f Mon Sep 17 00:00:00 2001 From: thanushreevani <157587255+thanushreevani@users.noreply.github.com> Date: Mon, 13 May 2024 18:12:45 +0530 Subject: [PATCH 15/38] gh #43 remove DS_ASSERT_AUTO_TERM_NUMERICAL --- src/test_l2_dsVideoPort.c | 6055 ++++++++++++++++++++++++++++++++++++- 1 file changed, 6004 insertions(+), 51 deletions(-) diff --git a/src/test_l2_dsVideoPort.c b/src/test_l2_dsVideoPort.c index 8e994798..eb77da84 100644 --- a/src/test_l2_dsVideoPort.c +++ b/src/test_l2_dsVideoPort.c @@ -1,21 +1,21 @@ /** -* If not stated otherwise in this file or this component's LICENSE -* file the following copyright and licenses apply: -* -* Copyright 2022 RDK Management -* -* Licensed under the Apache License, Version 2.0 (the License); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an AS IS BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * If not stated otherwise in this file or this component's LICENSE + * file the following copyright and licenses apply: + * + * Copyright 2022 RDK Management + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /** * @addtogroup HPK Hardware Porting Kit @@ -47,73 +47,6026 @@ */ /** - * @defgroup DS_VideoPort_HALTEST_L2 Device Settings Video Port HAL Tests L2 File + * @defgroup DS_VideoPort_HALTEST_L1 Device Settings Video Port HAL Tests L1 File * @{ * @parblock * - * ### L2 Tests for DS Video Port HAL : + * ### L1 Tests for DS Video Port HAL : * - * Level 2 unit test cases for all APIs of Device Settings Video Port HAL + * Level 1 unit test cases for all APIs of Device Settings Video Port HAL * * **Pre-Conditions:** None@n * **Dependencies:** None@n * - * TODO: Refer to L2 Specification documentation : [l2_module_test_specification_template.md](../docs/pages/l2_module_test_specification_template.md) + * Refer to API Definition specification documentation : [ds-video-port_halSpec.md](../../docs/pages/ds-video-port_halSpec.md) * * @endparblock */ /** - * @file test_l2_dsVideoPort.c + * @file test_l1_dsVideoPort.c * */ #include #include +#include "dsVideoPort.h" +#include "dsVideoPortSettings.h" #include #include +static int gTestGroup = 1; +static int gTestID = 1; + +#define NUM_OF_PORTS (sizeof(kPorts) / sizeof(kPorts[0])) +#define HANDLE_ARRAY_INIT 0 + +#define UT_ASSERT_EQUAL(value, comparison){\ + if(value != comparison){\ + UT_LOG("\n In %s Comparison: [%d = %d]\n", __FUNCTION__, value, comparison);\ + dsVideoPortTerm();\ + UT_FAIL();\ + }\ +}\ + /** -* @brief TODO: Describe the object of the test -* -* TODO: Add the description of what is tested and why in this test -* -* **Test Group ID:** TODO: Add the group this test belongs to - Basic (for L1): 01 / Module (L2): 02 / Stress (L2): 03)@n -* **Test Case ID:** TODO: Add the ID of the test case so that it can be logically tracked in the logs@n -* -* **Test Procedure:** -* TODO: Refer to L2 Specification documentation : [l2_module_test_specification_template.md](../docs/pages/l2_module_test_specification_template.md) -*/ -void test_l2_dsVideoPort (void) -{ - UT_FAIL("This function needs to be implemented!"); + * @brief Ensure dsVideoPortInit() returns correct status codes during positive scenarios + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 001@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize the video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |03|Call dsVideoPortInit() - Reinitialize the video port system | | dsERR_NONE | Make sure that the video ports can be reinitialized after termination | + * |04|Call dsVideoPortTerm() - Re-terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsVideoPortInit(void) { + gTestID = 1; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + + // Step 01: Initialize the video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Reinitialize the video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 04: Re-terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + +/** + * @brief Ensure dsVideoPortInit() returns correct error codes during negative scenarios + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 002@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize the video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsVideoPortInit() - Attempt to initialize again without terminating the first initialization | | dsERR_ALREADY_INITIALIZED | Initialization must fail as it is already initialized | + * |03|Call dsVideoPortTerm() - Terminate video port system | | dsERR_NONE | Termination must be successful | + * + * + * @note Testing for the `dsERR_RESOURCE_NOT_AVAILABLE` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsVideoPortInit(void) { + gTestID = 2; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + + // Step 01: Initialize the video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Attempt to initialize again without terminating the first initialization + status = dsVideoPortInit(); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_ALREADY_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_GENERAL); + #endif + + // Step 03: Terminate video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); } -static UT_test_suite_t * pSuite = NULL; /** - * @brief Register the main test(s) for this module - * - * @return int - 0 on success, otherwise failure + * @brief Ensure dsVideoPortTerm() returns correct status codes during positive scenarios + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 003@n + * + * **Pre-Conditions:**None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsVideoPortTerm() - Terminate video port system | | dsERR_NONE | Termination must be successful | + * |03|Call dsVideoPortInit() - Reinitialize video port system | | dsERR_NONE | Initialization must be successful | + * |04|Call dsVideoPortTerm() - Re-terminate video port system | | dsERR_NONE | Termination must be successful | + * */ -int test_l2_dsVideoPort_register ( void ) -{ - /* add a suite to the registry */ - pSuite = UT_add_suite( "[L2 dsVideoPort]", NULL, NULL ); - if ( NULL == pSuite ) - { - return -1; - } +void test_l1_dsVideoPort_positive_dsVideoPortTerm(void) { + gTestID = 3; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - UT_add_test( pSuite, "test_l2_dsVideoPort" ,test_l2_dsVideoPort ); + dsError_t status; - return 0; + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Terminate video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Reinitialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 04: Re-terminate video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Ensure dsVideoPortTerm() returns correct error codes during negative scenarios + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 004@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortTerm() - Attempt to terminate the video port without prior initialization | | dsERR_NOT_INITIALIZED | Termination must fail as video port is not initialized | + * |02|Call dsVideoPortInit() - Initialize the video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |04|Call dsVideoPortTerm() - Attempt to terminate the video port again after termination | | dsERR_NOT_INITIALIZED | Termination must fail as video port is not initialized | + * + * + * @note Testing for the `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsVideoPortTerm(void) { + gTestID = 4; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + + // Step 01: Attempt to terminate the video port without prior initialization + status = dsVideoPortTerm(); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_NONE); + #endif + + // Step 02: Initialize the video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 04: Attempt to terminate the video port again after termination + status = dsVideoPortTerm(); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_NONE); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Ensure dsGetVideoPort() returns correct handles for the available video ports + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 005@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Get the video port handle for last element , store it in a new variable and compare it with previous step | | dsERR_NONE | Port handle obtained from previous step must be equal to handle obtained in this step + * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsGetVideoPort(void) { + gTestID = 5; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + intptr_t lastHandle; + intptr_t newHandle; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle for valid video port type and index + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + if(i == NUM_OF_PORTS-1) + { + lastHandle = handle[i]; + } + } + + // Step 03: Compare with the last handle + status = dsGetVideoPort(kPorts[NUM_OF_PORTS-1].id.type, kPorts[NUM_OF_PORTS-1].id.index, &(handle[NUM_OF_PORTS-1])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + //getting last handle in to new handle for comparision + newHandle = handle[NUM_OF_PORTS-1]; + UT_ASSERT_EQUAL(lastHandle , newHandle); + + // Step 04: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + +/** + * @brief Ensure dsGetVideoPort() returns correct error codes during negative scenarios + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 006@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetVideoPort() - Attempt to get the Video Port handle without initializing video ports | `type`,`index`= kPorts[0], `handle`= valid handle | dsERR_NOT_INITIALIZED | Get Video Port Handle must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsGetVideoPort() - by looping through valid port indexes but with invalid type | type = [not in kPorts] , index = [ loop through kPorts ], handle = [ valid handle ] | dsERR_OPERATION_NOT_SUPPORTED | Operation not supported error must be returned | + * |04|Call dsGetVideoPort() - by looping through valid types but with invalid index | type = [loop through types in kPorts], index = [ invalid index which is not in kPorts ], handle: [ valid handle ] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | + * |05|Call dsGetVideoPort() - by looping through valid types and index but with a NULL handle | type, index: [ loop through kPorts ], handle: [ NULL pointer ] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsGetVideoPort() - Attempt to get the video port handle again after termination | type, index: [ loop through kPorts ], handle: [ valid handle ] | dsERR_NOT_INITIALIZED | Get Video Port Handle must fail as module is not initialized | + * + * + * @note Testing for `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetVideoPort(void) { + gTestID = 6; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + // Step 01: Attempt to get the Video Port handle without initializing + status = dsGetVideoPort(kPorts[0].id.type, kPorts[0].id.index, &(handle[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_NONE); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Attempt to get the Video Port handle with invalid port type + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(dsVIDEOPORT_TYPE_MAX, kPorts[i].id.index, &(handle[i])); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_OPERATION_NOT_SUPPORTED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + } + + // Step 04: Attempt to get the Video Port handle invalid port index + for (int i = 0; i < NUM_OF_PORTS ; i++) { + status = dsGetVideoPort(kPorts[i].id.type, -1 , &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 05: NULL handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index , NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get the video port handle again after termination + status = dsGetVideoPort(kPorts[0].id.type, kPorts[0].id.index, &(handle[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_NONE); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Ensure dsIsVideoPortEnabled() correctly indicates the enabled status of a video port + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 007@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform | type , index = [ Loop through kPorts ] | dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |03|Call dsIsVideoPortEnabled - by looping through the acquired port handles to check if a video port is enabled or not and store the values in an array | handle: [valid handle], enabled: [pointer to hold the enabled/disabled status of video port] | dsERR_NONE | Flag which holds the enabled status of Video Port must be returned | + * |04|Call dsIsVideoPortEnabled - Again by looping through the acquired port handles to check if a video port is enabled or not and store the values in a new array | handle: [valid handle], enabled: [pointer to hold the enabled/disabled status of video port] | dsERR_NONE | Flag which holds the enabled status of Video Port must be returned | + * |05|Compare the array values and make sure they are equal| | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsIsVideoPortEnabled(void) { + gTestID = 7; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool isEnabledArray1[NUM_OF_PORTS]; + bool isEnabledArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the port handle for all supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Check if video port is enabled or not + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsIsVideoPortEnabled(handle[i], &isEnabledArray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the check for enabled status + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsIsVideoPortEnabled(handle[i], &isEnabledArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(isEnabledArray1[i], isEnabledArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Ensure dsIsVideoPortEnabled() returns correct error codes during negative scenarios + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 008@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsIsVideoPortEnabled() - Attempt to check if video port is enabled or not without initializing video ports | handle: [ invalid handle ], connected: [ pointer to hold enabled status]| dsERR_NOT_INITIALIZED | Call to check if video port is enabled or not must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsIsVideoPortEnabled() using an invalid handle but with a valid pointer to hold the enabled status | handle: [ invalid handle ], enabled: [ pointer to hold enabled status] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | + * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |05|Call dsIsVideoPortEnabled() by looping through acquired port handles but with a null pointer for enabled status | handle: [ loop through valid handles ], enabled: [ NULL ] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsIsVideoPortEnabled() - Attempt to check if video port is enabled or not without initializing video ports| handle: [ valid handle ], connected: [ pointer to hold enabled status] | dsERR_NOT_INITIALIZED | Call to check if video port is enabled or not must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsIsVideoPortEnabled(void) { + gTestID = 8; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool enabled[NUM_OF_PORTS]; + + // Step 01: Attempt to check enabled status without initialization + status = dsIsVideoPortEnabled(-1, &enabled[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsIsVideoPortEnabled(handle[0], &enabled[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Check enabled status with null pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsIsVideoPortEnabled(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Check enabled status after termination + status = dsIsVideoPortEnabled(handle[0], &enabled[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + +/** + * @brief Ensure dsIsDisplayConnected() behaves as expected during positive scenarios + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 009@n + * + * **Pre-Conditions:**@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsIsDisplayConnected() - by looping through the acquired port handles to check if video port is connected to a display or not and store it in an array| handle: [ loop through valid handles ] , connected: [pointer to hold the connection status of Video Port] | dsERR_NONE | Flag which holds the connection status of Video Port must be returned | + * |04|Call dsIsDisplayConnected() - Again by looping through the acquired port handles to check if video port is connected to a display or not and store it in a new array | handle: [ loop through valid handles ] , connected: [pointer to hold the connection status of Video Port] | dsERR_NONE | Flag which holds the connection status of Video Port must be returned | + * |05|Compare the array values and make sure they are equal| | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsIsDisplayConnected(void) { + gTestID = 9; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool isConnectedArray1[NUM_OF_PORTS]; + bool isConnectedArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS ; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Check if video port is connected + for (int i = 0; i < NUM_OF_PORTS ; i++) { + status = dsIsDisplayConnected(handle[i], &isConnectedArray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the check for connection status + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsIsDisplayConnected(handle[i], &isConnectedArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS ; i++) { + UT_ASSERT_EQUAL(isConnectedArray1[i], isConnectedArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Ensure dsIsDisplayConnected() returns correct error codes during negative scenarios + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 010@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsIsDisplayConnected() - Attempt to check if video port is connected without initializing video ports | handle: [ invalid handle ], connected: [ pointer to hold connection status] | dsERR_NOT_INITIALIZED | Call to check if display is connected to video port must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsIsDisplayConnected() using an invalid handle but with a valid pointer to hold the connection status | handle: [ invalid handle ], connected: [ pointer to hold connection status] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | + * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |05|Call dsIsDisplayConnected() by looping through acquired port handles but with a null pointer for display connection | handle: [ loop through valid handles ], connected: [ NULL ] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsIsDisplayConnected() - Attempt to check if video port is connected without initializing video ports| handle: [ valid handle ], connected: [ pointer to hold connection status] | dsERR_NOT_INITIALIZED | Call to check if display is connected to video port must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsIsDisplayConnected(void) { + gTestID = 10; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool connected[NUM_OF_PORTS]; + + // Step 01: Attempt to check connection status without initialization + status = dsIsDisplayConnected(-1 , &(connected[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsIsDisplayConnected(handle[0], &connected[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Check connection status with null pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsIsDisplayConnected(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Check connection status after termination + status = dsIsDisplayConnected(handle[0], &connected[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsIsDisplaySurround() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 011@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsIsDisplaySurround() - by looping through the acquired port handles to check if display connected to video port supports the audio surround and store it an array | handle: [ loop through valid handles ] , surround: [pointer to hold the audio surround support] | dsERR_NONE | Audio surround support of Video Port must be returned | + * |04|Call dsIsDisplaySurround() - Again by looping through the acquired port handles to check if display connected to video port supports the audio surround and store it in a new array| handle: [ loop through valid handles ] , surround: [pointer to hold the audio surround support] | dsERR_NONE | Audio surround support of Video Port must be returned | + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsIsDisplaySurround(void) { + gTestID = 11; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool isSurroundArray1[NUM_OF_PORTS]; + bool isSurroundArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Check if the connected display supports audio surround + status = dsIsDisplaySurround(handle[i], &isSurroundArray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the check for audio surround support + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsIsDisplaySurround(handle[i], &isSurroundArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(isSurroundArray1[i], isSurroundArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Ensure dsIsDisplaySurround() returns correct error codes during negative scenarios + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 012@n + * + * **Pre-Conditions:**@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsIsDisplaySurround() - Attempt to check if display connected to video port has surround support without initializing video ports | handle: [ invalid handle ], , surround: [ pointer to hold Audio surround support] | dsERR_NOT_INITIALIZED | Call to check if display connected to video port has surround support must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsIsDisplaySurround() using an invalid handle but with a valid pointer to hold the surround support | handle: [ invalid handle ], surround: [ pointer to hold Audio surround support] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | + * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |05|Call dsIsDisplaySurround() by looping through acquired port handles but with a null pointer for audio surround | handle: [ loop through valid handles ], surround: [ NULL ] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsIsDisplayConnected() - Attempt to check if display connected to video port has surround support without initializing video ports | handle: [ valid handle ], , surround: [ pointer to hold Audio surround support] | dsERR_NOT_INITIALIZED | Call to check if display connected to video port has surround support must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsIsDisplaySurround(void) { + gTestID = 12; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool surround[NUM_OF_PORTS]; + + // Step 01: Attempt to check audio surround support without initialization + status = dsIsDisplaySurround(-1, &surround[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsIsDisplaySurround(handle[0], &surround[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Check audio surround support with null pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsIsDisplaySurround(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Check audio surround support after termination + status = dsIsDisplaySurround(handle[0], &surround[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsGetSurroundMode() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 013@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsGetSurroundMode() - by looping through the acquired port handles to get the surround mode of each video port and store it in an array | handle: [ loop through valid handles ] , surround: [pointer to hold the Surround mode] | dsERR_NONE | Surround mode (dsSURROUNDMode_t)of Video Port must be returned | + * |04|Call dsGetSurroundMode() - Again by looping through the acquired port handles to get the surround mode of each video port and store it in a new array | handle: [ loop through valid handles ] , surround: [pointer to hold the Surround mode] | dsERR_NONE | Surround mode (dsSURROUNDMode_t)of Video Port must be returned | + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsGetSurroundMode(void) { + gTestID = 13; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + int surroundModeArray1[NUM_OF_PORTS]; + int surroundModeArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + for (int i = 0; i < NUM_OF_PORTS; i++) { + // Step 03: Get the surround mode of each video port + status = dsGetSurroundMode(handle[i], &surroundModeArray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the retrieval of surround mode + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetSurroundMode(handle[i], &surroundModeArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS ; i++) { + UT_ASSERT_EQUAL(surroundModeArray1[i], surroundModeArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsGetSurroundMode() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 014@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetSurroundMode() - Attempt to get the surround mode without initializing video ports | handle: [ invalid handle ], surround: [pointer to hold the surround mode] | dsERR_NOT_INITIALIZED | Get surround mode of video ports must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsGetSurroundMode() using an invalid handle but with a valid pointer to hold the surround mode | handle: [ invalid handle ], surround: [ pointer to hold surround mode] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | + * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |05|Call dsGetSurroundMode() by looping through acquired port handles but with a null pointer for surround mode | handle: [ loop through valid handles ], surround: [ NULL ] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsGetSurroundMode() - Attempt to get the surround mode without initializing video ports | handle: [ valid handle ], surround: [pointer to hold the surround mode] | dsERR_NOT_INITIALIZED | Get surround mode of video ports must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetSurroundMode(void) { + gTestID = 14; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + int surroundMode[NUM_OF_PORTS]; + + // Step 01: Attempt to get surround mode without initialization + status = dsGetSurroundMode(-1, &surroundMode[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsGetSurroundMode(handle[0], &surroundMode[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Check surround mode with null pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetSurroundMode(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get surround mode after termination + status = dsGetSurroundMode(handle[0], &surroundMode[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsIsVideoPortActive() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 015@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsIsVideoPortActive() - by looping through the acquired port handles to check whether a video port is active or not for each port and store it in an array| handle: [ loop through valid handles ] , active: [pointer to hold the active status] | dsERR_NONE | Active Status(A Video port is active if it is connected to the active port of sink device) of Video Port must be returned | + * |04|Call dsIsVideoPortActive() - by looping through the acquired port handles to check whether a video port is active or not for each port and store it in a new array | handle: [ loop through valid handles ] , active: [pointer to hold the active status] | dsERR_NONE | Active Status(A Video port is active if it is connected to the active port of sink device) of Video Port must be returned | + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsIsVideoPortActive(void) { + gTestID = 15; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool isActiveArray1[NUM_OF_PORTS]; + bool isActiveArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Check whether each video port is active + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsIsVideoPortActive(handle[i], &isActiveArray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the active status check + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsIsVideoPortActive(handle[i], &isActiveArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(isActiveArray1[i], isActiveArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsIsVideoPortActive() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 016@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsIsVideoPortActive() - Attempt to check whether a video port is active or not without initializing video ports | handle: [ invalid handle ], active: [pointer to hold the active status of video port] | dsERR_NOT_INITIALIZED | Call to check if video port is active or not must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsIsVideoPortActive() using an invalid handle but with a valid pointer to hold the active status | handle: [ invalid handle ], active: [ pointer to hold active status] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | + * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |05|Call dsIsVideoPortActive() by looping through acquired port handles but with a null pointer for active status | handle: [ loop through valid handles ], active: [ NULL ] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsIsVideoPortActive() - Attempt to check whether a video port is active or not without initializing video ports | handle: [ valid handle ], active: [pointer to hold the active status of video port] | dsERR_NOT_INITIALIZED | Call to check if video port is active or not must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsIsVideoPortActive(void) { + gTestID = 16; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool active[NUM_OF_PORTS]; + + // Step 01: Attempt to check active status without initialization + status = dsIsVideoPortActive(-1, &active[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsIsVideoPortActive(handle[0], &active[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Check active status with null pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsIsVideoPortActive(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to check active status after termination + status = dsIsVideoPortActive(handle[0], &active[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsEnableDTCP() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 017@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsEnableDTCP() by looping through the acquired port handles to enable DTCP for ports which support DTCP | handle: [ loop through valid handles ] , contentProtect: [1] (enable DTCP) |dsERR_NONE or dsERR_OPERATION_NOT_SUPPORTED| API must either successfully enable DTCP or indicate that the operation isn't supported if the particular video does not have DTCP support| + * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsEnableDTCP(void) { + gTestID = 17; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool enableDTCP = true; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS ; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Enable DTCP + for (int i = 0; i < NUM_OF_PORTS ; i++) { + status = dsEnableDTCP(handle[i], enableDTCP); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); } -/** @} */ // End of DS_VideoPort_HALTEST_L2 + +/** + * @brief Negative Test Scenarios for dsEnableDTCP() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 018@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsEnableDTCP() - Attempt to enable DTCP without initializing the video ports | handle: [ invalid handle ], contentProtect: [true = enable DTCP/ false = disable DTCP] | dsERR_NOT_INITIALIZED | Enable DTCP must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsEnableDTCP() using an invalid handle but with a valid DTCP Flag(enable = 1/ disable = 0) | handle: [ invalid handle ], contentProtect: [ Flag to enable/disable DTCP] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | + * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |05|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |06|Call dsEnableDTCP() Attempt to enable DTCP without initializing the video ports | handle: [ valid handle ], contentProtect: [true = enable DTCP/ false = disable DTCP] | dsERR_NOT_INITIALIZED | Enable DTCP must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsEnableDTCP(void) { + gTestID = 18; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool enableDTCP = true; // Flag to enable/disable DTCP + + // Step 01: Attempt to enable DTCP without initialization + status = dsEnableDTCP(-1, enableDTCP); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsEnableDTCP(handle[0], enableDTCP); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get the Video Port handle + for (int i = 0; i < NUM_OF_PORTS ; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 06: Attempt to enable DTCP after termination + status = dsEnableDTCP(handle[0], enableDTCP); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsEnableHDCP() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 019@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsEnableHDCP() by looping through the acquired port handles to enable HDCP for ports which support HDCP | handle: [ loop through valid handles ] , contentProtect: [1] (enable HDCP), hdcpKey: [ HDCP key ], keySize: [HDCP key size]|dsERR_NONE| API must either successfully enable HDCP or indicate that the operation isn't supported if the particular video does not have HDCP support| + * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsEnableHDCP(void) { + gTestID = 19; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool enableHDCP = true; + char hdcpKey[HDCP_KEY_MAX_SIZE] = "ADEF"; + int keySize = HDCP_KEY_MAX_SIZE; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Enable HDCP + status = dsEnableHDCP(handle[i], enableHDCP, hdcpKey, keySize); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + } + + // Step 04: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsEnableHDCP() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 020@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsEnableHDCP() - Attempt to enable HDCP without initializing the video ports | handle: [ invalid handle ], contentProtect: [true = enable/ false = disable], hdcpKey: [valid hdcp key], keySize: [valid key size]| dsERR_NOT_INITIALIZED | Enable HDCP must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsEnableHDCP() - Attempt to enable HDCP with an invalid handle |handle: [ invalid handle ], contentProtect: [true = enable/ false = disable], hdcpKey: [valid hdcp key], keySize: [valid key size (HDCP_KEY_MAX_SIZE)]| dsERR_INVALID_PARAM | Invalid Parameter error must be returned | + * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |05|Call dsEnableHDCP() by looping through acquired port handles(which support HDCP) with an invalid HDCP key size |handle: [ valid handle ], contentProtect: [true = enable/ false = disable], hdcpKey: [valid hdcp key], keySize: [invalid key size (> HDCP_KEY_MAX_SIZE)| dsERR_INVALID_PARAM | Invalid Parameter error must be returned | + * |05|Call dsEnableHDCP() by looping through acquired port handles with an NULL hdcpKey pointer |handle: [ valid handle ], contentProtect: [true = enable/ false = disable], hdcpKey: [NULL], keySize: [valid key size] | dsERR_INVALID_PARAM | Invalid Parameter error must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsEnableHDCP() Attempt to enable HDCP without initializing the video ports | handle: [ valid handle ], contentProtect: [true = enable/ false = disable], hdcpKey: [valid hdcp key], keySize: [valid key size] | dsERR_NOT_INITIALIZED | Enable HDCP must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsEnableHDCP(void) { + gTestID = 20; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool enableHDCP = true; + char hdcpKey[HDCP_KEY_MAX_SIZE] = "ADEF"; + int keySize = HDCP_KEY_MAX_SIZE; + + // Step 01: Attempt to enable HDCP without initialization + status = dsEnableHDCP(-1, enableHDCP, hdcpKey, keySize); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Attempt to enable HDCP with an invalid handle + status = dsEnableHDCP(handle[0], enableHDCP, hdcpKey, keySize); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get the video port handle for supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 05: Enable HDCP with invalid key size + status = dsEnableHDCP(handle[i],enableHDCP, hdcpKey, HDCP_KEY_MAX_SIZE+1); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 06: Enable HDCP with NULL hdcpKey pointer + status = dsEnableHDCP(handle[i], enableHDCP, NULL, keySize); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 07: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 08: Attempt to enable HDCP after termination + status = dsEnableHDCP(handle[0], enableHDCP, hdcpKey, keySize); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsIsDTCPEnabled() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 021@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| + * |03|Call dsIsDTCPEnabled() by looping through the acquired port handles and valid pointer to check whether DTCP enabled or not(.ie TRUE / FALSE) and store it in an array | handle : [loop through valid handles] , pContentProtected = [pointer to hold data ]|dsERR_NONE |dsIsDTCPEnabled must return a valid value| + * |03|Call dsIsDTCPEnabled() by looping through the acquired port handles and valid pointer to check whether DTCP enabled or not(.ie TRUE / FALSE) and store it in a new array | handle : [loop through valid handles] , pContentProtected = [pointer to hold data ]|dsERR_NONE |dsIsDTCPEnabled must return a valid value| + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video ports of a system| |dsERR_NONE|Termination must be successful| + * + */ +void test_l1_dsVideoPort_positive_dsIsDTCPEnabled(void) { + gTestID = 21; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool isDTCPEnabledArray1[NUM_OF_PORTS]; + bool isDTCPEnabledArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Check if DTCP is enabled + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsIsDTCPEnabled(handle[i], &isDTCPEnabledArray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the check for DTCP status + for (int i = 0; i < NUM_OF_PORTS; i++){ + status = dsIsDTCPEnabled(handle[i], &isDTCPEnabledArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(isDTCPEnabledArray1[i], isDTCPEnabledArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsIsDTCPEnabled() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 022@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsIsDTCPEnabled() - Attempt to get the DTCP status with out initializing video ports| handle [invalid handle] , pContentProtected = [valid pointer]|dsERR_NOT_INITIALIZED| dsIsDTCPEnabled call must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | + * |03|Call dsIsDTCPEnabled() - Using an invalid handle but with valid pointer | handle = [invalid handle], pContentProtected = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsIsDTCPEnabled() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], pContentProtected = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video ports of a system | | dsERR_NONE | Termination must be successful | + * |07|Call dsIsDTCPEnabled() - Again after terminating video ports attempt to get DTCP status | handle= [valid handle] , pContentProtected = [valid pointer] | dsERR_NOT_INITIALIZED | dsIsDTCPEnabled call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsIsDTCPEnabled(void) { + gTestID = 22; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool isDTCPEnabled[NUM_OF_PORTS]; + + // Step 01: Attempt to get DTCP status without initialization + status = dsIsDTCPEnabled(-1, &isDTCPEnabled[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsIsDTCPEnabled(handle[0], &isDTCPEnabled[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Check DTCP status with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++){ + status = dsIsDTCPEnabled(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get DTCP status after termination + status = dsIsDTCPEnabled(handle[0], &isDTCPEnabled[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsIsHDCPEnabled() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 023@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| + * |03|Call dsIsHDCPEnabled() by looping through the acquired port handles and checks whether HDCP enabled or not(.ie TRUE / FALSE) and store it in an array | handle : [loop through valid handles] , pContentProtected = [pointer to hold data ] | dsERR_NONE | dsIsHDCPEnabled must return a valid value| + * |04|Call dsIsHDCPEnabled() by looping through the acquired port handles and checks whether HDCP enabled or not(.ie TRUE / FALSE) and store it in a new array | handle : [loop through valid handles] , pContentProtected = [pointer to hold data ] | dsERR_NONE | dsIsHDCPEnabled must return a valid value| + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video ports of a system| |dsERR_NONE|Termination must be successful| + * + */ +void test_l1_dsVideoPort_positive_dsIsHDCPEnabled(void) { + gTestID = 23; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool isHDCPEnabledArray1[NUM_OF_PORTS]; + bool isHDCPEnabledArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + // Step 03: Check if HDCP is enabled + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsIsHDCPEnabled(handle[i], &isHDCPEnabledArray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the check for HDCP status + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsIsHDCPEnabled(handle[i], &isHDCPEnabledArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(isHDCPEnabledArray1[i], isHDCPEnabledArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsIsHDCPEnabled() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 024@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsIsHDCPEnabled() - Attempt to get the HDCP status with out initializing video ports| handle [invalid handle] , pContentProtected = [valid pointer]|dsERR_NOT_INITIALIZED| dsIsHDCPEnabled call must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | + * |03|Call dsIsHDCPEnabled() - Using an invalid handle but with valid pointer | handle = [invalid handle], pContentProtected = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsIsHDCPEnabled() - By looping through acquired port handles but with a invalid pointer | handle = [valid handle], pContentProtected = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video ports of a system | | dsERR_NONE | Termination must be successful | + * |07|Call dsIsHDCPEnabled() - Again after terminating video ports attempt to get HDCP status | handle= [valid handle from step 04 ] , pContentProtected = [valid pointer] | dsERR_NOT_INITIALIZED | dsIsHDCPEnabled call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsIsHDCPEnabled(void) { + gTestID = 24; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool contentProtected[NUM_OF_PORTS]; + + // Step 01: Attempt to get HDCP status without initialization + status = dsIsHDCPEnabled(-1, &(contentProtected[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Attempt to get HDCP status with an invalid handle + status = dsIsHDCPEnabled(handle[0], &(contentProtected[0])); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get the video port handle for supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get HDCP status with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsIsHDCPEnabled(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get HDCP status after termination + status = dsIsHDCPEnabled(handle[0], &(contentProtected[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsEnableVideoPort() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 025@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] | dsERR_NONE | Valid port handle must be returned for all supported video ports| + * |03|Call dsEnableVideoPort() by looping through the acquired port handles to enable video ports | handle = [loop through valid handles] , enabled = [TRUE] | dsERR_NONE | Video ports must be enabled | + * |04|Call dsVideoPortTerm() - Terminate the video ports of a system| |dsERR_NONE|Termination must be successful| + * + */ +void test_l1_dsVideoPort_positive_dsEnableVideoPort(void) { + gTestID = 25; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Enable the video port + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsEnableVideoPort(handle[i], true); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsEnableVideoPort() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 026@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsEnableVideoPort() - Attempt to enable or disable video port with out initializing video ports| handle [invalid handle] , enabled = [valid bool value]| dsERR_NOT_INITIALIZED| dsEnableVideoPort call must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | + * |03|Call dsEnableVideoPort() - Using an invalid handle but with valid enabled value(i.e TRUE/FALSE) | handle = [invalid handle], enabled = [valid bool value] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsVideoPortTerm() - Terminate the video ports of a system | | dsERR_NONE | Termination must be successful | + * |06|Call dsEnableVideoPort() - Again after terminating video ports attempt to enable or disable video port | handle = [valid handle ] , enabled = [valid bool value] | dsERR_NOT_INITIALIZED | dsEnableVideoPort call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsEnableVideoPort(void) { + gTestID = 26; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + bool enabled = true; // Example value for enabling/disabling the port + + // Step 01: Attempt to enable/disable video port without initialization + status = dsEnableVideoPort(-1, enabled); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsEnableVideoPort(handle[0], enabled); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 06: Attempt to enable/disable video port after termination + status = dsEnableVideoPort(handle[0], enabled); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsSetResolution() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 027@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| + * |03|Call dsSetResolution() by looping through the acquired port handles and valid resolution pointer to set the video port resolution |handle = [loop through valid handles] , resolution = [valid pointer]|dsERR_NONE|Resolution must be set successfully| + * |04|Call dsVideoPortTerm() - Terminate the video ports of a system| |dsERR_NONE|Termination must be successful| + * + */ +void test_l1_dsVideoPort_positive_dsSetResolution(void) { + gTestID = 27; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Set the resolution for the video port + for (int i = 0; i < NUM_OF_PORTS; i++) { + for(int j =0; j < (sizeof(kResolutions)/sizeof(kResolutions[0])); j++) { + status = dsSetResolution(handle[i], &kResolutions[j]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + } + + // Step 04: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsSetResolution() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 028@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsSetResolution() - Attempt to set the resolution with out initializing video ports| handle = [invalid handle] , resolution = [valid pointer]| dsERR_NOT_INITIALIZED| dsSetResolution call must fail as module is not initialized | + * |02|dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | + * |03|Call dsSetResolution() - Using an invalid handle but with valid resolution pointer | handle = [invalid handle], resolution = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsSetResolution() - By looping through acquired port handles but with a invalid pointer | handle = [valid handle], resolution = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |06|Call dsSetResolution() - By looping through acquired port handles but with a out of range resolution paramerters | handle = [valid handle], resolution = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |07|Call dsVideoPortTerm() - Terminate the video ports of a system | | dsERR_NONE | Termination must be successful | + * |08|Call dsSetResolution() - Again after terminating video ports attempt to set the resolution | handle= [valid handle from step 04 ] , resolution = [valid pointer] | dsERR_NOT_INITIALIZED | dsSetResolution call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsSetResolution(void) { + gTestID = 28; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + + + // Step 01: Attempt to set resolution without initialization + status = dsSetResolution(-1, &(kResolutions[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsSetResolution(handle[0], &(kResolutions[0])); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Set resolution with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsSetResolution(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Set resolution with invalid resolution parameters + for (int i = 0; i < NUM_OF_PORTS; i++) { + for (int j = 0; j < (sizeof(invalid_kRes)/sizeof(invalid_kRes[0])); j++) { + status = dsSetResolution(handle[i], &invalid_kRes[j]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + } + // Step 07: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 08: Attempt to set resolution after termination + status = dsSetResolution(handle[0], &(kResolutions[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsGetResolution() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 029@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| + * |03|Call dsGetResolution() by looping through the acquired port handles and valid resolution pointer to retrieve the resolution of a video port and store it in an array | handle = [loop through valid handles] , resolution = [valid pointer] |dsERR_NONE|Resolution must be retrieved successfully| + * |04|Call dsGetResolution() Again by looping through the acquired port handles and valid resolution pointer to retrieve the resolution of a video port and store it in a new array | handle = [loop through valid handles] , resolution = [valid pointer] |dsERR_NONE|Resolution must be retrieved successfully| + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video ports of a system| |dsERR_NONE|Termination must be successful| + * + */ +void test_l1_dsVideoPort_positive_dsGetResolution(void) { + gTestID = 29; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsVideoPortResolution_t resolutionArray1[NUM_OF_PORTS]; + dsVideoPortResolution_t resolutionArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Retrieve the resolution of the video port + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetResolution(handle[i], &(resolutionArray1[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the retrieval of resolution + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetResolution(handle[i] , &resolutionArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(resolutionArray1[i].pixelResolution, resolutionArray2[i].pixelResolution); + UT_ASSERT_EQUAL(resolutionArray1[i].aspectRatio, resolutionArray2[i].aspectRatio); + UT_ASSERT_EQUAL(resolutionArray1[i].stereoScopicMode, resolutionArray2[i].stereoScopicMode); + UT_ASSERT_EQUAL(resolutionArray1[i].frameRate, resolutionArray2[i].frameRate); + UT_ASSERT_EQUAL(resolutionArray1[i].interlaced, resolutionArray2[i].interlaced); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsGetResolution() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 030@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetResolution() - Attempt to get the resolution without initializing video ports| handle = [invalid handle] , resolution = [valid pointer]| dsERR_NOT_INITIALIZED| Get Resolution call must fail as module is not initialized | + * |02|dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | + * |03|Call dsGetResolution() - Using an invalid handle but with valid resolution pointer | handle = [invalid handle], resolution = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |04|Call dsGetResolution() - By looping through acquired port handles but with a invalid pointer | handle = [valid handle], resolution = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |05|Call dsVideoPortTerm() - Terminate the video ports of a system | | dsERR_NONE | Termination must be successful | + * |06|Call dsGetResolution() - Again after terminating video ports attempt to get the resolution of video ports | handle = [valid handle] , resolution = [valid pointer] | dsERR_NOT_INITIALIZED | Get Resolution call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetResolution(void) { + gTestID = 30; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsVideoPortResolution_t resolution[NUM_OF_PORTS]; + + // Step 01: Attempt to get resolution without initialization + status = dsGetResolution(-1, &(resolution[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsGetResolution( handle[0] , &(resolution[0])); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get resolution with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetResolution(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get resolution after termination + status = dsGetResolution(handle[0], &(resolution[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsSetActiveSource() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 031@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| + * |03|Call dsSetActiveSource() by looping through the acquired port handles and set the video port as active source | handle = [loop through valid handles] |dsERR_NONE|The video port must be set as the active source successfully| + * |04|dsVideoPortTerm() - Terminate the video ports of a system| |dsERR_NONE|Termination must be successful| + * + */ +void test_l1_dsVideoPort_positive_dsSetActiveSource(void) { + gTestID = 31; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Set the video port as the active source + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsSetActiveSource(handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsSetActiveSource() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 032@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsSetActiveSource() - Attempt to set the active source with out initializing video ports| handle = [invalid handle] | dsERR_NOT_INITIALIZED| dsSetActiveSource call must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | + * |03|Call dsSetActiveSource() - Using an invalid handle attempt to set active source | handle = [invalid handle] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsVideoPortTerm() - Terminate the video ports of a system | | dsERR_NONE | Termination must be successful | + * |06|Call dsSetActiveSource() - Again after terminating video ports attempt to set the active source | handle= [valid handle ] | dsERR_NOT_INITIALIZED | dsSetActiveSource call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsSetActiveSource(void) { + gTestID = 32; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle [NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + // Step 01: Attempt to set active source without initialization + status = dsSetActiveSource(-1); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsSetActiveSource(handle[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 06: Attempt to set active source after termination + status = dsSetActiveSource(handle[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + +/** + * @brief Positive Test Scenarios for dsVideoFormatUpdateRegisterCB() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 033@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsVideoFormatUpdateRegisterCB() - Register a valid Video Format update callback | cb = [valid callback function] | dsERR_NONE | Video Format Update callback registration must be successful | + * |03|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ + +/*callback*/ +void mockVideoFormatCallback(dsHDRStandard_t videoFormat){ + // Mock implementation, can be customized for testing +} + +void test_l1_dsVideoPort_positive_dsVideoFormatUpdateRegisterCB(void) { + gTestID = 33; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Register a valid Video Format update callback + status = dsVideoFormatUpdateRegisterCB(mockVideoFormatCallback); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsVideoFormatUpdateRegisterCB() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 034@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoFormatUpdateRegisterCB() - Attempt to register for video format update callback without initializing the video ports | cb = [valid callback function ] | dsERR_NOT_INITIALIZED | Callback registration must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsVideoFormatUpdateRegisterCB() with an invalid callback (NULL)| cb = NULL | dsERR_INVALID_PARAM | Invalid paramter error must be returned | + * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |05|Call dsVideoFormatUpdateRegisterCB() - Attempt to register for video format update callback without initializing the video ports | cb = [valid callback function ] | dsERR_NOT_INITIALIZED | Callback registration must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsVideoFormatUpdateRegisterCB(void) { + gTestID = 34; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + + // Step 01: Attempt to register callback without initialization + status = dsVideoFormatUpdateRegisterCB(mockVideoFormatCallback); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Register with invalid callback (NULL) + status = dsVideoFormatUpdateRegisterCB(NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 05: Attempt to register callback after termination + status = dsVideoFormatUpdateRegisterCB(mockVideoFormatCallback); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + +/** + * @brief Positive Test Scenarios for dsRegisterHdcpStatusCallback() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 035@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsRegisterHdcpStatusCallback() - Register a valid HDCP status change callback |handle = [valid handle], cb = [Callback function] | dsERR_NONE | Callback must be registered successfully | + * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ + +/*callback */ +void myHdcpStatusCallbackFunction(intptr_t handle, dsHdcpStatus_t status) +{ + /*stub callback*/ +} + +void test_l1_dsVideoPort_positive_dsRegisterHdcpStatusCallback(void) { + gTestID = 35; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + // Assume dsHdcpStatusCallback_t is defined and a valid callback function is implemented + dsHDCPStatusCallback_t validHdcpStatusCallback = myHdcpStatusCallbackFunction; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle and register HDCP status callback + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Register HDCP status change callback + status = dsRegisterHdcpStatusCallback(handle[i], validHdcpStatusCallback); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsRegisterHdcpStatusCallback() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 036@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsRegisterHdcpStatusCallback() - Attempt to register HDCP status change callback without initializing the video ports | handle= [invalid handle], cb = [valid callback function] | dsERR_NOT_INITIALIZED | Callback Registration for HDCP status change must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsRegisterHdcpStatusCallback() with an invalid handle but with a valid callback function as parameter | handle= [invalid handle], cb = [valid callback function] | dsERR_INVALID_PARAM | Invalid Parameter error must be returned | + * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |05|Call dsRegisterHdcpStatusCallback() with a valid handle and a NULL callback function | handle= [valid handle], cb = NULL | dsERR_INVALID_PARAM | Invalid Parameter error must be returned | + * |05|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |06|Call dsRegisterHdcpStatusCallback() - Attempt to register HDCP status change callback without initializing the video ports | handle= [valid handle], cb = [valid callback function] | dsERR_NOT_INITIALIZED | Callback Registration for HDCP status change must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsRegisterHdcpStatusCallback(void) { + gTestID = 36; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS] = {HANDLE_ARRAY_INIT} /* Initialize with invalid handle */; + + // Assume dsHdcpStatusCallback_t is defined + dsHDCPStatusCallback_t validHdcpStatusCallback = myHdcpStatusCallbackFunction; + + // Step 01: Attempt to register HDCP status callback without initialization + status = dsRegisterHdcpStatusCallback(-1, validHdcpStatusCallback); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsRegisterHdcpStatusCallback(handle[0], validHdcpStatusCallback); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + // Step 05: Register HDCP status callback with NULL callback function + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsRegisterHdcpStatusCallback(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to register HDCP status callback after termination + status = dsRegisterHdcpStatusCallback(handle[0], validHdcpStatusCallback); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsGetHDCPStatus() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 037@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsGetHDCPStatus() by looping through the acquired port handles and valid pointer to retrieve HDCP status and store it in an array | handle = [valid handles] status = [valid pointer] | dsERR_NONE | The HDCP status must be successfully fetched and stored in the given pointer| + * |04|Call dsGetHDCPStatus() - Again by looping through the acquired port handles and valid pointer to retrieve HDCP status and store it in a new array | handle = [valid handles] status = [valid pointer] | dsERR_NONE | The HDCP status must be successfully fetched and stored in the given pointer| + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsGetHDCPStatus(void) { + gTestID = 37; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsHdcpStatus_t hdcpStatusArray1[NUM_OF_PORTS]; + dsHdcpStatus_t hdcpStatusArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Retrieve the HDCP status + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetHDCPStatus(handle[i], &(hdcpStatusArray1[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the retrieval of HDCP status + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetHDCPStatus(handle[i], &(hdcpStatusArray2[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(hdcpStatusArray1[i], hdcpStatusArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsGetHDCPStatus() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 038@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetHDCPStatus() Attempt to get the HDCP status with out initializing video ports| handle = [invalid handle] , status = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetHDCPStatus call must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsGetHDCPStatus() Using an invalid handle but with valid status pointer | handle = [invalid handle], status = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| + * |04|Call dsGetHDCPStatus() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], status = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |05|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |06|Call dsGetHDCPStatus() Again after terminating video ports attempt to get the status of video ports | handle= [valid handle ] , status = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetHDCPStatus call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetHDCPStatus(void) { + gTestID = 38; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + dsHdcpStatus_t hdcpStatus[NUM_OF_PORTS]; + + // Step 01: Attempt to get HDCP status without initialization + status = dsGetHDCPStatus(-1, &(hdcpStatus[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsGetHDCPStatus(handle[0], &(hdcpStatus[0])); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get HDCP status with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetHDCPStatus(handle[i] , NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get HDCP status after termination + status = dsGetHDCPStatus(handle[0], &(hdcpStatus[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + + +/** + * @brief Positive Test Scenarios for dsGetHDCPProtocol() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 039@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsGetHDCPProtocol() by looping through the acquired suported port handles and valid pointer to retrieve the protocol version of a video port and store it in an array |handle = [valid handles] , protocolVersion = [valid pointer] |dsERR_NONE|The HDCP protocol version must be successfully fetched | + * |04|Call dsGetHDCPProtocol() -Again by looping through the acquired suported port handles and valid pointer to retrieve the protocol version of a video port and store it in a new array |handle = [valid handles] , protocolVersion = [valid pointer] |dsERR_NONE|The HDCP protocol version must be successfully fetched | + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsGetHDCPProtocol(void) { + gTestID = 39; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsHdcpProtocolVersion_t protocolVersionArray1[NUM_OF_PORTS]; + dsHdcpProtocolVersion_t protocolVersionArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Retrieve the HDCP protocol version + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetHDCPProtocol(handle[i], &(protocolVersionArray1[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the retrieval of HDCP protocol version + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetHDCPProtocol(handle[i], &(protocolVersionArray2[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(protocolVersionArray1[i], protocolVersionArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + +/** + * @brief Negative Test Scenarios for dsGetHDCPProtocol() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 040@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetHDCPProtocol() Attempt to get the HDCP protocol version with out initializing video ports| handle = [invalid handle] , protocolVersion = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetHDCPProtocol call must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsGetHDCPProtocol() Using an invalid handle but with valid pointer | handle = [invalid handle], protocolVersion = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| + * |05|Call dsGetHDCPProtocol() By looping through acquired supported port handles but with a invalid pointer | handle = [valid handle], protocolVersion = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsGetHDCPProtocol() Again after terminating video ports attempt to get the HDCP protocol version of video ports | handle= [ valid handle ] , protocolVersion = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetHDCPProtocol call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetHDCPProtocol(void) { + gTestID = 40; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsHdcpProtocolVersion_t protocolVersion[NUM_OF_PORTS]; + + // Step 01: Attempt to get HDCP protocol without initialization + status = dsGetHDCPProtocol(-1, &(protocolVersion[0])); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsGetHDCPProtocol(handle[0], &(protocolVersion[0])); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get HDCP protocol with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetHDCPProtocol(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get HDCP protocol after termination + status = dsGetHDCPProtocol(handle[0], &protocolVersion[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsGetHDCPReceiverProtocol() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 041@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsGetHDCPReceiverProtocol() by looping through the acquired supported port handles and valid pointer to retrieve the sink device protocol version of a video port and store it in an array |handle = [loop through valid handles] , protocolVersion = [valid pointer] |dsERR_NONE|The Receiver HDCP protocol version must be successfully fetched and stored in the given pointer| + * |04|Call dsGetHDCPReceiverProtocol() - Again by looping through the acquired supported port handles and valid pointer to retrieve the sink device protocol version of a video port and store it in a new array |handle = [loop through valid handles] , protocolVersion = [valid pointer] |dsERR_NONE|The Receiver HDCP protocol version must be successfully fetched and stored in the given pointer| + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsGetHDCPReceiverProtocol(void) { + gTestID = 41; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + + intptr_t handle[NUM_OF_PORTS]; + + dsHdcpProtocolVersion_t protocolVersionArray1[NUM_OF_PORTS]; + dsHdcpProtocolVersion_t protocolVersionArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Retrieve the Receiver HDCP protocol version + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetHDCPReceiverProtocol(handle[i], &(protocolVersionArray1[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the retrieval of Receiver HDCP protocol version + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetHDCPReceiverProtocol(handle[i], &(protocolVersionArray2[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(protocolVersionArray1[i], protocolVersionArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsGetHDCPReceiverProtocol() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 042@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetHDCPReceiverProtocol() Attempt to get the sink device HDCP protocol version of sink device with out initializing video ports| handle = [invalid handle] , protocolVersion = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetHDCPReceiverProtocol call must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsGetHDCPReceiverProtocol() Using an invalid handle but with valid pointer | handle = [invalid handle], protocolVersion = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| + * |05|Call dsGetHDCPReceiverProtocol() By looping through acquired supported port handles but with a invalid pointer | handle = [valid handle], protocolVersion = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsGetHDCPReceiverProtocol() Again after terminating video ports attempt to get the sink device HDCP protocol version of video ports | handle= [valid handle ] , protocolVersion = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetHDCPReceiverProtocol call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetHDCPReceiverProtocol(void) { + gTestID = 42; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsHdcpProtocolVersion_t receiverProtocolVersion[NUM_OF_PORTS]; + + // Step 01: Attempt to get Receiver HDCP protocol without initialization + status = dsGetHDCPReceiverProtocol(-1, &receiverProtocolVersion[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsGetHDCPReceiverProtocol(handle[0], &receiverProtocolVersion[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get Receiver HDCP protocol with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetHDCPReceiverProtocol(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get Receiver HDCP protocol after termination + status = dsGetHDCPReceiverProtocol(handle[0], &receiverProtocolVersion[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsGetHDCPCurrentProtocol() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 043@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsGetHDCPCurrentProtocol() by looping through the acquired supported port handles and valid pointer to retrieve the current negotiated protocol version of a video port and store it in an array |handle = [valid handles] , protocolVersion = [valid pointer] |dsERR_NONE|The current HDCP protocol version must be successfully fetched | + * |04|Call dsGetHDCPCurrentProtocol() -Again by looping through the acquired supported port handles and valid pointer to retrieve the current negotiated protocol version of a video port and store it in a new array |handle = [valid handles] , protocolVersion = [valid pointer] |dsERR_NONE|The current HDCP protocol version must be successfully fetched | + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsGetHDCPCurrentProtocol(void) { + gTestID = 43; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]; + + dsHdcpProtocolVersion_t currentProtocolArray1[NUM_OF_PORTS]; + dsHdcpProtocolVersion_t currentProtocolArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Retrieve the current negotiated HDCP protocol version + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetHDCPCurrentProtocol(handle[i], ¤tProtocolArray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the retrieval of current HDCP protocol version + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetHDCPCurrentProtocol(handle[i], ¤tProtocolArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(currentProtocolArray1[i], currentProtocolArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsGetHDCPCurrentProtocol() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 044@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetHDCPCurrentProtocol() Attempt to get the current negotiated HDCP protocol version with out initializing video ports| handle = [invalid handle] , protocolVersion = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetHDCPCurrentProtocol call must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsGetHDCPCurrentProtocol() Using an invalid handle but with valid pointer | handle = [invalid handle], protocolVersion = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| + * |05|Call dsGetHDCPCurrentProtocol() By looping through acquired supported port handles but with a invalid pointer | handle = [valid handle], protocolVersion = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsGetHDCPCurrentProtocol() Again after terminating video ports attempt to get the current negotiated HDCP protocol version of video ports | handle= [valid handle ] , protocolVersion = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetHDCPCurrentProtocol call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetHDCPCurrentProtocol(void) { + gTestID = 44; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsHdcpProtocolVersion_t currentProtocolVersion[NUM_OF_PORTS]; + + // Step 01: Attempt to get current negotiated HDCP protocol without initialization + status = dsGetHDCPCurrentProtocol(-1, ¤tProtocolVersion[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsGetHDCPCurrentProtocol(handle[0], ¤tProtocolVersion[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get current HDCP protocol with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetHDCPCurrentProtocol(handle[i] , NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get current negotiated HDCP protocol after termination + status = dsGetHDCPCurrentProtocol(handle[0], ¤tProtocolVersion[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsGetTVHDRCapabilities() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 045@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| + * |03|Call dsGetTVHDRCapabilities() by looping through the acquired port handles and valid pointer to retrieve the HDR capabilities of a video port and store it in an array | handle = [loop through valid handles] , capabilities = [valid pointer] |dsERR_NONE|The HDR capabilities must be successfully fetched and stored in the given pointer| + * |04|Call dsGetTVHDRCapabilities() - Again by looping through the acquired port handles and valid pointer to retrieve the HDR capabilities of a video port and store it in a new array | handle = [loop through valid handles] , capabilities = [valid pointer] |dsERR_NONE|The HDR capabilities must be successfully fetched and stored in the given pointer| + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsGetTVHDRCapabilities(void) { + gTestID = 45; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + int capabilitiesArray1[NUM_OF_PORTS]; + int capabilitiesArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Retrieve the HDR capabilities + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetTVHDRCapabilities(handle[i], &capabilitiesArray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the retrieval of HDR capabilities + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetTVHDRCapabilities(handle[i], &capabilitiesArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(capabilitiesArray1[i], capabilitiesArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsGetTVHDRCapabilities() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 046@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetTVHDRCapabilities() Attempt to get the HDR capabilites with out initializing video ports| handle = [invalid handle] , capabilities = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetTVHDRCapabilities call must fail as module is not initialized | + * |02|dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | + * |03|Call dsGetTVHDRCapabilities() Using an invalid handle but with valid pointer | handle = [invalid handle], capabilities = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| + * |04|Call dsGetTVHDRCapabilities() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], capabilities = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |05|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |06|Call dsGetTVHDRCapabilities() Again after terminating video ports attempt to get the HDR capabilites of video ports | handle= [valid handle ] , capabilities = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetTVHDRCapabilities call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetTVHDRCapabilities(void) { + gTestID = 46; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + int capabilities[NUM_OF_PORTS]; + + // Step 01: Attempt to get HDR capabilities without initialization + status = dsGetTVHDRCapabilities(-1, &capabilities[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsGetTVHDRCapabilities(handle[0], &capabilities[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + for (int i = 0; i < NUM_OF_PORTS; i++) { + // Step 05: Get HDR capabilities with invalid pointer + status = dsGetTVHDRCapabilities(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get HDR capabilities after termination + status = dsGetTVHDRCapabilities(handle[0], &capabilities[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsSupportedTvResolutions() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 047@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| + * |03|Call dsSupportedTvResolutions() by looping through the acquired port handles and valid pointer to retrieve the resolutions of a video port and store it in an array |handle = [loop through valid handles] , resolutions = [valid pointer] |dsERR_NONE|Resolutions must be set successfully| + * |04|Call dsSupportedTvResolutions() -Again by looping through the acquired port handles and valid pointer to retrieve the resolutions of a video port and store it in a new array |handle = [loop through valid handles] , resolutions = [valid pointer] |dsERR_NONE|Resolutions must be set successfully| + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video ports of a system| |dsERR_NONE|Termination must be successful| + * + */ +void test_l1_dsVideoPort_positive_dsSupportedTvResolutions(void) { + gTestID = 47; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + int resolutionsArray1[NUM_OF_PORTS]; + int resolutionsArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Retrieve the supported TV resolutions + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsSupportedTvResolutions(handle[i], &resolutionsArray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the retrieval of supported TV resolutions + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsSupportedTvResolutions(handle[i], &resolutionsArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(resolutionsArray1[i], resolutionsArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsSupportedTvResolutions() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 048@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsSupportedTvResolutions() - Attempt to get the supported resolutions with out initializing video ports| handle = [invalid handle] , resolutions = [valid pointer]| dsERR_NOT_INITIALIZED| dsSupportedTvResolutions call must fail as module is not initialized | + * |02|dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | + * |03|Call dsSupportedTvResolutions() - Using an invalid handle but with valid resolutions pointer | handle = [invalid handle], resolutions = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |04|Call dsSupportedTvResolutions() - By looping through acquired port handles but with a invalid pointer | handle = [valid handle], resolutions = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |05|Call dsVideoPortTerm() - Terminate the video ports of a system | | dsERR_NONE | Termination must be successful | + * |06|Call dsSupportedTvResolutions() - Again after terminating video ports attempt to get the supported resolutions of video ports | handle= [valid handle ] , resolutions = [valid pointer] | dsERR_NOT_INITIALIZED | dsSupportedTvResolutions call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsSupportedTvResolutions(void) { + gTestID = 48; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + int resolutions[NUM_OF_PORTS]; + + // Step 01: Attempt to get supported resolutions without initialization + status = dsSupportedTvResolutions(-1, &resolutions[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsSupportedTvResolutions(handle[0], &resolutions[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get supported resolutions with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsSupportedTvResolutions(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get supported resolutions after termination + status = dsSupportedTvResolutions(handle[0], &resolutions[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsSetForceDisable4KSupport() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 049@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsSetForceDisable4KSupport() by looping through the acquired port handles and valid value to Set the 4K support to be forcefully disabled or not | handle = [loop through valid handles] , disable= [valid value] | dsERR_NONE | The 4K support must be successfully disabled or not | + * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsSetForceDisable4KSupport(void) { + gTestID = 49; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool disable4K = true; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + for (int i = 0; i < NUM_OF_PORTS; i++) { + // Step 03: Set force disable 4K support + status = dsSetForceDisable4KSupport(handle[i], disable4K); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsSetForceDisable4KSupport() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 050@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsSetForceDisable4KSupport() Attempt to disable or not to disable 4K support with out initializing video ports| handle = [invalid handle] , disable = [valid value]| dsERR_NOT_INITIALIZED| dsSetForceDisable4KSupport call must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsSetForceDisable4KSupport() Using an invalid handle but with valid disable parameter value | handle = [invalid handle], disable = [valid value] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |06|Call dsSetForceDisable4KSupport() Again after terminating video ports attempt to disable or not to disable 4k support of video ports | handle= [valid handle ] , disable = [valid value] | dsERR_NOT_INITIALIZED | dsSetForceDisable4KSupport call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsSetForceDisable4KSupport(void) { + gTestID = 50; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool disable4K = true; + + // Step 01: Attempt to set force disable 4K support without initialization + status = dsSetForceDisable4KSupport(-1, disable4K); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsSetForceDisable4KSupport(handle[0], disable4K); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 06: Attempt to set force disable 4K support after termination + status = dsSetForceDisable4KSupport(handle[0], disable4K); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsGetForceDisable4KSupport() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 051@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsGetForceDisable4KSupport() by looping through the acquired port handles and valid pointer to get the 4K support disabled or not and store it in an array | handle = [loop through valid handles] , disable= [valid pointer] | dsERR_NONE | The 4K support disabled or not must be successfully retrieved | + * |04|Call dsGetForceDisable4KSupport() - Again by looping through the acquired port handles and valid pointer to get the 4K support disabled or not and store it in a new array | handle = [loop through valid handles] , disable= [valid pointer] | dsERR_NONE | The 4K support disabled or not must be successfully retrieved | + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsGetForceDisable4KSupport(void) { + gTestID = 51; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool disable4KArray1[NUM_OF_PORTS]; + bool disable4KArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Retrieve whether 4K support is disabled + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetForceDisable4KSupport(handle[i], &disable4KArray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the retrieval + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetForceDisable4KSupport(handle[i], &disable4KArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(disable4KArray1[i], disable4KArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsGetForceDisable4KSupport() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 052@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetForceDisable4KSupport() Attempt to get 4k support disable or not with out initializing video ports| handle = [invalid handle] , disable = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetForceDisable4KSupport call must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsGetForceDisable4KSupport() Using an invalid handle but with valid pointer | handle = [invalid handle], disable = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsGetForceDisable4KSupport() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], disable = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsGetForceDisable4KSupport() Again after terminating video ports attempt to get whether 4K support of video ports disabled or not | handle= [valid handle ] , disable = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetForceDisable4KSupport call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetForceDisable4KSupport(void) { + gTestID = 52; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool disable4K[NUM_OF_PORTS]; + + // Step 01: Attempt to get 4K support status without initialization + status = dsGetForceDisable4KSupport(-1, &disable4K[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsGetForceDisable4KSupport(handle[0], &disable4K[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get 4K support status with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetForceDisable4KSupport(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get 4K support status after termination + status = dsGetForceDisable4KSupport(handle[0], &disable4K[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsGetVideoEOTF() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 053@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsGetVideoEOTF() by looping through the acquired port handles and valid pointer to retrieve the current Electro-Optical Transfer Function (EOTF) value and store it in an array | handle = [loop through ports] , video_eotf = [valid pointer] |dsERR_NONE | Valid EOTF value must return a valid EOTF value of the specified video port| + * |04|Call dsGetVideoEOTF() -Again by looping through the acquired port handles and valid pointer to retrieve the current Electro-Optical Transfer Function (EOTF) value and store it in a new array | handle = [loop through ports] , video_eotf = [valid pointer] |dsERR_NONE | Valid EOTF value must return a valid EOTF value of the specified video port| + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsGetVideoEOTF(void) { + gTestID = 53; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsHDRStandard_t eotfArray1[NUM_OF_PORTS]; + dsHDRStandard_t eotfArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Retrieve the EOTF value + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoEOTF(handle[i], &eotfArray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the retrieval of EOTF value + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoEOTF(handle[i], &eotfArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(eotfArray1[i], eotfArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsGetVideoEOTF() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 054@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetVideoEOTF() Attempt to get the EOTF with out initializing video ports| handle = [invalid handle] , video_eotf = [valid pointer] | dsERR_NOT_INITIALIZED| dsGetVideoEOTF call must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsGetVideoEOTF() Using an invalid handle but with valid pointer | handle = [invalid handle], video_eotf = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsGetVideoEOTF() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], video_eotf = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsGetVideoEOTF() Again after terminating video ports attempt to get the EOTF of video ports | handle= [invalid handle ] , video_eotf = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetVideoEOTF call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetVideoEOTF(void) { + gTestID = 54; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsHDRStandard_t eotf[NUM_OF_PORTS]; + + // Step 01: Attempt to get EOTF without initialization + status = dsGetVideoEOTF(-1, &eotf[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsGetVideoEOTF(handle[0], &eotf[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get EOTF value with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoEOTF(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get EOTF after termination + status = dsGetVideoEOTF(handle[0], &eotf[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsGetMatrixCoefficients() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 055@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsGetMatrixCoefficients() by looping through the acquired port handles and valid resolution pointer to retrieve the current matrix coefficients of a specified port and store it in an array |handle = [loop through valid handles] , matrix_coefficients = [valid pointer] |dsERR_NONE|must return a valid matrix coefficient value of the specified video port| + * |04|Call dsGetMatrixCoefficients() -Again by looping through the acquired port handles and valid resolution pointer to retrieve the current matrix coefficients of a specified port and store it in a new array |handle = [loop through valid handles] , matrix_coefficients = [valid pointer] |dsERR_NONE|must return a valid matrix coefficient value of the specified video port| + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsGetMatrixCoefficients(void) { + gTestID = 55; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsDisplayMatrixCoefficients_t matrixCoefficientsArray1[NUM_OF_PORTS]; + dsDisplayMatrixCoefficients_t matrixCoefficientsArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + for (int i = 0; i < NUM_OF_PORTS; i++) { + // Step 03: Retrieve the matrix coefficients + status = dsGetMatrixCoefficients(handle[i], &matrixCoefficientsArray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the retrieval of matrix coefficients + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetMatrixCoefficients(handle[i], &matrixCoefficientsArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(matrixCoefficientsArray1[i], matrixCoefficientsArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsGetMatrixCoefficients() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 056@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetMatrixCoefficients() Attempt to get the matrix coefficients with out initializing video ports| handle = [invalid handle] , matrix_coefficients = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetMatrixCoefficients call must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsGetMatrixCoefficients() Using an invalid handle but with valid pointer | handle = [invalid handle], matrix_coefficients = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsGetMatrixCoefficients() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], matrix_coefficients = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsGetMatrixCoefficients() Again after terminating video ports attempt to get the matrix coefficients of video ports | handle= [ valid handle ] , matrix_coefficients = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetMatrixCoefficients call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetMatrixCoefficients(void) { + gTestID = 56; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsDisplayMatrixCoefficients_t matrixCoefficients[NUM_OF_PORTS]; + + // Step 01: Attempt to get matrix coefficients without initialization + status = dsGetMatrixCoefficients(-1, &matrixCoefficients[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsGetMatrixCoefficients(handle[0], &matrixCoefficients[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get matrix coefficients with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetMatrixCoefficients(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get matrix coefficients after termination + status = dsGetMatrixCoefficients(handle[0], &matrixCoefficients[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsGetColorDepth() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 057@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsGetColorDepth() by looping through the acquired port handles and valid pointer to retrieve the current color depth & store in an array | handle = [loop through valid handles] , color_depth = [valid pointer] | dsERR_NONE | must return a valid color depth value of the specified video port| + * |04|Call dsGetColorDepth() -Again by looping through the acquired port handles and valid pointer to retrieve the current color depth & store it in a new array | handle = [loop through valid handles] , color_depth = [valid pointer] | dsERR_NONE | must return a valid color depth value of the specified video port| + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsGetColorDepth(void) { + gTestID = 57; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + unsigned int colorDepthArray1[NUM_OF_PORTS]; + unsigned int colorDepthArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Retrieve the color depth + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetColorDepth(handle[i], &colorDepthArray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the retrieval of color depth + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetColorDepth(handle[i], &colorDepthArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(colorDepthArray1[i], colorDepthArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsGetColorDepth() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 058@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetColorDepth() Attempt to get the color depth with out initializing video ports| handle = [invalid handle] , color_depth = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetColorDepth call must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsGetColorDepth() Using an invalid handle but with valid pointer | handle = [invalid handle], color_depth = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsGetColorDepth() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], color_depth = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsGetColorDepth() Again after terminating video ports attempt to get the color depth of video ports | handle= [invalid handle] , color_depth = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetColorDepth call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetColorDepth(void) { + gTestID = 58; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + unsigned int colorDepth[NUM_OF_PORTS]; // To store the color depth + + // Step 01: Attempt to get color depth without initialization + status = dsGetColorDepth(-1, &colorDepth[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsGetColorDepth(handle[0], &colorDepth[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get color depth with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetColorDepth(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get color depth after termination + status = dsGetColorDepth(handle[0], &colorDepth[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsGetColorSpace() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 059@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsGetColorSpace() by looping through the acquired port handles and valid pointer to retrieve the current color space setting of video port & store it in an array |handle = [loop through valid handles] , color_space = [valid pointer] |Valid color space value|must return a valid color space setting of the specified video port| + * |04|Call dsGetColorSpace() -Again by looping through the acquired port handles and valid pointer to retrieve the current color space setting of video port & store it in a new array |handle = [loop through valid handles] , color_space = [valid pointer] |Valid color space value|must return a valid color space setting of the specified video port| + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsGetColorSpace(void) { + gTestID = 59; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsDisplayColorSpace_t colorSpaceArray1[NUM_OF_PORTS]; + dsDisplayColorSpace_t colorSpaceArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Retrieve the color space + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetColorSpace(handle[i], &colorSpaceArray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the retrieval of color space + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetColorSpace(handle[i], &colorSpaceArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(colorSpaceArray1[i], colorSpaceArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + +/** + * @brief Negative Test Scenarios for dsGetColorSpace() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 060@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetColorSpace() Attempt to get the color space with out initializing video ports| handle = [invalid handle] , color_space = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetColorSpace call must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsGetColorSpace() Using an invalid handle but with valid pointer | handle = [invalid handle], color_space = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsGetColorSpace() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], color_space = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsGetColorSpace() Again after terminating video ports attempt to get the color space of video ports | handle= [invalid handle] , color_space = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetColorSpace call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetColorSpace(void) { + gTestID = 60; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsDisplayColorSpace_t colorSpace[NUM_OF_PORTS]; + + // Step 01: Attempt to get color space without initialization + status = dsGetColorSpace(-1, &colorSpace[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsGetColorSpace(handle[0], &colorSpace[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get color space with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetColorSpace(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get color space after termination + status = dsGetColorSpace(handle[0], &colorSpace[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + +/** + * @brief Positive Test Scenarios for dsGetQuantizationRange() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 061@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsGetQuantizationRange() by looping through the acquired port handles and valid pointer to retrieve the current quantization range & store it in an array |handle = [loop through valid handles] , quantization_range = [valid pointer] |dsERR_NONE | must return a valid quantization range of the specified video port| + * |04|Call dsGetQuantizationRange() -Again by looping through the acquired port handles and valid pointer to retrieve the current quantization range & store it in a new array |handle = [loop through valid handles] , quantization_range = [valid pointer] |dsERR_NONE | must return a valid quantization range of the specified video port| + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsGetQuantizationRange(void) { + gTestID = 61; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsDisplayQuantizationRange_t quantizationRangeArray1[NUM_OF_PORTS]; + dsDisplayQuantizationRange_t quantizationRangeArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Retrieve the quantization range + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetQuantizationRange(handle[i], &quantizationRangeArray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the retrieval of quantization range + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetQuantizationRange(handle[i], &quantizationRangeArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(quantizationRangeArray1[i], quantizationRangeArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + +/** + * @brief Negative Test Scenarios for dsGetQuantizationRange() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 062@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetQuantizationRange() Attempt to get the quantization range with out initializing video ports| handle = [invalid handle] , quantization_range = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetQuantizationRange call must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsGetQuantizationRange() Using an invalid handle but with valid pointer | handle = [invalid handle], quantization_range = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsGetQuantizationRange() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], quantization_range = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsGetQuantizationRange() Again after terminating video ports attempt to get the quantization of video ports | handle= [valid handle from step 04 ] , quantization_range = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetQuantizationRange call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetQuantizationRange(void) { + gTestID = 62; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsDisplayQuantizationRange_t quantizationRange[NUM_OF_PORTS]; + + // Step 01: Attempt to get quantization range without initialization + status = dsGetQuantizationRange(-1, &quantizationRange[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsGetQuantizationRange(handle[0], &quantizationRange[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get quantization range with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetQuantizationRange(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get quantization range after termination + status = dsGetQuantizationRange(handle[0], &quantizationRange[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsGetCurrentOutputSettings() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 063@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsGetCurrentOutputSettings() by looping through the acquired port handles and valid pointer to retrieve the current output settings and store it in an array | handle= [loop through valid handles] , video_eotf = [valid EOTF pointer], matrix_coefficients = = [valid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [valid color depth pointer], quantization_range = [valid quantization range pointer]| dsERR_NONE and valid settings| All the output settings for the specified video port must be returned | + * |04|Call dsGetCurrentOutputSettings() -Again by looping through the acquired port handles and valid pointer to retrieve the current output settings and store it in a new array | handle= [loop through valid handles] , video_eotf = [valid EOTF pointer], matrix_coefficients = = [valid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [valid color depth pointer], quantization_range = [valid quantization range pointer]| dsERR_NONE and valid settings| All the output settings for the specified video port must be returned | + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsGetCurrentOutputSettings(void) { + gTestID = 63; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + dsHDRStandard_t hdrstandardarray1[NUM_OF_PORTS]; + dsDisplayMatrixCoefficients_t matrixcoefarray1[NUM_OF_PORTS]; + dsDisplayColorSpace_t colorspacearray1[NUM_OF_PORTS]; + unsigned int colordeptharray1[NUM_OF_PORTS]; + dsDisplayQuantizationRange_t quant_rangearray1[NUM_OF_PORTS]; + + dsHDRStandard_t hdrstandardarray2[NUM_OF_PORTS]; + dsDisplayMatrixCoefficients_t matrixcoefarray2[NUM_OF_PORTS]; + dsDisplayColorSpace_t colorspacearray2[NUM_OF_PORTS]; + unsigned int colordeptharray2[NUM_OF_PORTS]; + dsDisplayQuantizationRange_t quant_rangearray2[NUM_OF_PORTS]; + + // Assume OutputSettings is a struct that includes EOTF, matrix coefficients, color space, color depth, and quantization range + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Retrieve the current output settings + status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray1[i] ,&matrixcoefarray1[i], &colorspacearray1[i],\ + &colordeptharray1[i], &quant_rangearray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the retrieval of output settings + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray2[i] ,&matrixcoefarray2[i], &colorspacearray2[i],\ + &colordeptharray2[i], &quant_rangearray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(hdrstandardarray1[i], hdrstandardarray2[i]); + UT_ASSERT_EQUAL(matrixcoefarray1[i], matrixcoefarray2[i]); + UT_ASSERT_EQUAL(colorspacearray1[i], colorspacearray2[i]); + UT_ASSERT_EQUAL(colordeptharray1[i], colordeptharray2[i]); + UT_ASSERT_EQUAL(quant_rangearray1[i], quant_rangearray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsGetCurrentOutputSettings() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 064@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetCurrentOutputSettings() - Attempt to get the current output settings without initializing the video ports | handle = [invalid handle], video_eotf = [valid EOTF pointer], matrix_coefficients = = [valid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [valid color depth pointer], quantization_range = [valid quantization range pointer] | dsERR_NOT_INITIALIZED | Get Output settings must fail as module is not initialized| + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsGetCurrentOutputSettings() with an invalid handle but with valid pointers for output settings |handle = [valid handle], video_eotf = [valid EOTF pointer], matrix_coefficients = [valid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [valid color depth pointer], quantization_range = [valid quantization range pointer] |dsERR_INVALID_PARAM| Invalid parameter error must be returned | + * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsGetCurrentOutputSettings() by looping through valid handles but invalid pointer for parameters | handle = [valid handle], video_eotf = [invalid EOTF pointer], matrix_coefficients =[valid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [valid color depth pointer], quantization_range = [valid quantization range pointer] |dsERR_INVALID_PARAM| Invalid parameter error must be returned | + * |06|Call dsGetCurrentOutputSettings() by looping through valid handles but invalid pointer for parameters | handle = [valid handle], video_eotf = [valid EOTF pointer], matrix_coefficients = [invalid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [valid color depth pointer], quantization_range = [valid quantization range pointer] |dsERR_INVALID_PARAM| Invalid parameter error must be returned | + * |07|Call dsGetCurrentOutputSettings() by looping through valid handles but invalid pointer for parameters | handle = [valid handle], video_eotf = [valid EOTF pointer], matrix_coefficients = [valid matrix coefficient pointer], color_space = [invalid color space pointer], color_depth = [valid color depth pointer], quantization_range = [valid quantization range pointer] |dsERR_INVALID_PARAM| Invalid parameter error must be returned | + * |08|Call dsGetCurrentOutputSettings() by looping through valid handles but invalid pointer for parameters | handle = [valid handle], video_eotf = [valid EOTF pointer], matrix_coefficients = [valid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [invalid color depth pointer], quantization_range = [valid quantization range pointer] |dsERR_INVALID_PARAM| Invalid parameter error must be returned | + * |09|Call dsGetCurrentOutputSettings() by looping through valid handles but invalid pointer for parameters | handle = [valid handle], video_eotf = [valid EOTF pointer], matrix_coefficients = = [valid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [valid color depth pointer], quantization_range = [invalid quantization range pointer] |dsERR_INVALID_PARAM| Invalid parameter error must be returned | + * |10|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |11|Call dsGetCurrentOutputSettings() - Attempt to get the current output settings without initializing the video ports | handle = [valid handle], video_eotf = [valid EOTF pointer], matrix_coefficients = = [valid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [valid color depth pointer], quantization_range = [valid quantization range pointer] | dsERR_NOT_INITIALIZED | Get Output settings must fail as module is not initialized| + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetCurrentOutputSettings(void) { + gTestID = 64; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + dsHDRStandard_t hdrstandardarray[NUM_OF_PORTS]; + dsDisplayMatrixCoefficients_t matrixcoefarray[NUM_OF_PORTS]; + dsDisplayColorSpace_t colorspacearray[NUM_OF_PORTS]; + unsigned int colordeptharray[NUM_OF_PORTS]; + dsDisplayQuantizationRange_t quant_rangearray[NUM_OF_PORTS]; + + // Step 01: Attempt to get output settings without initialization + status = dsGetCurrentOutputSettings(-1, &hdrstandardarray[0], &matrixcoefarray[0], &colorspacearray[0],\ + &colordeptharray[0], &quant_rangearray[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsGetCurrentOutputSettings(handle[0], &hdrstandardarray[0], &matrixcoefarray[0], &colorspacearray[0],\ + &colordeptharray[0], &quant_rangearray[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle*/ + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get output settings with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetCurrentOutputSettings(handle[i], NULL, &matrixcoefarray[i], &colorspacearray[i],\ + &colordeptharray[i], &quant_rangearray[i]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Get output settings with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray[i], NULL, &colorspacearray[i],\ + &colordeptharray[i], &quant_rangearray[i]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 07: Get output settings with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray[i], &matrixcoefarray[i], NULL,\ + &colordeptharray[i], &quant_rangearray[i]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 08: Get output settings with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray[i], &matrixcoefarray[i], &colorspacearray[i],\ + NULL, &quant_rangearray[i]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 09: Get output settings with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray[i], &matrixcoefarray[i], &colorspacearray[i],\ + &colordeptharray[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 10: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 11: Attempt to get output settings after termination + status = dsGetCurrentOutputSettings(handle[0], &hdrstandardarray[0], &matrixcoefarray[0], &colorspacearray[0],\ + &colordeptharray[0], &quant_rangearray[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsIsOutputHDR() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 065@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsIsOutputHDR() - by looping through acquired port handles to check if the video output is HDR or not & store it in an array | handle = [valid handle], hdr = [valid pointer to hold hdr status value](true = HDR) | dsERR_NONE | Flag which holds the HDR status( @a true if Video Output is HDR and @a false otherwise ) of Video Port must be returned | + * |04|Call dsIsOutputHDR() - Again by looping through acquired port handles to check if the video output is HDR or not & store it in a new array | handle = [valid handle], hdr = [valid pointer to hold hdr status value](true = HDR) | dsERR_NONE | Flag which holds the HDR status( @a true if Video Output is HDR and @a false otherwise ) of Video Port must be returned | + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + * + */ +void test_l1_dsVideoPort_positive_dsIsOutputHDR(void) { + gTestID = 65; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool hdrArray1[NUM_OF_PORTS]; + bool hdrArray2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Check HDR status + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsIsOutputHDR(handle[i], &hdrArray1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat the HDR status check + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsIsOutputHDR(handle[i], &hdrArray2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(hdrArray1[i], hdrArray2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsIsOutputHDR() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 066@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsIsOutputHDR() - Attempt to check if video output is HDR or not without initializing video ports | handle: [ invalid handle ], hdr: [ pointer to hold HDR status]| dsERR_NOT_INITIALIZED | Call to check if video output is HDR or not must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsIsOutputHDR() using an invalid handle but with a valid pointer to hold the HDR status | handle: [ invalid handle ], hdr: [ pointer to hold HDR status] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | + * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |05|Call dsIsOutputHDR() by looping through acquired port handles but with a null pointer for HDR status | handle: [ loop through valid handles ], hdr: [ NULL ] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsIsOutputHDR() - Attempt to check if video output is HDR or not without initializing video ports | handle: [ valid handle ], hdr: [ pointer to hold HDR status] | dsERR_NOT_INITIALIZED | Call to check if video output is HDR or not must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsIsOutputHDR(void) { + gTestID = 66; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool hdrStatus[NUM_OF_PORTS]; + + // Step 01: Attempt to check HDR status without initialization + status = dsIsOutputHDR(-1, &hdrStatus[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Invalid handle check + status = dsIsOutputHDR(handle[0], &hdrStatus[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get valid video port handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Check HDR status with null pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsIsOutputHDR(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to check HDR status after termination + status = dsIsOutputHDR(handle[0], &hdrStatus[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsResetOutputToSDR() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 067@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|dsResetOutputToSDR() - To reset the video output to SDR | | dsERR_NONE | Video Output must be resetted to SDR | + * |03|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + * + */ +void test_l1_dsVideoPort_positive_dsResetOutputToSDR(void) { + gTestID = 67; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Reset video output to SDR + status = dsResetOutputToSDR(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsResetOutputToSDR() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 068@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsResetOutputToSDR() - Attempt to reset the video output to SDR without initializing the video ports | dsERR_NOT_INITIALIZED | Reset Video output to SDR must fail as video port is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |04|Call dsResetOutputToSDR() - Again attempt to reset the video output to SDR after terminating the video ports | dsERR_NOT_INITIALIZED| Reset Video output to SDR must fail as video port is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsResetOutputToSDR(void) { + gTestID = 68; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + + // Step 01: Attempt reset without initialization + status = dsResetOutputToSDR(); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_NONE); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 04: Attempt reset after termination + status = dsResetOutputToSDR(); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_NONE); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsSetHdmiPreference() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 069@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned for all supported video ports| + * |03|Call dsSetHdmiPreference() - by looping through the acquired port handles and set the HDMI preference from dsHdcpProtocolVersion_t | handle = [Valid handle], hdcpCurrentProtocol=[valid HDCP Protocol] | dsERR_NONE | HDMI Preference must be set successfully | + * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsSetHdmiPreference(void) { + gTestID = 69; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the port handle for all supported video ports + // Loop through kPorts to get each handle + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Set the HDMI preference + for (int i = 0; i < NUM_OF_PORTS; i++) { + for(dsHdcpProtocolVersion_t hdcpCurrentProtocol = dsHDCP_VERSION_1X ; hdcpCurrentProtocol < dsHDCP_VERSION_MAX; hdcpCurrentProtocol++) + { + status = dsSetHdmiPreference(handle[i], &hdcpCurrentProtocol); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + } + + // Step 04: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsSetHdmiPreference() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 070@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsSetHdmiPreference() - Attempt to set the HDMI Preference without initializing the video ports | handle = [invalid handle], hdcpCurrentProtocol = [valid pointer] | dsERR_NOT_INITIALIZED | Set Hdmi Preference must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsSetHdmiPreference() - Using an invalid handle but with valid HDCP Protcol pointer | handle = [invalid handle], hdcpCurrentProtocol = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] | dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsSetHdmiPreference() - by looping through the acquired port handles and set an invalid HDMI preference| handle = [Valid handle], hdcpCurrentProtocol=[invalid hdcp protocol] | dsERR_NONE | HDMI Preference must be set successfully | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsSetHdmiPreference() - Attempt to set the HDMI Preference without initializing the video ports | handle = [valid handle], hdcpCurrentProtocol = [valid pointer] | dsERR_NOT_INITIALIZED | Set Hdmi Preference must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsSetHdmiPreference(void) { + gTestID = 70; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsHdcpProtocolVersion_t in_range = dsHDCP_VERSION_1X , out_range = dsHDCP_VERSION_MAX; + + // Step 01: Attempt set HDMI preference without initialization + status = dsSetHdmiPreference(-1, &in_range); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Set HDMI preference with invalid handle + status = dsSetHdmiPreference(handle[0], &in_range); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get the port handle for all supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Set HDMI preference with valid handle and invalid HDCP protocol + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsSetHdmiPreference(handle[i], &out_range); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt set HDMI preference after termination + status = dsSetHdmiPreference(handle[0], &in_range); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsGetHdmiPreference() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 071@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsGetHdmiPreference() - by looping through the acquired port handles to get the HDMI Preference of each video ports which supports HDCP & store it in an array | handle = [valid handle], hdcpCurrentProtocol = [valid pointer] | dsERR_NONE | The Current HDMI Preference must be returned | + * |04|Call dsGetHdmiPreference() - Again by looping through the acquired port handles to get the HDMI Preference of each video ports which supports HDCP & store it in a new array | handle = [valid handle], hdcpCurrentProtocol = [valid pointer] | dsERR_NONE | The Current HDMI Preference must be returned | + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsGetHdmiPreference(void) { + gTestID = 71; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsHdcpProtocolVersion_t hdcpCurrentProtocol1[NUM_OF_PORTS]; + dsHdcpProtocolVersion_t hdcpCurrentProtocol2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the port handle for all supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Get the HDMI preference + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetHdmiPreference(handle[i], &hdcpCurrentProtocol1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat getting HDMI preference + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetHdmiPreference(handle[i], &hdcpCurrentProtocol2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values and make sure they are equal + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(hdcpCurrentProtocol1[i], hdcpCurrentProtocol2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsGetHdmiPreference() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 072@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetHdmiPreference() - Attempt to get the HDMI Preference without prior initializing the video ports| handle = [invalid handle], hdcpCurrentProtocol = [valid pointer] | dsERR_NOT_INITIALIZED | Get HDMI Preference of video ports must fail as module is not initialized | + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsGetHdmiPreference() - Using an invalid handle but with valid HDCP Protcol pointer | handle = [invalid handle], hdcpCurrentProtocol = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | + * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] | dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsGetHdmiPreference() - by looping through the acquired port handles but with NULL pointer for HDMI preference | handle = [Valid handle], hdcpCurrentProtocol = [NULL] | dsERR_NONE | Invalid Parameter error must be returned| + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsSetHdmiPreference() - Attempt to get the HDMI Preference without initializing the video ports | handle = [valid handle], hdcpCurrentProtocol = [valid pointer] | dsERR_NOT_INITIALIZED | Get Hdmi Preference must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetHdmiPreference(void) { + gTestID = 72; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsHdcpProtocolVersion_t hdcpCurrentProtocol[NUM_OF_PORTS]; + + // Step 01: Attempt to get HDMI preference without initialization + status = dsGetHdmiPreference(-1, &hdcpCurrentProtocol[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Get HDMI preference with invalid handle + status = dsGetHdmiPreference(handle[0], &hdcpCurrentProtocol[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get the port handle for all supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get HDMI preference with valid handle but with NULL pointer for HDMI Preference + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetHdmiPreference(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get HDMI preference after termination + status = dsGetHdmiPreference(handle[0], &hdcpCurrentProtocol[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsGetIgnoreEDIDStatus() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 073@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsGetIgnoreEDIDStatus() by looping through acquired handles and valid pointer to get IgnoreEDID status & store it in an array |handle=[valid handle] ,status=[valid pointer] |dsERR_NONE | must successfully get the IgnoreEDID status| + * |04|Call dsGetIgnoreEDIDStatus() - Again by looping through acquired handles and valid pointer to get IgnoreEDID status & store it in a new array |handle=[valid handle] ,status=[valid pointer] |dsERR_NONE | must successfully get the IgnoreEDID status| + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsGetIgnoreEDIDStatus(void) { + gTestID = 73; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool ignoreEDIDStatus1[NUM_OF_PORTS]; + bool ignoreEDIDStatus2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the port handle for supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Get IgnoreEDID status + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetIgnoreEDIDStatus(handle[i], &ignoreEDIDStatus1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat getting IgnoreEDID status + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetIgnoreEDIDStatus(handle[i], &ignoreEDIDStatus2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare the array values and make sure they are equal + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(ignoreEDIDStatus1[i], ignoreEDIDStatus2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsGetIgnoreEDIDStatus() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 074@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetIgnoreEDIDStatus() without prior initialization of video ports| handle=[invalid handle] ,status=[invalid pointer] |dsERR_NOT_INITIALIZED|call must be fail as module is not initialzed| + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsGetIgnoreEDIDStatus() with an invalid handle but with valid pointer|handle=[invalid handle] ,status=[valid pointer]|dsERR_INVALID_PARAM|Invalid parameter must be returned| + * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsGetIgnoreEDIDStatus() by looping through valid handles with a NULL status pointer | handle=[valid handle] , status=[NULL pointer]|dsERR_INVALID_PARAM|Invalid parameter must be returned| + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsGetIgnoreEDIDStatus() Again after terminating video ports | handle=[valid handle from step 04 ] , status=[valid pointer] | dsERR_NOT_INITIALIZED | call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetIgnoreEDIDStatus(void) { + gTestID = 74; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + bool ignoreEDIDStatus[NUM_OF_PORTS]; + + // Step 01: Attempt to get IgnoreEDID status without initialization + status = dsGetIgnoreEDIDStatus(-1, &ignoreEDIDStatus[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Get IgnoreEDID status with invalid handle + status = dsGetIgnoreEDIDStatus(handle[0], &ignoreEDIDStatus[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get the port handle for supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get IgnoreEDID status with valid handle but null pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetIgnoreEDIDStatus(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get IgnoreEDID status after termination + status = dsGetIgnoreEDIDStatus(handle[0], &ignoreEDIDStatus[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsSetBackgroundColor() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 075@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsSetBackgroundColor by looping through the acquired prots and valid color values| handle=[Valid handle], color=[valid values] | dsERR_NONE|Background color must be set successfully| + * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsSetBackgroundColor(void) { + gTestID = 75; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the port handle for supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Set background color for each port by looping through dsVideoBackgroundColor_t enum + for (int i = 0; i < NUM_OF_PORTS; i++) { + for(dsVideoBackgroundColor_t color = dsVIDEO_BGCOLOR_BLUE; color < dsVIDEO_BGCOLOR_MAX ; color++){ + status = dsSetBackgroundColor(handle[i], color); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + } + + // Step 04: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsSetBackgroundColor() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 076@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsSetBackgroundColor() without prior initialization of video ports| handle=[inValid handle], color=[valid values] |dsERR_NOT_INITIALIZED|call must fail as module not initialized| + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsSetBackgroundColor() with an invalid handle and valid color values |handle=[inValid handle], color=[valid values]|dsERR_INVALID_PARAM|Invalid parameter must return | + * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsSetBackgroundColor() by looping through acquired handles and invalid color value|handle=[valid handle], color=[Invalid color value|dsERR_INVALID_PARAM|Invalid parameter must return| + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsSetBackgroundColor() after termination video ports |handle= [valid handle from step 04 ] , color= [valid values] | dsERR_NOT_INITIALIZED | call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsSetBackgroundColor(void) { + gTestID = 76; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + // Step 01: Attempt to set background color without initialization + status = dsSetBackgroundColor(-1, dsVIDEO_BGCOLOR_BLUE); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Set background color with invalid handle + status = dsSetBackgroundColor(handle[0], dsVIDEO_BGCOLOR_BLUE); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get the port handle for supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Set background color with valid handle but invalid color + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsSetBackgroundColor(handle[i], dsVIDEO_BGCOLOR_MAX); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to set background color after termination + status = dsSetBackgroundColor(handle[0], dsVIDEO_BGCOLOR_BLACK); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsSetForceHDRMode() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 077@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsSetForceHDRMode() by looping through acquired handles and valid mode values|handle=[valid handle], mode=[valid values]|dsERR_NONE|HDR mode must be set successfully| + * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsSetForceHDRMode(void) { + gTestID = 77; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the port handle for supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Set HDR mode + for (int i = 0; i < NUM_OF_PORTS; i++) { + for(dsHDRStandard_t mode = dsHDRSTANDARD_NONE; mode < dsHDRSTANDARD_Invalid ; mode++ ) { + status = dsSetForceHDRMode(handle[i], mode); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + } + + // Step 04: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsSetForceHDRMode() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 078@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsSetForceHDRMode() without prior initialization of video ports| handle=[invalid handle], mode=[valid values] |dsERR_NOT_INITIALIZED|call must fail as module not initialized| + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsSetForceHDRMode() with an invalid handle and valid mode values|handle=[inValid handle], mode=[valid values]|dsERR_INVALID_PARAM|Invalid parameter must return| + * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsSetForceHDRMode() by looping through acquired handles and valid mode values|handle=[Valid handle], mode=[invalid values]|dsERR_INVALID_PARAM|Invalid parameter must return| + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsSetForceHDRMode() after termination video ports |handle=[valid handle from step 04 ] , mode=[valid values] | dsERR_NOT_INITIALIZED | call must fail as module is not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsSetForceHDRMode(void) { + gTestID = 78; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + // Step 01: Attempt to set HDR mode without initialization + status = dsSetForceHDRMode(-1, dsHDRSTANDARD_HDR10 ); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Set HDR mode with invalid handle + status = dsSetForceHDRMode(handle[0],dsHDRSTANDARD_HDR10 ); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get the port handle for supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Set HDR mode with invalid mode values + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsSetForceHDRMode(handle[i], dsHDRSTANDARD_Invalid ); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to set HDR mode after termination + status = dsSetForceHDRMode(handle[0], dsHDRSTANDARD_HDR10); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsColorDepthCapabilities() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 079@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsColorDepthCapabilities() by looping through the acquired ports and valid pointer to get the color depth capabilities & store it in an array |handle=[vallid handle], colorDepthCapability=[valid pointer] |dsERR_NONE Color depth capabilities must be retrieved successfully| + * |04|Call dsColorDepthCapabilities() -Again by looping through the acquired ports and valid pointer to get the color depth capabilities & store it in a new array |handle=[vallid handle], colorDepthCapability=[valid pointer] |dsERR_NONE Color depth capabilities must be retrieved successfully| + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsColorDepthCapabilities(void) { + gTestID = 79; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + unsigned int colorDepthCapability1[NUM_OF_PORTS]; + unsigned int colorDepthCapability2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the port handle for supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Get color depth capabilities + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsColorDepthCapabilities(handle[i], &colorDepthCapability1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeating to get capabilities for new array + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsColorDepthCapabilities(handle[i], &colorDepthCapability2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(colorDepthCapability1[i], colorDepthCapability2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsColorDepthCapabilities() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 080@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsColorDepthCapabilities() without prior initialization of video ports|handle=[invalid handle], colorDepthCapability=[valid pointer]|dsERR_NOT_INITIALIZED|call must fail as module not initialized| + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsColorDepthCapabilities() with an invalid handle and valid pointer |handle=[valid handle], colorDepthCapability=[valid pointer] |dsERR_INVALID_PARAM|Invalid parameter must be returned | + * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |04|Call dsColorDepthCapabilities() by looping through acquired handles and invalid pointer | handle=[valid handle], colorDepthCapability=[Invalid pointer]|dsERR_INVALID_PARAM|Invalid parameter must return| + * |05|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |06|Call dsColorDepthCapabilities() after terminating videop ports |handle= [valid handle from step 04 ] , colorDepthCapability= [valid pointer] | dsERR_NOT_INITIALIZED|call must fail as module not initialized | + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsColorDepthCapabilities(void) { + gTestID = 80; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + unsigned int colorDepthCapability[NUM_OF_PORTS]; + + // Step 01: Attempt to get capabilities without initialization + status = dsColorDepthCapabilities(-1, &colorDepthCapability[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Get capabilities with invalid handle + status = dsColorDepthCapabilities(handle[0], &colorDepthCapability[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get the port handle for supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get capabilities with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsColorDepthCapabilities(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get capabilities after termination + status = dsColorDepthCapabilities(handle[0], &colorDepthCapability[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsGetPreferredColorDepth() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 081@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsGetPreferredColorDepth by looping through acquired handles and valid pointer to get the preferred color depth of each port & store it in an array |handle=[valid handle] , colorDepth=[valid pointer]|dsERR_NONE|Preferred Color depth must be retrieved successfully| + * |04|Call dsGetPreferredColorDepth - Again by looping through acquired handles and valid pointer to get the preferred color depth of each port & store it in a new array |handle=[valid handle] , colorDepth=[valid pointer]|dsERR_NONE|Preferred Color depth must be retrieved successfully| + * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsGetPreferredColorDepth(void) { + gTestID = 81; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsDisplayColorDepth_t colorDepth1[NUM_OF_PORTS]; + dsDisplayColorDepth_t colorDepth2[NUM_OF_PORTS]; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the port handle for all supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Get preferred color depth + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetPreferredColorDepth(handle[i], &colorDepth1[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 04: Repeat to get color depth for new array + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetPreferredColorDepth(handle[i], &colorDepth2[i]); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Compare array values + for (int i = 0; i < NUM_OF_PORTS; i++) { + UT_ASSERT_EQUAL(colorDepth1[i], colorDepth2[i]); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsGetPreferredColorDepth() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 082@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsGetPreferredColorDepth() without prior initialization of video ports|handle=[invalid handle] , colorDepth=[valid pointer]|dsERR_NOT_INITIALIZED|call must fail as module is not initialized| + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsGetPreferredColorDepth() with an invalid handle and with valid pointer|handle=[invalid handle] , colorDepth=[valid pointer]|dsERR_INVALID_PARAM|Invalid parameter must be returned| + * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsGetPreferredColorDepth() by looping through valid handes and with invalid pointer|handle=[valid handle] , colorDepth=[invalid pointer]|dsERR_INVALID_PARAM|Invalid parameter must be returned| + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsGetPreferredColorDepth() after terminating video ports |handle=[valid handle] , colorDepth=[valid pointer] |dsERR_NOT_INITIALIZED|call must fail as module is not initialized| + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsGetPreferredColorDepth(void) { + gTestID = 82; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + dsDisplayColorDepth_t colorDepth[NUM_OF_PORTS]; + + // Step 01: Attempt to get color depth without initialization + status = dsGetPreferredColorDepth(-1, &colorDepth[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Get color depth with invalid handle + status = dsGetPreferredColorDepth(handle[0], &colorDepth[0]); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get the port handle for supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Get color depth with invalid pointer + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetPreferredColorDepth(handle[i], NULL); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to get color depth after termination + status = dsGetPreferredColorDepth(handle[0], &colorDepth[0]); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Positive Test Scenarios for dsSetPreferredColorDepth() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 083@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | + * |03|Call dsSetPreferredColorDepth() by looping through the acquired handles and Valid colorDepth values|handle=[invalid handle] , colorDepth=[valid values] |dsERR_NONE|Color depth must be set successfully| + * |05|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * + */ +void test_l1_dsVideoPort_positive_dsSetPreferredColorDepth(void) { + gTestID = 83; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + // Step 01: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 02: Get the port handle for supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 03: Set preferred color depth + for (int i = 0; i < NUM_OF_PORTS; i++) { + for (dsDisplayColorDepth_t colorDepth = dsDISPLAY_COLORDEPTH_UNKNOWN; colorDepth <= dsDISPLAY_COLORDEPTH_AUTO; colorDepth++ ) { + status = dsSetPreferredColorDepth(handle[i], colorDepth); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + } + + // Step 05: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +/** + * @brief Negative Test Scenarios for dsSetPreferredColorDepth() + * + * **Test Group ID:** Basic: 01@n + * **Test Case ID:** 084@n + * + * **Pre-Conditions:** None@n + * + * **Dependencies:** None@n + * + * **User Interaction:** None + * + * **Test Procedure:**@n + * |Variation / Step|Description|Test Data|Expected Result|Notes| + * |:--:|---------|----------|--------------|-----| + * |01|Call dsSetPreferredColorDepth() without prior initialization of video ports|handle=[invalid handle] , colorDepth=[valid values]|dsERR_NOT_INITIALIZED|call must fail as module not initialized| + * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | + * |03|Call dsSetPreferredColorDepth() with an invalid handle with valid color depth values|handle=[Invalid handle],colorDepth=[valid values]|dsERR_INVALID_PARAM|Invalid parameter must be return| + * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | + * |05|Call dsSetPreferredColorDepth() by looping through valid handles with an unsupported colorDepth value|handle=[valid handle],colorDepth=[invalid values]|dsERR_OPERATION_NOT_SUPPORTED|Invalid parameter must be return| + * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | + * |07|Call dsSetPreferredColorDepth() after terminating video ports|handle=[valid handle] , colorDepth=[valid values]|dsERR_NOT_INITIALIZED|call must fail as module not initialized| + * + * + * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. + */ +void test_l1_dsVideoPort_negative_dsSetPreferredColorDepth(void) { + gTestID = 84; + UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); + + dsError_t status; + intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; + + // Step 01: Attempt to set color depth without initialization + status = dsSetPreferredColorDepth(-1, dsDISPLAY_COLORDEPTH_8BIT ); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + // Step 02: Initialize video port system + status = dsVideoPortInit(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 03: Set color depth with invalid handle + status = dsSetPreferredColorDepth(handle[0], dsDISPLAY_COLORDEPTH_8BIT ); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + + // Step 04: Get the port handle for supported video ports + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); + UT_ASSERT_EQUAL(status, dsERR_NONE); + } + + // Step 05: Set unsupported color depth + for (int i = 0; i < NUM_OF_PORTS; i++) { + status = dsSetPreferredColorDepth(handle[i], 0x60); + UT_ASSERT_EQUAL(status, dsERR_OPERATION_NOT_SUPPORTED); + } + + // Step 06: Terminate the video port system + status = dsVideoPortTerm(); + UT_ASSERT_EQUAL(status, dsERR_NONE); + + // Step 07: Attempt to set color depth after termination + status = dsSetPreferredColorDepth(handle[0], dsDISPLAY_COLORDEPTH_12BIT ); + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); + #else + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); + #endif + + UT_LOG("\n Out %s\n", __FUNCTION__); +} + + +static UT_test_suite_t * pSuite = NULL; + +/** + * @brief Register the main test(s) for this module + * + * @return int - 0 on success, otherwise failure + */ +int test_l1_dsVideoPort_register ( void ) +{ + /* add a suite to the registry */ + pSuite = UT_add_suite( "[L1 dsVideoPort]", NULL, NULL ); + if ( NULL == pSuite ) + { + return -1; + } + + UT_add_test( pSuite, "dsVideoPortInit_L1_positive" ,test_l1_dsVideoPort_positive_dsVideoPortInit ); + UT_add_test( pSuite, "dsVideoPortInit_L1_negative" ,test_l1_dsVideoPort_negative_dsVideoPortInit ); + UT_add_test( pSuite, "dsVideoPortTerm_L1_positive" ,test_l1_dsVideoPort_positive_dsVideoPortTerm ); + UT_add_test( pSuite, "dsVideoPortTerm_L1_negative" ,test_l1_dsVideoPort_negative_dsVideoPortTerm ); + UT_add_test( pSuite, "dsGetVideoPort_L1_positive" ,test_l1_dsVideoPort_positive_dsGetVideoPort ); + UT_add_test( pSuite, "dsGetVideoPort_L1_negative" ,test_l1_dsVideoPort_negative_dsGetVideoPort ); + UT_add_test( pSuite, "dsIsVideoPortEnabled_L1_positive" ,test_l1_dsVideoPort_positive_dsIsVideoPortEnabled ); + UT_add_test( pSuite, "dsIsVideoPortEnabled_L1_negative" ,test_l1_dsVideoPort_negative_dsIsVideoPortEnabled ); + UT_add_test( pSuite, "dsIsDisplayConnected_L1_positive" ,test_l1_dsVideoPort_positive_dsIsDisplayConnected ); + UT_add_test( pSuite, "dsIsDisplayConnected_L1_negative" ,test_l1_dsVideoPort_negative_dsIsDisplayConnected ); + UT_add_test( pSuite, "dsIsDisplaySurround_L1_positive" ,test_l1_dsVideoPort_positive_dsIsDisplaySurround ); + UT_add_test( pSuite, "dsIsDisplaySurround_L1_negative" ,test_l1_dsVideoPort_negative_dsIsDisplaySurround ); + UT_add_test( pSuite, "dsGetSurroundMode_L1_positive" ,test_l1_dsVideoPort_positive_dsGetSurroundMode ); + UT_add_test( pSuite, "dsGetSurroundMode_L1_negative" ,test_l1_dsVideoPort_negative_dsGetSurroundMode ); + UT_add_test( pSuite, "dsVideoFormatUpdateRegisterCB_L1_positive" ,test_l1_dsVideoPort_positive_dsVideoFormatUpdateRegisterCB ); + UT_add_test( pSuite, "dsVideoFormatUpdateRegisterCB_L1_negative" ,test_l1_dsVideoPort_negative_dsVideoFormatUpdateRegisterCB ); + UT_add_test( pSuite, "dsIsVideoPortActive_L1_positive" ,test_l1_dsVideoPort_positive_dsIsVideoPortActive ); + UT_add_test( pSuite, "dsIsVideoPortActive_L1_negative" ,test_l1_dsVideoPort_negative_dsIsVideoPortActive ); + UT_add_test( pSuite, "dsEnableDTCP_L1_positive" ,test_l1_dsVideoPort_positive_dsEnableDTCP ); + UT_add_test( pSuite, "dsEnableDTCP_L1_negative" ,test_l1_dsVideoPort_negative_dsEnableDTCP ); + UT_add_test( pSuite, "dsEnableHDCP_L1_positive" ,test_l1_dsVideoPort_positive_dsEnableHDCP ); + UT_add_test( pSuite, "dsEnableHDCP_L1_negative" ,test_l1_dsVideoPort_negative_dsEnableHDCP ); + UT_add_test( pSuite, "dsIsDTCPEnabled_L1_positive" ,test_l1_dsVideoPort_positive_dsIsDTCPEnabled ); + UT_add_test( pSuite, "dsIsDTCPEnabled_L1_negative" ,test_l1_dsVideoPort_negative_dsIsDTCPEnabled ); + UT_add_test( pSuite, "dsIsHDCPEnabled_L1_positive" ,test_l1_dsVideoPort_positive_dsIsHDCPEnabled ); + UT_add_test( pSuite, "dsIsHDCPEnabled_L1_negative" ,test_l1_dsVideoPort_negative_dsIsHDCPEnabled ); + UT_add_test( pSuite, "dsEnableVideoPort_L1_positive" ,test_l1_dsVideoPort_positive_dsEnableVideoPort ); + UT_add_test( pSuite, "dsEnableVideoPort_L1_negative" ,test_l1_dsVideoPort_negative_dsEnableVideoPort ); + UT_add_test( pSuite, "dsSetResolution_L1_positive" ,test_l1_dsVideoPort_positive_dsSetResolution ); + UT_add_test( pSuite, "dsSetResolution_L1_negative" ,test_l1_dsVideoPort_negative_dsSetResolution ); + UT_add_test( pSuite, "dsGetResolution_L1_positive" ,test_l1_dsVideoPort_positive_dsGetResolution ); + UT_add_test( pSuite, "dsGetResolution_L1_negative" ,test_l1_dsVideoPort_negative_dsGetResolution ); + UT_add_test( pSuite, "dsSetActiveSource_L1_positive" ,test_l1_dsVideoPort_positive_dsSetActiveSource ); + UT_add_test( pSuite, "dsSetActiveSource_L1_negative" ,test_l1_dsVideoPort_negative_dsSetActiveSource ); + UT_add_test( pSuite, "dsRegisterHdcpStatusCallback_L1_positive" ,test_l1_dsVideoPort_positive_dsRegisterHdcpStatusCallback ); + UT_add_test( pSuite, "dsRegisterHdcpStatusCallback_L1_negative" ,test_l1_dsVideoPort_negative_dsRegisterHdcpStatusCallback ); + UT_add_test( pSuite, "dsGetHDCPStatus_L1_positive" ,test_l1_dsVideoPort_positive_dsGetHDCPStatus ); + UT_add_test( pSuite, "dsGetHDCPStatus_L1_negative" ,test_l1_dsVideoPort_negative_dsGetHDCPStatus ); + UT_add_test( pSuite, "dsGetHDCPProtocol_L1_positive" ,test_l1_dsVideoPort_positive_dsGetHDCPProtocol ); + UT_add_test( pSuite, "dsGetHDCPProtocol_L1_negative" ,test_l1_dsVideoPort_negative_dsGetHDCPProtocol ); + UT_add_test( pSuite, "dsGetHDCPReceiverProtocol_L1_positive" ,test_l1_dsVideoPort_positive_dsGetHDCPReceiverProtocol ); + UT_add_test( pSuite, "dsGetHDCPReceiverProtocol_L1_negative" ,test_l1_dsVideoPort_negative_dsGetHDCPReceiverProtocol ); + UT_add_test( pSuite, "dsGetHDCPCurrentProtocol_L1_positive" ,test_l1_dsVideoPort_positive_dsGetHDCPCurrentProtocol ); + UT_add_test( pSuite, "dsGetHDCPCurrentProtocol_L1_negative" ,test_l1_dsVideoPort_negative_dsGetHDCPCurrentProtocol ); + UT_add_test( pSuite, "dsGetTVHDRCapabilities_L1_positive" ,test_l1_dsVideoPort_positive_dsGetTVHDRCapabilities ); + UT_add_test( pSuite, "dsGetTVHDRCapabilities_L1_negative" ,test_l1_dsVideoPort_negative_dsGetTVHDRCapabilities ); + UT_add_test( pSuite, "dsSupportedTvResolutions_L1_positive" ,test_l1_dsVideoPort_positive_dsSupportedTvResolutions ); + UT_add_test( pSuite, "dsSupportedTvResolutions_L1_negative" ,test_l1_dsVideoPort_negative_dsSupportedTvResolutions ); + UT_add_test( pSuite, "dsSetForceDisable4KSupport_L1_positive" ,test_l1_dsVideoPort_positive_dsSetForceDisable4KSupport ); + UT_add_test( pSuite, "dsSetForceDisable4KSupport_L1_negative" ,test_l1_dsVideoPort_negative_dsSetForceDisable4KSupport ); + UT_add_test( pSuite, "dsGetForceDisable4KSupport_L1_positive" ,test_l1_dsVideoPort_positive_dsGetForceDisable4KSupport ); + UT_add_test( pSuite, "dsGetForceDisable4KSupport_L1_negative" ,test_l1_dsVideoPort_negative_dsGetForceDisable4KSupport ); + UT_add_test( pSuite, "dsGetVideoEOTF_L1_positive" ,test_l1_dsVideoPort_positive_dsGetVideoEOTF ); + UT_add_test( pSuite, "dsGetVideoEOTF_L1_negative" ,test_l1_dsVideoPort_negative_dsGetVideoEOTF ); + UT_add_test( pSuite, "dsGetMatrixCoefficients_L1_positive" ,test_l1_dsVideoPort_positive_dsGetMatrixCoefficients ); + UT_add_test( pSuite, "dsGetMatrixCoefficients_L1_negative" ,test_l1_dsVideoPort_negative_dsGetMatrixCoefficients ); + UT_add_test( pSuite, "dsGetColorDepth_L1_positive" ,test_l1_dsVideoPort_positive_dsGetColorDepth ); + UT_add_test( pSuite, "dsGetColorDepth_L1_negative" ,test_l1_dsVideoPort_negative_dsGetColorDepth ); + UT_add_test( pSuite, "dsGetColorSpace_L1_positive" ,test_l1_dsVideoPort_positive_dsGetColorSpace ); + UT_add_test( pSuite, "dsGetColorSpace_L1_negative" ,test_l1_dsVideoPort_negative_dsGetColorSpace ); + UT_add_test( pSuite, "dsGetQuantizationRange_L1_positive" ,test_l1_dsVideoPort_positive_dsGetQuantizationRange ); + UT_add_test( pSuite, "dsGetQuantizationRange_L1_negative" ,test_l1_dsVideoPort_negative_dsGetQuantizationRange ); + UT_add_test( pSuite, "dsGetCurrentOutputSettings_L1_positive" ,test_l1_dsVideoPort_positive_dsGetCurrentOutputSettings ); + UT_add_test( pSuite, "dsGetCurrentOutputSettings_L1_negative" ,test_l1_dsVideoPort_negative_dsGetCurrentOutputSettings ); + UT_add_test( pSuite, "dsIsOutputHDR_L1_positive" ,test_l1_dsVideoPort_positive_dsIsOutputHDR ); + UT_add_test( pSuite, "dsIsOutputHDR_L1_negative" ,test_l1_dsVideoPort_negative_dsIsOutputHDR ); + UT_add_test( pSuite, "dsResetOutputToSDR_L1_positive" ,test_l1_dsVideoPort_positive_dsResetOutputToSDR ); + UT_add_test( pSuite, "dsResetOutputToSDR_L1_negative" ,test_l1_dsVideoPort_negative_dsResetOutputToSDR ); + UT_add_test( pSuite, "dsSetHdmiPreference_L1_positive" ,test_l1_dsVideoPort_positive_dsSetHdmiPreference ); + UT_add_test( pSuite, "dsSetHdmiPreference_L1_negative" ,test_l1_dsVideoPort_negative_dsSetHdmiPreference ); + UT_add_test( pSuite, "dsGetHdmiPreference_L1_positive" ,test_l1_dsVideoPort_positive_dsGetHdmiPreference ); + UT_add_test( pSuite, "dsGetHdmiPreference_L1_negative" ,test_l1_dsVideoPort_negative_dsGetHdmiPreference ); + UT_add_test( pSuite, "dsGetIgnoreEDIDStatus_L1_positive" ,test_l1_dsVideoPort_positive_dsGetIgnoreEDIDStatus ); + UT_add_test( pSuite, "dsGetIgnoreEDIDStatus_L1_negative" ,test_l1_dsVideoPort_negative_dsGetIgnoreEDIDStatus ); + UT_add_test( pSuite, "dsSetBackgroundColor_L1_positive" ,test_l1_dsVideoPort_positive_dsSetBackgroundColor ); + UT_add_test( pSuite, "dsSetBackgroundColor_L1_negative" ,test_l1_dsVideoPort_negative_dsSetBackgroundColor ); + UT_add_test( pSuite, "dsSetForceHDRMode_L1_positive" ,test_l1_dsVideoPort_positive_dsSetForceHDRMode ); + UT_add_test( pSuite, "dsSetForceHDRMode_L1_negative" ,test_l1_dsVideoPort_negative_dsSetForceHDRMode ); + UT_add_test( pSuite, "dsColorDepthCapabilities_L1_positive" ,test_l1_dsVideoPort_positive_dsColorDepthCapabilities ); + UT_add_test( pSuite, "dsColorDepthCapabilities_L1_negative" ,test_l1_dsVideoPort_negative_dsColorDepthCapabilities ); + UT_add_test( pSuite, "dsGetPreferredColorDepth_L1_positive" ,test_l1_dsVideoPort_positive_dsGetPreferredColorDepth ); + UT_add_test( pSuite, "dsGetPreferredColorDepth_L1_negative" ,test_l1_dsVideoPort_negative_dsGetPreferredColorDepth ); + UT_add_test( pSuite, "dsSetPreferredColorDepth_L1_positive" ,test_l1_dsVideoPort_positive_dsSetPreferredColorDepth ); + UT_add_test( pSuite, "dsSetPreferredColorDepth_L1_negative" ,test_l1_dsVideoPort_negative_dsSetPreferredColorDepth ); + + + return 0; +} + +/** @} */ // End of DS_VideoPort_HALTEST_L1 /** @} */ // End of DS_VideoPort_HALTEST /** @} */ // End of Device_Settings_HALTEST /** @} */ // End of Device_Settings From 8bea4d9f6921099cea7ce12568ecee8a3d5452fd Mon Sep 17 00:00:00 2001 From: thanushreevani <157587255+thanushreevani@users.noreply.github.com> Date: Mon, 13 May 2024 18:15:35 +0530 Subject: [PATCH 16/38] gh #43 remove DS_ASSERT_AUTO_TERM_NUMERICAL --- src/test_l1_dsVideoPort.c | 522 +++++++++++++++++++------------------- 1 file changed, 261 insertions(+), 261 deletions(-) diff --git a/src/test_l1_dsVideoPort.c b/src/test_l1_dsVideoPort.c index f43b0f66..eb77da84 100644 --- a/src/test_l1_dsVideoPort.c +++ b/src/test_l1_dsVideoPort.c @@ -83,7 +83,7 @@ static int gTestID = 1; #define NUM_OF_PORTS (sizeof(kPorts) / sizeof(kPorts[0])) #define HANDLE_ARRAY_INIT 0 -#define DS_ASSERT_AUTO_TERM_NUMERICAL(value, comparison){\ +#define UT_ASSERT_EQUAL(value, comparison){\ if(value != comparison){\ UT_LOG("\n In %s Comparison: [%d = %d]\n", __FUNCTION__, value, comparison);\ dsVideoPortTerm();\ @@ -172,9 +172,9 @@ void test_l1_dsVideoPort_negative_dsVideoPortInit(void) { // Step 02: Attempt to initialize again without terminating the first initialization status = dsVideoPortInit(); #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_ALREADY_INITIALIZED); + UT_ASSERT_EQUAL(status, dsERR_ALREADY_INITIALIZED); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_GENERAL); + UT_ASSERT_EQUAL(status, dsERR_GENERAL); #endif // Step 03: Terminate video port system @@ -327,7 +327,7 @@ void test_l1_dsVideoPort_positive_dsGetVideoPort(void) { // Step 02: Get the video port handle for valid video port type and index for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); if(i == NUM_OF_PORTS-1) { lastHandle = handle[i]; @@ -336,11 +336,11 @@ void test_l1_dsVideoPort_positive_dsGetVideoPort(void) { // Step 03: Compare with the last handle status = dsGetVideoPort(kPorts[NUM_OF_PORTS-1].id.type, kPorts[NUM_OF_PORTS-1].id.index, &(handle[NUM_OF_PORTS-1])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); //getting last handle in to new handle for comparision newHandle = handle[NUM_OF_PORTS-1]; - DS_ASSERT_AUTO_TERM_NUMERICAL(lastHandle , newHandle); + UT_ASSERT_EQUAL(lastHandle , newHandle); // Step 04: Terminate the video port system status = dsVideoPortTerm(); @@ -398,22 +398,22 @@ void test_l1_dsVideoPort_negative_dsGetVideoPort(void) { for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(dsVIDEOPORT_TYPE_MAX, kPorts[i].id.index, &(handle[i])); #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_OPERATION_NOT_SUPPORTED); + UT_ASSERT_EQUAL(status, dsERR_OPERATION_NOT_SUPPORTED); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); #endif } // Step 04: Attempt to get the Video Port handle invalid port index for (int i = 0; i < NUM_OF_PORTS ; i++) { status = dsGetVideoPort(kPorts[i].id.type, -1 , &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 05: NULL handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index , NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -472,24 +472,24 @@ void test_l1_dsVideoPort_positive_dsIsVideoPortEnabled(void) { // Step 02: Get the port handle for all supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Check if video port is enabled or not for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsIsVideoPortEnabled(handle[i], &isEnabledArray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the check for enabled status for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsIsVideoPortEnabled(handle[i], &isEnabledArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(isEnabledArray1[i], isEnabledArray2[i]); + UT_ASSERT_EQUAL(isEnabledArray1[i], isEnabledArray2[i]); } // Step 06: Terminate the video port system @@ -549,18 +549,18 @@ void test_l1_dsVideoPort_negative_dsIsVideoPortEnabled(void) { // Step 03: Invalid handle check status = dsIsVideoPortEnabled(handle[0], &enabled[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Check enabled status with null pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsIsVideoPortEnabled(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -619,24 +619,24 @@ void test_l1_dsVideoPort_positive_dsIsDisplayConnected(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS ; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Check if video port is connected for (int i = 0; i < NUM_OF_PORTS ; i++) { status = dsIsDisplayConnected(handle[i], &isConnectedArray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the check for connection status for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsIsDisplayConnected(handle[i], &isConnectedArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS ; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(isConnectedArray1[i], isConnectedArray2[i]); + UT_ASSERT_EQUAL(isConnectedArray1[i], isConnectedArray2[i]); } // Step 06: Terminate the video port system @@ -696,18 +696,18 @@ void test_l1_dsVideoPort_negative_dsIsDisplayConnected(void) { // Step 03: Invalid handle check status = dsIsDisplayConnected(handle[0], &connected[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Check connection status with null pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsIsDisplayConnected(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -766,22 +766,22 @@ void test_l1_dsVideoPort_positive_dsIsDisplaySurround(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 03: Check if the connected display supports audio surround status = dsIsDisplaySurround(handle[i], &isSurroundArray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the check for audio surround support for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsIsDisplaySurround(handle[i], &isSurroundArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(isSurroundArray1[i], isSurroundArray2[i]); + UT_ASSERT_EQUAL(isSurroundArray1[i], isSurroundArray2[i]); } // Step 06: Terminate the video port system @@ -841,18 +841,18 @@ void test_l1_dsVideoPort_negative_dsIsDisplaySurround(void) { // Step 03: Invalid handle check status = dsIsDisplaySurround(handle[0], &surround[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Check audio surround support with null pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsIsDisplaySurround(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -911,24 +911,24 @@ void test_l1_dsVideoPort_positive_dsGetSurroundMode(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } for (int i = 0; i < NUM_OF_PORTS; i++) { // Step 03: Get the surround mode of each video port status = dsGetSurroundMode(handle[i], &surroundModeArray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the retrieval of surround mode for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetSurroundMode(handle[i], &surroundModeArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS ; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(surroundModeArray1[i], surroundModeArray2[i]); + UT_ASSERT_EQUAL(surroundModeArray1[i], surroundModeArray2[i]); } // Step 06: Terminate the video port system @@ -988,18 +988,18 @@ void test_l1_dsVideoPort_negative_dsGetSurroundMode(void) { // Step 03: Invalid handle check status = dsGetSurroundMode(handle[0], &surroundMode[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Check surround mode with null pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetSurroundMode(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -1059,24 +1059,24 @@ void test_l1_dsVideoPort_positive_dsIsVideoPortActive(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Check whether each video port is active for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsIsVideoPortActive(handle[i], &isActiveArray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the active status check for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsIsVideoPortActive(handle[i], &isActiveArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(isActiveArray1[i], isActiveArray2[i]); + UT_ASSERT_EQUAL(isActiveArray1[i], isActiveArray2[i]); } // Step 06: Terminate the video port system @@ -1136,18 +1136,18 @@ void test_l1_dsVideoPort_negative_dsIsVideoPortActive(void) { // Step 03: Invalid handle check status = dsIsVideoPortActive(handle[0], &active[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Check active status with null pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsIsVideoPortActive(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -1203,13 +1203,13 @@ void test_l1_dsVideoPort_positive_dsEnableDTCP(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS ; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Enable DTCP for (int i = 0; i < NUM_OF_PORTS ; i++) { status = dsEnableDTCP(handle[i], enableDTCP); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Terminate the video port system @@ -1268,12 +1268,12 @@ void test_l1_dsVideoPort_negative_dsEnableDTCP(void) { // Step 03: Invalid handle check status = dsEnableDTCP(handle[0], enableDTCP); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get the Video Port handle for (int i = 0; i < NUM_OF_PORTS ; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Terminate the video port system @@ -1331,11 +1331,11 @@ void test_l1_dsVideoPort_positive_dsEnableHDCP(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 03: Enable HDCP status = dsEnableHDCP(handle[i], enableHDCP, hdcpKey, keySize); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } @@ -1399,20 +1399,20 @@ void test_l1_dsVideoPort_negative_dsEnableHDCP(void) { // Step 03: Attempt to enable HDCP with an invalid handle status = dsEnableHDCP(handle[0], enableHDCP, hdcpKey, keySize); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get the video port handle for supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 05: Enable HDCP with invalid key size status = dsEnableHDCP(handle[i],enableHDCP, hdcpKey, HDCP_KEY_MAX_SIZE+1); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 06: Enable HDCP with NULL hdcpKey pointer status = dsEnableHDCP(handle[i], enableHDCP, NULL, keySize); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 07: Terminate the video port system @@ -1471,24 +1471,24 @@ void test_l1_dsVideoPort_positive_dsIsDTCPEnabled(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Check if DTCP is enabled for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsIsDTCPEnabled(handle[i], &isDTCPEnabledArray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the check for DTCP status for (int i = 0; i < NUM_OF_PORTS; i++){ status = dsIsDTCPEnabled(handle[i], &isDTCPEnabledArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(isDTCPEnabledArray1[i], isDTCPEnabledArray2[i]); + UT_ASSERT_EQUAL(isDTCPEnabledArray1[i], isDTCPEnabledArray2[i]); } // Step 06: Terminate the video port system @@ -1547,18 +1547,18 @@ void test_l1_dsVideoPort_negative_dsIsDTCPEnabled(void) { // Step 03: Invalid handle check status = dsIsDTCPEnabled(handle[0], &isDTCPEnabled[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Check DTCP status with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++){ status = dsIsDTCPEnabled(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 06: Terminate the video port system @@ -1617,23 +1617,23 @@ void test_l1_dsVideoPort_positive_dsIsHDCPEnabled(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Check if HDCP is enabled for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsIsHDCPEnabled(handle[i], &isHDCPEnabledArray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the check for HDCP status for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsIsHDCPEnabled(handle[i], &isHDCPEnabledArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(isHDCPEnabledArray1[i], isHDCPEnabledArray2[i]); + UT_ASSERT_EQUAL(isHDCPEnabledArray1[i], isHDCPEnabledArray2[i]); } // Step 06: Terminate the video port system @@ -1693,18 +1693,18 @@ void test_l1_dsVideoPort_negative_dsIsHDCPEnabled(void) { // Step 03: Attempt to get HDCP status with an invalid handle status = dsIsHDCPEnabled(handle[0], &(contentProtected[0])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get the video port handle for supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get HDCP status with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsIsHDCPEnabled(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -1758,13 +1758,13 @@ void test_l1_dsVideoPort_positive_dsEnableVideoPort(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Enable the video port for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsEnableVideoPort(handle[i], true); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Terminate the video port system @@ -1823,12 +1823,12 @@ void test_l1_dsVideoPort_negative_dsEnableVideoPort(void) { // Step 03: Invalid handle check status = dsEnableVideoPort(handle[0], enabled); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Terminate the video port system @@ -1883,14 +1883,14 @@ void test_l1_dsVideoPort_positive_dsSetResolution(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Set the resolution for the video port for (int i = 0; i < NUM_OF_PORTS; i++) { for(int j =0; j < (sizeof(kResolutions)/sizeof(kResolutions[0])); j++) { status = dsSetResolution(handle[i], &kResolutions[j]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } } @@ -1952,25 +1952,25 @@ void test_l1_dsVideoPort_negative_dsSetResolution(void) { // Step 03: Invalid handle check status = dsSetResolution(handle[0], &(kResolutions[0])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Set resolution with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsSetResolution(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Set resolution with invalid resolution parameters for (int i = 0; i < NUM_OF_PORTS; i++) { for (int j = 0; j < (sizeof(invalid_kRes)/sizeof(invalid_kRes[0])); j++) { status = dsSetResolution(handle[i], &invalid_kRes[j]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } } // Step 07: Terminate the video port system @@ -2029,28 +2029,28 @@ void test_l1_dsVideoPort_positive_dsGetResolution(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Retrieve the resolution of the video port for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetResolution(handle[i], &(resolutionArray1[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the retrieval of resolution for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetResolution(handle[i] , &resolutionArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(resolutionArray1[i].pixelResolution, resolutionArray2[i].pixelResolution); - DS_ASSERT_AUTO_TERM_NUMERICAL(resolutionArray1[i].aspectRatio, resolutionArray2[i].aspectRatio); - DS_ASSERT_AUTO_TERM_NUMERICAL(resolutionArray1[i].stereoScopicMode, resolutionArray2[i].stereoScopicMode); - DS_ASSERT_AUTO_TERM_NUMERICAL(resolutionArray1[i].frameRate, resolutionArray2[i].frameRate); - DS_ASSERT_AUTO_TERM_NUMERICAL(resolutionArray1[i].interlaced, resolutionArray2[i].interlaced); + UT_ASSERT_EQUAL(resolutionArray1[i].pixelResolution, resolutionArray2[i].pixelResolution); + UT_ASSERT_EQUAL(resolutionArray1[i].aspectRatio, resolutionArray2[i].aspectRatio); + UT_ASSERT_EQUAL(resolutionArray1[i].stereoScopicMode, resolutionArray2[i].stereoScopicMode); + UT_ASSERT_EQUAL(resolutionArray1[i].frameRate, resolutionArray2[i].frameRate); + UT_ASSERT_EQUAL(resolutionArray1[i].interlaced, resolutionArray2[i].interlaced); } // Step 06: Terminate the video port system @@ -2110,18 +2110,18 @@ void test_l1_dsVideoPort_negative_dsGetResolution(void) { // Step 03: Invalid handle check status = dsGetResolution( handle[0] , &(resolution[0])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get resolution with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetResolution(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -2175,13 +2175,13 @@ void test_l1_dsVideoPort_positive_dsSetActiveSource(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Set the video port as the active source for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsSetActiveSource(handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Terminate the video port system @@ -2238,12 +2238,12 @@ void test_l1_dsVideoPort_negative_dsSetActiveSource(void) { // Step 03: Invalid handle check status = dsSetActiveSource(handle[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Terminate the video port system @@ -2299,7 +2299,7 @@ void test_l1_dsVideoPort_positive_dsVideoFormatUpdateRegisterCB(void) { // Step 02: Register a valid Video Format update callback status = dsVideoFormatUpdateRegisterCB(mockVideoFormatCallback); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 03: Terminate the video port system status = dsVideoPortTerm(); @@ -2353,7 +2353,7 @@ void test_l1_dsVideoPort_negative_dsVideoFormatUpdateRegisterCB(void) { // Step 03: Register with invalid callback (NULL) status = dsVideoFormatUpdateRegisterCB(NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Terminate the video port system status = dsVideoPortTerm(); @@ -2415,11 +2415,11 @@ void test_l1_dsVideoPort_positive_dsRegisterHdcpStatusCallback(void) { // Step 02: Get the video port handle and register HDCP status callback for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 03: Register HDCP status change callback status = dsRegisterHdcpStatusCallback(handle[i], validHdcpStatusCallback); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Terminate the video port system @@ -2480,17 +2480,17 @@ void test_l1_dsVideoPort_negative_dsRegisterHdcpStatusCallback(void) { // Step 03: Invalid handle check status = dsRegisterHdcpStatusCallback(handle[0], validHdcpStatusCallback); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Register HDCP status callback with NULL callback function for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsRegisterHdcpStatusCallback(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -2549,24 +2549,24 @@ void test_l1_dsVideoPort_positive_dsGetHDCPStatus(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Retrieve the HDCP status for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetHDCPStatus(handle[i], &(hdcpStatusArray1[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the retrieval of HDCP status for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetHDCPStatus(handle[i], &(hdcpStatusArray2[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(hdcpStatusArray1[i], hdcpStatusArray2[i]); + UT_ASSERT_EQUAL(hdcpStatusArray1[i], hdcpStatusArray2[i]); } // Step 06: Terminate the video port system @@ -2626,18 +2626,18 @@ void test_l1_dsVideoPort_negative_dsGetHDCPStatus(void) { // Step 03: Invalid handle check status = dsGetHDCPStatus(handle[0], &(hdcpStatus[0])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get HDCP status with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetHDCPStatus(handle[i] , NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -2697,24 +2697,24 @@ void test_l1_dsVideoPort_positive_dsGetHDCPProtocol(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Retrieve the HDCP protocol version for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetHDCPProtocol(handle[i], &(protocolVersionArray1[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the retrieval of HDCP protocol version for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetHDCPProtocol(handle[i], &(protocolVersionArray2[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(protocolVersionArray1[i], protocolVersionArray2[i]); + UT_ASSERT_EQUAL(protocolVersionArray1[i], protocolVersionArray2[i]); } // Step 06: Terminate the video port system @@ -2773,18 +2773,18 @@ void test_l1_dsVideoPort_negative_dsGetHDCPProtocol(void) { // Step 03: Invalid handle check status = dsGetHDCPProtocol(handle[0], &(protocolVersion[0])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get HDCP protocol with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetHDCPProtocol(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -2844,24 +2844,24 @@ void test_l1_dsVideoPort_positive_dsGetHDCPReceiverProtocol(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Retrieve the Receiver HDCP protocol version for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetHDCPReceiverProtocol(handle[i], &(protocolVersionArray1[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the retrieval of Receiver HDCP protocol version for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetHDCPReceiverProtocol(handle[i], &(protocolVersionArray2[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(protocolVersionArray1[i], protocolVersionArray2[i]); + UT_ASSERT_EQUAL(protocolVersionArray1[i], protocolVersionArray2[i]); } // Step 06: Terminate the video port system @@ -2921,18 +2921,18 @@ void test_l1_dsVideoPort_negative_dsGetHDCPReceiverProtocol(void) { // Step 03: Invalid handle check status = dsGetHDCPReceiverProtocol(handle[0], &receiverProtocolVersion[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get Receiver HDCP protocol with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetHDCPReceiverProtocol(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -2991,24 +2991,24 @@ void test_l1_dsVideoPort_positive_dsGetHDCPCurrentProtocol(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Retrieve the current negotiated HDCP protocol version for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetHDCPCurrentProtocol(handle[i], ¤tProtocolArray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the retrieval of current HDCP protocol version for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetHDCPCurrentProtocol(handle[i], ¤tProtocolArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(currentProtocolArray1[i], currentProtocolArray2[i]); + UT_ASSERT_EQUAL(currentProtocolArray1[i], currentProtocolArray2[i]); } // Step 06: Terminate the video port system @@ -3068,18 +3068,18 @@ void test_l1_dsVideoPort_negative_dsGetHDCPCurrentProtocol(void) { // Step 03: Invalid handle check status = dsGetHDCPCurrentProtocol(handle[0], ¤tProtocolVersion[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get current HDCP protocol with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetHDCPCurrentProtocol(handle[i] , NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -3138,24 +3138,24 @@ void test_l1_dsVideoPort_positive_dsGetTVHDRCapabilities(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Retrieve the HDR capabilities for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetTVHDRCapabilities(handle[i], &capabilitiesArray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the retrieval of HDR capabilities for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetTVHDRCapabilities(handle[i], &capabilitiesArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(capabilitiesArray1[i], capabilitiesArray2[i]); + UT_ASSERT_EQUAL(capabilitiesArray1[i], capabilitiesArray2[i]); } // Step 06: Terminate the video port system @@ -3215,18 +3215,18 @@ void test_l1_dsVideoPort_negative_dsGetTVHDRCapabilities(void) { // Step 03: Invalid handle check status = dsGetTVHDRCapabilities(handle[0], &capabilities[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } for (int i = 0; i < NUM_OF_PORTS; i++) { // Step 05: Get HDR capabilities with invalid pointer status = dsGetTVHDRCapabilities(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -3285,24 +3285,24 @@ void test_l1_dsVideoPort_positive_dsSupportedTvResolutions(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Retrieve the supported TV resolutions for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsSupportedTvResolutions(handle[i], &resolutionsArray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the retrieval of supported TV resolutions for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsSupportedTvResolutions(handle[i], &resolutionsArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(resolutionsArray1[i], resolutionsArray2[i]); + UT_ASSERT_EQUAL(resolutionsArray1[i], resolutionsArray2[i]); } // Step 06: Terminate the video port system @@ -3362,18 +3362,18 @@ void test_l1_dsVideoPort_negative_dsSupportedTvResolutions(void) { // Step 03: Invalid handle check status = dsSupportedTvResolutions(handle[0], &resolutions[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get supported resolutions with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsSupportedTvResolutions(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -3429,13 +3429,13 @@ void test_l1_dsVideoPort_positive_dsSetForceDisable4KSupport(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } for (int i = 0; i < NUM_OF_PORTS; i++) { // Step 03: Set force disable 4K support status = dsSetForceDisable4KSupport(handle[i], disable4K); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Terminate the video port system @@ -3494,17 +3494,17 @@ void test_l1_dsVideoPort_negative_dsSetForceDisable4KSupport(void) { // Step 03: Invalid handle check status = dsSetForceDisable4KSupport(handle[0], disable4K); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Terminate the video port system status = dsVideoPortTerm(); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 06: Attempt to set force disable 4K support after termination status = dsSetForceDisable4KSupport(handle[0], disable4K); @@ -3558,24 +3558,24 @@ void test_l1_dsVideoPort_positive_dsGetForceDisable4KSupport(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Retrieve whether 4K support is disabled for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetForceDisable4KSupport(handle[i], &disable4KArray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the retrieval for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetForceDisable4KSupport(handle[i], &disable4KArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(disable4KArray1[i], disable4KArray2[i]); + UT_ASSERT_EQUAL(disable4KArray1[i], disable4KArray2[i]); } // Step 06: Terminate the video port system @@ -3635,18 +3635,18 @@ void test_l1_dsVideoPort_negative_dsGetForceDisable4KSupport(void) { // Step 03: Invalid handle check status = dsGetForceDisable4KSupport(handle[0], &disable4K[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get 4K support status with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetForceDisable4KSupport(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -3705,24 +3705,24 @@ void test_l1_dsVideoPort_positive_dsGetVideoEOTF(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Retrieve the EOTF value for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoEOTF(handle[i], &eotfArray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the retrieval of EOTF value for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoEOTF(handle[i], &eotfArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(eotfArray1[i], eotfArray2[i]); + UT_ASSERT_EQUAL(eotfArray1[i], eotfArray2[i]); } // Step 06: Terminate the video port system @@ -3782,18 +3782,18 @@ void test_l1_dsVideoPort_negative_dsGetVideoEOTF(void) { // Step 03: Invalid handle check status = dsGetVideoEOTF(handle[0], &eotf[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get EOTF value with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoEOTF(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -3852,24 +3852,24 @@ void test_l1_dsVideoPort_positive_dsGetMatrixCoefficients(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } for (int i = 0; i < NUM_OF_PORTS; i++) { // Step 03: Retrieve the matrix coefficients status = dsGetMatrixCoefficients(handle[i], &matrixCoefficientsArray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the retrieval of matrix coefficients for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetMatrixCoefficients(handle[i], &matrixCoefficientsArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(matrixCoefficientsArray1[i], matrixCoefficientsArray2[i]); + UT_ASSERT_EQUAL(matrixCoefficientsArray1[i], matrixCoefficientsArray2[i]); } // Step 06: Terminate the video port system @@ -3929,18 +3929,18 @@ void test_l1_dsVideoPort_negative_dsGetMatrixCoefficients(void) { // Step 03: Invalid handle check status = dsGetMatrixCoefficients(handle[0], &matrixCoefficients[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get matrix coefficients with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetMatrixCoefficients(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -3999,24 +3999,24 @@ void test_l1_dsVideoPort_positive_dsGetColorDepth(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Retrieve the color depth for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetColorDepth(handle[i], &colorDepthArray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the retrieval of color depth for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetColorDepth(handle[i], &colorDepthArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(colorDepthArray1[i], colorDepthArray2[i]); + UT_ASSERT_EQUAL(colorDepthArray1[i], colorDepthArray2[i]); } // Step 06: Terminate the video port system @@ -4076,18 +4076,18 @@ void test_l1_dsVideoPort_negative_dsGetColorDepth(void) { // Step 03: Invalid handle check status = dsGetColorDepth(handle[0], &colorDepth[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get color depth with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetColorDepth(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -4146,24 +4146,24 @@ void test_l1_dsVideoPort_positive_dsGetColorSpace(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Retrieve the color space for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetColorSpace(handle[i], &colorSpaceArray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the retrieval of color space for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetColorSpace(handle[i], &colorSpaceArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(colorSpaceArray1[i], colorSpaceArray2[i]); + UT_ASSERT_EQUAL(colorSpaceArray1[i], colorSpaceArray2[i]); } // Step 06: Terminate the video port system @@ -4222,18 +4222,18 @@ void test_l1_dsVideoPort_negative_dsGetColorSpace(void) { // Step 03: Invalid handle check status = dsGetColorSpace(handle[0], &colorSpace[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get color space with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetColorSpace(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -4291,24 +4291,24 @@ void test_l1_dsVideoPort_positive_dsGetQuantizationRange(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Retrieve the quantization range for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetQuantizationRange(handle[i], &quantizationRangeArray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the retrieval of quantization range for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetQuantizationRange(handle[i], &quantizationRangeArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(quantizationRangeArray1[i], quantizationRangeArray2[i]); + UT_ASSERT_EQUAL(quantizationRangeArray1[i], quantizationRangeArray2[i]); } // Step 06: Terminate the video port system @@ -4367,18 +4367,18 @@ void test_l1_dsVideoPort_negative_dsGetQuantizationRange(void) { // Step 03: Invalid handle check status = dsGetQuantizationRange(handle[0], &quantizationRange[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get quantization range with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetQuantizationRange(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -4447,28 +4447,28 @@ void test_l1_dsVideoPort_positive_dsGetCurrentOutputSettings(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 03: Retrieve the current output settings status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray1[i] ,&matrixcoefarray1[i], &colorspacearray1[i],\ &colordeptharray1[i], &quant_rangearray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the retrieval of output settings for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray2[i] ,&matrixcoefarray2[i], &colorspacearray2[i],\ &colordeptharray2[i], &quant_rangearray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(hdrstandardarray1[i], hdrstandardarray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(matrixcoefarray1[i], matrixcoefarray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(colorspacearray1[i], colorspacearray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(colordeptharray1[i], colordeptharray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(quant_rangearray1[i], quant_rangearray2[i]); + UT_ASSERT_EQUAL(hdrstandardarray1[i], hdrstandardarray2[i]); + UT_ASSERT_EQUAL(matrixcoefarray1[i], matrixcoefarray2[i]); + UT_ASSERT_EQUAL(colorspacearray1[i], colorspacearray2[i]); + UT_ASSERT_EQUAL(colordeptharray1[i], colordeptharray2[i]); + UT_ASSERT_EQUAL(quant_rangearray1[i], quant_rangearray2[i]); } // Step 06: Terminate the video port system @@ -4537,47 +4537,47 @@ void test_l1_dsVideoPort_negative_dsGetCurrentOutputSettings(void) { // Step 03: Invalid handle check status = dsGetCurrentOutputSettings(handle[0], &hdrstandardarray[0], &matrixcoefarray[0], &colorspacearray[0],\ &colordeptharray[0], &quant_rangearray[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle*/ for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get output settings with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetCurrentOutputSettings(handle[i], NULL, &matrixcoefarray[i], &colorspacearray[i],\ &colordeptharray[i], &quant_rangearray[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Get output settings with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray[i], NULL, &colorspacearray[i],\ &colordeptharray[i], &quant_rangearray[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 07: Get output settings with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray[i], &matrixcoefarray[i], NULL,\ &colordeptharray[i], &quant_rangearray[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 08: Get output settings with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray[i], &matrixcoefarray[i], &colorspacearray[i],\ NULL, &quant_rangearray[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 09: Get output settings with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray[i], &matrixcoefarray[i], &colorspacearray[i],\ &colordeptharray[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 10: Terminate the video port system @@ -4638,24 +4638,24 @@ void test_l1_dsVideoPort_positive_dsIsOutputHDR(void) { // Step 02: Get the video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Check HDR status for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsIsOutputHDR(handle[i], &hdrArray1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat the HDR status check for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsIsOutputHDR(handle[i], &hdrArray2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(hdrArray1[i], hdrArray2[i]); + UT_ASSERT_EQUAL(hdrArray1[i], hdrArray2[i]); } // Step 06: Terminate the video port system @@ -4715,18 +4715,18 @@ void test_l1_dsVideoPort_negative_dsIsOutputHDR(void) { // Step 03: Invalid handle check status = dsIsOutputHDR(handle[0], &hdrStatus[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get valid video port handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Check HDR status with null pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsIsOutputHDR(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -4778,7 +4778,7 @@ void test_l1_dsVideoPort_positive_dsResetOutputToSDR(void) { // Step 02: Reset video output to SDR status = dsResetOutputToSDR(); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); // Step 03: Terminate the video port system status = dsVideoPortTerm(); @@ -4881,7 +4881,7 @@ void test_l1_dsVideoPort_positive_dsSetHdmiPreference(void) { // Loop through kPorts to get each handle for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Set the HDMI preference @@ -4889,7 +4889,7 @@ void test_l1_dsVideoPort_positive_dsSetHdmiPreference(void) { for(dsHdcpProtocolVersion_t hdcpCurrentProtocol = dsHDCP_VERSION_1X ; hdcpCurrentProtocol < dsHDCP_VERSION_MAX; hdcpCurrentProtocol++) { status = dsSetHdmiPreference(handle[i], &hdcpCurrentProtocol); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } } @@ -4950,18 +4950,18 @@ void test_l1_dsVideoPort_negative_dsSetHdmiPreference(void) { // Step 03: Set HDMI preference with invalid handle status = dsSetHdmiPreference(handle[0], &in_range); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get the port handle for all supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Set HDMI preference with valid handle and invalid HDCP protocol for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsSetHdmiPreference(handle[i], &out_range); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -5020,24 +5020,24 @@ void test_l1_dsVideoPort_positive_dsGetHdmiPreference(void) { // Step 02: Get the port handle for all supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Get the HDMI preference for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetHdmiPreference(handle[i], &hdcpCurrentProtocol1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat getting HDMI preference for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetHdmiPreference(handle[i], &hdcpCurrentProtocol2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values and make sure they are equal for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(hdcpCurrentProtocol1[i], hdcpCurrentProtocol2[i]); + UT_ASSERT_EQUAL(hdcpCurrentProtocol1[i], hdcpCurrentProtocol2[i]); } // Step 06: Terminate the video port system @@ -5097,18 +5097,18 @@ void test_l1_dsVideoPort_negative_dsGetHdmiPreference(void) { // Step 03: Get HDMI preference with invalid handle status = dsGetHdmiPreference(handle[0], &hdcpCurrentProtocol[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get the port handle for all supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get HDMI preference with valid handle but with NULL pointer for HDMI Preference for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetHdmiPreference(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 06: Terminate the video port system @@ -5167,24 +5167,24 @@ void test_l1_dsVideoPort_positive_dsGetIgnoreEDIDStatus(void) { // Step 02: Get the port handle for supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Get IgnoreEDID status for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetIgnoreEDIDStatus(handle[i], &ignoreEDIDStatus1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat getting IgnoreEDID status for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetIgnoreEDIDStatus(handle[i], &ignoreEDIDStatus2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare the array values and make sure they are equal for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(ignoreEDIDStatus1[i], ignoreEDIDStatus2[i]); + UT_ASSERT_EQUAL(ignoreEDIDStatus1[i], ignoreEDIDStatus2[i]); } // Step 06: Terminate the video port system @@ -5244,18 +5244,18 @@ void test_l1_dsVideoPort_negative_dsGetIgnoreEDIDStatus(void) { // Step 03: Get IgnoreEDID status with invalid handle status = dsGetIgnoreEDIDStatus(handle[0], &ignoreEDIDStatus[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get the port handle for supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get IgnoreEDID status with valid handle but null pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetIgnoreEDIDStatus(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -5309,14 +5309,14 @@ void test_l1_dsVideoPort_positive_dsSetBackgroundColor(void) { // Step 02: Get the port handle for supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Set background color for each port by looping through dsVideoBackgroundColor_t enum for (int i = 0; i < NUM_OF_PORTS; i++) { for(dsVideoBackgroundColor_t color = dsVIDEO_BGCOLOR_BLUE; color < dsVIDEO_BGCOLOR_MAX ; color++){ status = dsSetBackgroundColor(handle[i], color); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } } @@ -5375,18 +5375,18 @@ void test_l1_dsVideoPort_negative_dsSetBackgroundColor(void) { // Step 03: Set background color with invalid handle status = dsSetBackgroundColor(handle[0], dsVIDEO_BGCOLOR_BLUE); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get the port handle for supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Set background color with valid handle but invalid color for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsSetBackgroundColor(handle[i], dsVIDEO_BGCOLOR_MAX); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -5440,14 +5440,14 @@ void test_l1_dsVideoPort_positive_dsSetForceHDRMode(void) { // Step 02: Get the port handle for supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Set HDR mode for (int i = 0; i < NUM_OF_PORTS; i++) { for(dsHDRStandard_t mode = dsHDRSTANDARD_NONE; mode < dsHDRSTANDARD_Invalid ; mode++ ) { status = dsSetForceHDRMode(handle[i], mode); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } } @@ -5506,18 +5506,18 @@ void test_l1_dsVideoPort_negative_dsSetForceHDRMode(void) { // Step 03: Set HDR mode with invalid handle status = dsSetForceHDRMode(handle[0],dsHDRSTANDARD_HDR10 ); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get the port handle for supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Set HDR mode with invalid mode values for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsSetForceHDRMode(handle[i], dsHDRSTANDARD_Invalid ); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -5576,24 +5576,24 @@ void test_l1_dsVideoPort_positive_dsColorDepthCapabilities(void) { // Step 02: Get the port handle for supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Get color depth capabilities for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsColorDepthCapabilities(handle[i], &colorDepthCapability1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeating to get capabilities for new array for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsColorDepthCapabilities(handle[i], &colorDepthCapability2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(colorDepthCapability1[i], colorDepthCapability2[i]); + UT_ASSERT_EQUAL(colorDepthCapability1[i], colorDepthCapability2[i]); } // Step 06: Terminate the video port system @@ -5653,18 +5653,18 @@ void test_l1_dsVideoPort_negative_dsColorDepthCapabilities(void) { // Step 03: Get capabilities with invalid handle status = dsColorDepthCapabilities(handle[0], &colorDepthCapability[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get the port handle for supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get capabilities with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsColorDepthCapabilities(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -5723,24 +5723,24 @@ void test_l1_dsVideoPort_positive_dsGetPreferredColorDepth(void) { // Step 02: Get the port handle for all supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Get preferred color depth for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetPreferredColorDepth(handle[i], &colorDepth1[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 04: Repeat to get color depth for new array for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetPreferredColorDepth(handle[i], &colorDepth2[i]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Compare array values for (int i = 0; i < NUM_OF_PORTS; i++) { - DS_ASSERT_AUTO_TERM_NUMERICAL(colorDepth1[i], colorDepth2[i]); + UT_ASSERT_EQUAL(colorDepth1[i], colorDepth2[i]); } // Step 06: Terminate the video port system @@ -5800,18 +5800,18 @@ void test_l1_dsVideoPort_negative_dsGetPreferredColorDepth(void) { // Step 03: Get color depth with invalid handle status = dsGetPreferredColorDepth(handle[0], &colorDepth[0]); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get the port handle for supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Get color depth with invalid pointer for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetPreferredColorDepth(handle[i], NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 06: Terminate the video port system @@ -5865,14 +5865,14 @@ void test_l1_dsVideoPort_positive_dsSetPreferredColorDepth(void) { // Step 02: Get the port handle for supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 03: Set preferred color depth for (int i = 0; i < NUM_OF_PORTS; i++) { for (dsDisplayColorDepth_t colorDepth = dsDISPLAY_COLORDEPTH_UNKNOWN; colorDepth <= dsDISPLAY_COLORDEPTH_AUTO; colorDepth++ ) { status = dsSetPreferredColorDepth(handle[i], colorDepth); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } } @@ -5931,18 +5931,18 @@ void test_l1_dsVideoPort_negative_dsSetPreferredColorDepth(void) { // Step 03: Set color depth with invalid handle status = dsSetPreferredColorDepth(handle[0], dsDISPLAY_COLORDEPTH_8BIT ); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); // Step 04: Get the port handle for supported video ports for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_NONE); + UT_ASSERT_EQUAL(status, dsERR_NONE); } // Step 05: Set unsupported color depth for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsSetPreferredColorDepth(handle[i], 0x60); - DS_ASSERT_AUTO_TERM_NUMERICAL(status, dsERR_OPERATION_NOT_SUPPORTED); + UT_ASSERT_EQUAL(status, dsERR_OPERATION_NOT_SUPPORTED); } // Step 06: Terminate the video port system From b33cd0829396c87ad89d39d551e265830425ed5d Mon Sep 17 00:00:00 2001 From: thanushreevani <157587255+thanushreevani@users.noreply.github.com> Date: Mon, 13 May 2024 18:22:49 +0530 Subject: [PATCH 17/38] revert previous commit --- src/test_l2_dsVideoPort.c | 6055 +------------------------------------ 1 file changed, 51 insertions(+), 6004 deletions(-) diff --git a/src/test_l2_dsVideoPort.c b/src/test_l2_dsVideoPort.c index eb77da84..8e994798 100644 --- a/src/test_l2_dsVideoPort.c +++ b/src/test_l2_dsVideoPort.c @@ -1,21 +1,21 @@ /** - * If not stated otherwise in this file or this component's LICENSE - * file the following copyright and licenses apply: - * - * Copyright 2022 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +* If not stated otherwise in this file or this component's LICENSE +* file the following copyright and licenses apply: +* +* Copyright 2022 RDK Management +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ /** * @addtogroup HPK Hardware Porting Kit @@ -47,6026 +47,73 @@ */ /** - * @defgroup DS_VideoPort_HALTEST_L1 Device Settings Video Port HAL Tests L1 File + * @defgroup DS_VideoPort_HALTEST_L2 Device Settings Video Port HAL Tests L2 File * @{ * @parblock * - * ### L1 Tests for DS Video Port HAL : + * ### L2 Tests for DS Video Port HAL : * - * Level 1 unit test cases for all APIs of Device Settings Video Port HAL + * Level 2 unit test cases for all APIs of Device Settings Video Port HAL * * **Pre-Conditions:** None@n * **Dependencies:** None@n * - * Refer to API Definition specification documentation : [ds-video-port_halSpec.md](../../docs/pages/ds-video-port_halSpec.md) + * TODO: Refer to L2 Specification documentation : [l2_module_test_specification_template.md](../docs/pages/l2_module_test_specification_template.md) * * @endparblock */ /** - * @file test_l1_dsVideoPort.c + * @file test_l2_dsVideoPort.c * */ #include #include -#include "dsVideoPort.h" -#include "dsVideoPortSettings.h" #include #include -static int gTestGroup = 1; -static int gTestID = 1; - -#define NUM_OF_PORTS (sizeof(kPorts) / sizeof(kPorts[0])) -#define HANDLE_ARRAY_INIT 0 - -#define UT_ASSERT_EQUAL(value, comparison){\ - if(value != comparison){\ - UT_LOG("\n In %s Comparison: [%d = %d]\n", __FUNCTION__, value, comparison);\ - dsVideoPortTerm();\ - UT_FAIL();\ - }\ -}\ - -/** - * @brief Ensure dsVideoPortInit() returns correct status codes during positive scenarios - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 001@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize the video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |03|Call dsVideoPortInit() - Reinitialize the video port system | | dsERR_NONE | Make sure that the video ports can be reinitialized after termination | - * |04|Call dsVideoPortTerm() - Re-terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsVideoPortInit(void) { - gTestID = 1; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - - // Step 01: Initialize the video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Reinitialize the video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 04: Re-terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - -/** - * @brief Ensure dsVideoPortInit() returns correct error codes during negative scenarios - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 002@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize the video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsVideoPortInit() - Attempt to initialize again without terminating the first initialization | | dsERR_ALREADY_INITIALIZED | Initialization must fail as it is already initialized | - * |03|Call dsVideoPortTerm() - Terminate video port system | | dsERR_NONE | Termination must be successful | - * - * - * @note Testing for the `dsERR_RESOURCE_NOT_AVAILABLE` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsVideoPortInit(void) { - gTestID = 2; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - - // Step 01: Initialize the video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Attempt to initialize again without terminating the first initialization - status = dsVideoPortInit(); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_ALREADY_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_GENERAL); - #endif - - // Step 03: Terminate video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Ensure dsVideoPortTerm() returns correct status codes during positive scenarios - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 003@n - * - * **Pre-Conditions:**None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsVideoPortTerm() - Terminate video port system | | dsERR_NONE | Termination must be successful | - * |03|Call dsVideoPortInit() - Reinitialize video port system | | dsERR_NONE | Initialization must be successful | - * |04|Call dsVideoPortTerm() - Re-terminate video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsVideoPortTerm(void) { - gTestID = 3; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Terminate video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Reinitialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 04: Re-terminate video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Ensure dsVideoPortTerm() returns correct error codes during negative scenarios - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 004@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortTerm() - Attempt to terminate the video port without prior initialization | | dsERR_NOT_INITIALIZED | Termination must fail as video port is not initialized | - * |02|Call dsVideoPortInit() - Initialize the video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |04|Call dsVideoPortTerm() - Attempt to terminate the video port again after termination | | dsERR_NOT_INITIALIZED | Termination must fail as video port is not initialized | - * - * - * @note Testing for the `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsVideoPortTerm(void) { - gTestID = 4; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - - // Step 01: Attempt to terminate the video port without prior initialization - status = dsVideoPortTerm(); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_NONE); - #endif - - // Step 02: Initialize the video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 04: Attempt to terminate the video port again after termination - status = dsVideoPortTerm(); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_NONE); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Ensure dsGetVideoPort() returns correct handles for the available video ports - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 005@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Get the video port handle for last element , store it in a new variable and compare it with previous step | | dsERR_NONE | Port handle obtained from previous step must be equal to handle obtained in this step - * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsGetVideoPort(void) { - gTestID = 5; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - intptr_t lastHandle; - intptr_t newHandle; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle for valid video port type and index - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - if(i == NUM_OF_PORTS-1) - { - lastHandle = handle[i]; - } - } - - // Step 03: Compare with the last handle - status = dsGetVideoPort(kPorts[NUM_OF_PORTS-1].id.type, kPorts[NUM_OF_PORTS-1].id.index, &(handle[NUM_OF_PORTS-1])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - //getting last handle in to new handle for comparision - newHandle = handle[NUM_OF_PORTS-1]; - UT_ASSERT_EQUAL(lastHandle , newHandle); - - // Step 04: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - -/** - * @brief Ensure dsGetVideoPort() returns correct error codes during negative scenarios - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 006@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetVideoPort() - Attempt to get the Video Port handle without initializing video ports | `type`,`index`= kPorts[0], `handle`= valid handle | dsERR_NOT_INITIALIZED | Get Video Port Handle must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsGetVideoPort() - by looping through valid port indexes but with invalid type | type = [not in kPorts] , index = [ loop through kPorts ], handle = [ valid handle ] | dsERR_OPERATION_NOT_SUPPORTED | Operation not supported error must be returned | - * |04|Call dsGetVideoPort() - by looping through valid types but with invalid index | type = [loop through types in kPorts], index = [ invalid index which is not in kPorts ], handle: [ valid handle ] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | - * |05|Call dsGetVideoPort() - by looping through valid types and index but with a NULL handle | type, index: [ loop through kPorts ], handle: [ NULL pointer ] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsGetVideoPort() - Attempt to get the video port handle again after termination | type, index: [ loop through kPorts ], handle: [ valid handle ] | dsERR_NOT_INITIALIZED | Get Video Port Handle must fail as module is not initialized | - * - * - * @note Testing for `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetVideoPort(void) { - gTestID = 6; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - // Step 01: Attempt to get the Video Port handle without initializing - status = dsGetVideoPort(kPorts[0].id.type, kPorts[0].id.index, &(handle[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_NONE); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Attempt to get the Video Port handle with invalid port type - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(dsVIDEOPORT_TYPE_MAX, kPorts[i].id.index, &(handle[i])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_OPERATION_NOT_SUPPORTED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - } - - // Step 04: Attempt to get the Video Port handle invalid port index - for (int i = 0; i < NUM_OF_PORTS ; i++) { - status = dsGetVideoPort(kPorts[i].id.type, -1 , &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 05: NULL handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index , NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get the video port handle again after termination - status = dsGetVideoPort(kPorts[0].id.type, kPorts[0].id.index, &(handle[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_NONE); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Ensure dsIsVideoPortEnabled() correctly indicates the enabled status of a video port - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 007@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform | type , index = [ Loop through kPorts ] | dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |03|Call dsIsVideoPortEnabled - by looping through the acquired port handles to check if a video port is enabled or not and store the values in an array | handle: [valid handle], enabled: [pointer to hold the enabled/disabled status of video port] | dsERR_NONE | Flag which holds the enabled status of Video Port must be returned | - * |04|Call dsIsVideoPortEnabled - Again by looping through the acquired port handles to check if a video port is enabled or not and store the values in a new array | handle: [valid handle], enabled: [pointer to hold the enabled/disabled status of video port] | dsERR_NONE | Flag which holds the enabled status of Video Port must be returned | - * |05|Compare the array values and make sure they are equal| | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsIsVideoPortEnabled(void) { - gTestID = 7; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool isEnabledArray1[NUM_OF_PORTS]; - bool isEnabledArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the port handle for all supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Check if video port is enabled or not - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsIsVideoPortEnabled(handle[i], &isEnabledArray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the check for enabled status - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsIsVideoPortEnabled(handle[i], &isEnabledArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(isEnabledArray1[i], isEnabledArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Ensure dsIsVideoPortEnabled() returns correct error codes during negative scenarios - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 008@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsIsVideoPortEnabled() - Attempt to check if video port is enabled or not without initializing video ports | handle: [ invalid handle ], connected: [ pointer to hold enabled status]| dsERR_NOT_INITIALIZED | Call to check if video port is enabled or not must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsIsVideoPortEnabled() using an invalid handle but with a valid pointer to hold the enabled status | handle: [ invalid handle ], enabled: [ pointer to hold enabled status] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | - * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |05|Call dsIsVideoPortEnabled() by looping through acquired port handles but with a null pointer for enabled status | handle: [ loop through valid handles ], enabled: [ NULL ] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsIsVideoPortEnabled() - Attempt to check if video port is enabled or not without initializing video ports| handle: [ valid handle ], connected: [ pointer to hold enabled status] | dsERR_NOT_INITIALIZED | Call to check if video port is enabled or not must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsIsVideoPortEnabled(void) { - gTestID = 8; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool enabled[NUM_OF_PORTS]; - - // Step 01: Attempt to check enabled status without initialization - status = dsIsVideoPortEnabled(-1, &enabled[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsIsVideoPortEnabled(handle[0], &enabled[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Check enabled status with null pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsIsVideoPortEnabled(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Check enabled status after termination - status = dsIsVideoPortEnabled(handle[0], &enabled[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - -/** - * @brief Ensure dsIsDisplayConnected() behaves as expected during positive scenarios - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 009@n - * - * **Pre-Conditions:**@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsIsDisplayConnected() - by looping through the acquired port handles to check if video port is connected to a display or not and store it in an array| handle: [ loop through valid handles ] , connected: [pointer to hold the connection status of Video Port] | dsERR_NONE | Flag which holds the connection status of Video Port must be returned | - * |04|Call dsIsDisplayConnected() - Again by looping through the acquired port handles to check if video port is connected to a display or not and store it in a new array | handle: [ loop through valid handles ] , connected: [pointer to hold the connection status of Video Port] | dsERR_NONE | Flag which holds the connection status of Video Port must be returned | - * |05|Compare the array values and make sure they are equal| | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsIsDisplayConnected(void) { - gTestID = 9; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool isConnectedArray1[NUM_OF_PORTS]; - bool isConnectedArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS ; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Check if video port is connected - for (int i = 0; i < NUM_OF_PORTS ; i++) { - status = dsIsDisplayConnected(handle[i], &isConnectedArray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the check for connection status - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsIsDisplayConnected(handle[i], &isConnectedArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS ; i++) { - UT_ASSERT_EQUAL(isConnectedArray1[i], isConnectedArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - /** - * @brief Ensure dsIsDisplayConnected() returns correct error codes during negative scenarios - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 010@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsIsDisplayConnected() - Attempt to check if video port is connected without initializing video ports | handle: [ invalid handle ], connected: [ pointer to hold connection status] | dsERR_NOT_INITIALIZED | Call to check if display is connected to video port must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsIsDisplayConnected() using an invalid handle but with a valid pointer to hold the connection status | handle: [ invalid handle ], connected: [ pointer to hold connection status] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | - * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |05|Call dsIsDisplayConnected() by looping through acquired port handles but with a null pointer for display connection | handle: [ loop through valid handles ], connected: [ NULL ] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsIsDisplayConnected() - Attempt to check if video port is connected without initializing video ports| handle: [ valid handle ], connected: [ pointer to hold connection status] | dsERR_NOT_INITIALIZED | Call to check if display is connected to video port must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsIsDisplayConnected(void) { - gTestID = 10; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool connected[NUM_OF_PORTS]; - - // Step 01: Attempt to check connection status without initialization - status = dsIsDisplayConnected(-1 , &(connected[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsIsDisplayConnected(handle[0], &connected[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Check connection status with null pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsIsDisplayConnected(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Check connection status after termination - status = dsIsDisplayConnected(handle[0], &connected[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsIsDisplaySurround() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 011@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsIsDisplaySurround() - by looping through the acquired port handles to check if display connected to video port supports the audio surround and store it an array | handle: [ loop through valid handles ] , surround: [pointer to hold the audio surround support] | dsERR_NONE | Audio surround support of Video Port must be returned | - * |04|Call dsIsDisplaySurround() - Again by looping through the acquired port handles to check if display connected to video port supports the audio surround and store it in a new array| handle: [ loop through valid handles ] , surround: [pointer to hold the audio surround support] | dsERR_NONE | Audio surround support of Video Port must be returned | - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsIsDisplaySurround(void) { - gTestID = 11; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool isSurroundArray1[NUM_OF_PORTS]; - bool isSurroundArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Check if the connected display supports audio surround - status = dsIsDisplaySurround(handle[i], &isSurroundArray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the check for audio surround support - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsIsDisplaySurround(handle[i], &isSurroundArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(isSurroundArray1[i], isSurroundArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Ensure dsIsDisplaySurround() returns correct error codes during negative scenarios - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 012@n - * - * **Pre-Conditions:**@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsIsDisplaySurround() - Attempt to check if display connected to video port has surround support without initializing video ports | handle: [ invalid handle ], , surround: [ pointer to hold Audio surround support] | dsERR_NOT_INITIALIZED | Call to check if display connected to video port has surround support must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsIsDisplaySurround() using an invalid handle but with a valid pointer to hold the surround support | handle: [ invalid handle ], surround: [ pointer to hold Audio surround support] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | - * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |05|Call dsIsDisplaySurround() by looping through acquired port handles but with a null pointer for audio surround | handle: [ loop through valid handles ], surround: [ NULL ] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsIsDisplayConnected() - Attempt to check if display connected to video port has surround support without initializing video ports | handle: [ valid handle ], , surround: [ pointer to hold Audio surround support] | dsERR_NOT_INITIALIZED | Call to check if display connected to video port has surround support must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsIsDisplaySurround(void) { - gTestID = 12; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool surround[NUM_OF_PORTS]; - - // Step 01: Attempt to check audio surround support without initialization - status = dsIsDisplaySurround(-1, &surround[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsIsDisplaySurround(handle[0], &surround[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Check audio surround support with null pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsIsDisplaySurround(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Check audio surround support after termination - status = dsIsDisplaySurround(handle[0], &surround[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsGetSurroundMode() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 013@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsGetSurroundMode() - by looping through the acquired port handles to get the surround mode of each video port and store it in an array | handle: [ loop through valid handles ] , surround: [pointer to hold the Surround mode] | dsERR_NONE | Surround mode (dsSURROUNDMode_t)of Video Port must be returned | - * |04|Call dsGetSurroundMode() - Again by looping through the acquired port handles to get the surround mode of each video port and store it in a new array | handle: [ loop through valid handles ] , surround: [pointer to hold the Surround mode] | dsERR_NONE | Surround mode (dsSURROUNDMode_t)of Video Port must be returned | - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsGetSurroundMode(void) { - gTestID = 13; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - int surroundModeArray1[NUM_OF_PORTS]; - int surroundModeArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - for (int i = 0; i < NUM_OF_PORTS; i++) { - // Step 03: Get the surround mode of each video port - status = dsGetSurroundMode(handle[i], &surroundModeArray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the retrieval of surround mode - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetSurroundMode(handle[i], &surroundModeArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS ; i++) { - UT_ASSERT_EQUAL(surroundModeArray1[i], surroundModeArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsGetSurroundMode() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 014@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetSurroundMode() - Attempt to get the surround mode without initializing video ports | handle: [ invalid handle ], surround: [pointer to hold the surround mode] | dsERR_NOT_INITIALIZED | Get surround mode of video ports must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsGetSurroundMode() using an invalid handle but with a valid pointer to hold the surround mode | handle: [ invalid handle ], surround: [ pointer to hold surround mode] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | - * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |05|Call dsGetSurroundMode() by looping through acquired port handles but with a null pointer for surround mode | handle: [ loop through valid handles ], surround: [ NULL ] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsGetSurroundMode() - Attempt to get the surround mode without initializing video ports | handle: [ valid handle ], surround: [pointer to hold the surround mode] | dsERR_NOT_INITIALIZED | Get surround mode of video ports must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetSurroundMode(void) { - gTestID = 14; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - int surroundMode[NUM_OF_PORTS]; - - // Step 01: Attempt to get surround mode without initialization - status = dsGetSurroundMode(-1, &surroundMode[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsGetSurroundMode(handle[0], &surroundMode[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Check surround mode with null pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetSurroundMode(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get surround mode after termination - status = dsGetSurroundMode(handle[0], &surroundMode[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsIsVideoPortActive() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 015@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsIsVideoPortActive() - by looping through the acquired port handles to check whether a video port is active or not for each port and store it in an array| handle: [ loop through valid handles ] , active: [pointer to hold the active status] | dsERR_NONE | Active Status(A Video port is active if it is connected to the active port of sink device) of Video Port must be returned | - * |04|Call dsIsVideoPortActive() - by looping through the acquired port handles to check whether a video port is active or not for each port and store it in a new array | handle: [ loop through valid handles ] , active: [pointer to hold the active status] | dsERR_NONE | Active Status(A Video port is active if it is connected to the active port of sink device) of Video Port must be returned | - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsIsVideoPortActive(void) { - gTestID = 15; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool isActiveArray1[NUM_OF_PORTS]; - bool isActiveArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Check whether each video port is active - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsIsVideoPortActive(handle[i], &isActiveArray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the active status check - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsIsVideoPortActive(handle[i], &isActiveArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(isActiveArray1[i], isActiveArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsIsVideoPortActive() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 016@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsIsVideoPortActive() - Attempt to check whether a video port is active or not without initializing video ports | handle: [ invalid handle ], active: [pointer to hold the active status of video port] | dsERR_NOT_INITIALIZED | Call to check if video port is active or not must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsIsVideoPortActive() using an invalid handle but with a valid pointer to hold the active status | handle: [ invalid handle ], active: [ pointer to hold active status] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | - * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |05|Call dsIsVideoPortActive() by looping through acquired port handles but with a null pointer for active status | handle: [ loop through valid handles ], active: [ NULL ] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsIsVideoPortActive() - Attempt to check whether a video port is active or not without initializing video ports | handle: [ valid handle ], active: [pointer to hold the active status of video port] | dsERR_NOT_INITIALIZED | Call to check if video port is active or not must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsIsVideoPortActive(void) { - gTestID = 16; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool active[NUM_OF_PORTS]; - - // Step 01: Attempt to check active status without initialization - status = dsIsVideoPortActive(-1, &active[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsIsVideoPortActive(handle[0], &active[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Check active status with null pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsIsVideoPortActive(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to check active status after termination - status = dsIsVideoPortActive(handle[0], &active[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); +* @brief TODO: Describe the object of the test +* +* TODO: Add the description of what is tested and why in this test +* +* **Test Group ID:** TODO: Add the group this test belongs to - Basic (for L1): 01 / Module (L2): 02 / Stress (L2): 03)@n +* **Test Case ID:** TODO: Add the ID of the test case so that it can be logically tracked in the logs@n +* +* **Test Procedure:** +* TODO: Refer to L2 Specification documentation : [l2_module_test_specification_template.md](../docs/pages/l2_module_test_specification_template.md) +*/ +void test_l2_dsVideoPort (void) +{ + UT_FAIL("This function needs to be implemented!"); } +static UT_test_suite_t * pSuite = NULL; /** - * @brief Positive Test Scenarios for dsEnableDTCP() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 017@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsEnableDTCP() by looping through the acquired port handles to enable DTCP for ports which support DTCP | handle: [ loop through valid handles ] , contentProtect: [1] (enable DTCP) |dsERR_NONE or dsERR_OPERATION_NOT_SUPPORTED| API must either successfully enable DTCP or indicate that the operation isn't supported if the particular video does not have DTCP support| - * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * + * @brief Register the main test(s) for this module + * + * @return int - 0 on success, otherwise failure */ -void test_l1_dsVideoPort_positive_dsEnableDTCP(void) { - gTestID = 17; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool enableDTCP = true; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS ; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Enable DTCP - for (int i = 0; i < NUM_OF_PORTS ; i++) { - status = dsEnableDTCP(handle[i], enableDTCP); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } +int test_l2_dsVideoPort_register ( void ) +{ + /* add a suite to the registry */ + pSuite = UT_add_suite( "[L2 dsVideoPort]", NULL, NULL ); + if ( NULL == pSuite ) + { + return -1; + } - // Step 04: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); + + UT_add_test( pSuite, "test_l2_dsVideoPort" ,test_l2_dsVideoPort ); - UT_LOG("\n Out %s\n", __FUNCTION__); + return 0; } - -/** - * @brief Negative Test Scenarios for dsEnableDTCP() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 018@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsEnableDTCP() - Attempt to enable DTCP without initializing the video ports | handle: [ invalid handle ], contentProtect: [true = enable DTCP/ false = disable DTCP] | dsERR_NOT_INITIALIZED | Enable DTCP must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsEnableDTCP() using an invalid handle but with a valid DTCP Flag(enable = 1/ disable = 0) | handle: [ invalid handle ], contentProtect: [ Flag to enable/disable DTCP] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | - * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |05|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |06|Call dsEnableDTCP() Attempt to enable DTCP without initializing the video ports | handle: [ valid handle ], contentProtect: [true = enable DTCP/ false = disable DTCP] | dsERR_NOT_INITIALIZED | Enable DTCP must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsEnableDTCP(void) { - gTestID = 18; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool enableDTCP = true; // Flag to enable/disable DTCP - - // Step 01: Attempt to enable DTCP without initialization - status = dsEnableDTCP(-1, enableDTCP); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsEnableDTCP(handle[0], enableDTCP); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get the Video Port handle - for (int i = 0; i < NUM_OF_PORTS ; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 06: Attempt to enable DTCP after termination - status = dsEnableDTCP(handle[0], enableDTCP); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsEnableHDCP() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 019@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsEnableHDCP() by looping through the acquired port handles to enable HDCP for ports which support HDCP | handle: [ loop through valid handles ] , contentProtect: [1] (enable HDCP), hdcpKey: [ HDCP key ], keySize: [HDCP key size]|dsERR_NONE| API must either successfully enable HDCP or indicate that the operation isn't supported if the particular video does not have HDCP support| - * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsEnableHDCP(void) { - gTestID = 19; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool enableHDCP = true; - char hdcpKey[HDCP_KEY_MAX_SIZE] = "ADEF"; - int keySize = HDCP_KEY_MAX_SIZE; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Enable HDCP - status = dsEnableHDCP(handle[i], enableHDCP, hdcpKey, keySize); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - } - - // Step 04: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsEnableHDCP() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 020@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsEnableHDCP() - Attempt to enable HDCP without initializing the video ports | handle: [ invalid handle ], contentProtect: [true = enable/ false = disable], hdcpKey: [valid hdcp key], keySize: [valid key size]| dsERR_NOT_INITIALIZED | Enable HDCP must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsEnableHDCP() - Attempt to enable HDCP with an invalid handle |handle: [ invalid handle ], contentProtect: [true = enable/ false = disable], hdcpKey: [valid hdcp key], keySize: [valid key size (HDCP_KEY_MAX_SIZE)]| dsERR_INVALID_PARAM | Invalid Parameter error must be returned | - * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |05|Call dsEnableHDCP() by looping through acquired port handles(which support HDCP) with an invalid HDCP key size |handle: [ valid handle ], contentProtect: [true = enable/ false = disable], hdcpKey: [valid hdcp key], keySize: [invalid key size (> HDCP_KEY_MAX_SIZE)| dsERR_INVALID_PARAM | Invalid Parameter error must be returned | - * |05|Call dsEnableHDCP() by looping through acquired port handles with an NULL hdcpKey pointer |handle: [ valid handle ], contentProtect: [true = enable/ false = disable], hdcpKey: [NULL], keySize: [valid key size] | dsERR_INVALID_PARAM | Invalid Parameter error must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsEnableHDCP() Attempt to enable HDCP without initializing the video ports | handle: [ valid handle ], contentProtect: [true = enable/ false = disable], hdcpKey: [valid hdcp key], keySize: [valid key size] | dsERR_NOT_INITIALIZED | Enable HDCP must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsEnableHDCP(void) { - gTestID = 20; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool enableHDCP = true; - char hdcpKey[HDCP_KEY_MAX_SIZE] = "ADEF"; - int keySize = HDCP_KEY_MAX_SIZE; - - // Step 01: Attempt to enable HDCP without initialization - status = dsEnableHDCP(-1, enableHDCP, hdcpKey, keySize); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Attempt to enable HDCP with an invalid handle - status = dsEnableHDCP(handle[0], enableHDCP, hdcpKey, keySize); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get the video port handle for supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 05: Enable HDCP with invalid key size - status = dsEnableHDCP(handle[i],enableHDCP, hdcpKey, HDCP_KEY_MAX_SIZE+1); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 06: Enable HDCP with NULL hdcpKey pointer - status = dsEnableHDCP(handle[i], enableHDCP, NULL, keySize); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 07: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 08: Attempt to enable HDCP after termination - status = dsEnableHDCP(handle[0], enableHDCP, hdcpKey, keySize); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsIsDTCPEnabled() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 021@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| - * |03|Call dsIsDTCPEnabled() by looping through the acquired port handles and valid pointer to check whether DTCP enabled or not(.ie TRUE / FALSE) and store it in an array | handle : [loop through valid handles] , pContentProtected = [pointer to hold data ]|dsERR_NONE |dsIsDTCPEnabled must return a valid value| - * |03|Call dsIsDTCPEnabled() by looping through the acquired port handles and valid pointer to check whether DTCP enabled or not(.ie TRUE / FALSE) and store it in a new array | handle : [loop through valid handles] , pContentProtected = [pointer to hold data ]|dsERR_NONE |dsIsDTCPEnabled must return a valid value| - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video ports of a system| |dsERR_NONE|Termination must be successful| - * - */ -void test_l1_dsVideoPort_positive_dsIsDTCPEnabled(void) { - gTestID = 21; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool isDTCPEnabledArray1[NUM_OF_PORTS]; - bool isDTCPEnabledArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Check if DTCP is enabled - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsIsDTCPEnabled(handle[i], &isDTCPEnabledArray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the check for DTCP status - for (int i = 0; i < NUM_OF_PORTS; i++){ - status = dsIsDTCPEnabled(handle[i], &isDTCPEnabledArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(isDTCPEnabledArray1[i], isDTCPEnabledArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsIsDTCPEnabled() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 022@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsIsDTCPEnabled() - Attempt to get the DTCP status with out initializing video ports| handle [invalid handle] , pContentProtected = [valid pointer]|dsERR_NOT_INITIALIZED| dsIsDTCPEnabled call must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | - * |03|Call dsIsDTCPEnabled() - Using an invalid handle but with valid pointer | handle = [invalid handle], pContentProtected = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsIsDTCPEnabled() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], pContentProtected = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video ports of a system | | dsERR_NONE | Termination must be successful | - * |07|Call dsIsDTCPEnabled() - Again after terminating video ports attempt to get DTCP status | handle= [valid handle] , pContentProtected = [valid pointer] | dsERR_NOT_INITIALIZED | dsIsDTCPEnabled call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsIsDTCPEnabled(void) { - gTestID = 22; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool isDTCPEnabled[NUM_OF_PORTS]; - - // Step 01: Attempt to get DTCP status without initialization - status = dsIsDTCPEnabled(-1, &isDTCPEnabled[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsIsDTCPEnabled(handle[0], &isDTCPEnabled[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Check DTCP status with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++){ - status = dsIsDTCPEnabled(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get DTCP status after termination - status = dsIsDTCPEnabled(handle[0], &isDTCPEnabled[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsIsHDCPEnabled() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 023@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| - * |03|Call dsIsHDCPEnabled() by looping through the acquired port handles and checks whether HDCP enabled or not(.ie TRUE / FALSE) and store it in an array | handle : [loop through valid handles] , pContentProtected = [pointer to hold data ] | dsERR_NONE | dsIsHDCPEnabled must return a valid value| - * |04|Call dsIsHDCPEnabled() by looping through the acquired port handles and checks whether HDCP enabled or not(.ie TRUE / FALSE) and store it in a new array | handle : [loop through valid handles] , pContentProtected = [pointer to hold data ] | dsERR_NONE | dsIsHDCPEnabled must return a valid value| - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video ports of a system| |dsERR_NONE|Termination must be successful| - * - */ -void test_l1_dsVideoPort_positive_dsIsHDCPEnabled(void) { - gTestID = 23; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool isHDCPEnabledArray1[NUM_OF_PORTS]; - bool isHDCPEnabledArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - // Step 03: Check if HDCP is enabled - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsIsHDCPEnabled(handle[i], &isHDCPEnabledArray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the check for HDCP status - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsIsHDCPEnabled(handle[i], &isHDCPEnabledArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(isHDCPEnabledArray1[i], isHDCPEnabledArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsIsHDCPEnabled() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 024@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsIsHDCPEnabled() - Attempt to get the HDCP status with out initializing video ports| handle [invalid handle] , pContentProtected = [valid pointer]|dsERR_NOT_INITIALIZED| dsIsHDCPEnabled call must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | - * |03|Call dsIsHDCPEnabled() - Using an invalid handle but with valid pointer | handle = [invalid handle], pContentProtected = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsIsHDCPEnabled() - By looping through acquired port handles but with a invalid pointer | handle = [valid handle], pContentProtected = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video ports of a system | | dsERR_NONE | Termination must be successful | - * |07|Call dsIsHDCPEnabled() - Again after terminating video ports attempt to get HDCP status | handle= [valid handle from step 04 ] , pContentProtected = [valid pointer] | dsERR_NOT_INITIALIZED | dsIsHDCPEnabled call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsIsHDCPEnabled(void) { - gTestID = 24; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool contentProtected[NUM_OF_PORTS]; - - // Step 01: Attempt to get HDCP status without initialization - status = dsIsHDCPEnabled(-1, &(contentProtected[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Attempt to get HDCP status with an invalid handle - status = dsIsHDCPEnabled(handle[0], &(contentProtected[0])); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get the video port handle for supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get HDCP status with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsIsHDCPEnabled(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get HDCP status after termination - status = dsIsHDCPEnabled(handle[0], &(contentProtected[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsEnableVideoPort() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 025@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] | dsERR_NONE | Valid port handle must be returned for all supported video ports| - * |03|Call dsEnableVideoPort() by looping through the acquired port handles to enable video ports | handle = [loop through valid handles] , enabled = [TRUE] | dsERR_NONE | Video ports must be enabled | - * |04|Call dsVideoPortTerm() - Terminate the video ports of a system| |dsERR_NONE|Termination must be successful| - * - */ -void test_l1_dsVideoPort_positive_dsEnableVideoPort(void) { - gTestID = 25; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Enable the video port - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsEnableVideoPort(handle[i], true); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsEnableVideoPort() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 026@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsEnableVideoPort() - Attempt to enable or disable video port with out initializing video ports| handle [invalid handle] , enabled = [valid bool value]| dsERR_NOT_INITIALIZED| dsEnableVideoPort call must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | - * |03|Call dsEnableVideoPort() - Using an invalid handle but with valid enabled value(i.e TRUE/FALSE) | handle = [invalid handle], enabled = [valid bool value] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsVideoPortTerm() - Terminate the video ports of a system | | dsERR_NONE | Termination must be successful | - * |06|Call dsEnableVideoPort() - Again after terminating video ports attempt to enable or disable video port | handle = [valid handle ] , enabled = [valid bool value] | dsERR_NOT_INITIALIZED | dsEnableVideoPort call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsEnableVideoPort(void) { - gTestID = 26; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - bool enabled = true; // Example value for enabling/disabling the port - - // Step 01: Attempt to enable/disable video port without initialization - status = dsEnableVideoPort(-1, enabled); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsEnableVideoPort(handle[0], enabled); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 06: Attempt to enable/disable video port after termination - status = dsEnableVideoPort(handle[0], enabled); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsSetResolution() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 027@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| - * |03|Call dsSetResolution() by looping through the acquired port handles and valid resolution pointer to set the video port resolution |handle = [loop through valid handles] , resolution = [valid pointer]|dsERR_NONE|Resolution must be set successfully| - * |04|Call dsVideoPortTerm() - Terminate the video ports of a system| |dsERR_NONE|Termination must be successful| - * - */ -void test_l1_dsVideoPort_positive_dsSetResolution(void) { - gTestID = 27; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Set the resolution for the video port - for (int i = 0; i < NUM_OF_PORTS; i++) { - for(int j =0; j < (sizeof(kResolutions)/sizeof(kResolutions[0])); j++) { - status = dsSetResolution(handle[i], &kResolutions[j]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - } - - // Step 04: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsSetResolution() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 028@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsSetResolution() - Attempt to set the resolution with out initializing video ports| handle = [invalid handle] , resolution = [valid pointer]| dsERR_NOT_INITIALIZED| dsSetResolution call must fail as module is not initialized | - * |02|dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | - * |03|Call dsSetResolution() - Using an invalid handle but with valid resolution pointer | handle = [invalid handle], resolution = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsSetResolution() - By looping through acquired port handles but with a invalid pointer | handle = [valid handle], resolution = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |06|Call dsSetResolution() - By looping through acquired port handles but with a out of range resolution paramerters | handle = [valid handle], resolution = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |07|Call dsVideoPortTerm() - Terminate the video ports of a system | | dsERR_NONE | Termination must be successful | - * |08|Call dsSetResolution() - Again after terminating video ports attempt to set the resolution | handle= [valid handle from step 04 ] , resolution = [valid pointer] | dsERR_NOT_INITIALIZED | dsSetResolution call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsSetResolution(void) { - gTestID = 28; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - - - // Step 01: Attempt to set resolution without initialization - status = dsSetResolution(-1, &(kResolutions[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsSetResolution(handle[0], &(kResolutions[0])); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Set resolution with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsSetResolution(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Set resolution with invalid resolution parameters - for (int i = 0; i < NUM_OF_PORTS; i++) { - for (int j = 0; j < (sizeof(invalid_kRes)/sizeof(invalid_kRes[0])); j++) { - status = dsSetResolution(handle[i], &invalid_kRes[j]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - } - // Step 07: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 08: Attempt to set resolution after termination - status = dsSetResolution(handle[0], &(kResolutions[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsGetResolution() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 029@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| - * |03|Call dsGetResolution() by looping through the acquired port handles and valid resolution pointer to retrieve the resolution of a video port and store it in an array | handle = [loop through valid handles] , resolution = [valid pointer] |dsERR_NONE|Resolution must be retrieved successfully| - * |04|Call dsGetResolution() Again by looping through the acquired port handles and valid resolution pointer to retrieve the resolution of a video port and store it in a new array | handle = [loop through valid handles] , resolution = [valid pointer] |dsERR_NONE|Resolution must be retrieved successfully| - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video ports of a system| |dsERR_NONE|Termination must be successful| - * - */ -void test_l1_dsVideoPort_positive_dsGetResolution(void) { - gTestID = 29; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsVideoPortResolution_t resolutionArray1[NUM_OF_PORTS]; - dsVideoPortResolution_t resolutionArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Retrieve the resolution of the video port - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetResolution(handle[i], &(resolutionArray1[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the retrieval of resolution - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetResolution(handle[i] , &resolutionArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(resolutionArray1[i].pixelResolution, resolutionArray2[i].pixelResolution); - UT_ASSERT_EQUAL(resolutionArray1[i].aspectRatio, resolutionArray2[i].aspectRatio); - UT_ASSERT_EQUAL(resolutionArray1[i].stereoScopicMode, resolutionArray2[i].stereoScopicMode); - UT_ASSERT_EQUAL(resolutionArray1[i].frameRate, resolutionArray2[i].frameRate); - UT_ASSERT_EQUAL(resolutionArray1[i].interlaced, resolutionArray2[i].interlaced); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsGetResolution() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 030@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetResolution() - Attempt to get the resolution without initializing video ports| handle = [invalid handle] , resolution = [valid pointer]| dsERR_NOT_INITIALIZED| Get Resolution call must fail as module is not initialized | - * |02|dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | - * |03|Call dsGetResolution() - Using an invalid handle but with valid resolution pointer | handle = [invalid handle], resolution = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |04|Call dsGetResolution() - By looping through acquired port handles but with a invalid pointer | handle = [valid handle], resolution = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |05|Call dsVideoPortTerm() - Terminate the video ports of a system | | dsERR_NONE | Termination must be successful | - * |06|Call dsGetResolution() - Again after terminating video ports attempt to get the resolution of video ports | handle = [valid handle] , resolution = [valid pointer] | dsERR_NOT_INITIALIZED | Get Resolution call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetResolution(void) { - gTestID = 30; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsVideoPortResolution_t resolution[NUM_OF_PORTS]; - - // Step 01: Attempt to get resolution without initialization - status = dsGetResolution(-1, &(resolution[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsGetResolution( handle[0] , &(resolution[0])); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get resolution with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetResolution(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get resolution after termination - status = dsGetResolution(handle[0], &(resolution[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsSetActiveSource() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 031@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| - * |03|Call dsSetActiveSource() by looping through the acquired port handles and set the video port as active source | handle = [loop through valid handles] |dsERR_NONE|The video port must be set as the active source successfully| - * |04|dsVideoPortTerm() - Terminate the video ports of a system| |dsERR_NONE|Termination must be successful| - * - */ -void test_l1_dsVideoPort_positive_dsSetActiveSource(void) { - gTestID = 31; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Set the video port as the active source - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsSetActiveSource(handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsSetActiveSource() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 032@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsSetActiveSource() - Attempt to set the active source with out initializing video ports| handle = [invalid handle] | dsERR_NOT_INITIALIZED| dsSetActiveSource call must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | - * |03|Call dsSetActiveSource() - Using an invalid handle attempt to set active source | handle = [invalid handle] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsVideoPortTerm() - Terminate the video ports of a system | | dsERR_NONE | Termination must be successful | - * |06|Call dsSetActiveSource() - Again after terminating video ports attempt to set the active source | handle= [valid handle ] | dsERR_NOT_INITIALIZED | dsSetActiveSource call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsSetActiveSource(void) { - gTestID = 32; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle [NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - // Step 01: Attempt to set active source without initialization - status = dsSetActiveSource(-1); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsSetActiveSource(handle[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 06: Attempt to set active source after termination - status = dsSetActiveSource(handle[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - -/** - * @brief Positive Test Scenarios for dsVideoFormatUpdateRegisterCB() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 033@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsVideoFormatUpdateRegisterCB() - Register a valid Video Format update callback | cb = [valid callback function] | dsERR_NONE | Video Format Update callback registration must be successful | - * |03|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ - -/*callback*/ -void mockVideoFormatCallback(dsHDRStandard_t videoFormat){ - // Mock implementation, can be customized for testing -} - -void test_l1_dsVideoPort_positive_dsVideoFormatUpdateRegisterCB(void) { - gTestID = 33; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Register a valid Video Format update callback - status = dsVideoFormatUpdateRegisterCB(mockVideoFormatCallback); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsVideoFormatUpdateRegisterCB() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 034@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoFormatUpdateRegisterCB() - Attempt to register for video format update callback without initializing the video ports | cb = [valid callback function ] | dsERR_NOT_INITIALIZED | Callback registration must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsVideoFormatUpdateRegisterCB() with an invalid callback (NULL)| cb = NULL | dsERR_INVALID_PARAM | Invalid paramter error must be returned | - * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |05|Call dsVideoFormatUpdateRegisterCB() - Attempt to register for video format update callback without initializing the video ports | cb = [valid callback function ] | dsERR_NOT_INITIALIZED | Callback registration must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsVideoFormatUpdateRegisterCB(void) { - gTestID = 34; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - - // Step 01: Attempt to register callback without initialization - status = dsVideoFormatUpdateRegisterCB(mockVideoFormatCallback); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Register with invalid callback (NULL) - status = dsVideoFormatUpdateRegisterCB(NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 05: Attempt to register callback after termination - status = dsVideoFormatUpdateRegisterCB(mockVideoFormatCallback); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - -/** - * @brief Positive Test Scenarios for dsRegisterHdcpStatusCallback() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 035@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsRegisterHdcpStatusCallback() - Register a valid HDCP status change callback |handle = [valid handle], cb = [Callback function] | dsERR_NONE | Callback must be registered successfully | - * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ - -/*callback */ -void myHdcpStatusCallbackFunction(intptr_t handle, dsHdcpStatus_t status) -{ - /*stub callback*/ -} - -void test_l1_dsVideoPort_positive_dsRegisterHdcpStatusCallback(void) { - gTestID = 35; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - // Assume dsHdcpStatusCallback_t is defined and a valid callback function is implemented - dsHDCPStatusCallback_t validHdcpStatusCallback = myHdcpStatusCallbackFunction; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle and register HDCP status callback - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Register HDCP status change callback - status = dsRegisterHdcpStatusCallback(handle[i], validHdcpStatusCallback); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsRegisterHdcpStatusCallback() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 036@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsRegisterHdcpStatusCallback() - Attempt to register HDCP status change callback without initializing the video ports | handle= [invalid handle], cb = [valid callback function] | dsERR_NOT_INITIALIZED | Callback Registration for HDCP status change must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsRegisterHdcpStatusCallback() with an invalid handle but with a valid callback function as parameter | handle= [invalid handle], cb = [valid callback function] | dsERR_INVALID_PARAM | Invalid Parameter error must be returned | - * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |05|Call dsRegisterHdcpStatusCallback() with a valid handle and a NULL callback function | handle= [valid handle], cb = NULL | dsERR_INVALID_PARAM | Invalid Parameter error must be returned | - * |05|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |06|Call dsRegisterHdcpStatusCallback() - Attempt to register HDCP status change callback without initializing the video ports | handle= [valid handle], cb = [valid callback function] | dsERR_NOT_INITIALIZED | Callback Registration for HDCP status change must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsRegisterHdcpStatusCallback(void) { - gTestID = 36; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS] = {HANDLE_ARRAY_INIT} /* Initialize with invalid handle */; - - // Assume dsHdcpStatusCallback_t is defined - dsHDCPStatusCallback_t validHdcpStatusCallback = myHdcpStatusCallbackFunction; - - // Step 01: Attempt to register HDCP status callback without initialization - status = dsRegisterHdcpStatusCallback(-1, validHdcpStatusCallback); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsRegisterHdcpStatusCallback(handle[0], validHdcpStatusCallback); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - // Step 05: Register HDCP status callback with NULL callback function - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsRegisterHdcpStatusCallback(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to register HDCP status callback after termination - status = dsRegisterHdcpStatusCallback(handle[0], validHdcpStatusCallback); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsGetHDCPStatus() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 037@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsGetHDCPStatus() by looping through the acquired port handles and valid pointer to retrieve HDCP status and store it in an array | handle = [valid handles] status = [valid pointer] | dsERR_NONE | The HDCP status must be successfully fetched and stored in the given pointer| - * |04|Call dsGetHDCPStatus() - Again by looping through the acquired port handles and valid pointer to retrieve HDCP status and store it in a new array | handle = [valid handles] status = [valid pointer] | dsERR_NONE | The HDCP status must be successfully fetched and stored in the given pointer| - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsGetHDCPStatus(void) { - gTestID = 37; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsHdcpStatus_t hdcpStatusArray1[NUM_OF_PORTS]; - dsHdcpStatus_t hdcpStatusArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Retrieve the HDCP status - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetHDCPStatus(handle[i], &(hdcpStatusArray1[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the retrieval of HDCP status - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetHDCPStatus(handle[i], &(hdcpStatusArray2[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(hdcpStatusArray1[i], hdcpStatusArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsGetHDCPStatus() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 038@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetHDCPStatus() Attempt to get the HDCP status with out initializing video ports| handle = [invalid handle] , status = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetHDCPStatus call must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsGetHDCPStatus() Using an invalid handle but with valid status pointer | handle = [invalid handle], status = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| - * |04|Call dsGetHDCPStatus() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], status = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |05|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |06|Call dsGetHDCPStatus() Again after terminating video ports attempt to get the status of video ports | handle= [valid handle ] , status = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetHDCPStatus call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetHDCPStatus(void) { - gTestID = 38; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - dsHdcpStatus_t hdcpStatus[NUM_OF_PORTS]; - - // Step 01: Attempt to get HDCP status without initialization - status = dsGetHDCPStatus(-1, &(hdcpStatus[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsGetHDCPStatus(handle[0], &(hdcpStatus[0])); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get HDCP status with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetHDCPStatus(handle[i] , NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get HDCP status after termination - status = dsGetHDCPStatus(handle[0], &(hdcpStatus[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - - -/** - * @brief Positive Test Scenarios for dsGetHDCPProtocol() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 039@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsGetHDCPProtocol() by looping through the acquired suported port handles and valid pointer to retrieve the protocol version of a video port and store it in an array |handle = [valid handles] , protocolVersion = [valid pointer] |dsERR_NONE|The HDCP protocol version must be successfully fetched | - * |04|Call dsGetHDCPProtocol() -Again by looping through the acquired suported port handles and valid pointer to retrieve the protocol version of a video port and store it in a new array |handle = [valid handles] , protocolVersion = [valid pointer] |dsERR_NONE|The HDCP protocol version must be successfully fetched | - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsGetHDCPProtocol(void) { - gTestID = 39; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsHdcpProtocolVersion_t protocolVersionArray1[NUM_OF_PORTS]; - dsHdcpProtocolVersion_t protocolVersionArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Retrieve the HDCP protocol version - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetHDCPProtocol(handle[i], &(protocolVersionArray1[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the retrieval of HDCP protocol version - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetHDCPProtocol(handle[i], &(protocolVersionArray2[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(protocolVersionArray1[i], protocolVersionArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - -/** - * @brief Negative Test Scenarios for dsGetHDCPProtocol() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 040@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetHDCPProtocol() Attempt to get the HDCP protocol version with out initializing video ports| handle = [invalid handle] , protocolVersion = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetHDCPProtocol call must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsGetHDCPProtocol() Using an invalid handle but with valid pointer | handle = [invalid handle], protocolVersion = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| - * |05|Call dsGetHDCPProtocol() By looping through acquired supported port handles but with a invalid pointer | handle = [valid handle], protocolVersion = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsGetHDCPProtocol() Again after terminating video ports attempt to get the HDCP protocol version of video ports | handle= [ valid handle ] , protocolVersion = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetHDCPProtocol call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetHDCPProtocol(void) { - gTestID = 40; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsHdcpProtocolVersion_t protocolVersion[NUM_OF_PORTS]; - - // Step 01: Attempt to get HDCP protocol without initialization - status = dsGetHDCPProtocol(-1, &(protocolVersion[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsGetHDCPProtocol(handle[0], &(protocolVersion[0])); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get HDCP protocol with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetHDCPProtocol(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get HDCP protocol after termination - status = dsGetHDCPProtocol(handle[0], &protocolVersion[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsGetHDCPReceiverProtocol() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 041@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsGetHDCPReceiverProtocol() by looping through the acquired supported port handles and valid pointer to retrieve the sink device protocol version of a video port and store it in an array |handle = [loop through valid handles] , protocolVersion = [valid pointer] |dsERR_NONE|The Receiver HDCP protocol version must be successfully fetched and stored in the given pointer| - * |04|Call dsGetHDCPReceiverProtocol() - Again by looping through the acquired supported port handles and valid pointer to retrieve the sink device protocol version of a video port and store it in a new array |handle = [loop through valid handles] , protocolVersion = [valid pointer] |dsERR_NONE|The Receiver HDCP protocol version must be successfully fetched and stored in the given pointer| - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsGetHDCPReceiverProtocol(void) { - gTestID = 41; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - - intptr_t handle[NUM_OF_PORTS]; - - dsHdcpProtocolVersion_t protocolVersionArray1[NUM_OF_PORTS]; - dsHdcpProtocolVersion_t protocolVersionArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Retrieve the Receiver HDCP protocol version - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetHDCPReceiverProtocol(handle[i], &(protocolVersionArray1[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the retrieval of Receiver HDCP protocol version - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetHDCPReceiverProtocol(handle[i], &(protocolVersionArray2[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(protocolVersionArray1[i], protocolVersionArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsGetHDCPReceiverProtocol() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 042@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetHDCPReceiverProtocol() Attempt to get the sink device HDCP protocol version of sink device with out initializing video ports| handle = [invalid handle] , protocolVersion = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetHDCPReceiverProtocol call must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsGetHDCPReceiverProtocol() Using an invalid handle but with valid pointer | handle = [invalid handle], protocolVersion = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| - * |05|Call dsGetHDCPReceiverProtocol() By looping through acquired supported port handles but with a invalid pointer | handle = [valid handle], protocolVersion = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsGetHDCPReceiverProtocol() Again after terminating video ports attempt to get the sink device HDCP protocol version of video ports | handle= [valid handle ] , protocolVersion = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetHDCPReceiverProtocol call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetHDCPReceiverProtocol(void) { - gTestID = 42; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsHdcpProtocolVersion_t receiverProtocolVersion[NUM_OF_PORTS]; - - // Step 01: Attempt to get Receiver HDCP protocol without initialization - status = dsGetHDCPReceiverProtocol(-1, &receiverProtocolVersion[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsGetHDCPReceiverProtocol(handle[0], &receiverProtocolVersion[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get Receiver HDCP protocol with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetHDCPReceiverProtocol(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get Receiver HDCP protocol after termination - status = dsGetHDCPReceiverProtocol(handle[0], &receiverProtocolVersion[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsGetHDCPCurrentProtocol() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 043@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsGetHDCPCurrentProtocol() by looping through the acquired supported port handles and valid pointer to retrieve the current negotiated protocol version of a video port and store it in an array |handle = [valid handles] , protocolVersion = [valid pointer] |dsERR_NONE|The current HDCP protocol version must be successfully fetched | - * |04|Call dsGetHDCPCurrentProtocol() -Again by looping through the acquired supported port handles and valid pointer to retrieve the current negotiated protocol version of a video port and store it in a new array |handle = [valid handles] , protocolVersion = [valid pointer] |dsERR_NONE|The current HDCP protocol version must be successfully fetched | - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsGetHDCPCurrentProtocol(void) { - gTestID = 43; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]; - - dsHdcpProtocolVersion_t currentProtocolArray1[NUM_OF_PORTS]; - dsHdcpProtocolVersion_t currentProtocolArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Retrieve the current negotiated HDCP protocol version - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetHDCPCurrentProtocol(handle[i], ¤tProtocolArray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the retrieval of current HDCP protocol version - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetHDCPCurrentProtocol(handle[i], ¤tProtocolArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(currentProtocolArray1[i], currentProtocolArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsGetHDCPCurrentProtocol() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 044@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetHDCPCurrentProtocol() Attempt to get the current negotiated HDCP protocol version with out initializing video ports| handle = [invalid handle] , protocolVersion = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetHDCPCurrentProtocol call must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsGetHDCPCurrentProtocol() Using an invalid handle but with valid pointer | handle = [invalid handle], protocolVersion = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| - * |05|Call dsGetHDCPCurrentProtocol() By looping through acquired supported port handles but with a invalid pointer | handle = [valid handle], protocolVersion = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsGetHDCPCurrentProtocol() Again after terminating video ports attempt to get the current negotiated HDCP protocol version of video ports | handle= [valid handle ] , protocolVersion = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetHDCPCurrentProtocol call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetHDCPCurrentProtocol(void) { - gTestID = 44; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsHdcpProtocolVersion_t currentProtocolVersion[NUM_OF_PORTS]; - - // Step 01: Attempt to get current negotiated HDCP protocol without initialization - status = dsGetHDCPCurrentProtocol(-1, ¤tProtocolVersion[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsGetHDCPCurrentProtocol(handle[0], ¤tProtocolVersion[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get current HDCP protocol with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetHDCPCurrentProtocol(handle[i] , NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get current negotiated HDCP protocol after termination - status = dsGetHDCPCurrentProtocol(handle[0], ¤tProtocolVersion[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsGetTVHDRCapabilities() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 045@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| - * |03|Call dsGetTVHDRCapabilities() by looping through the acquired port handles and valid pointer to retrieve the HDR capabilities of a video port and store it in an array | handle = [loop through valid handles] , capabilities = [valid pointer] |dsERR_NONE|The HDR capabilities must be successfully fetched and stored in the given pointer| - * |04|Call dsGetTVHDRCapabilities() - Again by looping through the acquired port handles and valid pointer to retrieve the HDR capabilities of a video port and store it in a new array | handle = [loop through valid handles] , capabilities = [valid pointer] |dsERR_NONE|The HDR capabilities must be successfully fetched and stored in the given pointer| - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsGetTVHDRCapabilities(void) { - gTestID = 45; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - int capabilitiesArray1[NUM_OF_PORTS]; - int capabilitiesArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Retrieve the HDR capabilities - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetTVHDRCapabilities(handle[i], &capabilitiesArray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the retrieval of HDR capabilities - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetTVHDRCapabilities(handle[i], &capabilitiesArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(capabilitiesArray1[i], capabilitiesArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsGetTVHDRCapabilities() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 046@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetTVHDRCapabilities() Attempt to get the HDR capabilites with out initializing video ports| handle = [invalid handle] , capabilities = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetTVHDRCapabilities call must fail as module is not initialized | - * |02|dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | - * |03|Call dsGetTVHDRCapabilities() Using an invalid handle but with valid pointer | handle = [invalid handle], capabilities = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| - * |04|Call dsGetTVHDRCapabilities() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], capabilities = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |05|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |06|Call dsGetTVHDRCapabilities() Again after terminating video ports attempt to get the HDR capabilites of video ports | handle= [valid handle ] , capabilities = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetTVHDRCapabilities call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetTVHDRCapabilities(void) { - gTestID = 46; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - int capabilities[NUM_OF_PORTS]; - - // Step 01: Attempt to get HDR capabilities without initialization - status = dsGetTVHDRCapabilities(-1, &capabilities[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsGetTVHDRCapabilities(handle[0], &capabilities[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - for (int i = 0; i < NUM_OF_PORTS; i++) { - // Step 05: Get HDR capabilities with invalid pointer - status = dsGetTVHDRCapabilities(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get HDR capabilities after termination - status = dsGetTVHDRCapabilities(handle[0], &capabilities[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsSupportedTvResolutions() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 047@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports| - * |03|Call dsSupportedTvResolutions() by looping through the acquired port handles and valid pointer to retrieve the resolutions of a video port and store it in an array |handle = [loop through valid handles] , resolutions = [valid pointer] |dsERR_NONE|Resolutions must be set successfully| - * |04|Call dsSupportedTvResolutions() -Again by looping through the acquired port handles and valid pointer to retrieve the resolutions of a video port and store it in a new array |handle = [loop through valid handles] , resolutions = [valid pointer] |dsERR_NONE|Resolutions must be set successfully| - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video ports of a system| |dsERR_NONE|Termination must be successful| - * - */ -void test_l1_dsVideoPort_positive_dsSupportedTvResolutions(void) { - gTestID = 47; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - int resolutionsArray1[NUM_OF_PORTS]; - int resolutionsArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Retrieve the supported TV resolutions - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsSupportedTvResolutions(handle[i], &resolutionsArray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the retrieval of supported TV resolutions - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsSupportedTvResolutions(handle[i], &resolutionsArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(resolutionsArray1[i], resolutionsArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsSupportedTvResolutions() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 048@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsSupportedTvResolutions() - Attempt to get the supported resolutions with out initializing video ports| handle = [invalid handle] , resolutions = [valid pointer]| dsERR_NOT_INITIALIZED| dsSupportedTvResolutions call must fail as module is not initialized | - * |02|dsVideoPortInit() - Initialize video ports of a system | |dsERR_NONE| Initialization must be successful | - * |03|Call dsSupportedTvResolutions() - Using an invalid handle but with valid resolutions pointer | handle = [invalid handle], resolutions = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |04|Call dsSupportedTvResolutions() - By looping through acquired port handles but with a invalid pointer | handle = [valid handle], resolutions = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |05|Call dsVideoPortTerm() - Terminate the video ports of a system | | dsERR_NONE | Termination must be successful | - * |06|Call dsSupportedTvResolutions() - Again after terminating video ports attempt to get the supported resolutions of video ports | handle= [valid handle ] , resolutions = [valid pointer] | dsERR_NOT_INITIALIZED | dsSupportedTvResolutions call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsSupportedTvResolutions(void) { - gTestID = 48; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - int resolutions[NUM_OF_PORTS]; - - // Step 01: Attempt to get supported resolutions without initialization - status = dsSupportedTvResolutions(-1, &resolutions[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsSupportedTvResolutions(handle[0], &resolutions[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get supported resolutions with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsSupportedTvResolutions(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get supported resolutions after termination - status = dsSupportedTvResolutions(handle[0], &resolutions[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsSetForceDisable4KSupport() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 049@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsSetForceDisable4KSupport() by looping through the acquired port handles and valid value to Set the 4K support to be forcefully disabled or not | handle = [loop through valid handles] , disable= [valid value] | dsERR_NONE | The 4K support must be successfully disabled or not | - * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsSetForceDisable4KSupport(void) { - gTestID = 49; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool disable4K = true; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - for (int i = 0; i < NUM_OF_PORTS; i++) { - // Step 03: Set force disable 4K support - status = dsSetForceDisable4KSupport(handle[i], disable4K); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsSetForceDisable4KSupport() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 050@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsSetForceDisable4KSupport() Attempt to disable or not to disable 4K support with out initializing video ports| handle = [invalid handle] , disable = [valid value]| dsERR_NOT_INITIALIZED| dsSetForceDisable4KSupport call must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsSetForceDisable4KSupport() Using an invalid handle but with valid disable parameter value | handle = [invalid handle], disable = [valid value] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |06|Call dsSetForceDisable4KSupport() Again after terminating video ports attempt to disable or not to disable 4k support of video ports | handle= [valid handle ] , disable = [valid value] | dsERR_NOT_INITIALIZED | dsSetForceDisable4KSupport call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsSetForceDisable4KSupport(void) { - gTestID = 50; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool disable4K = true; - - // Step 01: Attempt to set force disable 4K support without initialization - status = dsSetForceDisable4KSupport(-1, disable4K); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsSetForceDisable4KSupport(handle[0], disable4K); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 06: Attempt to set force disable 4K support after termination - status = dsSetForceDisable4KSupport(handle[0], disable4K); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsGetForceDisable4KSupport() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 051@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsGetForceDisable4KSupport() by looping through the acquired port handles and valid pointer to get the 4K support disabled or not and store it in an array | handle = [loop through valid handles] , disable= [valid pointer] | dsERR_NONE | The 4K support disabled or not must be successfully retrieved | - * |04|Call dsGetForceDisable4KSupport() - Again by looping through the acquired port handles and valid pointer to get the 4K support disabled or not and store it in a new array | handle = [loop through valid handles] , disable= [valid pointer] | dsERR_NONE | The 4K support disabled or not must be successfully retrieved | - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsGetForceDisable4KSupport(void) { - gTestID = 51; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool disable4KArray1[NUM_OF_PORTS]; - bool disable4KArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Retrieve whether 4K support is disabled - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetForceDisable4KSupport(handle[i], &disable4KArray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the retrieval - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetForceDisable4KSupport(handle[i], &disable4KArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(disable4KArray1[i], disable4KArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsGetForceDisable4KSupport() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 052@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetForceDisable4KSupport() Attempt to get 4k support disable or not with out initializing video ports| handle = [invalid handle] , disable = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetForceDisable4KSupport call must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsGetForceDisable4KSupport() Using an invalid handle but with valid pointer | handle = [invalid handle], disable = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsGetForceDisable4KSupport() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], disable = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsGetForceDisable4KSupport() Again after terminating video ports attempt to get whether 4K support of video ports disabled or not | handle= [valid handle ] , disable = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetForceDisable4KSupport call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetForceDisable4KSupport(void) { - gTestID = 52; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool disable4K[NUM_OF_PORTS]; - - // Step 01: Attempt to get 4K support status without initialization - status = dsGetForceDisable4KSupport(-1, &disable4K[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsGetForceDisable4KSupport(handle[0], &disable4K[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get 4K support status with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetForceDisable4KSupport(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get 4K support status after termination - status = dsGetForceDisable4KSupport(handle[0], &disable4K[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsGetVideoEOTF() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 053@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsGetVideoEOTF() by looping through the acquired port handles and valid pointer to retrieve the current Electro-Optical Transfer Function (EOTF) value and store it in an array | handle = [loop through ports] , video_eotf = [valid pointer] |dsERR_NONE | Valid EOTF value must return a valid EOTF value of the specified video port| - * |04|Call dsGetVideoEOTF() -Again by looping through the acquired port handles and valid pointer to retrieve the current Electro-Optical Transfer Function (EOTF) value and store it in a new array | handle = [loop through ports] , video_eotf = [valid pointer] |dsERR_NONE | Valid EOTF value must return a valid EOTF value of the specified video port| - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsGetVideoEOTF(void) { - gTestID = 53; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsHDRStandard_t eotfArray1[NUM_OF_PORTS]; - dsHDRStandard_t eotfArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Retrieve the EOTF value - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoEOTF(handle[i], &eotfArray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the retrieval of EOTF value - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoEOTF(handle[i], &eotfArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(eotfArray1[i], eotfArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsGetVideoEOTF() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 054@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetVideoEOTF() Attempt to get the EOTF with out initializing video ports| handle = [invalid handle] , video_eotf = [valid pointer] | dsERR_NOT_INITIALIZED| dsGetVideoEOTF call must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsGetVideoEOTF() Using an invalid handle but with valid pointer | handle = [invalid handle], video_eotf = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsGetVideoEOTF() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], video_eotf = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsGetVideoEOTF() Again after terminating video ports attempt to get the EOTF of video ports | handle= [invalid handle ] , video_eotf = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetVideoEOTF call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetVideoEOTF(void) { - gTestID = 54; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsHDRStandard_t eotf[NUM_OF_PORTS]; - - // Step 01: Attempt to get EOTF without initialization - status = dsGetVideoEOTF(-1, &eotf[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsGetVideoEOTF(handle[0], &eotf[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get EOTF value with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoEOTF(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get EOTF after termination - status = dsGetVideoEOTF(handle[0], &eotf[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsGetMatrixCoefficients() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 055@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsGetMatrixCoefficients() by looping through the acquired port handles and valid resolution pointer to retrieve the current matrix coefficients of a specified port and store it in an array |handle = [loop through valid handles] , matrix_coefficients = [valid pointer] |dsERR_NONE|must return a valid matrix coefficient value of the specified video port| - * |04|Call dsGetMatrixCoefficients() -Again by looping through the acquired port handles and valid resolution pointer to retrieve the current matrix coefficients of a specified port and store it in a new array |handle = [loop through valid handles] , matrix_coefficients = [valid pointer] |dsERR_NONE|must return a valid matrix coefficient value of the specified video port| - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsGetMatrixCoefficients(void) { - gTestID = 55; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsDisplayMatrixCoefficients_t matrixCoefficientsArray1[NUM_OF_PORTS]; - dsDisplayMatrixCoefficients_t matrixCoefficientsArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - for (int i = 0; i < NUM_OF_PORTS; i++) { - // Step 03: Retrieve the matrix coefficients - status = dsGetMatrixCoefficients(handle[i], &matrixCoefficientsArray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the retrieval of matrix coefficients - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetMatrixCoefficients(handle[i], &matrixCoefficientsArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(matrixCoefficientsArray1[i], matrixCoefficientsArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsGetMatrixCoefficients() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 056@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetMatrixCoefficients() Attempt to get the matrix coefficients with out initializing video ports| handle = [invalid handle] , matrix_coefficients = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetMatrixCoefficients call must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsGetMatrixCoefficients() Using an invalid handle but with valid pointer | handle = [invalid handle], matrix_coefficients = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsGetMatrixCoefficients() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], matrix_coefficients = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsGetMatrixCoefficients() Again after terminating video ports attempt to get the matrix coefficients of video ports | handle= [ valid handle ] , matrix_coefficients = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetMatrixCoefficients call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetMatrixCoefficients(void) { - gTestID = 56; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsDisplayMatrixCoefficients_t matrixCoefficients[NUM_OF_PORTS]; - - // Step 01: Attempt to get matrix coefficients without initialization - status = dsGetMatrixCoefficients(-1, &matrixCoefficients[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsGetMatrixCoefficients(handle[0], &matrixCoefficients[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get matrix coefficients with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetMatrixCoefficients(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get matrix coefficients after termination - status = dsGetMatrixCoefficients(handle[0], &matrixCoefficients[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsGetColorDepth() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 057@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsGetColorDepth() by looping through the acquired port handles and valid pointer to retrieve the current color depth & store in an array | handle = [loop through valid handles] , color_depth = [valid pointer] | dsERR_NONE | must return a valid color depth value of the specified video port| - * |04|Call dsGetColorDepth() -Again by looping through the acquired port handles and valid pointer to retrieve the current color depth & store it in a new array | handle = [loop through valid handles] , color_depth = [valid pointer] | dsERR_NONE | must return a valid color depth value of the specified video port| - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsGetColorDepth(void) { - gTestID = 57; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - unsigned int colorDepthArray1[NUM_OF_PORTS]; - unsigned int colorDepthArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Retrieve the color depth - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetColorDepth(handle[i], &colorDepthArray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the retrieval of color depth - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetColorDepth(handle[i], &colorDepthArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(colorDepthArray1[i], colorDepthArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsGetColorDepth() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 058@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetColorDepth() Attempt to get the color depth with out initializing video ports| handle = [invalid handle] , color_depth = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetColorDepth call must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsGetColorDepth() Using an invalid handle but with valid pointer | handle = [invalid handle], color_depth = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsGetColorDepth() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], color_depth = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsGetColorDepth() Again after terminating video ports attempt to get the color depth of video ports | handle= [invalid handle] , color_depth = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetColorDepth call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetColorDepth(void) { - gTestID = 58; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - unsigned int colorDepth[NUM_OF_PORTS]; // To store the color depth - - // Step 01: Attempt to get color depth without initialization - status = dsGetColorDepth(-1, &colorDepth[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsGetColorDepth(handle[0], &colorDepth[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get color depth with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetColorDepth(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get color depth after termination - status = dsGetColorDepth(handle[0], &colorDepth[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsGetColorSpace() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 059@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsGetColorSpace() by looping through the acquired port handles and valid pointer to retrieve the current color space setting of video port & store it in an array |handle = [loop through valid handles] , color_space = [valid pointer] |Valid color space value|must return a valid color space setting of the specified video port| - * |04|Call dsGetColorSpace() -Again by looping through the acquired port handles and valid pointer to retrieve the current color space setting of video port & store it in a new array |handle = [loop through valid handles] , color_space = [valid pointer] |Valid color space value|must return a valid color space setting of the specified video port| - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsGetColorSpace(void) { - gTestID = 59; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsDisplayColorSpace_t colorSpaceArray1[NUM_OF_PORTS]; - dsDisplayColorSpace_t colorSpaceArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Retrieve the color space - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetColorSpace(handle[i], &colorSpaceArray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the retrieval of color space - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetColorSpace(handle[i], &colorSpaceArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(colorSpaceArray1[i], colorSpaceArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - -/** - * @brief Negative Test Scenarios for dsGetColorSpace() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 060@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetColorSpace() Attempt to get the color space with out initializing video ports| handle = [invalid handle] , color_space = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetColorSpace call must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsGetColorSpace() Using an invalid handle but with valid pointer | handle = [invalid handle], color_space = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsGetColorSpace() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], color_space = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsGetColorSpace() Again after terminating video ports attempt to get the color space of video ports | handle= [invalid handle] , color_space = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetColorSpace call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetColorSpace(void) { - gTestID = 60; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsDisplayColorSpace_t colorSpace[NUM_OF_PORTS]; - - // Step 01: Attempt to get color space without initialization - status = dsGetColorSpace(-1, &colorSpace[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsGetColorSpace(handle[0], &colorSpace[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get color space with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetColorSpace(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get color space after termination - status = dsGetColorSpace(handle[0], &colorSpace[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - -/** - * @brief Positive Test Scenarios for dsGetQuantizationRange() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 061@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsGetQuantizationRange() by looping through the acquired port handles and valid pointer to retrieve the current quantization range & store it in an array |handle = [loop through valid handles] , quantization_range = [valid pointer] |dsERR_NONE | must return a valid quantization range of the specified video port| - * |04|Call dsGetQuantizationRange() -Again by looping through the acquired port handles and valid pointer to retrieve the current quantization range & store it in a new array |handle = [loop through valid handles] , quantization_range = [valid pointer] |dsERR_NONE | must return a valid quantization range of the specified video port| - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsGetQuantizationRange(void) { - gTestID = 61; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsDisplayQuantizationRange_t quantizationRangeArray1[NUM_OF_PORTS]; - dsDisplayQuantizationRange_t quantizationRangeArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Retrieve the quantization range - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetQuantizationRange(handle[i], &quantizationRangeArray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the retrieval of quantization range - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetQuantizationRange(handle[i], &quantizationRangeArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(quantizationRangeArray1[i], quantizationRangeArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - -/** - * @brief Negative Test Scenarios for dsGetQuantizationRange() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 062@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetQuantizationRange() Attempt to get the quantization range with out initializing video ports| handle = [invalid handle] , quantization_range = [valid pointer]| dsERR_NOT_INITIALIZED| dsGetQuantizationRange call must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsGetQuantizationRange() Using an invalid handle but with valid pointer | handle = [invalid handle], quantization_range = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsGetQuantizationRange() By looping through acquired port handles but with a invalid pointer | handle = [valid handle], quantization_range = [invalid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsGetQuantizationRange() Again after terminating video ports attempt to get the quantization of video ports | handle= [valid handle from step 04 ] , quantization_range = [valid pointer] | dsERR_NOT_INITIALIZED | dsGetQuantizationRange call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetQuantizationRange(void) { - gTestID = 62; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsDisplayQuantizationRange_t quantizationRange[NUM_OF_PORTS]; - - // Step 01: Attempt to get quantization range without initialization - status = dsGetQuantizationRange(-1, &quantizationRange[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsGetQuantizationRange(handle[0], &quantizationRange[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get quantization range with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetQuantizationRange(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get quantization range after termination - status = dsGetQuantizationRange(handle[0], &quantizationRange[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsGetCurrentOutputSettings() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 063@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsGetCurrentOutputSettings() by looping through the acquired port handles and valid pointer to retrieve the current output settings and store it in an array | handle= [loop through valid handles] , video_eotf = [valid EOTF pointer], matrix_coefficients = = [valid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [valid color depth pointer], quantization_range = [valid quantization range pointer]| dsERR_NONE and valid settings| All the output settings for the specified video port must be returned | - * |04|Call dsGetCurrentOutputSettings() -Again by looping through the acquired port handles and valid pointer to retrieve the current output settings and store it in a new array | handle= [loop through valid handles] , video_eotf = [valid EOTF pointer], matrix_coefficients = = [valid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [valid color depth pointer], quantization_range = [valid quantization range pointer]| dsERR_NONE and valid settings| All the output settings for the specified video port must be returned | - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsGetCurrentOutputSettings(void) { - gTestID = 63; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - dsHDRStandard_t hdrstandardarray1[NUM_OF_PORTS]; - dsDisplayMatrixCoefficients_t matrixcoefarray1[NUM_OF_PORTS]; - dsDisplayColorSpace_t colorspacearray1[NUM_OF_PORTS]; - unsigned int colordeptharray1[NUM_OF_PORTS]; - dsDisplayQuantizationRange_t quant_rangearray1[NUM_OF_PORTS]; - - dsHDRStandard_t hdrstandardarray2[NUM_OF_PORTS]; - dsDisplayMatrixCoefficients_t matrixcoefarray2[NUM_OF_PORTS]; - dsDisplayColorSpace_t colorspacearray2[NUM_OF_PORTS]; - unsigned int colordeptharray2[NUM_OF_PORTS]; - dsDisplayQuantizationRange_t quant_rangearray2[NUM_OF_PORTS]; - - // Assume OutputSettings is a struct that includes EOTF, matrix coefficients, color space, color depth, and quantization range - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Retrieve the current output settings - status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray1[i] ,&matrixcoefarray1[i], &colorspacearray1[i],\ - &colordeptharray1[i], &quant_rangearray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the retrieval of output settings - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray2[i] ,&matrixcoefarray2[i], &colorspacearray2[i],\ - &colordeptharray2[i], &quant_rangearray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(hdrstandardarray1[i], hdrstandardarray2[i]); - UT_ASSERT_EQUAL(matrixcoefarray1[i], matrixcoefarray2[i]); - UT_ASSERT_EQUAL(colorspacearray1[i], colorspacearray2[i]); - UT_ASSERT_EQUAL(colordeptharray1[i], colordeptharray2[i]); - UT_ASSERT_EQUAL(quant_rangearray1[i], quant_rangearray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsGetCurrentOutputSettings() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 064@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetCurrentOutputSettings() - Attempt to get the current output settings without initializing the video ports | handle = [invalid handle], video_eotf = [valid EOTF pointer], matrix_coefficients = = [valid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [valid color depth pointer], quantization_range = [valid quantization range pointer] | dsERR_NOT_INITIALIZED | Get Output settings must fail as module is not initialized| - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsGetCurrentOutputSettings() with an invalid handle but with valid pointers for output settings |handle = [valid handle], video_eotf = [valid EOTF pointer], matrix_coefficients = [valid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [valid color depth pointer], quantization_range = [valid quantization range pointer] |dsERR_INVALID_PARAM| Invalid parameter error must be returned | - * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsGetCurrentOutputSettings() by looping through valid handles but invalid pointer for parameters | handle = [valid handle], video_eotf = [invalid EOTF pointer], matrix_coefficients =[valid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [valid color depth pointer], quantization_range = [valid quantization range pointer] |dsERR_INVALID_PARAM| Invalid parameter error must be returned | - * |06|Call dsGetCurrentOutputSettings() by looping through valid handles but invalid pointer for parameters | handle = [valid handle], video_eotf = [valid EOTF pointer], matrix_coefficients = [invalid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [valid color depth pointer], quantization_range = [valid quantization range pointer] |dsERR_INVALID_PARAM| Invalid parameter error must be returned | - * |07|Call dsGetCurrentOutputSettings() by looping through valid handles but invalid pointer for parameters | handle = [valid handle], video_eotf = [valid EOTF pointer], matrix_coefficients = [valid matrix coefficient pointer], color_space = [invalid color space pointer], color_depth = [valid color depth pointer], quantization_range = [valid quantization range pointer] |dsERR_INVALID_PARAM| Invalid parameter error must be returned | - * |08|Call dsGetCurrentOutputSettings() by looping through valid handles but invalid pointer for parameters | handle = [valid handle], video_eotf = [valid EOTF pointer], matrix_coefficients = [valid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [invalid color depth pointer], quantization_range = [valid quantization range pointer] |dsERR_INVALID_PARAM| Invalid parameter error must be returned | - * |09|Call dsGetCurrentOutputSettings() by looping through valid handles but invalid pointer for parameters | handle = [valid handle], video_eotf = [valid EOTF pointer], matrix_coefficients = = [valid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [valid color depth pointer], quantization_range = [invalid quantization range pointer] |dsERR_INVALID_PARAM| Invalid parameter error must be returned | - * |10|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |11|Call dsGetCurrentOutputSettings() - Attempt to get the current output settings without initializing the video ports | handle = [valid handle], video_eotf = [valid EOTF pointer], matrix_coefficients = = [valid matrix coefficient pointer], color_space = [valid color space pointer], color_depth = [valid color depth pointer], quantization_range = [valid quantization range pointer] | dsERR_NOT_INITIALIZED | Get Output settings must fail as module is not initialized| - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetCurrentOutputSettings(void) { - gTestID = 64; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - dsHDRStandard_t hdrstandardarray[NUM_OF_PORTS]; - dsDisplayMatrixCoefficients_t matrixcoefarray[NUM_OF_PORTS]; - dsDisplayColorSpace_t colorspacearray[NUM_OF_PORTS]; - unsigned int colordeptharray[NUM_OF_PORTS]; - dsDisplayQuantizationRange_t quant_rangearray[NUM_OF_PORTS]; - - // Step 01: Attempt to get output settings without initialization - status = dsGetCurrentOutputSettings(-1, &hdrstandardarray[0], &matrixcoefarray[0], &colorspacearray[0],\ - &colordeptharray[0], &quant_rangearray[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsGetCurrentOutputSettings(handle[0], &hdrstandardarray[0], &matrixcoefarray[0], &colorspacearray[0],\ - &colordeptharray[0], &quant_rangearray[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle*/ - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get output settings with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetCurrentOutputSettings(handle[i], NULL, &matrixcoefarray[i], &colorspacearray[i],\ - &colordeptharray[i], &quant_rangearray[i]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Get output settings with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray[i], NULL, &colorspacearray[i],\ - &colordeptharray[i], &quant_rangearray[i]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 07: Get output settings with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray[i], &matrixcoefarray[i], NULL,\ - &colordeptharray[i], &quant_rangearray[i]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 08: Get output settings with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray[i], &matrixcoefarray[i], &colorspacearray[i],\ - NULL, &quant_rangearray[i]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 09: Get output settings with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetCurrentOutputSettings(handle[i], &hdrstandardarray[i], &matrixcoefarray[i], &colorspacearray[i],\ - &colordeptharray[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 10: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 11: Attempt to get output settings after termination - status = dsGetCurrentOutputSettings(handle[0], &hdrstandardarray[0], &matrixcoefarray[0], &colorspacearray[0],\ - &colordeptharray[0], &quant_rangearray[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsIsOutputHDR() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 065@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsIsOutputHDR() - by looping through acquired port handles to check if the video output is HDR or not & store it in an array | handle = [valid handle], hdr = [valid pointer to hold hdr status value](true = HDR) | dsERR_NONE | Flag which holds the HDR status( @a true if Video Output is HDR and @a false otherwise ) of Video Port must be returned | - * |04|Call dsIsOutputHDR() - Again by looping through acquired port handles to check if the video output is HDR or not & store it in a new array | handle = [valid handle], hdr = [valid pointer to hold hdr status value](true = HDR) | dsERR_NONE | Flag which holds the HDR status( @a true if Video Output is HDR and @a false otherwise ) of Video Port must be returned | - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - * - */ -void test_l1_dsVideoPort_positive_dsIsOutputHDR(void) { - gTestID = 65; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool hdrArray1[NUM_OF_PORTS]; - bool hdrArray2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Check HDR status - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsIsOutputHDR(handle[i], &hdrArray1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat the HDR status check - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsIsOutputHDR(handle[i], &hdrArray2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(hdrArray1[i], hdrArray2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsIsOutputHDR() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 066@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsIsOutputHDR() - Attempt to check if video output is HDR or not without initializing video ports | handle: [ invalid handle ], hdr: [ pointer to hold HDR status]| dsERR_NOT_INITIALIZED | Call to check if video output is HDR or not must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsIsOutputHDR() using an invalid handle but with a valid pointer to hold the HDR status | handle: [ invalid handle ], hdr: [ pointer to hold HDR status] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | - * |04|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |05|Call dsIsOutputHDR() by looping through acquired port handles but with a null pointer for HDR status | handle: [ loop through valid handles ], hdr: [ NULL ] | dsERR_INVALID_PARAM | Invalid parameter error must be returned | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsIsOutputHDR() - Attempt to check if video output is HDR or not without initializing video ports | handle: [ valid handle ], hdr: [ pointer to hold HDR status] | dsERR_NOT_INITIALIZED | Call to check if video output is HDR or not must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsIsOutputHDR(void) { - gTestID = 66; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool hdrStatus[NUM_OF_PORTS]; - - // Step 01: Attempt to check HDR status without initialization - status = dsIsOutputHDR(-1, &hdrStatus[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Invalid handle check - status = dsIsOutputHDR(handle[0], &hdrStatus[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get valid video port handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Check HDR status with null pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsIsOutputHDR(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to check HDR status after termination - status = dsIsOutputHDR(handle[0], &hdrStatus[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsResetOutputToSDR() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 067@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|dsResetOutputToSDR() - To reset the video output to SDR | | dsERR_NONE | Video Output must be resetted to SDR | - * |03|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - * - */ -void test_l1_dsVideoPort_positive_dsResetOutputToSDR(void) { - gTestID = 67; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Reset video output to SDR - status = dsResetOutputToSDR(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsResetOutputToSDR() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 068@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsResetOutputToSDR() - Attempt to reset the video output to SDR without initializing the video ports | dsERR_NOT_INITIALIZED | Reset Video output to SDR must fail as video port is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |04|Call dsResetOutputToSDR() - Again attempt to reset the video output to SDR after terminating the video ports | dsERR_NOT_INITIALIZED| Reset Video output to SDR must fail as video port is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsResetOutputToSDR(void) { - gTestID = 68; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - - // Step 01: Attempt reset without initialization - status = dsResetOutputToSDR(); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_NONE); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 04: Attempt reset after termination - status = dsResetOutputToSDR(); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_NONE); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsSetHdmiPreference() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 069@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned for all supported video ports| - * |03|Call dsSetHdmiPreference() - by looping through the acquired port handles and set the HDMI preference from dsHdcpProtocolVersion_t | handle = [Valid handle], hdcpCurrentProtocol=[valid HDCP Protocol] | dsERR_NONE | HDMI Preference must be set successfully | - * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsSetHdmiPreference(void) { - gTestID = 69; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the port handle for all supported video ports - // Loop through kPorts to get each handle - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Set the HDMI preference - for (int i = 0; i < NUM_OF_PORTS; i++) { - for(dsHdcpProtocolVersion_t hdcpCurrentProtocol = dsHDCP_VERSION_1X ; hdcpCurrentProtocol < dsHDCP_VERSION_MAX; hdcpCurrentProtocol++) - { - status = dsSetHdmiPreference(handle[i], &hdcpCurrentProtocol); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - } - - // Step 04: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsSetHdmiPreference() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 070@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsSetHdmiPreference() - Attempt to set the HDMI Preference without initializing the video ports | handle = [invalid handle], hdcpCurrentProtocol = [valid pointer] | dsERR_NOT_INITIALIZED | Set Hdmi Preference must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsSetHdmiPreference() - Using an invalid handle but with valid HDCP Protcol pointer | handle = [invalid handle], hdcpCurrentProtocol = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] | dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsSetHdmiPreference() - by looping through the acquired port handles and set an invalid HDMI preference| handle = [Valid handle], hdcpCurrentProtocol=[invalid hdcp protocol] | dsERR_NONE | HDMI Preference must be set successfully | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsSetHdmiPreference() - Attempt to set the HDMI Preference without initializing the video ports | handle = [valid handle], hdcpCurrentProtocol = [valid pointer] | dsERR_NOT_INITIALIZED | Set Hdmi Preference must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsSetHdmiPreference(void) { - gTestID = 70; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsHdcpProtocolVersion_t in_range = dsHDCP_VERSION_1X , out_range = dsHDCP_VERSION_MAX; - - // Step 01: Attempt set HDMI preference without initialization - status = dsSetHdmiPreference(-1, &in_range); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Set HDMI preference with invalid handle - status = dsSetHdmiPreference(handle[0], &in_range); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get the port handle for all supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Set HDMI preference with valid handle and invalid HDCP protocol - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsSetHdmiPreference(handle[i], &out_range); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt set HDMI preference after termination - status = dsSetHdmiPreference(handle[0], &in_range); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsGetHdmiPreference() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 071@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsGetHdmiPreference() - by looping through the acquired port handles to get the HDMI Preference of each video ports which supports HDCP & store it in an array | handle = [valid handle], hdcpCurrentProtocol = [valid pointer] | dsERR_NONE | The Current HDMI Preference must be returned | - * |04|Call dsGetHdmiPreference() - Again by looping through the acquired port handles to get the HDMI Preference of each video ports which supports HDCP & store it in a new array | handle = [valid handle], hdcpCurrentProtocol = [valid pointer] | dsERR_NONE | The Current HDMI Preference must be returned | - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsGetHdmiPreference(void) { - gTestID = 71; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsHdcpProtocolVersion_t hdcpCurrentProtocol1[NUM_OF_PORTS]; - dsHdcpProtocolVersion_t hdcpCurrentProtocol2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the port handle for all supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Get the HDMI preference - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetHdmiPreference(handle[i], &hdcpCurrentProtocol1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat getting HDMI preference - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetHdmiPreference(handle[i], &hdcpCurrentProtocol2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values and make sure they are equal - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(hdcpCurrentProtocol1[i], hdcpCurrentProtocol2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsGetHdmiPreference() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 072@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetHdmiPreference() - Attempt to get the HDMI Preference without prior initializing the video ports| handle = [invalid handle], hdcpCurrentProtocol = [valid pointer] | dsERR_NOT_INITIALIZED | Get HDMI Preference of video ports must fail as module is not initialized | - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsGetHdmiPreference() - Using an invalid handle but with valid HDCP Protcol pointer | handle = [invalid handle], hdcpCurrentProtocol = [valid pointer] | dsERR_INVALID_PARAM | Invalid paramerter must be returned | - * |04|Call dsGetVideoPort() - Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] | dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsGetHdmiPreference() - by looping through the acquired port handles but with NULL pointer for HDMI preference | handle = [Valid handle], hdcpCurrentProtocol = [NULL] | dsERR_NONE | Invalid Parameter error must be returned| - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsSetHdmiPreference() - Attempt to get the HDMI Preference without initializing the video ports | handle = [valid handle], hdcpCurrentProtocol = [valid pointer] | dsERR_NOT_INITIALIZED | Get Hdmi Preference must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetHdmiPreference(void) { - gTestID = 72; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsHdcpProtocolVersion_t hdcpCurrentProtocol[NUM_OF_PORTS]; - - // Step 01: Attempt to get HDMI preference without initialization - status = dsGetHdmiPreference(-1, &hdcpCurrentProtocol[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Get HDMI preference with invalid handle - status = dsGetHdmiPreference(handle[0], &hdcpCurrentProtocol[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get the port handle for all supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get HDMI preference with valid handle but with NULL pointer for HDMI Preference - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetHdmiPreference(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get HDMI preference after termination - status = dsGetHdmiPreference(handle[0], &hdcpCurrentProtocol[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsGetIgnoreEDIDStatus() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 073@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsGetIgnoreEDIDStatus() by looping through acquired handles and valid pointer to get IgnoreEDID status & store it in an array |handle=[valid handle] ,status=[valid pointer] |dsERR_NONE | must successfully get the IgnoreEDID status| - * |04|Call dsGetIgnoreEDIDStatus() - Again by looping through acquired handles and valid pointer to get IgnoreEDID status & store it in a new array |handle=[valid handle] ,status=[valid pointer] |dsERR_NONE | must successfully get the IgnoreEDID status| - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsGetIgnoreEDIDStatus(void) { - gTestID = 73; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool ignoreEDIDStatus1[NUM_OF_PORTS]; - bool ignoreEDIDStatus2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the port handle for supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Get IgnoreEDID status - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetIgnoreEDIDStatus(handle[i], &ignoreEDIDStatus1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat getting IgnoreEDID status - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetIgnoreEDIDStatus(handle[i], &ignoreEDIDStatus2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare the array values and make sure they are equal - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(ignoreEDIDStatus1[i], ignoreEDIDStatus2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsGetIgnoreEDIDStatus() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 074@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetIgnoreEDIDStatus() without prior initialization of video ports| handle=[invalid handle] ,status=[invalid pointer] |dsERR_NOT_INITIALIZED|call must be fail as module is not initialzed| - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsGetIgnoreEDIDStatus() with an invalid handle but with valid pointer|handle=[invalid handle] ,status=[valid pointer]|dsERR_INVALID_PARAM|Invalid parameter must be returned| - * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsGetIgnoreEDIDStatus() by looping through valid handles with a NULL status pointer | handle=[valid handle] , status=[NULL pointer]|dsERR_INVALID_PARAM|Invalid parameter must be returned| - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsGetIgnoreEDIDStatus() Again after terminating video ports | handle=[valid handle from step 04 ] , status=[valid pointer] | dsERR_NOT_INITIALIZED | call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetIgnoreEDIDStatus(void) { - gTestID = 74; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - bool ignoreEDIDStatus[NUM_OF_PORTS]; - - // Step 01: Attempt to get IgnoreEDID status without initialization - status = dsGetIgnoreEDIDStatus(-1, &ignoreEDIDStatus[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Get IgnoreEDID status with invalid handle - status = dsGetIgnoreEDIDStatus(handle[0], &ignoreEDIDStatus[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get the port handle for supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get IgnoreEDID status with valid handle but null pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetIgnoreEDIDStatus(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get IgnoreEDID status after termination - status = dsGetIgnoreEDIDStatus(handle[0], &ignoreEDIDStatus[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsSetBackgroundColor() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 075@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsSetBackgroundColor by looping through the acquired prots and valid color values| handle=[Valid handle], color=[valid values] | dsERR_NONE|Background color must be set successfully| - * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsSetBackgroundColor(void) { - gTestID = 75; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the port handle for supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &handle[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Set background color for each port by looping through dsVideoBackgroundColor_t enum - for (int i = 0; i < NUM_OF_PORTS; i++) { - for(dsVideoBackgroundColor_t color = dsVIDEO_BGCOLOR_BLUE; color < dsVIDEO_BGCOLOR_MAX ; color++){ - status = dsSetBackgroundColor(handle[i], color); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - } - - // Step 04: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsSetBackgroundColor() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 076@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsSetBackgroundColor() without prior initialization of video ports| handle=[inValid handle], color=[valid values] |dsERR_NOT_INITIALIZED|call must fail as module not initialized| - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsSetBackgroundColor() with an invalid handle and valid color values |handle=[inValid handle], color=[valid values]|dsERR_INVALID_PARAM|Invalid parameter must return | - * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsSetBackgroundColor() by looping through acquired handles and invalid color value|handle=[valid handle], color=[Invalid color value|dsERR_INVALID_PARAM|Invalid parameter must return| - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsSetBackgroundColor() after termination video ports |handle= [valid handle from step 04 ] , color= [valid values] | dsERR_NOT_INITIALIZED | call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsSetBackgroundColor(void) { - gTestID = 76; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - // Step 01: Attempt to set background color without initialization - status = dsSetBackgroundColor(-1, dsVIDEO_BGCOLOR_BLUE); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Set background color with invalid handle - status = dsSetBackgroundColor(handle[0], dsVIDEO_BGCOLOR_BLUE); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get the port handle for supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Set background color with valid handle but invalid color - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsSetBackgroundColor(handle[i], dsVIDEO_BGCOLOR_MAX); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to set background color after termination - status = dsSetBackgroundColor(handle[0], dsVIDEO_BGCOLOR_BLACK); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsSetForceHDRMode() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 077@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsSetForceHDRMode() by looping through acquired handles and valid mode values|handle=[valid handle], mode=[valid values]|dsERR_NONE|HDR mode must be set successfully| - * |04|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsSetForceHDRMode(void) { - gTestID = 77; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the port handle for supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Set HDR mode - for (int i = 0; i < NUM_OF_PORTS; i++) { - for(dsHDRStandard_t mode = dsHDRSTANDARD_NONE; mode < dsHDRSTANDARD_Invalid ; mode++ ) { - status = dsSetForceHDRMode(handle[i], mode); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - } - - // Step 04: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsSetForceHDRMode() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 078@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsSetForceHDRMode() without prior initialization of video ports| handle=[invalid handle], mode=[valid values] |dsERR_NOT_INITIALIZED|call must fail as module not initialized| - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsSetForceHDRMode() with an invalid handle and valid mode values|handle=[inValid handle], mode=[valid values]|dsERR_INVALID_PARAM|Invalid parameter must return| - * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsSetForceHDRMode() by looping through acquired handles and valid mode values|handle=[Valid handle], mode=[invalid values]|dsERR_INVALID_PARAM|Invalid parameter must return| - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsSetForceHDRMode() after termination video ports |handle=[valid handle from step 04 ] , mode=[valid values] | dsERR_NOT_INITIALIZED | call must fail as module is not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsSetForceHDRMode(void) { - gTestID = 78; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - // Step 01: Attempt to set HDR mode without initialization - status = dsSetForceHDRMode(-1, dsHDRSTANDARD_HDR10 ); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Set HDR mode with invalid handle - status = dsSetForceHDRMode(handle[0],dsHDRSTANDARD_HDR10 ); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get the port handle for supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Set HDR mode with invalid mode values - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsSetForceHDRMode(handle[i], dsHDRSTANDARD_Invalid ); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to set HDR mode after termination - status = dsSetForceHDRMode(handle[0], dsHDRSTANDARD_HDR10); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsColorDepthCapabilities() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 079@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsColorDepthCapabilities() by looping through the acquired ports and valid pointer to get the color depth capabilities & store it in an array |handle=[vallid handle], colorDepthCapability=[valid pointer] |dsERR_NONE Color depth capabilities must be retrieved successfully| - * |04|Call dsColorDepthCapabilities() -Again by looping through the acquired ports and valid pointer to get the color depth capabilities & store it in a new array |handle=[vallid handle], colorDepthCapability=[valid pointer] |dsERR_NONE Color depth capabilities must be retrieved successfully| - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsColorDepthCapabilities(void) { - gTestID = 79; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - unsigned int colorDepthCapability1[NUM_OF_PORTS]; - unsigned int colorDepthCapability2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the port handle for supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Get color depth capabilities - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsColorDepthCapabilities(handle[i], &colorDepthCapability1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeating to get capabilities for new array - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsColorDepthCapabilities(handle[i], &colorDepthCapability2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(colorDepthCapability1[i], colorDepthCapability2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsColorDepthCapabilities() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 080@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsColorDepthCapabilities() without prior initialization of video ports|handle=[invalid handle], colorDepthCapability=[valid pointer]|dsERR_NOT_INITIALIZED|call must fail as module not initialized| - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsColorDepthCapabilities() with an invalid handle and valid pointer |handle=[valid handle], colorDepthCapability=[valid pointer] |dsERR_INVALID_PARAM|Invalid parameter must be returned | - * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |04|Call dsColorDepthCapabilities() by looping through acquired handles and invalid pointer | handle=[valid handle], colorDepthCapability=[Invalid pointer]|dsERR_INVALID_PARAM|Invalid parameter must return| - * |05|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |06|Call dsColorDepthCapabilities() after terminating videop ports |handle= [valid handle from step 04 ] , colorDepthCapability= [valid pointer] | dsERR_NOT_INITIALIZED|call must fail as module not initialized | - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsColorDepthCapabilities(void) { - gTestID = 80; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - unsigned int colorDepthCapability[NUM_OF_PORTS]; - - // Step 01: Attempt to get capabilities without initialization - status = dsColorDepthCapabilities(-1, &colorDepthCapability[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Get capabilities with invalid handle - status = dsColorDepthCapabilities(handle[0], &colorDepthCapability[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get the port handle for supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get capabilities with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsColorDepthCapabilities(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get capabilities after termination - status = dsColorDepthCapabilities(handle[0], &colorDepthCapability[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsGetPreferredColorDepth() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 081@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsGetPreferredColorDepth by looping through acquired handles and valid pointer to get the preferred color depth of each port & store it in an array |handle=[valid handle] , colorDepth=[valid pointer]|dsERR_NONE|Preferred Color depth must be retrieved successfully| - * |04|Call dsGetPreferredColorDepth - Again by looping through acquired handles and valid pointer to get the preferred color depth of each port & store it in a new array |handle=[valid handle] , colorDepth=[valid pointer]|dsERR_NONE|Preferred Color depth must be retrieved successfully| - * |05|Compare the array values and make sure they are equal | | dsERR_NONE | The values must be equal | - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsGetPreferredColorDepth(void) { - gTestID = 81; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsDisplayColorDepth_t colorDepth1[NUM_OF_PORTS]; - dsDisplayColorDepth_t colorDepth2[NUM_OF_PORTS]; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the port handle for all supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Get preferred color depth - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetPreferredColorDepth(handle[i], &colorDepth1[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 04: Repeat to get color depth for new array - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetPreferredColorDepth(handle[i], &colorDepth2[i]); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Compare array values - for (int i = 0; i < NUM_OF_PORTS; i++) { - UT_ASSERT_EQUAL(colorDepth1[i], colorDepth2[i]); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsGetPreferredColorDepth() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 082@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsGetPreferredColorDepth() without prior initialization of video ports|handle=[invalid handle] , colorDepth=[valid pointer]|dsERR_NOT_INITIALIZED|call must fail as module is not initialized| - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsGetPreferredColorDepth() with an invalid handle and with valid pointer|handle=[invalid handle] , colorDepth=[valid pointer]|dsERR_INVALID_PARAM|Invalid parameter must be returned| - * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsGetPreferredColorDepth() by looping through valid handes and with invalid pointer|handle=[valid handle] , colorDepth=[invalid pointer]|dsERR_INVALID_PARAM|Invalid parameter must be returned| - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsGetPreferredColorDepth() after terminating video ports |handle=[valid handle] , colorDepth=[valid pointer] |dsERR_NOT_INITIALIZED|call must fail as module is not initialized| - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsGetPreferredColorDepth(void) { - gTestID = 82; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - dsDisplayColorDepth_t colorDepth[NUM_OF_PORTS]; - - // Step 01: Attempt to get color depth without initialization - status = dsGetPreferredColorDepth(-1, &colorDepth[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Get color depth with invalid handle - status = dsGetPreferredColorDepth(handle[0], &colorDepth[0]); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get the port handle for supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Get color depth with invalid pointer - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetPreferredColorDepth(handle[i], NULL); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to get color depth after termination - status = dsGetPreferredColorDepth(handle[0], &colorDepth[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Positive Test Scenarios for dsSetPreferredColorDepth() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 083@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |02|Call dsGetVideoPort() - Get the video port handle for valid video port type and valid index | type, index = [Loop through kPorts] , handle = [valid handle] | dsERR_NONE | Valid port handle must be returned | - * |03|Call dsSetPreferredColorDepth() by looping through the acquired handles and Valid colorDepth values|handle=[invalid handle] , colorDepth=[valid values] |dsERR_NONE|Color depth must be set successfully| - * |05|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * - */ -void test_l1_dsVideoPort_positive_dsSetPreferredColorDepth(void) { - gTestID = 83; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - // Step 01: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 02: Get the port handle for supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 03: Set preferred color depth - for (int i = 0; i < NUM_OF_PORTS; i++) { - for (dsDisplayColorDepth_t colorDepth = dsDISPLAY_COLORDEPTH_UNKNOWN; colorDepth <= dsDISPLAY_COLORDEPTH_AUTO; colorDepth++ ) { - status = dsSetPreferredColorDepth(handle[i], colorDepth); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - } - - // Step 05: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -/** - * @brief Negative Test Scenarios for dsSetPreferredColorDepth() - * - * **Test Group ID:** Basic: 01@n - * **Test Case ID:** 084@n - * - * **Pre-Conditions:** None@n - * - * **Dependencies:** None@n - * - * **User Interaction:** None - * - * **Test Procedure:**@n - * |Variation / Step|Description|Test Data|Expected Result|Notes| - * |:--:|---------|----------|--------------|-----| - * |01|Call dsSetPreferredColorDepth() without prior initialization of video ports|handle=[invalid handle] , colorDepth=[valid values]|dsERR_NOT_INITIALIZED|call must fail as module not initialized| - * |02|Call dsVideoPortInit() - Initialize video port system | | dsERR_NONE | Initialization must be successful | - * |03|Call dsSetPreferredColorDepth() with an invalid handle with valid color depth values|handle=[Invalid handle],colorDepth=[valid values]|dsERR_INVALID_PARAM|Invalid parameter must be return| - * |04|Call dsGetVideoPort() Get the port handle for all supported video ports on the platform |type , index = [ Loop through kPorts ] |dsERR_NONE | Valid port handle must be returned for all supported video ports | - * |05|Call dsSetPreferredColorDepth() by looping through valid handles with an unsupported colorDepth value|handle=[valid handle],colorDepth=[invalid values]|dsERR_OPERATION_NOT_SUPPORTED|Invalid parameter must be return| - * |06|Call dsVideoPortTerm() - Terminate the video port system | | dsERR_NONE | Termination must be successful | - * |07|Call dsSetPreferredColorDepth() after terminating video ports|handle=[valid handle] , colorDepth=[valid values]|dsERR_NOT_INITIALIZED|call must fail as module not initialized| - * - * - * @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_GENERAL` might be challenging since it requires a specific scenarios. - */ -void test_l1_dsVideoPort_negative_dsSetPreferredColorDepth(void) { - gTestID = 84; - UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); - - dsError_t status; - intptr_t handle[NUM_OF_PORTS]={HANDLE_ARRAY_INIT}; - - // Step 01: Attempt to set color depth without initialization - status = dsSetPreferredColorDepth(-1, dsDISPLAY_COLORDEPTH_8BIT ); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - // Step 02: Initialize video port system - status = dsVideoPortInit(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 03: Set color depth with invalid handle - status = dsSetPreferredColorDepth(handle[0], dsDISPLAY_COLORDEPTH_8BIT ); - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - - // Step 04: Get the port handle for supported video ports - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsGetVideoPort(kPorts[i].id.type, kPorts[i].id.index, &(handle[i])); - UT_ASSERT_EQUAL(status, dsERR_NONE); - } - - // Step 05: Set unsupported color depth - for (int i = 0; i < NUM_OF_PORTS; i++) { - status = dsSetPreferredColorDepth(handle[i], 0x60); - UT_ASSERT_EQUAL(status, dsERR_OPERATION_NOT_SUPPORTED); - } - - // Step 06: Terminate the video port system - status = dsVideoPortTerm(); - UT_ASSERT_EQUAL(status, dsERR_NONE); - - // Step 07: Attempt to set color depth after termination - status = dsSetPreferredColorDepth(handle[0], dsDISPLAY_COLORDEPTH_12BIT ); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif - - UT_LOG("\n Out %s\n", __FUNCTION__); -} - - -static UT_test_suite_t * pSuite = NULL; - -/** - * @brief Register the main test(s) for this module - * - * @return int - 0 on success, otherwise failure - */ -int test_l1_dsVideoPort_register ( void ) -{ - /* add a suite to the registry */ - pSuite = UT_add_suite( "[L1 dsVideoPort]", NULL, NULL ); - if ( NULL == pSuite ) - { - return -1; - } - - UT_add_test( pSuite, "dsVideoPortInit_L1_positive" ,test_l1_dsVideoPort_positive_dsVideoPortInit ); - UT_add_test( pSuite, "dsVideoPortInit_L1_negative" ,test_l1_dsVideoPort_negative_dsVideoPortInit ); - UT_add_test( pSuite, "dsVideoPortTerm_L1_positive" ,test_l1_dsVideoPort_positive_dsVideoPortTerm ); - UT_add_test( pSuite, "dsVideoPortTerm_L1_negative" ,test_l1_dsVideoPort_negative_dsVideoPortTerm ); - UT_add_test( pSuite, "dsGetVideoPort_L1_positive" ,test_l1_dsVideoPort_positive_dsGetVideoPort ); - UT_add_test( pSuite, "dsGetVideoPort_L1_negative" ,test_l1_dsVideoPort_negative_dsGetVideoPort ); - UT_add_test( pSuite, "dsIsVideoPortEnabled_L1_positive" ,test_l1_dsVideoPort_positive_dsIsVideoPortEnabled ); - UT_add_test( pSuite, "dsIsVideoPortEnabled_L1_negative" ,test_l1_dsVideoPort_negative_dsIsVideoPortEnabled ); - UT_add_test( pSuite, "dsIsDisplayConnected_L1_positive" ,test_l1_dsVideoPort_positive_dsIsDisplayConnected ); - UT_add_test( pSuite, "dsIsDisplayConnected_L1_negative" ,test_l1_dsVideoPort_negative_dsIsDisplayConnected ); - UT_add_test( pSuite, "dsIsDisplaySurround_L1_positive" ,test_l1_dsVideoPort_positive_dsIsDisplaySurround ); - UT_add_test( pSuite, "dsIsDisplaySurround_L1_negative" ,test_l1_dsVideoPort_negative_dsIsDisplaySurround ); - UT_add_test( pSuite, "dsGetSurroundMode_L1_positive" ,test_l1_dsVideoPort_positive_dsGetSurroundMode ); - UT_add_test( pSuite, "dsGetSurroundMode_L1_negative" ,test_l1_dsVideoPort_negative_dsGetSurroundMode ); - UT_add_test( pSuite, "dsVideoFormatUpdateRegisterCB_L1_positive" ,test_l1_dsVideoPort_positive_dsVideoFormatUpdateRegisterCB ); - UT_add_test( pSuite, "dsVideoFormatUpdateRegisterCB_L1_negative" ,test_l1_dsVideoPort_negative_dsVideoFormatUpdateRegisterCB ); - UT_add_test( pSuite, "dsIsVideoPortActive_L1_positive" ,test_l1_dsVideoPort_positive_dsIsVideoPortActive ); - UT_add_test( pSuite, "dsIsVideoPortActive_L1_negative" ,test_l1_dsVideoPort_negative_dsIsVideoPortActive ); - UT_add_test( pSuite, "dsEnableDTCP_L1_positive" ,test_l1_dsVideoPort_positive_dsEnableDTCP ); - UT_add_test( pSuite, "dsEnableDTCP_L1_negative" ,test_l1_dsVideoPort_negative_dsEnableDTCP ); - UT_add_test( pSuite, "dsEnableHDCP_L1_positive" ,test_l1_dsVideoPort_positive_dsEnableHDCP ); - UT_add_test( pSuite, "dsEnableHDCP_L1_negative" ,test_l1_dsVideoPort_negative_dsEnableHDCP ); - UT_add_test( pSuite, "dsIsDTCPEnabled_L1_positive" ,test_l1_dsVideoPort_positive_dsIsDTCPEnabled ); - UT_add_test( pSuite, "dsIsDTCPEnabled_L1_negative" ,test_l1_dsVideoPort_negative_dsIsDTCPEnabled ); - UT_add_test( pSuite, "dsIsHDCPEnabled_L1_positive" ,test_l1_dsVideoPort_positive_dsIsHDCPEnabled ); - UT_add_test( pSuite, "dsIsHDCPEnabled_L1_negative" ,test_l1_dsVideoPort_negative_dsIsHDCPEnabled ); - UT_add_test( pSuite, "dsEnableVideoPort_L1_positive" ,test_l1_dsVideoPort_positive_dsEnableVideoPort ); - UT_add_test( pSuite, "dsEnableVideoPort_L1_negative" ,test_l1_dsVideoPort_negative_dsEnableVideoPort ); - UT_add_test( pSuite, "dsSetResolution_L1_positive" ,test_l1_dsVideoPort_positive_dsSetResolution ); - UT_add_test( pSuite, "dsSetResolution_L1_negative" ,test_l1_dsVideoPort_negative_dsSetResolution ); - UT_add_test( pSuite, "dsGetResolution_L1_positive" ,test_l1_dsVideoPort_positive_dsGetResolution ); - UT_add_test( pSuite, "dsGetResolution_L1_negative" ,test_l1_dsVideoPort_negative_dsGetResolution ); - UT_add_test( pSuite, "dsSetActiveSource_L1_positive" ,test_l1_dsVideoPort_positive_dsSetActiveSource ); - UT_add_test( pSuite, "dsSetActiveSource_L1_negative" ,test_l1_dsVideoPort_negative_dsSetActiveSource ); - UT_add_test( pSuite, "dsRegisterHdcpStatusCallback_L1_positive" ,test_l1_dsVideoPort_positive_dsRegisterHdcpStatusCallback ); - UT_add_test( pSuite, "dsRegisterHdcpStatusCallback_L1_negative" ,test_l1_dsVideoPort_negative_dsRegisterHdcpStatusCallback ); - UT_add_test( pSuite, "dsGetHDCPStatus_L1_positive" ,test_l1_dsVideoPort_positive_dsGetHDCPStatus ); - UT_add_test( pSuite, "dsGetHDCPStatus_L1_negative" ,test_l1_dsVideoPort_negative_dsGetHDCPStatus ); - UT_add_test( pSuite, "dsGetHDCPProtocol_L1_positive" ,test_l1_dsVideoPort_positive_dsGetHDCPProtocol ); - UT_add_test( pSuite, "dsGetHDCPProtocol_L1_negative" ,test_l1_dsVideoPort_negative_dsGetHDCPProtocol ); - UT_add_test( pSuite, "dsGetHDCPReceiverProtocol_L1_positive" ,test_l1_dsVideoPort_positive_dsGetHDCPReceiverProtocol ); - UT_add_test( pSuite, "dsGetHDCPReceiverProtocol_L1_negative" ,test_l1_dsVideoPort_negative_dsGetHDCPReceiverProtocol ); - UT_add_test( pSuite, "dsGetHDCPCurrentProtocol_L1_positive" ,test_l1_dsVideoPort_positive_dsGetHDCPCurrentProtocol ); - UT_add_test( pSuite, "dsGetHDCPCurrentProtocol_L1_negative" ,test_l1_dsVideoPort_negative_dsGetHDCPCurrentProtocol ); - UT_add_test( pSuite, "dsGetTVHDRCapabilities_L1_positive" ,test_l1_dsVideoPort_positive_dsGetTVHDRCapabilities ); - UT_add_test( pSuite, "dsGetTVHDRCapabilities_L1_negative" ,test_l1_dsVideoPort_negative_dsGetTVHDRCapabilities ); - UT_add_test( pSuite, "dsSupportedTvResolutions_L1_positive" ,test_l1_dsVideoPort_positive_dsSupportedTvResolutions ); - UT_add_test( pSuite, "dsSupportedTvResolutions_L1_negative" ,test_l1_dsVideoPort_negative_dsSupportedTvResolutions ); - UT_add_test( pSuite, "dsSetForceDisable4KSupport_L1_positive" ,test_l1_dsVideoPort_positive_dsSetForceDisable4KSupport ); - UT_add_test( pSuite, "dsSetForceDisable4KSupport_L1_negative" ,test_l1_dsVideoPort_negative_dsSetForceDisable4KSupport ); - UT_add_test( pSuite, "dsGetForceDisable4KSupport_L1_positive" ,test_l1_dsVideoPort_positive_dsGetForceDisable4KSupport ); - UT_add_test( pSuite, "dsGetForceDisable4KSupport_L1_negative" ,test_l1_dsVideoPort_negative_dsGetForceDisable4KSupport ); - UT_add_test( pSuite, "dsGetVideoEOTF_L1_positive" ,test_l1_dsVideoPort_positive_dsGetVideoEOTF ); - UT_add_test( pSuite, "dsGetVideoEOTF_L1_negative" ,test_l1_dsVideoPort_negative_dsGetVideoEOTF ); - UT_add_test( pSuite, "dsGetMatrixCoefficients_L1_positive" ,test_l1_dsVideoPort_positive_dsGetMatrixCoefficients ); - UT_add_test( pSuite, "dsGetMatrixCoefficients_L1_negative" ,test_l1_dsVideoPort_negative_dsGetMatrixCoefficients ); - UT_add_test( pSuite, "dsGetColorDepth_L1_positive" ,test_l1_dsVideoPort_positive_dsGetColorDepth ); - UT_add_test( pSuite, "dsGetColorDepth_L1_negative" ,test_l1_dsVideoPort_negative_dsGetColorDepth ); - UT_add_test( pSuite, "dsGetColorSpace_L1_positive" ,test_l1_dsVideoPort_positive_dsGetColorSpace ); - UT_add_test( pSuite, "dsGetColorSpace_L1_negative" ,test_l1_dsVideoPort_negative_dsGetColorSpace ); - UT_add_test( pSuite, "dsGetQuantizationRange_L1_positive" ,test_l1_dsVideoPort_positive_dsGetQuantizationRange ); - UT_add_test( pSuite, "dsGetQuantizationRange_L1_negative" ,test_l1_dsVideoPort_negative_dsGetQuantizationRange ); - UT_add_test( pSuite, "dsGetCurrentOutputSettings_L1_positive" ,test_l1_dsVideoPort_positive_dsGetCurrentOutputSettings ); - UT_add_test( pSuite, "dsGetCurrentOutputSettings_L1_negative" ,test_l1_dsVideoPort_negative_dsGetCurrentOutputSettings ); - UT_add_test( pSuite, "dsIsOutputHDR_L1_positive" ,test_l1_dsVideoPort_positive_dsIsOutputHDR ); - UT_add_test( pSuite, "dsIsOutputHDR_L1_negative" ,test_l1_dsVideoPort_negative_dsIsOutputHDR ); - UT_add_test( pSuite, "dsResetOutputToSDR_L1_positive" ,test_l1_dsVideoPort_positive_dsResetOutputToSDR ); - UT_add_test( pSuite, "dsResetOutputToSDR_L1_negative" ,test_l1_dsVideoPort_negative_dsResetOutputToSDR ); - UT_add_test( pSuite, "dsSetHdmiPreference_L1_positive" ,test_l1_dsVideoPort_positive_dsSetHdmiPreference ); - UT_add_test( pSuite, "dsSetHdmiPreference_L1_negative" ,test_l1_dsVideoPort_negative_dsSetHdmiPreference ); - UT_add_test( pSuite, "dsGetHdmiPreference_L1_positive" ,test_l1_dsVideoPort_positive_dsGetHdmiPreference ); - UT_add_test( pSuite, "dsGetHdmiPreference_L1_negative" ,test_l1_dsVideoPort_negative_dsGetHdmiPreference ); - UT_add_test( pSuite, "dsGetIgnoreEDIDStatus_L1_positive" ,test_l1_dsVideoPort_positive_dsGetIgnoreEDIDStatus ); - UT_add_test( pSuite, "dsGetIgnoreEDIDStatus_L1_negative" ,test_l1_dsVideoPort_negative_dsGetIgnoreEDIDStatus ); - UT_add_test( pSuite, "dsSetBackgroundColor_L1_positive" ,test_l1_dsVideoPort_positive_dsSetBackgroundColor ); - UT_add_test( pSuite, "dsSetBackgroundColor_L1_negative" ,test_l1_dsVideoPort_negative_dsSetBackgroundColor ); - UT_add_test( pSuite, "dsSetForceHDRMode_L1_positive" ,test_l1_dsVideoPort_positive_dsSetForceHDRMode ); - UT_add_test( pSuite, "dsSetForceHDRMode_L1_negative" ,test_l1_dsVideoPort_negative_dsSetForceHDRMode ); - UT_add_test( pSuite, "dsColorDepthCapabilities_L1_positive" ,test_l1_dsVideoPort_positive_dsColorDepthCapabilities ); - UT_add_test( pSuite, "dsColorDepthCapabilities_L1_negative" ,test_l1_dsVideoPort_negative_dsColorDepthCapabilities ); - UT_add_test( pSuite, "dsGetPreferredColorDepth_L1_positive" ,test_l1_dsVideoPort_positive_dsGetPreferredColorDepth ); - UT_add_test( pSuite, "dsGetPreferredColorDepth_L1_negative" ,test_l1_dsVideoPort_negative_dsGetPreferredColorDepth ); - UT_add_test( pSuite, "dsSetPreferredColorDepth_L1_positive" ,test_l1_dsVideoPort_positive_dsSetPreferredColorDepth ); - UT_add_test( pSuite, "dsSetPreferredColorDepth_L1_negative" ,test_l1_dsVideoPort_negative_dsSetPreferredColorDepth ); - - - return 0; -} - -/** @} */ // End of DS_VideoPort_HALTEST_L1 +/** @} */ // End of DS_VideoPort_HALTEST_L2 /** @} */ // End of DS_VideoPort_HALTEST /** @} */ // End of Device_Settings_HALTEST /** @} */ // End of Device_Settings From 19274bf9f25818d857249e6c6e78b373842e6dfd Mon Sep 17 00:00:00 2001 From: drissya-k <167057835+drissya-k@users.noreply.github.com> Date: Mon, 13 May 2024 19:09:52 +0530 Subject: [PATCH 18/38] Adding Enhanced Error code support --- src/test_l1_dsVideoDevice.c | 174 ++++++++++++++++++------------------ 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/src/test_l1_dsVideoDevice.c b/src/test_l1_dsVideoDevice.c index 87c430b0..5347119f 100644 --- a/src/test_l1_dsVideoDevice.c +++ b/src/test_l1_dsVideoDevice.c @@ -167,9 +167,9 @@ void test_l1_dsVideoDevice_negative_dsVideoDeviceInit(void) // Step 02: Try initializing again without terminating result = dsVideoDeviceInit(); #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_ALREADY_INITIALIZED); + UT_ASSERT_EQUAL(result, dsERR_ALREADY_INITIALIZED); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // Step 03: De-initialize the video devices for cleanup @@ -303,7 +303,7 @@ void test_l1_dsVideoDevice_positive_dsGetVideoDevice(void) // Step 02: Get the video device handle intptr_t handle = -1; result = dsGetVideoDevice(0, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); UT_ASSERT_TRUE(handle >= 0); // Step 03: De-initialize the video devices @@ -355,11 +355,11 @@ void test_l1_dsVideoDevice_negative_dsGetVideoDevice(void) // Step 03: Get the video device handle with invalid index result = dsGetVideoDevice(-1, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 04: Get the video device handle with valid index but null pointer for handle result = dsGetVideoDevice(0, NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 05: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -420,7 +420,7 @@ void test_l1_dsVideoDevice_positive_dsSetDFC (void) // 02: Obtain video device handle result = dsGetVideoDevice(0, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); UT_ASSERT_TRUE(handle >= 0); // 03-15: Set DFC mode with various zoom modes @@ -428,7 +428,7 @@ void test_l1_dsVideoDevice_positive_dsSetDFC (void) { dsVideoZoom_t zoomMode = i; result = dsSetDFC(handle, zoomMode); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); } // 16: De-initialize video devices @@ -481,16 +481,16 @@ void test_l1_dsVideoDevice_negative_dsSetDFC (void) // 03: Obtain video device handle result = dsGetVideoDevice(0, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); UT_ASSERT_TRUE(handle >= 0); // 04: Call dsSetDFC() with an invalid handle result = dsSetDFC(-1, dsVIDEO_ZOOM_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // 05: Call dsSetDFC() with an invalid zoom mode result = dsSetDFC(handle, dsVIDEO_ZOOM_MAX); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // 06: De-initialize video devices result = dsVideoDeviceTerm(); @@ -544,19 +544,19 @@ void test_l1_dsVideoDevice_positive_dsGetDFC(void) // Step 02: Obtain video device handle result = dsGetVideoDevice(index, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); + UT_ASSERT_EQUAL(result, dsERR_NONE); + UT_ASSERT_EQUAL((handle >= 0), true); // Step 03: Get the DFC mode using dsGetDFC() with the obtained handle result = dsGetDFC(handle, &dfc_mode_1); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: Get the DFC mode using dsGetDFC() again result = dsGetDFC(handle, &dfc_mode_2); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 05: Compare the results to make sure they match - DS_ASSERT_AUTO_TERM_NUMERICAL(memcmp(&dfc_mode_1, &dfc_mode_2, sizeof(dsVideoZoom_t)),0); + UT_ASSERT_EQUAL(memcmp(&dfc_mode_1, &dfc_mode_2, sizeof(dsVideoZoom_t)),0); // Step 06: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -612,16 +612,16 @@ void test_l1_dsVideoDevice_negative_dsGetDFC(void) // Step 03: Obtain video device handle result = dsGetVideoDevice(index, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); + UT_ASSERT_EQUAL(result, dsERR_NONE); + UT_ASSERT_EQUAL((handle >= 0), true); // Step 04: Call dsGetDFC() with an invalid handle result = dsGetDFC(-1, &dfc_mode); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 05: Call dsGetDFC() with an invalid pointer result = dsGetDFC(handle, NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 06: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -675,20 +675,20 @@ void test_l1_dsVideoDevice_positive_dsGetHDRCapabilities(void) // Step 02: Obtain video device handle result = dsGetVideoDevice(index, &handle); UT_LOG("\nHandle: %d\n", handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); + UT_ASSERT_EQUAL(result, dsERR_NONE); + UT_ASSERT_EQUAL((handle >= 0), true); // Step 03: Get HDR capabilities using dsGetHDRCapabilities() with the obtained handle result = dsGetHDRCapabilities(handle, &hdr_capabilities_1); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: Get HDR capabilities using dsGetHDRCapabilities() again result = dsGetHDRCapabilities(handle, &hdr_capabilities_2); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 05: Compare the results to make sure they match UT_LOG("\nhdr1: %d, hrd2: %d\n", hdr_capabilities_1, hdr_capabilities_2); - DS_ASSERT_AUTO_TERM_NUMERICAL(hdr_capabilities_1, hdr_capabilities_2); + UT_ASSERT_EQUAL(hdr_capabilities_1, hdr_capabilities_2); // Step 06: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -744,20 +744,20 @@ void test_l1_dsVideoDevice_negative_dsGetHDRCapabilities(void) // Step 03: Obtain video device handle result = dsGetVideoDevice(index, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); + UT_ASSERT_EQUAL(result, dsERR_NONE); + UT_ASSERT_EQUAL((handle >= 0), true); // Step 04: Call dsGetHDRCapabilities() with an invalid handle result = dsGetHDRCapabilities(-1, &hdr_capabilities); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 05: Call dsGetHDRCapabilities() with a null parameter result = dsGetHDRCapabilities(handle, NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 06: De-initialize the video devices result = dsVideoDeviceTerm(); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetHDRCapabilities() after termination result = dsGetHDRCapabilities(handle, &hdr_capabilities); @@ -807,19 +807,19 @@ void test_l1_dsVideoDevice_positive_dsGetSupportedVideoCodingFormats(void) // Step 02: Obtain video device handle result = dsGetVideoDevice(index, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); + UT_ASSERT_EQUAL(result, dsERR_NONE); + UT_ASSERT_EQUAL((handle >= 0), true); // Step 03: Get supported video formats using dsGetSupportedVideoCodingFormats() with the obtained handle result = dsGetSupportedVideoCodingFormats(handle, &supported_formats_1); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: Get supported video formats using dsGetSupportedVideoCodingFormats() with the obtained handle result = dsGetSupportedVideoCodingFormats(handle, &supported_formats_2); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 05: Compare the results to make sure they match - DS_ASSERT_AUTO_TERM_NUMERICAL(supported_formats_1, supported_formats_2); + UT_ASSERT_EQUAL(supported_formats_1, supported_formats_2); // Step 06: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -875,16 +875,16 @@ void test_l1_dsVideoDevice_negative_dsGetSupportedVideoCodingFormats(void) // Step 03: Obtain video device handle result = dsGetVideoDevice(index, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); + UT_ASSERT_EQUAL(result, dsERR_NONE); + UT_ASSERT_EQUAL((handle >= 0), true); // Step 04: Call dsGetSupportedVideoCodingFormats() with an invalid handle result = dsGetSupportedVideoCodingFormats(-1, &supported_formats); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 05: Call dsGetSupportedVideoCodingFormats() with a null value result = dsGetSupportedVideoCodingFormats(handle, NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 06: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -938,39 +938,39 @@ void test_l1_dsVideoDevice_positive_dsGetVideoCodecInfo(void) // Step 02: Obtain video device handle result = dsGetVideoDevice(index, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); + UT_ASSERT_EQUAL(result, dsERR_NONE); + UT_ASSERT_EQUAL((handle >= 0), true); // Step 03: Get video codec information with dsVIDEO_CODEC_MPEGHPART2 result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEGHPART2, &codecInfo); #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_OPERATION_NOT_SUPPORTED); + UT_ASSERT_EQUAL(result, dsERR_OPERATION_NOT_SUPPORTED); #endif // Step 04: Get video codec information with dsVIDEO_CODEC_MPEG4PART10 result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEG4PART10, &codecInfo); #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_OPERATION_NOT_SUPPORTED); + UT_ASSERT_EQUAL(result, dsERR_OPERATION_NOT_SUPPORTED); #endif // Step 05: Get video codec information with dsVIDEO_CODEC_MPEG2 result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEG2, &codecInfo); #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_OPERATION_NOT_SUPPORTED); + UT_ASSERT_EQUAL(result, dsERR_OPERATION_NOT_SUPPORTED); #endif // Step 06: Get video codec information with dsVIDEO_CODEC_MPEG2 (again to replicate the provided test case) result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEG2, &codecInfo); #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); #else - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_OPERATION_NOT_SUPPORTED); + UT_ASSERT_EQUAL(result, dsERR_OPERATION_NOT_SUPPORTED); #endif // Step 07: De-initialize the video devices @@ -1029,20 +1029,20 @@ void test_l1_dsVideoDevice_negative_dsGetVideoCodecInfo(void) // Step 03: Obtain video device handle result = dsGetVideoDevice(index, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); + UT_ASSERT_EQUAL(result, dsERR_NONE); + UT_ASSERT_EQUAL((handle >= 0), true); // Step 04: Call dsGetVideoCodecInfo() with an invalid handle result = dsGetVideoCodecInfo(-1, dsVIDEO_CODEC_MPEGHPART2, &codecInfo); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 05: Call dsGetVideoCodecInfo() with an invalid coding format result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MAX, &codecInfo); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 06: Call dsGetVideoCodecInfo() with a null parameter result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEGHPART2, NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 07: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -1094,16 +1094,16 @@ void test_l1_dsVideoDevice_positive_dsForceDisableHDRSupport(void) // Step 02: Obtain video device handle result = dsGetVideoDevice(index, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); + UT_ASSERT_EQUAL(result, dsERR_NONE); + UT_ASSERT_EQUAL((handle >= 0), true); // Step 03: Force disable HDR support (set to true) result = dsForceDisableHDRSupport(handle, true); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: Force disable HDR support (set to false) result = dsForceDisableHDRSupport(handle, false); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 05: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -1158,12 +1158,12 @@ void test_l1_dsVideoDevice_negative_dsForceDisableHDRSupport(void) // Step 03: Obtain video device handle result = dsGetVideoDevice(index, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); + UT_ASSERT_EQUAL(result, dsERR_NONE); + UT_ASSERT_EQUAL((handle >= 0), true); // Step 04: Call dsForceDisableHDRSupport() with an invalid handle result = dsForceDisableHDRSupport(-1, true); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 05: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -1215,12 +1215,12 @@ void test_l1_dsVideoDevice_positive_dsSetFRFMode(void) // Step 02: Obtain video device handle result = dsGetVideoDevice(index, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); + UT_ASSERT_EQUAL(result, dsERR_NONE); + UT_ASSERT_EQUAL((handle >= 0), true); // Step 03: Set the FRF mode using a valid framerate result = dsSetFRFMode(handle, validFramerate); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -1276,16 +1276,16 @@ void test_l1_dsVideoDevice_negative_dsSetFRFMode(void) // Step 03: Obtain video device handle result = dsGetVideoDevice(index, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); - DS_ASSERT_AUTO_TERM_NUMERICAL((handle >= 0), true); + UT_ASSERT_EQUAL(result, dsERR_NONE); + UT_ASSERT_EQUAL((handle >= 0), true); // Step 04: Call dsSetFRFMode() with an invalid handle result = dsSetFRFMode(-1, 60); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 05: Call dsSetFRFMode() with an invalid framerate result = dsSetFRFMode(handle, -1); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 06: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -1340,19 +1340,19 @@ void test_l1_dsVideoDevice_positive_dsGetFRFMode(void) // Step 02: Obtain video device handle result = dsGetVideoDevice(index, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); UT_ASSERT_TRUE(handle >= 0); // Step 03: Get the FRF mode using the obtained handle result = dsGetFRFMode(handle, &fetchedFRFMode1); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: Get the FRF mode using the obtained handle again result = dsGetFRFMode(handle, &fetchedFRFMode2); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 05: Compare the returned values - DS_ASSERT_AUTO_TERM_NUMERICAL(fetchedFRFMode1, fetchedFRFMode2); + UT_ASSERT_EQUAL(fetchedFRFMode1, fetchedFRFMode2); // Step 06: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -1409,16 +1409,16 @@ void test_l1_dsVideoDevice_negative_dsGetFRFMode(void) // Step 03: Obtain video device handle result = dsGetVideoDevice(index, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); UT_ASSERT_TRUE(handle >= 0); // Step 04: Call dsGetFRFMode() with an invalid handle result = dsGetFRFMode(-1, &fetchedFRFMode); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 05: Call dsGetFRFMode() with null value result = dsGetFRFMode(handle, NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 06: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -1473,19 +1473,19 @@ void test_l1_dsVideoDevice_positive_dsGetCurrentDisplayframerate(void) // Step 02: Obtain video device handle result = dsGetVideoDevice(index, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); UT_ASSERT_TRUE(handle >= 0); // Step 03: Get the current display framerate using the obtained handle result = dsGetCurrentDisplayframerate(handle, fetchedFramerate1); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: Get the current display framerate again result = dsGetCurrentDisplayframerate(handle, fetchedFramerate2); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 05: Compare the returned values - DS_ASSERT_AUTO_TERM_NUMERICAL(strcmp(fetchedFramerate1, fetchedFramerate2), 0); // They should be the same + UT_ASSERT_EQUAL(strcmp(fetchedFramerate1, fetchedFramerate2), 0); // They should be the same // Step 06: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -1542,16 +1542,16 @@ void test_l1_dsVideoDevice_negative_dsGetCurrentDisplayframerate(void) // Step 03: Obtain video device handle result = dsGetVideoDevice(index, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); UT_ASSERT_TRUE(handle >= 0); // Step 04: Call dsGetCurrentDisplayframerate() with an invalid handle result = dsGetCurrentDisplayframerate(-1, fetchedFramerate); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 05: Call dsGetCurrentDisplayframerate() with NULL value result = dsGetCurrentDisplayframerate(handle, NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 06: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -1603,12 +1603,12 @@ void test_l1_dsVideoDevice_positive_dsSetDisplayframerate(void) // Step 02: Obtain video device handle result = dsGetVideoDevice(index, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); UT_ASSERT_TRUE(handle >= 0); // Step 03: Set the display framerate using the obtained handle result = dsSetDisplayframerate(handle, desiredFramerate); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -1665,20 +1665,20 @@ void test_l1_dsVideoDevice_negative_dsSetDisplayframerate(void) // Step 03: Obtain video device handle result = dsGetVideoDevice(index, &handle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); UT_ASSERT_TRUE(handle >= 0); // Step 04: Call dsSetDisplayframerate() with an invalid handle result = dsSetDisplayframerate(-1, "30fps"); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 05: Call dsSetDisplayframerate() with NULL char* result = dsSetDisplayframerate(handle, NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 06: Call dsSetDisplayframerate() with invalid char* result = dsSetDisplayframerate(handle, "junk"); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 07: De-initialize the video devices result = dsVideoDeviceTerm(); From 7cc527d932c257d0c538049f18e215e3a97b93ba Mon Sep 17 00:00:00 2001 From: Sumip98 <167012926+Sumip98@users.noreply.github.com> Date: Mon, 13 May 2024 19:49:19 +0530 Subject: [PATCH 19/38] Adding Enhanced Error Code Flag Support Adding Enhanced Error --- src/test_l1_dsDisplay.c | 119 ++++++++++++++++++++++------------------ 1 file changed, 67 insertions(+), 52 deletions(-) diff --git a/src/test_l1_dsDisplay.c b/src/test_l1_dsDisplay.c index 68153536..53164c82 100644 --- a/src/test_l1_dsDisplay.c +++ b/src/test_l1_dsDisplay.c @@ -183,11 +183,14 @@ void test_l1_dsDisplay_negative_dsDisplayInit(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 02: Attempt to initialize the display module again - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsDisplayInit(); - UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_ALREADY_INITIALIZED); - #endif +#ifdef ENABLE_ENHANCED_ERROR_CODE + UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); + UT_ASSERT_EQUAL(result, dsERR_ALREADY_INITIALIZED); +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif + // Step 03: Terminate the display module @@ -281,11 +284,13 @@ void test_l1_dsDisplay_negative_dsDisplayTerm(void) { int result; // Step 01: Call dsDisplayTerm() without initializing the display sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - result = dsDisplayTerm(); - UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif + result = dsDisplayTerm(); +#ifdef ENABLE_ENHANCED_ERROR_CODE + UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); + UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // Step 02: Initialize the display sub-system result = dsDisplayInit(); @@ -298,11 +303,13 @@ void test_l1_dsDisplay_negative_dsDisplayTerm(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: Call dsDisplayTerm() again after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsDisplayTerm(); - UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#ifdef ENABLE_ENHANCED_ERROR_CODE + UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); + UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -408,11 +415,13 @@ void test_l1_dsDisplay_negative_dsGetDisplay(void) { intptr_t displayHandle; // Step 01: Call dsGetDisplay() without initializing the display sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDisplay(kSupportedPortTypes[0], 0, &displayHandle); - UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#ifdef ENABLE_ENHANCED_ERROR_CODE + UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); + UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // Step 02: Initialize the display sub-system result = dsDisplayInit(); @@ -427,12 +436,12 @@ void test_l1_dsDisplay_negative_dsGetDisplay(void) { // Step 04: Call dsGetDisplay() with invalid index result = dsGetDisplay(kSupportedPortTypes[0], -1, &displayHandle); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); // Step 05: Call dsGetDisplay() with NULL handle result = dsGetDisplay(kSupportedPortTypes[0], 0, NULL); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); // Step 06: Terminate the display sub-system result = dsDisplayTerm(); @@ -440,11 +449,13 @@ void test_l1_dsDisplay_negative_dsGetDisplay(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetDisplay() again after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDisplay(kSupportedPortTypes[0], 0, &displayHandle); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -503,7 +514,7 @@ void test_l1_dsDisplay_positive_dsGetEDID(void) { // Step 04: Call dsGetEDID() again with the same handle result = dsGetEDID(displayHandle, edid2); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); // Step 05: Compare the returned results DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->productCode , edid2->productCode); @@ -569,11 +580,13 @@ void test_l1_dsDisplay_negative_dsGetEDID(void) { dsDisplayEDID_t *edid = {0}; // Step 01: Call dsGetEDID() without initializing the display sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetEDID(displayHandle, edid); - UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#ifdef ENABLE_ENHANCED_ERROR_CODE + UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); + UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // Step 02: Initialize the display sub-system result = dsDisplayInit(); @@ -583,15 +596,15 @@ void test_l1_dsDisplay_negative_dsGetEDID(void) { // Step 03: Obtain a display device handle for (int i = 0; i < sizeof(kSupportedPortTypes) / sizeof(kSupportedPortTypes[0]); i++) { result = dsGetDisplay(kSupportedPortTypes[i], i, &displayHandle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); // Step 04: Call dsGetEDID() with an invalid handle result = dsGetEDID((intptr_t)NULL, edid); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); // Step 05: Call dsGetEDID() with a NULL dsDisplayEDID_t result = dsGetEDID(displayHandle, NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); } // Step 06: Terminate the display sub-system @@ -600,11 +613,13 @@ void test_l1_dsDisplay_negative_dsGetEDID(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetEDID() without initializing the display sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetEDID(displayHandle, edid); - UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif + #ifdef ENABLE_ENHANCED_ERROR_CODE + UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); + UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -742,7 +757,7 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { int length = 0; // Step 01: Call dsGetEDIDBytes() without initializing or obtaining a handle - #ifdef ENABLE_ENHANCED_ERROR_CODE +#ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetEDIDBytes(displayHandle, edid, &length); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); if(result != dsERR_NOT_INITIALIZED) @@ -751,7 +766,7 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { free(edid); return; } - #endif +#endif // Step 02: Initialize the display sub-system result = dsDisplayInit(); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); @@ -765,7 +780,7 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { // Step 03: Loop through all valid ports for (int i = 0; i < sizeof(kSupportedPortTypes) / sizeof(kSupportedPortTypes[0]); i++) { result = dsGetDisplay(kSupportedPortTypes[i], i, &displayHandle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); if(result != dsERR_NONE) { UT_FAIL("Failed to get displayHandle"); @@ -808,7 +823,7 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { } // Step 08: Call dsGetEDIDBytes() without initializing or obtaining a handle - #ifdef ENABLE_ENHANCED_ERROR_CODE +#ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetEDIDBytes(displayHandle, edid, &length); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); if(result != dsERR_NOT_INITIALIZED) @@ -819,7 +834,7 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { } free(edid); - #endif +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -927,11 +942,11 @@ void test_l1_dsDisplay_negative_dsGetDisplayAspectRatio(void) { dsVideoAspectRatio_t aspectRatio; // Step 01: Call dsGetDisplayAspectRatio() without initializing the display sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE +#ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDisplayAspectRatio(displayHandle, &aspectRatio); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // Step 02: Initialize the display sub-system result = dsDisplayInit(); @@ -941,15 +956,15 @@ void test_l1_dsDisplay_negative_dsGetDisplayAspectRatio(void) { // Step 03: Loop through all valid ports in kSupportedPortTypes for (int i = 0; i < sizeof(kSupportedPortTypes) / sizeof(kSupportedPortTypes[0]); i++) { result = dsGetDisplay(kSupportedPortTypes[i], i, &displayHandle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); // Step 04: Call dsGetDisplayAspectRatio() with an invalid handle result = dsGetDisplayAspectRatio((intptr_t)NULL, &aspectRatio); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); // Step 05: Call dsGetDisplayAspectRatio() with a NULL aspectRatio result = dsGetDisplayAspectRatio(displayHandle, NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); } // Step 06: Terminate the display sub-system @@ -958,11 +973,11 @@ void test_l1_dsDisplay_negative_dsGetDisplayAspectRatio(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetDisplayAspectRatio() without initializing the display sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE +#ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDisplayAspectRatio(displayHandle, &aspectRatio); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1063,11 +1078,11 @@ void test_l1_dsDisplay_negative_dsRegisterDisplayEventCallback(void) { const int portCount = sizeof(kSupportedPortTypes) / sizeof(kSupportedPortTypes[0]); // Step 01: Call dsRegisterDisplayEventCallback() without initializing the display sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE +#ifdef ENABLE_ENHANCED_ERROR_CODE result = dsRegisterDisplayEventCallback(displayHandle, testDisplayCallback); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // Step 02: Initialize the display sub-system result = dsDisplayInit(); @@ -1078,15 +1093,15 @@ void test_l1_dsDisplay_negative_dsRegisterDisplayEventCallback(void) { for (int i = 0; i < portCount; ++i) { // Obtain a display device handle result = dsGetDisplay(kSupportedPortTypes[i], i, &displayHandle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); // Call dsRegisterDisplayEventCallback() with a NULL handle result = dsRegisterDisplayEventCallback((intptr_t)NULL, testDisplayCallback); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); // Call dsRegisterDisplayEventCallback() with a NULL callback function result = dsRegisterDisplayEventCallback(displayHandle, NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); } // Step 05: Terminate the display sub-system @@ -1095,11 +1110,11 @@ void test_l1_dsDisplay_negative_dsRegisterDisplayEventCallback(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Call dsRegisterDisplayEventCallback() without reinitializing the display sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE +#ifdef ENABLE_ENHANCED_ERROR_CODE result = dsRegisterDisplayEventCallback(displayHandle, testDisplayCallback); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); From 08bf169be16873fc3cef9b8f540cafd2933da6d7 Mon Sep 17 00:00:00 2001 From: Sumip98 <167012926+Sumip98@users.noreply.github.com> Date: Mon, 13 May 2024 20:03:32 +0530 Subject: [PATCH 20/38] Adding Enhanced Error Code Flag Support Adding Enhanced Error Code --- src/test_l1_dsHost.c | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/test_l1_dsHost.c b/src/test_l1_dsHost.c index 850e1487..ceb63b1c 100644 --- a/src/test_l1_dsHost.c +++ b/src/test_l1_dsHost.c @@ -175,7 +175,7 @@ void test_l1_dsHost_negative_dsHostInit(void) { // Step 02: Call dsHostInit() Attempt to initialize dsHost again #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsHostInit(); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_ALREADY_INITIALIZED); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_ALREADY_INITIALIZED); UT_LOG("Step 02: Attempt to initialize dsHost again -> Expected: dsERR_ALREADY_INITIALIZED, Got: %d\n", result); #endif @@ -319,12 +319,12 @@ void test_l1_dsHost_positive_dsGetCPUTemperature(void) { // Step 02: dsGetCPUTemperature() Call with valid pointer to store temperature result = dsGetCPUTemperature(&temperatureValue); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); UT_LOG("Step 02: Fetch CPU Temperature (1st time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 03: dsGetCPUTemperature() Call with valid pointer to store temperature again result = dsGetCPUTemperature(&temperatureValue); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); UT_LOG("Step 03: Fetch CPU Temperature (2nd time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 04: dsHostTerm() Terminate dsHost @@ -364,11 +364,11 @@ void test_l1_dsHost_negative_dsGetCPUTemperature(void) { float temperatureValue; // Step 01: dsGetCPUTemperature() Call without prior initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE +#ifdef ENABLE_ENHANCED_ERROR_CODE dsError_t result = dsGetCPUTemperature(&temperatureValue); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); UT_LOG("Step 01: Fetch CPU Temperature without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); - #endif +#endif // Step 02: dsHostInit() Initialize dsHost result = dsHostInit(); @@ -376,11 +376,10 @@ void test_l1_dsHost_negative_dsGetCPUTemperature(void) { UT_LOG("Step 02: Initialize dsHost -> Expected: dsERR_NONE, Got: %d\n", result); // Step 03: dsGetCPUTemperature() Call with NULL pointer - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetCPUTemperature(NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); UT_LOG("Step 03: Fetch CPU Temperature with NULL pointer -> Expected: dsERR_INVALID_PARAM, Got: %d\n", result); - #endif + // Step 04: dsHostTerm() Terminate dsHost result = dsHostTerm(); @@ -388,11 +387,11 @@ void test_l1_dsHost_negative_dsGetCPUTemperature(void) { UT_LOG("Step 04: Terminate dsHost -> Expected: dsERR_NONE, Got: %d\n", result); // Step 05: dsGetCPUTemperature() Call after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE +#ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetCPUTemperature(&temperatureValue); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); UT_LOG("Step 05: Fetch CPU Temperature after termination -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); - #endif +#endif UT_LOG("\n Out %s\n",__FUNCTION__); } @@ -432,16 +431,16 @@ void test_l1_dsHost_positive_dsGetSocIDFromSDK(void) { // Step 02: dsGetSocIDFromSDK() Call with a valid pointer to store the SOC ID result = dsGetSocIDFromSDK(socID1); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); UT_LOG("Step 02: Fetch SOC ID (1st time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 03: dsGetSocIDFromSDK() Call with a valid pointer to store the SOC ID again result = dsGetSocIDFromSDK(socID2); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); UT_LOG("Step 03: Fetch SOC ID (2nd time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 04: Compare return values from step 2/3 to ensure they are the same - DS_ASSERT_AUTO_TERM_NUMERICAL(strcmp(socID1, socID2),0); + //DS_ASSERT_AUTO_TERM_NUMERICAL(strcmp(socID1, socID2),0); UT_LOG("Step 04: Compare SOC IDs from Step 2 and Step 3 -> Expected: Match, Result: Matched\n"); // Step 05: dsHostTerm() Terminate dsHost @@ -495,7 +494,7 @@ void test_l1_dsHost_negative_dsGetSocIDFromSDK(void) { // Step 03: dsGetSocIDFromSDK() Call with NULL pointer result = dsGetSocIDFromSDK(NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); UT_LOG("Step 03: Fetch SOC ID with NULL pointer -> Expected: dsERR_INVALID_PARAM, Got: %d\n", result); // Step 04: dsHostTerm() Terminate dsHost @@ -550,17 +549,17 @@ void test_l1_dsHost_positive_dsGetHostEDID(void) { // Step 02: dsGetHostEDID() Call with valid pointers for edid and length result = dsGetHostEDID(edid1, &length1); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); UT_LOG("Step 02: Fetch Host EDID (1st time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 03: dsGetHostEDID() Call with valid pointers for edid and length again result = dsGetHostEDID(edid2, &length2); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); UT_LOG("Step 03: Fetch Host EDID (2nd time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 04: Compare EDIDs from step 2/3 and verify they are the same - DS_ASSERT_AUTO_TERM_NUMERICAL(length1, length2); - DS_ASSERT_AUTO_TERM_NUMERICAL(memcmp(edid1, edid2, length1), 0); + // DS_ASSERT_AUTO_TERM_NUMERICAL(length1, length2); + // DS_ASSERT_AUTO_TERM_NUMERICAL(memcmp(edid1, edid2, length1), 0); UT_LOG("Step 04: Compare EDIDs from Step 2 and Step 3 -> Expected: Match, Result: Matched\n"); // Step 05: dsHostTerm() Terminate dsHost @@ -615,12 +614,12 @@ void test_l1_dsHost_negative_dsGetHostEDID(void) { // Step 03: dsGetHostEDID() Call with NULL pointers result = dsGetHostEDID(edid, NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); UT_LOG("Step 03: Fetch Host EDID with NULL pointers -> Expected: dsERR_INVALID_PARAM, Got: %d\n", result); // Step 04: dsGetHostEDID() Call with NULL pointers result = dsGetHostEDID(NULL, &length); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); UT_LOG("Step 03: Fetch Host EDID with NULL pointers -> Expected: dsERR_INVALID_PARAM, Got: %d\n", result); // Step 05: dsHostTerm() Terminate dsHost From 547c13821c3c92577206a2aa6b123414fc5759c5 Mon Sep 17 00:00:00 2001 From: Sumip98 <167012926+Sumip98@users.noreply.github.com> Date: Mon, 13 May 2024 20:12:35 +0530 Subject: [PATCH 21/38] Updated with enhanced error code Adding Enhanced Error Code Flag Support --- src/test_l1_dsDisplay.c | 50 ++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/test_l1_dsDisplay.c b/src/test_l1_dsDisplay.c index 53164c82..3f947a59 100644 --- a/src/test_l1_dsDisplay.c +++ b/src/test_l1_dsDisplay.c @@ -358,15 +358,15 @@ void test_l1_dsDisplay_positive_dsGetDisplay(void) { // Step 02: Call dsGetDisplay() for each valid port result = dsGetDisplay(vType, i, &displayHandle1); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); UT_LOG("Display handle for port type %d: %ld\n", vType, (long)displayHandle1); // Step 03: Call the last value again, and compare the results result = dsGetDisplay(vType, i, &displayHandle2); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, displayHandle1, displayHandle2); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); UT_LOG("\n In %s Comparison: [%d = %d]\n", __FUNCTION__, result); - DS_ASSERT_AUTO_TERM_NUMERICAL(displayHandle1, displayHandle2); + // DS_ASSERT_AUTO_TERM_NUMERICAL(displayHandle1, displayHandle2); UT_LOG("Repeated display handle for port type %d: %ld\n", vType, (long)displayHandle2); } @@ -431,7 +431,7 @@ void test_l1_dsDisplay_negative_dsGetDisplay(void) { // Step 03: Call dsGetDisplay() with invalid video type result = dsGetDisplay(dsVIDEOPORT_TYPE_MAX, (int)dsVIDEOPORT_TYPE_MAX, &displayHandle); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); // Step 04: Call dsGetDisplay() with invalid index result = dsGetDisplay(kSupportedPortTypes[0], -1, &displayHandle); @@ -506,29 +506,29 @@ void test_l1_dsDisplay_positive_dsGetEDID(void) { // Step 02: Get the display device handle if(kSupportedPortTypes[i] == dsVIDEOPORT_TYPE_INTERNAL || kSupportedPortTypes[i] == dsVIDEOPORT_TYPE_HDMI || kSupportedPortTypes[i] == dsVIDEOPORT_TYPE_HDMI_INPUT){ result = dsGetDisplay(kSupportedPortTypes[i], i, &displayHandle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); // Step 03: Call dsGetEDID() with the obtained handle result = dsGetEDID(displayHandle, edid1); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); // Step 04: Call dsGetEDID() again with the same handle result = dsGetEDID(displayHandle, edid2); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); // Step 05: Compare the returned results - DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->productCode , edid2->productCode); - DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->serialNumber , edid2->serialNumber); - DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->manufactureYear , edid2->manufactureYear); - DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->manufactureWeek , edid2->manufactureWeek); - DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->hdmiDeviceType , edid2->hdmiDeviceType); - DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->isRepeater , edid2->isRepeater); - DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->physicalAddressA , edid2->physicalAddressA); - DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->physicalAddressB , edid2->physicalAddressB); - DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->physicalAddressC , edid2->physicalAddressC); - DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->physicalAddressD , edid2->physicalAddressD); - DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->numOfSupportedResolution , edid2->numOfSupportedResolution); - DS_ASSERT_AUTO_TERM_STRING(edid2->monitorName, edid2->monitorName) + // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->productCode , edid2->productCode); + // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->serialNumber , edid2->serialNumber); + // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->manufactureYear , edid2->manufactureYear); + // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->manufactureWeek , edid2->manufactureWeek); + // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->hdmiDeviceType , edid2->hdmiDeviceType); + // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->isRepeater , edid2->isRepeater); + // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->physicalAddressA , edid2->physicalAddressA); + // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->physicalAddressB , edid2->physicalAddressB); + // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->physicalAddressC , edid2->physicalAddressC); + // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->physicalAddressD , edid2->physicalAddressD); + // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->numOfSupportedResolution , edid2->numOfSupportedResolution); + // DS_ASSERT_AUTO_TERM_STRING(edid2->monitorName, edid2->monitorName) } } @@ -882,18 +882,18 @@ void test_l1_dsDisplay_positive_dsGetDisplayAspectRatio(void) { // Step 02: Loop through all valid ports in kSupportedPortTypes for (int i = 0; i < sizeof(kSupportedPortTypes) / sizeof(kSupportedPortTypes[0]); i++) { result = dsGetDisplay(kSupportedPortTypes[i], i, &displayHandle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); // Step 03: Call dsGetDisplayAspectRatio() with the obtained handle result = dsGetDisplayAspectRatio(displayHandle, &aspectRatio1); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); // Step 04: Call dsGetDisplayAspectRatio() again with the same handle result = dsGetDisplayAspectRatio(displayHandle, &aspectRatio2); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); // Step 05: Compare the results - DS_ASSERT_AUTO_TERM_NUMERICAL(aspectRatio1, aspectRatio2); + // DS_ASSERT_AUTO_TERM_NUMERICAL(aspectRatio1, aspectRatio2); } // Step 06: Terminate the display sub-system @@ -1026,11 +1026,11 @@ void test_l1_dsDisplay_positive_dsRegisterDisplayEventCallback(void) { // Step 02: Loop through all valid ports in kSupportedPortTypes for (int i = 0; i < sizeof(kSupportedPortTypes) / sizeof(kSupportedPortTypes[0]); i++) { result = dsGetDisplay(kSupportedPortTypes[i], i, &displayHandle); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); // Step 03: Call dsRegisterDisplayEventCallback() with the obtained handle and a valid callback function result = dsRegisterDisplayEventCallback(displayHandle, testDisplayCallback); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); } // Step 04: Terminate the display sub-system From 8ff5e5a5b220d549b2b1c87225210e6251d9b3ed Mon Sep 17 00:00:00 2001 From: Sumip98 <167012926+Sumip98@users.noreply.github.com> Date: Tue, 14 May 2024 12:57:52 +0530 Subject: [PATCH 22/38] Adding Enhanced Error Code Flag Support --- src/test_l1_dsAudio.c | 937 +++++++++++++++++++++++++++--------------- 1 file changed, 613 insertions(+), 324 deletions(-) diff --git a/src/test_l1_dsAudio.c b/src/test_l1_dsAudio.c index 647836b7..3c16a5b2 100644 --- a/src/test_l1_dsAudio.c +++ b/src/test_l1_dsAudio.c @@ -160,10 +160,12 @@ void test_l1_dsAudio_negative_dsAudioPortInit (void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 02: Call dsAudioPortInit() Attempt to initialize dsAudio again - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsAudioPortInit(); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_ALREADY_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // Step 03: Call dsAudioPortTerm() Terminate dsAudio result = dsAudioPortTerm(); @@ -246,10 +248,12 @@ void test_l1_dsAudio_negative_dsAudioPortTerm (void) UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 01: dsAudioPortTerm() Attempt to terminate dsAudio without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE dsError_t result = dsAudioPortTerm(); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // Step 02: dsAudioPortInit() Initialize dsAudio result = dsAudioPortInit(); @@ -260,10 +264,12 @@ void test_l1_dsAudio_negative_dsAudioPortTerm (void) UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: dsAudioPortTerm() Attempt to terminate dsAudio again - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsAudioPortTerm(); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif UT_LOG("\n Out %s\n",__FUNCTION__); } @@ -358,10 +364,12 @@ void test_l1_dsAudio_negative_dsGetAudioPort(void) { intptr_t handle[NUM_OF_PORTS]={INT_ARRAY_INIT}; // Step 01: Attempt to get the Audio Port handle without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioPort(kPorts[0].id.type, kPorts[0].id.index, &handle[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -391,10 +399,12 @@ void test_l1_dsAudio_negative_dsGetAudioPort(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get the audio port handle after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioPort(kPorts[0].id.type, kPorts[0].id.index, &handle[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -502,10 +512,12 @@ void test_l1_dsAudio_negative_dsGetAudioEncoding(void) { dsAudioEncoding_t encoding[NUM_OF_PORTS]; // Step 01: Get audio encoding without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioEncoding(-1, &encoding[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -528,13 +540,15 @@ void test_l1_dsAudio_negative_dsGetAudioEncoding(void) { // Step 06: Terminate audio ports result = dsAudioPortTerm(); - UT_ASSERT_EQUAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result,dsERR_NONE ); // Step 07: Attempt to get the audio encoding type after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioEncoding(handle[0], &encoding[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result,dsERR_INVALID_PARAM ); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -645,10 +659,12 @@ void test_l1_dsAudio_negative_dsSetAudioEncoding(void) { intptr_t handle[NUM_OF_PORTS]={INT_ARRAY_INIT}; // Step 01: Attempt to set Audio Encoding without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioEncoding(-1 , kSupportedSPEAKEREncodings[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result,dsERR_INVALID_PARAM ); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -674,10 +690,12 @@ void test_l1_dsAudio_negative_dsSetAudioEncoding(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to set Audio Encoding after termination - #ifdef ENABLE_ENHANCED_TESTS result = dsSetAudioEncoding(handle[0], kSupportedSPEAKEREncodings[0]); // Replace with valid handle and encoding +#ifdef ENABLE_ENHANCED_TESTS UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -783,10 +801,12 @@ void test_l1_dsAudio_negative_dsGetAudioFormat(void) { dsAudioFormat_t audioFormat[NUM_OF_PORTS]; // Step 01: Attempt to get audio format without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioFormat(-1, &audioFormat[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -812,10 +832,12 @@ void test_l1_dsAudio_negative_dsGetAudioFormat(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get audio format after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioFormat(handle[0], &audioFormat[0]); // Replace with valid handle +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -915,10 +937,12 @@ void test_l1_dsAudio_negative_dsGetAudioCompression(void) { int compression[NUM_OF_PORTS]; // Step 01: Attempt to get audio compression without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioCompression(-1, &compression[0]); // Replace with valid handle +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -946,10 +970,12 @@ void test_l1_dsAudio_negative_dsGetAudioCompression(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get audio compression after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioCompression(handle[0], &compression[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1050,10 +1076,12 @@ void test_l1_dsAudio_negative_dsSetAudioCompression(void) { int max_compression = 10, out_of_range_pos = 20, out_of_range_neg = -10; // Step 01: Attempt to set audio compression with an invalid handle - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioCompression(-1, max_compression); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -1083,10 +1111,12 @@ void test_l1_dsAudio_negative_dsSetAudioCompression(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Attempt to set audio compression after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioCompression(handle[0], max_compression); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1179,10 +1209,12 @@ void test_l1_dsAudio_negative_dsGetDialogEnhancement(void) { int dialogEnhancementLevel[NUM_OF_PORTS]; // Step 01: Attempt to get dialog enhancement without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDialogEnhancement(-1, &dialogEnhancementLevel[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -1208,10 +1240,12 @@ void test_l1_dsAudio_negative_dsGetDialogEnhancement(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get dialog enhancement after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDialogEnhancement(handle[0], &dialogEnhancementLevel[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1313,10 +1347,12 @@ void test_l1_dsAudio_negative_dsSetDialogEnhancement(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Attempt to set dialog enhancement without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDialogEnhancement(-1, valid_de_level); // Assume INVALID_HANDLE is an invalid handle +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -1346,10 +1382,12 @@ void test_l1_dsAudio_negative_dsSetDialogEnhancement(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Attempt to set dialog enhancement after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDialogEnhancement(handle[0], valid_de_level); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1441,10 +1479,12 @@ void test_l1_dsAudio_negative_dsGetDolbyVolumeMode(void) { bool dolbyVolumeMode[NUM_OF_PORTS]; // Step 01: Attempt to get Dolby Volume mode without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDolbyVolumeMode(-1, &dolbyVolumeMode[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -1470,10 +1510,12 @@ void test_l1_dsAudio_negative_dsGetDolbyVolumeMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get Dolby Volume mode after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDolbyVolumeMode(handle[0], &dolbyVolumeMode[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1563,10 +1605,12 @@ void test_l1_dsAudio_negative_dsSetDolbyVolumeMode(void) { bool validMode = true; // Assuming 'true' as a valid mode // Step 01: Attempt to set the Dolby Volume Mode without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDolbyVolumeMode(-1, validMode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -1588,10 +1632,12 @@ void test_l1_dsAudio_negative_dsSetDolbyVolumeMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Attempt to set Dolby Volume Mode after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDolbyVolumeMode(handle[0], validMode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1682,10 +1728,12 @@ void test_l1_dsAudio_negative_dsGetIntelligentEqualizerMode(void) { int intelligentEqualizerMode[NUM_OF_PORTS]; // Step 01: Attempt to get Intelligent Equalizer Mode without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetIntelligentEqualizerMode(-1, &intelligentEqualizerMode[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -1711,10 +1759,12 @@ void test_l1_dsAudio_negative_dsGetIntelligentEqualizerMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get Intelligent Equalizer Mode after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetIntelligentEqualizerMode(handle[0], &intelligentEqualizerMode[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1805,10 +1855,12 @@ void test_l1_dsAudio_negative_dsSetIntelligentEqualizerMode(void) { int valid_mode = 0, invalid_mode = -1; // Step 01: Attempt to set Intelligent Equalizer Mode without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetIntelligentEqualizerMode(-1, valid_mode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -1834,10 +1886,12 @@ void test_l1_dsAudio_negative_dsSetIntelligentEqualizerMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to set Intelligent Equalizer Mode after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetIntelligentEqualizerMode(handle[0], valid_mode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1927,10 +1981,12 @@ void test_l1_dsAudio_negative_dsGetVolumeLeveller(void) { dsVolumeLeveller_t volLeveller[NUM_OF_PORTS]; // Step 01: Attempt to get Volume Leveller settings without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVolumeLeveller(-1, &volLeveller[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -1958,10 +2014,12 @@ void test_l1_dsAudio_negative_dsGetVolumeLeveller(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get Volume Leveller settings after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetVolumeLeveller(handle[0], &volLeveller[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2060,12 +2118,14 @@ void test_l1_dsAudio_negative_dsSetVolumeLeveller(void) { int valid_mode = 2, valid_level = 10, invalid_mode = -1, invalid_level = 20; // Step 01: Attempt to set Volume Leveller without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE volLeveller.mode = valid_mode; volLeveller.level = valid_level; result = dsSetVolumeLeveller(-1, volLeveller); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -2104,12 +2164,14 @@ void test_l1_dsAudio_negative_dsSetVolumeLeveller(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Attempt to set Volume Leveller after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE volLeveller.mode = valid_mode; volLeveller.level = valid_level; result = dsSetVolumeLeveller(handle[0],volLeveller); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2209,10 +2271,12 @@ void test_l1_dsAudio_negative_dsGetBassEnhancer(void) { int boost; // Step 01: Attempt to get Bass Enhancer without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetBassEnhancer(-1, &boost); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -2238,10 +2302,12 @@ void test_l1_dsAudio_negative_dsGetBassEnhancer(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get Bass Enhancer after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetBassEnhancer(handle[0], &boost); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2337,10 +2403,12 @@ void test_l1_dsAudio_negative_dsSetBassEnhancer(void) { int boost = 75, invalidBoost_pos = 101, invalidBoost_neg = -20; // Step 01: Attempt to set Bass Enhancer without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetBassEnhancer(-1, boost); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -2369,10 +2437,12 @@ void test_l1_dsAudio_negative_dsSetBassEnhancer(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to set Bass Enhancer after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetBassEnhancer(handle[0], boost); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2462,10 +2532,12 @@ void test_l1_dsAudio_negative_dsIsSurroundDecoderEnabled(void) { bool surroundDecoderEnabled; // Step 01: Attempt to check Surround Decoder status without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsSurroundDecoderEnabled(-1, &surroundDecoderEnabled); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -2491,10 +2563,12 @@ void test_l1_dsAudio_negative_dsIsSurroundDecoderEnabled(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to check Surround Decoder status after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsSurroundDecoderEnabled(handle[0], &surroundDecoderEnabled); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2584,10 +2658,12 @@ void test_l1_dsAudio_negative_dsEnableSurroundDecoder(void) { bool enabled = true; // Step 01: Attempt to enable Surround Decoder without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableSurroundDecoder(-1, enabled); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -2609,10 +2685,12 @@ void test_l1_dsAudio_negative_dsEnableSurroundDecoder(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Attempt to enable Surround Decoder after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableSurroundDecoder(handle[0], enabled); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2716,10 +2794,12 @@ void test_l1_dsAudio_negative_dsGetDRCMode(void) { int drcMode; // Step 01: Attempt to get DRC Mode without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDRCMode(-1, &drcMode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -2745,10 +2825,12 @@ void test_l1_dsAudio_negative_dsGetDRCMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get DRC Mode after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDRCMode(handle[0], &drcMode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2839,10 +2921,12 @@ void test_l1_dsAudio_negative_dsSetDRCMode(void) { int validMode = 1, invalidMode = 2; // Step 01: Attempt to set DRC Mode without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDRCMode(-1, validMode); // Assume INVALID_HANDLE is an invalid handle +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -2868,10 +2952,12 @@ void test_l1_dsAudio_negative_dsSetDRCMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Attempt to set DRC Mode after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetDRCMode(handle[0], validMode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2977,10 +3063,12 @@ void test_l1_dsAudio_negative_dsGetSurroundVirtualizer(void) { dsSurroundVirtualizer_t virtualizerLevel; // Step 01: Attempt to get Surround Virtualizer without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSurroundVirtualizer(-1, &virtualizerLevel); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -3006,10 +3094,12 @@ void test_l1_dsAudio_negative_dsGetSurroundVirtualizer(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get Surround Virtualizer after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSurroundVirtualizer(handle[0], &virtualizerLevel); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3117,12 +3207,14 @@ void test_l1_dsAudio_negative_dsSetSurroundVirtualizer(void) { int valid_mode = 2, valid_boost = 96, invalid_mode = -1, invalid_boost = 100; // Step 01: Attempt to set Surround Virtualizer without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE virtualizer.mode = valid_mode; virtualizer.boost = valid_boost; result = dsSetSurroundVirtualizer(-1, virtualizer); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -3157,12 +3249,14 @@ void test_l1_dsAudio_negative_dsSetSurroundVirtualizer(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Attempt to set Surround Virtualizer after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE virtualizer.mode = valid_mode; virtualizer.boost = valid_boost; result = dsSetSurroundVirtualizer(handle[0], virtualizer); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3267,10 +3361,12 @@ void test_l1_dsAudio_negative_dsGetMISteering(void) { bool miSteeringEnabled; // Step 01: Attempt to get MI Steering without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetMISteering(-1, &miSteeringEnabled); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -3296,10 +3392,12 @@ void test_l1_dsAudio_negative_dsGetMISteering(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get MI Steering after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetMISteering(handle[0], &miSteeringEnabled); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3387,10 +3485,12 @@ void test_l1_dsAudio_negative_dsSetMISteering(void) { bool enabled = true; // Step 01: Attempt to set MI Steering without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetMISteering(-1, enabled); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -3412,10 +3512,12 @@ void test_l1_dsAudio_negative_dsSetMISteering(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Attempt to set MI Steering after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetMISteering(handle[0], enabled); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3521,10 +3623,12 @@ void test_l1_dsAudio_negative_dsGetGraphicEqualizerMode(void) { int graphicEqMode; // Step 01: Attempt to get Graphic Equalizer Mode without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetGraphicEqualizerMode(-1, &graphicEqMode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -3550,10 +3654,12 @@ void test_l1_dsAudio_negative_dsGetGraphicEqualizerMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get Graphic Equalizer Mode after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetGraphicEqualizerMode(handle[0], &graphicEqMode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3645,10 +3751,12 @@ void test_l1_dsAudio_negative_dsSetGraphicEqualizerMode(void) { int valid_mode = 2, invalid_mode_neg = -1, invalid_mode_pos = 4; // Step 01: Attempt to set Graphic Equalizer Mode without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetGraphicEqualizerMode(-1, valid_mode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -3677,10 +3785,12 @@ void test_l1_dsAudio_negative_dsSetGraphicEqualizerMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to set Graphic Equalizer Mode after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetGraphicEqualizerMode(handle[0], valid_mode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3796,10 +3906,12 @@ void test_l1_dsAudio_negative_dsGetMS12AudioProfileList(void) { dsMS12AudioProfileList_t profileList; // Step 01: Attempt to get MS12 Audio Profile List without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetMS12AudioProfileList(-1, &profileList); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -3825,10 +3937,12 @@ void test_l1_dsAudio_negative_dsGetMS12AudioProfileList(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get MS12 Audio Profile List after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetMS12AudioProfileList(handle[0], &profileList); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3929,10 +4043,12 @@ void test_l1_dsAudio_negative_dsGetMS12AudioProfile(void) { char currentProfile[MAX_PROFILE_NAME_LEN]; // Step 01: Attempt to get MS12 Audio Profile without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetMS12AudioProfile(-1, currentProfile); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -3960,10 +4076,12 @@ void test_l1_dsAudio_negative_dsGetMS12AudioProfile(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get MS12 Audio Profile after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetMS12AudioProfile(handle[0], currentProfile); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4062,10 +4180,12 @@ void test_l1_dsAudio_negative_dsGetStereoMode(void) { dsAudioStereoMode_t stereoMode; // Step 01: Attempt to get stereo mode without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetStereoMode(-1, &stereoMode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -4091,10 +4211,12 @@ void test_l1_dsAudio_negative_dsGetStereoMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get stereo mode again after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetStereoMode(handle[0], &stereoMode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4184,10 +4306,12 @@ void test_l1_dsAudio_negative_dsSetStereoMode(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Attempt to set stereo mode without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetStereoMode(-1, dsAUDIO_STEREO_SURROUND); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -4211,11 +4335,12 @@ void test_l1_dsAudio_negative_dsSetStereoMode(void) { // Step 05: Terminate audio ports result = dsAudioPortTerm(); UT_ASSERT_EQUAL(result, dsERR_NONE); - - #ifdef ENABLE_ENHANCED_ERROR_CODE - result = dsSetStereoMode(handle[0], dsAUDIO_STEREO_SURROUND); + result = dsSetStereoMode(handle[0], dsAUDIO_STEREO_SURROUND); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4313,10 +4438,12 @@ void test_l1_dsAudio_negative_dsGetStereoAuto(void) { int autoMode; // Step 01: Attempt to get stereo auto without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetStereoAuto(-1, &autoMode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -4342,10 +4469,12 @@ void test_l1_dsAudio_negative_dsGetStereoAuto(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); //Step 07: Attempt to get Stereo Auto after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetStereoAuto(handle[0], &autoMode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4435,10 +4564,12 @@ void test_l1_dsAudio_negative_dsSetStereoAuto(void) { int autoMode = 1, invalidAutoMode = -1; // Step 01: Attempt to set stereo auto without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetStereoAuto(-1, autoMode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -4465,10 +4596,12 @@ void test_l1_dsAudio_negative_dsSetStereoAuto(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to set auto mode after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetStereoAuto(handle[0], autoMode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4568,10 +4701,12 @@ void test_l1_dsAudio_negative_dsGetAudioGain(void) { float gain; // Step 01: Attempt to get audio gain without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioGain(-1, &gain); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -4597,10 +4732,12 @@ void test_l1_dsAudio_negative_dsGetAudioGain(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get the Audio Gain after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioGain(handle[0], &gain); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4696,10 +4833,12 @@ void test_l1_dsAudio_negative_dsSetAudioGain(void) { float gainValue = 200, invalid_gain_neg = -3000, invalid_gain_pos = 500; // Step 01: Attempt to set audio gain without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioGain(-1, gainValue); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -4728,10 +4867,12 @@ void test_l1_dsAudio_negative_dsSetAudioGain(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt t set audio gain after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioGain(handle[0], gainValue); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4833,10 +4974,12 @@ void test_l1_dsAudio_negative_dsGetAudioDB(void) { float db; // Step 01: Attempt to call dsGetAudioDB without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioDB(-1, &db); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -4862,10 +5005,12 @@ void test_l1_dsAudio_negative_dsGetAudioDB(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to call dsGetAudioDB after audio ports have been terminated - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioDB(handle[0], &db); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4961,10 +5106,12 @@ void test_l1_dsAudio_negative_dsSetAudioDB(void) { float valid_db = 100, invalid_db_neg = -1500, invalid_db_pos = 200; // Step 01: Attempt to call dsSetAudioDB without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioDB(-1, valid_db); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -4993,10 +5140,12 @@ void test_l1_dsAudio_negative_dsSetAudioDB(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to call dsSetAudioDB after audio ports have been terminated - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioDB(handle[0], valid_db); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -5101,10 +5250,12 @@ void test_l1_dsAudio_negative_dsGetAudioLevel(void) { float audioLevel; // Step 01: Attempt to get audio level without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioLevel(-1, &audioLevel); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -5130,10 +5281,12 @@ void test_l1_dsAudio_negative_dsGetAudioLevel(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get audio level after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioLevel(handle[0], &audioLevel); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -5227,10 +5380,12 @@ void test_l1_dsAudio_negative_dsSetAudioLevel(void) { float audio_level = 50, invalid_audio_level_neg = -10, invalid_audio_level_pos = 120; // Step 01: Attempt to set audio level without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioLevel(-1, audio_level); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -5259,10 +5414,12 @@ void test_l1_dsAudio_negative_dsSetAudioLevel(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to set audio level after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioLevel(handle[0], audio_level); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -5364,10 +5521,12 @@ void test_l1_dsAudio_negative_dsGetAudioMaxDB(void) { float maxDb; // Step 01: Attempt to get max dB without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioMaxDB(-1, &maxDb); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -5393,10 +5552,12 @@ void test_l1_dsAudio_negative_dsGetAudioMaxDB(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get max dB after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioMaxDB(handle[0], &maxDb); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -5498,10 +5659,12 @@ void test_l1_dsAudio_negative_dsGetAudioMinDB(void) { float minDb; // Step 01: Attempt to get min dB without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioMinDB(-1, &minDb); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -5527,10 +5690,12 @@ void test_l1_dsAudio_negative_dsGetAudioMinDB(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get min dB after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioMinDB(handle[0], &minDb); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -5630,10 +5795,12 @@ void test_l1_dsAudio_negative_dsGetAudioOptimalLevel(void) { float optimalLevel; // Step 01: Attempt to get optimal dB without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioOptimalLevel(-1, &optimalLevel); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -5659,10 +5826,12 @@ void test_l1_dsAudio_negative_dsGetAudioOptimalLevel(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get optimal dB after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioOptimalLevel(handle[0], &optimalLevel); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -5764,10 +5933,12 @@ void test_l1_dsAudio_negative_dsGetAudioDelay(void) { uint32_t audioDelay; // Step 01: Attempt to get audio delay without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioDelay(-1, &audioDelay); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -5793,10 +5964,12 @@ void test_l1_dsAudio_negative_dsGetAudioDelay(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get audio delay after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioDelay(handle[0], &audioDelay); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -5892,10 +6065,12 @@ void test_l1_dsAudio_negative_dsSetAudioDelay(void) { uint32_t audio_delay = 100, invalid_audio_delay = 300; // Step 01: Attempt to set audio delay without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioDelay(-1, audio_delay); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -5920,10 +6095,12 @@ void test_l1_dsAudio_negative_dsSetAudioDelay(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 05: Attempt to set audio delay after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioDelay(handle[0], audio_delay); + #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif + #else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); + #endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6023,10 +6200,12 @@ void test_l1_dsAudio_negative_dsGetAudioDelayOffset(void) { uint32_t audioDelayOffsetMs; // Step 01: Attempt to retrieve audio delay offset without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioDelayOffset(-1, &audioDelayOffsetMs); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6052,10 +6231,12 @@ void test_l1_dsAudio_negative_dsGetAudioDelayOffset(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to retrieve audio delay offset after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioDelayOffset(handle[0], &audioDelayOffsetMs); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6144,10 +6325,12 @@ void test_l1_dsAudio_negative_dsSetAudioDelayOffset(void) { uint32_t audio_delay_offset = 200 , invalid_audio_delay_offset= 300; // Step 01: Attempt to set audio delay offset without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioDelayOffset(-1, audio_delay_offset); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6173,10 +6356,12 @@ void test_l1_dsAudio_negative_dsSetAudioDelayOffset(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to set audio delay offset after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioDelayOffset(handle[0], audio_delay_offset); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6269,10 +6454,12 @@ void test_l1_dsAudio_negative_dsSetAudioAtmosOutputMode(void) { bool valid_value = true; // Step 01: Attempt to set ATMOS Output mode without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioAtmosOutputMode(-1, valid_value); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_GENERAL); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6294,10 +6481,12 @@ void test_l1_dsAudio_negative_dsSetAudioAtmosOutputMode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Attempt to set ATMOS Output mode after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioAtmosOutputMode(handle[0], valid_value); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_GENERAL); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6397,10 +6586,12 @@ void test_l1_dsAudio_negative_dsGetSinkDeviceAtmosCapability(void) { dsATMOSCapability_t atmosCapability; // Step 01: Attempt to get ATMOS capability without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSinkDeviceAtmosCapability(-1, &atmosCapability); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6427,10 +6618,12 @@ void test_l1_dsAudio_negative_dsGetSinkDeviceAtmosCapability(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get ATMOS capability after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSinkDeviceAtmosCapability(handle[0], &atmosCapability); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6530,10 +6723,12 @@ void test_l1_dsAudio_negative_dsIsAudioLoopThru(void) { bool loopThru; // Step 01: Attempt to check Loop-Thru status without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioLoopThru(-1, &loopThru); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6555,10 +6750,12 @@ void test_l1_dsAudio_negative_dsIsAudioLoopThru(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to check Loop-Thru status after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioLoopThru(handle[0], &loopThru); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6657,10 +6854,12 @@ void test_l1_dsAudio_negative_dsIsAudioMute(void) { bool muted; // Step 01: Attempt to check Mute status without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioMute(-1, &muted); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6682,10 +6881,12 @@ void test_l1_dsAudio_negative_dsIsAudioMute(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to check Mute status after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioMute(handle[0], &muted); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6784,10 +6985,12 @@ void test_l1_dsAudio_negative_dsIsAudioPortEnabled(void) { bool isEnabled; // Step 01: Attempt to check Enabled status without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioPortEnabled(-1, &isEnabled); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6809,10 +7012,12 @@ void test_l1_dsAudio_negative_dsIsAudioPortEnabled(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to check Enabled status after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioPortEnabled(handle[0], &isEnabled); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6916,10 +7121,12 @@ void test_l1_dsAudio_negative_dsEnableAudioPort(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Attempt to enable/disable audio ports without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableAudioPort(-1, true); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6941,10 +7148,12 @@ void test_l1_dsAudio_negative_dsEnableAudioPort(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Attempt to enable/disable after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableAudioPort(handle[0], true); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -7040,10 +7249,10 @@ void test_l1_dsAudio_negative_dsEnableMS12Config(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Attempt to enable MS12 Configs without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableMS12Config(-1, dsMS12FEATURE_DAPV2 , true); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7069,10 +7278,10 @@ void test_l1_dsAudio_negative_dsEnableMS12Config(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to enable MS12 Configs after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableMS12Config(handle[0], dsMS12FEATURE_DAPV2, true); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -7160,10 +7369,12 @@ void test_l1_dsAudio_negative_dsEnableLEConfig(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Attempt to enable LE without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableLEConfig(-1, true); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7185,10 +7396,12 @@ void test_l1_dsAudio_negative_dsEnableLEConfig(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Attempt to enable LE after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableLEConfig(handle[0], false); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -7288,10 +7501,12 @@ void test_l1_dsAudio_negative_dsGetLEConfig(void) { bool enable; // Step 01: Attempt to get LE Config without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetLEConfig(-1, &enable); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7317,10 +7532,12 @@ void test_l1_dsAudio_negative_dsGetLEConfig(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to get LE Config after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetLEConfig(handle[0], &enable); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -7412,10 +7629,12 @@ void test_l1_dsAudio_negative_dsSetMS12AudioProfile(void) { char *validProfile = "YourValidMS12Profile"; // Replace with a valid profile from _dsMS12AudioProfileList_t // Step 01: Attempt to set MS12 Audio Profile without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetMS12AudioProfile(-1, validProfile); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7441,10 +7660,12 @@ void test_l1_dsAudio_negative_dsSetMS12AudioProfile(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to set MS12 Audio Profile after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetMS12AudioProfile(handle[0], validProfile); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -7548,10 +7769,10 @@ void test_l1_dsAudio_negative_dsSetAudioDucking(void) { unsigned char valid_level = 100; // Step 01: Attempt to set Audio Ducking without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioDucking(-1, valid_action, vaild_type, valid_level); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7586,10 +7807,10 @@ void test_l1_dsAudio_negative_dsSetAudioDucking(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 09: Attempt to set Audio Ducking after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioDucking(handle[0], valid_action, vaild_type, valid_level); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -7682,10 +7903,12 @@ void test_l1_dsAudio_negative_dsEnableLoopThru(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Attempt to enable loop-through without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableLoopThru(-1, true); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_OPERATION_NOT_SUPPORTED); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7707,10 +7930,12 @@ void test_l1_dsAudio_negative_dsEnableLoopThru(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Attempt to enable loop-through after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsEnableLoopThru(handle[0], true); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_OPERATION_NOT_SUPPORTED); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -7805,10 +8030,12 @@ void test_l1_dsAudio_negative_dsSetAudioMute(void) { bool valid_value = true; // Step 01: Attempt to set mute without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioMute(-1, valid_value); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7830,10 +8057,12 @@ void test_l1_dsAudio_negative_dsSetAudioMute(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Attempt to set mute after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAudioMute(handle[0], true); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -7923,10 +8152,12 @@ void test_l1_dsAudio_negative_dsIsAudioMSDecode(void) { bool hasMS11Decode; // Step 01: Attempt to check MS11 Decode without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioMSDecode(-1, &hasMS11Decode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7953,10 +8184,12 @@ void test_l1_dsAudio_negative_dsIsAudioMSDecode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to check MS11 Decode after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioMSDecode(handle[0], &hasMS11Decode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -8046,10 +8279,10 @@ void test_l1_dsAudio_negative_dsIsAudioMS12Decode(void) { bool hasMS12Decode; // Step 01: Attempt to check MS12 Decode without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioMS12Decode(-1, &hasMS12Decode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -8075,10 +8308,10 @@ void test_l1_dsAudio_negative_dsIsAudioMS12Decode(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to check MS12 Decode after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsIsAudioMS12Decode(handle[0], &hasMS12Decode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -8168,10 +8401,12 @@ void test_l1_dsAudio_negative_dsAudioOutIsConnected(void) { bool isConnected; // Step 01: Attempt to check connection status without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsAudioOutIsConnected(-1, &isConnected); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -8197,10 +8432,12 @@ void test_l1_dsAudio_negative_dsAudioOutIsConnected(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Attempt to check connection status after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsAudioOutIsConnected(handle[0], &isConnected); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -8280,10 +8517,12 @@ void test_l1_dsAudio_negative_dsAudioOutRegisterConnectCB(void) { int result; // Step 01: Attempt to register callback without initializing ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsAudioOutRegisterConnectCB(NULL); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -8376,10 +8615,12 @@ void test_l1_dsAudio_negative_dsAudioFormatUpdateRegisterCB(void) { int result; // Step 01: Attempt to register callback without initializing ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsAudioFormatUpdateRegisterCB(NULL); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -8487,10 +8728,12 @@ void test_l1_dsAudio_negative_dsGetAudioCapabilities(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioCapabilities(-1, &capabilities); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -8516,10 +8759,12 @@ void test_l1_dsAudio_negative_dsGetAudioCapabilities(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call again after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAudioCapabilities(handle[0], &capabilities); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -8619,10 +8864,10 @@ void test_l1_dsAudio_negative_dsGetMS12Capabilities(void) { int ms12Capabilities; // Step 01: Call without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetMS12Capabilities(-1, &ms12Capabilities); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -8648,10 +8893,10 @@ void test_l1_dsAudio_negative_dsGetMS12Capabilities(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call again after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetMS12Capabilities(handle[0], &ms12Capabilities); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -8738,10 +8983,12 @@ void test_l1_dsAudio_negative_dsResetDialogEnhancement(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsResetDialogEnhancement(-1); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -8764,10 +9011,12 @@ void test_l1_dsAudio_negative_dsResetDialogEnhancement(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 05: Call again after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsResetDialogEnhancement(handle[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -8855,10 +9104,10 @@ void test_l1_dsAudio_negative_dsResetBassEnhancer(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsResetBassEnhancer(-1); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -8880,10 +9129,10 @@ void test_l1_dsAudio_negative_dsResetBassEnhancer(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Call again after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsResetBassEnhancer(handle[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -8969,10 +9218,10 @@ void test_l1_dsAudio_negative_dsResetSurroundVirtualizer(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsResetSurroundVirtualizer(-1); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -8994,10 +9243,10 @@ void test_l1_dsAudio_negative_dsResetSurroundVirtualizer(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Call again after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsResetSurroundVirtualizer(handle[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -9084,10 +9333,10 @@ void test_l1_dsAudio_negative_dsResetVolumeLeveller(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsResetVolumeLeveller(-1); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -9109,10 +9358,10 @@ void test_l1_dsAudio_negative_dsResetVolumeLeveller(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Call again after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsResetVolumeLeveller(handle[0]); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -9203,10 +9452,12 @@ void test_l1_dsAudio_negative_dsSetAssociatedAudioMixing(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAssociatedAudioMixing(-1, true); // Example invalid handle +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_GENERAL); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -9214,7 +9465,11 @@ void test_l1_dsAudio_negative_dsSetAssociatedAudioMixing(void) { // Step 03: Call with invalid handle result = dsSetAssociatedAudioMixing(handle[0], true); // Example invalid handle +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); +#else + UT_ASSERT_EQUAL(result, dsERR_GENERAL); +#endif // Step 04: Loop through kPorts to get audio port handle for (int i = 0; i < NUM_OF_PORTS; i++) { @@ -9228,10 +9483,12 @@ void test_l1_dsAudio_negative_dsSetAssociatedAudioMixing(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Call again after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetAssociatedAudioMixing(handle[0], true); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_GENERAL); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -9331,10 +9588,12 @@ void test_l1_dsAudio_negative_dsGetAssociatedAudioMixing(void) { bool mixing; // Step 01: Call without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAssociatedAudioMixing(-1, &mixing); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -9360,10 +9619,12 @@ void test_l1_dsAudio_negative_dsGetAssociatedAudioMixing(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call again after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetAssociatedAudioMixing(handle[0], &mixing); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -9458,11 +9719,13 @@ void test_l1_dsAudio_negative_dsSetFaderControl(void) { int invalidMixerBalance = 100; // invalid mixer balance value // Step 01: Call without initializing - #ifdef ENABLE_ENHANCED_ERROR_CODE int mixerBalance = 0; //valid value result = dsSetFaderControl(-1, mixerBalance); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -9488,10 +9751,12 @@ void test_l1_dsAudio_negative_dsSetFaderControl(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call again after terminating - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetFaderControl(handle[0], mixerBalance); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -9591,10 +9856,12 @@ void test_l1_dsAudio_negative_dsGetFaderControl(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call dsGetFaderControl() without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetFaderControl(-1, &mixerBalance); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -9620,10 +9887,12 @@ void test_l1_dsAudio_negative_dsGetFaderControl(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetFaderControl() after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetFaderControl(handle[0], &mixerBalance); // using last valid handle obtained +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -9714,10 +9983,12 @@ void test_l1_dsAudio_negative_dsSetPrimaryLanguage(void) { const char *invalidLanguage = "XYZ"; // Assuming "XYZ" is an invalid language code // Step 01: Call without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetPrimaryLanguage(-1, "ENG"); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -9747,10 +10018,12 @@ void test_l1_dsAudio_negative_dsSetPrimaryLanguage(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetPrimaryLanguage(handle[0], "ENG"); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -9850,10 +10123,12 @@ void test_l1_dsAudio_negative_dsGetPrimaryLanguage(void) { char primaryLanguage[4]; // Step 01: Call without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetPrimaryLanguage(-1, primaryLanguage); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -9879,10 +10154,12 @@ void test_l1_dsAudio_negative_dsGetPrimaryLanguage(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetPrimaryLanguage(handle[0], primaryLanguage); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -9971,10 +10248,12 @@ void test_l1_dsAudio_negative_dsSetSecondaryLanguage(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetSecondaryLanguage(-1, "ENG"); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -10004,10 +10283,12 @@ void test_l1_dsAudio_negative_dsSetSecondaryLanguage(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Call after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsSetSecondaryLanguage(handle[0], "ENG"); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -10107,10 +10388,12 @@ void test_l1_dsAudio_negative_dsGetSecondaryLanguage(void) { char languageCode[4]; // Step 01: Call without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSecondaryLanguage(-1, languageCode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -10136,10 +10419,12 @@ void test_l1_dsAudio_negative_dsGetSecondaryLanguage(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetSecondaryLanguage(handle[0], languageCode); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -10216,10 +10501,10 @@ void test_l1_dsAudio_negative_dsGetHDMIARCPortId(void) { int result; // Step 01: Call without initializing audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetHDMIARCPortId(NULL); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -10234,10 +10519,10 @@ void test_l1_dsAudio_negative_dsGetHDMIARCPortId(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 05: Call after terminating audio ports - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetHDMIARCPortId(NULL); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -10337,10 +10622,12 @@ void test_l1_dsAudio_negative_dsSetAudioMixerLevels(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Call dsSetAudioMixerLevels() without prior initialization of Audio Port - #ifdef ENABLE_ENHANCED_ERROR_CODE - result = dsSetAudioMixerLevels((intptr_t)NULL, dsAUDIO_INPUT_PRIMARY, valid_vol_level); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif + result = dsSetAudioMixerLevels((intptr_t)NULL, dsAUDIO_INPUT_PRIMARY, valid_vol_level); +#ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // Step 02: Initialize Audio Port using dsAudioPortInit() result = dsAudioPortInit(); @@ -10373,10 +10660,12 @@ void test_l1_dsAudio_negative_dsSetAudioMixerLevels(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Call dsSetAudioMixerLevels() after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE - result = dsSetAudioMixerLevels(handle[0], dsAUDIO_INPUT_PRIMARY, valid_vol_level); + result = dsSetAudioMixerLevels(handle[0], dsAUDIO_INPUT_PRIMARY, valid_vol_level); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); +#endif // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); From 4216817c4b1e87129d289288ac8d548a2beecb69 Mon Sep 17 00:00:00 2001 From: thanushreevani <157587255+thanushreevani@users.noreply.github.com> Date: Tue, 14 May 2024 15:00:52 +0530 Subject: [PATCH 23/38] gh #43 fix warning --- src/test_l1_dsVideoPort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_l1_dsVideoPort.c b/src/test_l1_dsVideoPort.c index eb77da84..fab2fc5e 100644 --- a/src/test_l1_dsVideoPort.c +++ b/src/test_l1_dsVideoPort.c @@ -83,7 +83,7 @@ static int gTestID = 1; #define NUM_OF_PORTS (sizeof(kPorts) / sizeof(kPorts[0])) #define HANDLE_ARRAY_INIT 0 -#define UT_ASSERT_EQUAL(value, comparison){\ +#define DS_ASSERT_AUTO_TERM_NUMERICAL(value, comparison){\ if(value != comparison){\ UT_LOG("\n In %s Comparison: [%d = %d]\n", __FUNCTION__, value, comparison);\ dsVideoPortTerm();\ From 916ef8bd4153727a65537999bef046746695d0d4 Mon Sep 17 00:00:00 2001 From: Sumip98 <167012926+Sumip98@users.noreply.github.com> Date: Tue, 14 May 2024 17:39:27 +0530 Subject: [PATCH 24/38] Adding Enhanced Error Code Flag Support --- src/test_l1_dsHost.c | 112 ++++++++++++++++++++++++------------------- 1 file changed, 64 insertions(+), 48 deletions(-) diff --git a/src/test_l1_dsHost.c b/src/test_l1_dsHost.c index ceb63b1c..f006d227 100644 --- a/src/test_l1_dsHost.c +++ b/src/test_l1_dsHost.c @@ -82,7 +82,7 @@ static int gTestID = 1; #define DS_ASSERT_AUTO_TERM_NUMERICAL(value, comparison){\ if(value != comparison){\ UT_LOG("\n In %s Comparison: [%d = %d]\n", __FUNCTION__, value, comparison);\ - dsHostTerm();\ + //dsHostTerm();\ UT_FAIL();\ }\ }\ @@ -90,7 +90,7 @@ static int gTestID = 1; #define DS_ASSERT_AUTO_TERM_STRING(value, comparison){\ if(strcmp(value, comparison) != 0){\ UT_LOG("\n In %s Comparison: [%s = %s]\n", __FUNCTION__, value, comparison);\ - dsHostTerm();\ + //dsHostTerm();\ UT_FAIL();\ }\ }\ @@ -126,7 +126,7 @@ void test_l1_dsHost_positive_dsHostInit(void) { UT_LOG("Step 01: Initialize dsHost -> Expected: dsERR_NONE, Got: %d\n", result); // Step 02: Call dsHostTerm() Terminate dsHost - result = dsHostTerm(); + result = dsHostTerm(); UT_ASSERT_EQUAL(result, dsERR_NONE); UT_LOG("Step 02: Terminate dsHost -> Expected: dsERR_NONE, Got: %d\n", result); @@ -173,11 +173,13 @@ void test_l1_dsHost_negative_dsHostInit(void) { UT_LOG("Step 01: Initialize dsHost -> Expected: dsERR_NONE, Got: %d\n", result); // Step 02: Call dsHostInit() Attempt to initialize dsHost again - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsHostInit(); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_ALREADY_INITIALIZED); + #ifdef ENABLE_ENHANCED_ERROR_CODE + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_ALREADY_INITIALIZED); UT_LOG("Step 02: Attempt to initialize dsHost again -> Expected: dsERR_ALREADY_INITIALIZED, Got: %d\n", result); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // Step 03: Call dsHostTerm() Terminate dsHost result = dsHostTerm(); @@ -260,11 +262,13 @@ void test_l1_dsHost_negative_dsHostTerm(void) { UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 01: dsHostTerm() Attempt to terminate dsHost without initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE dsError_t result = dsHostTerm(); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - UT_LOG("Step 01: Attempt to terminate dsHost without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); - #endif +#ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + UT_LOG("Step 01: Attempt to terminate dsHost without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif // Step 02: dsHostInit() Initialize dsHost result = dsHostInit(); @@ -277,11 +281,13 @@ void test_l1_dsHost_negative_dsHostTerm(void) { UT_LOG("Step 03: Terminate dsHost after initialization -> Expected: dsERR_NONE, Got: %d\n", result); // Step 04: dsHostTerm() Attempt to terminate dsHost again - #ifdef ENABLE_ENHANCED_ERROR_CODE - result = dsHostTerm(); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - UT_LOG("Step 04: Attempt to terminate dsHost again -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); - #endif + result = dsHostTerm(); +#ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + UT_LOG("Step 04: Attempt to terminate dsHost again -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif UT_LOG("\n Out %s\n",__FUNCTION__); } @@ -319,12 +325,12 @@ void test_l1_dsHost_positive_dsGetCPUTemperature(void) { // Step 02: dsGetCPUTemperature() Call with valid pointer to store temperature result = dsGetCPUTemperature(&temperatureValue); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); UT_LOG("Step 02: Fetch CPU Temperature (1st time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 03: dsGetCPUTemperature() Call with valid pointer to store temperature again result = dsGetCPUTemperature(&temperatureValue); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); UT_LOG("Step 03: Fetch CPU Temperature (2nd time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 04: dsHostTerm() Terminate dsHost @@ -364,10 +370,12 @@ void test_l1_dsHost_negative_dsGetCPUTemperature(void) { float temperatureValue; // Step 01: dsGetCPUTemperature() Call without prior initialization -#ifdef ENABLE_ENHANCED_ERROR_CODE dsError_t result = dsGetCPUTemperature(&temperatureValue); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - UT_LOG("Step 01: Fetch CPU Temperature without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); +#ifdef ENABLE_ENHANCED_ERROR_CODE + UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + UT_LOG("Step 01: Fetch CPU Temperature without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // Step 02: dsHostInit() Initialize dsHost @@ -377,20 +385,22 @@ void test_l1_dsHost_negative_dsGetCPUTemperature(void) { // Step 03: dsGetCPUTemperature() Call with NULL pointer result = dsGetCPUTemperature(NULL); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); UT_LOG("Step 03: Fetch CPU Temperature with NULL pointer -> Expected: dsERR_INVALID_PARAM, Got: %d\n", result); // Step 04: dsHostTerm() Terminate dsHost - result = dsHostTerm(); + result = dsHostTerm(); UT_ASSERT_EQUAL(result, dsERR_NONE); UT_LOG("Step 04: Terminate dsHost -> Expected: dsERR_NONE, Got: %d\n", result); // Step 05: dsGetCPUTemperature() Call after termination + result = dsGetCPUTemperature(&temperatureValue); #ifdef ENABLE_ENHANCED_ERROR_CODE - result = dsGetCPUTemperature(&temperatureValue); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - UT_LOG("Step 05: Fetch CPU Temperature after termination -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); + UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + UT_LOG("Step 05: Fetch CPU Temperature after termination -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif UT_LOG("\n Out %s\n",__FUNCTION__); } @@ -431,16 +441,16 @@ void test_l1_dsHost_positive_dsGetSocIDFromSDK(void) { // Step 02: dsGetSocIDFromSDK() Call with a valid pointer to store the SOC ID result = dsGetSocIDFromSDK(socID1); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); UT_LOG("Step 02: Fetch SOC ID (1st time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 03: dsGetSocIDFromSDK() Call with a valid pointer to store the SOC ID again result = dsGetSocIDFromSDK(socID2); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); UT_LOG("Step 03: Fetch SOC ID (2nd time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 04: Compare return values from step 2/3 to ensure they are the same - //DS_ASSERT_AUTO_TERM_NUMERICAL(strcmp(socID1, socID2),0); + DS_ASSERT_AUTO_TERM_NUMERICAL(strcmp(socID1, socID2),0); UT_LOG("Step 04: Compare SOC IDs from Step 2 and Step 3 -> Expected: Match, Result: Matched\n"); // Step 05: dsHostTerm() Terminate dsHost @@ -481,11 +491,12 @@ void test_l1_dsHost_negative_dsGetSocIDFromSDK(void) { char socID[1024] = {0}; // Step 01: dsGetSocIDFromSDK() Call without prior initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE - dsError_t result = dsGetSocIDFromSDK(socID); + dsError_t result = dsERROR_NONE; +#ifdef ENABLE_ENHANCED_ERROR_CODE + result = dsGetSocIDFromSDK(socID); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); UT_LOG("Step 01: Fetch SOC ID without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); - #endif +#endif // Step 02: dsHostInit() Initialize dsHost result = dsHostInit(); @@ -494,7 +505,7 @@ void test_l1_dsHost_negative_dsGetSocIDFromSDK(void) { // Step 03: dsGetSocIDFromSDK() Call with NULL pointer result = dsGetSocIDFromSDK(NULL); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); UT_LOG("Step 03: Fetch SOC ID with NULL pointer -> Expected: dsERR_INVALID_PARAM, Got: %d\n", result); // Step 04: dsHostTerm() Terminate dsHost @@ -503,11 +514,13 @@ void test_l1_dsHost_negative_dsGetSocIDFromSDK(void) { UT_LOG("Step 04: Terminate dsHost -> Expected: dsERR_NONE, Got: %d\n", result); // Step 05: dsGetSocIDFromSDK() Call after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE - result = dsGetSocIDFromSDK(socID); + result = dsGetSocIDFromSDK(socID); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); UT_LOG("Step 05: Fetch SOC ID after termination -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif UT_LOG("\n Out %s\n",__FUNCTION__); } @@ -549,17 +562,17 @@ void test_l1_dsHost_positive_dsGetHostEDID(void) { // Step 02: dsGetHostEDID() Call with valid pointers for edid and length result = dsGetHostEDID(edid1, &length1); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); UT_LOG("Step 02: Fetch Host EDID (1st time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 03: dsGetHostEDID() Call with valid pointers for edid and length again result = dsGetHostEDID(edid2, &length2); - // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); UT_LOG("Step 03: Fetch Host EDID (2nd time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 04: Compare EDIDs from step 2/3 and verify they are the same - // DS_ASSERT_AUTO_TERM_NUMERICAL(length1, length2); - // DS_ASSERT_AUTO_TERM_NUMERICAL(memcmp(edid1, edid2, length1), 0); + DS_ASSERT_AUTO_TERM_NUMERICAL(length1, length2); + DS_ASSERT_AUTO_TERM_NUMERICAL(memcmp(edid1, edid2, length1), 0); UT_LOG("Step 04: Compare EDIDs from Step 2 and Step 3 -> Expected: Match, Result: Matched\n"); // Step 05: dsHostTerm() Terminate dsHost @@ -601,11 +614,12 @@ void test_l1_dsHost_negative_dsGetHostEDID(void) { int length; // Step 01: dsGetHostEDID() Call without prior initialization - #ifdef ENABLE_ENHANCED_ERROR_CODE - dsError_t result = dsGetHostEDID(edid, &length); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - UT_LOG("Step 01: Fetch Host EDID without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); - #endif + dsError_t result = dsERROR_NONE; +#ifdef ENABLE_ENHANCED_ERROR_CODE + result = dsGetHostEDID(edid, &length); + UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + UT_LOG("Step 01: Fetch Host EDID without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); +#endif // Step 02: dsHostInit() Initialize dsHost result = dsHostInit(); @@ -614,12 +628,12 @@ void test_l1_dsHost_negative_dsGetHostEDID(void) { // Step 03: dsGetHostEDID() Call with NULL pointers result = dsGetHostEDID(edid, NULL); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); UT_LOG("Step 03: Fetch Host EDID with NULL pointers -> Expected: dsERR_INVALID_PARAM, Got: %d\n", result); // Step 04: dsGetHostEDID() Call with NULL pointers result = dsGetHostEDID(NULL, &length); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); UT_LOG("Step 03: Fetch Host EDID with NULL pointers -> Expected: dsERR_INVALID_PARAM, Got: %d\n", result); // Step 05: dsHostTerm() Terminate dsHost @@ -628,11 +642,13 @@ void test_l1_dsHost_negative_dsGetHostEDID(void) { UT_LOG("Step 04: Terminate dsHost -> Expected: dsERR_NONE, Got: %d\n", result); // Step 06: dsGetHostEDID() Call after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetHostEDID(edid, &length); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); UT_LOG("Step 05: Fetch Host EDID after termination -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); - #endif +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); +#endif UT_LOG("\n Out %s\n",__FUNCTION__); } From 7cee7e66d58fd0f8e2651cf9b1a586b3f92c0501 Mon Sep 17 00:00:00 2001 From: Sumip98 <167012926+Sumip98@users.noreply.github.com> Date: Tue, 14 May 2024 21:18:21 +0530 Subject: [PATCH 25/38] Adding Enhanced Error Code Flag Support --- src/test_l1_dsHost.c | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/test_l1_dsHost.c b/src/test_l1_dsHost.c index f006d227..c2ae537f 100644 --- a/src/test_l1_dsHost.c +++ b/src/test_l1_dsHost.c @@ -82,7 +82,7 @@ static int gTestID = 1; #define DS_ASSERT_AUTO_TERM_NUMERICAL(value, comparison){\ if(value != comparison){\ UT_LOG("\n In %s Comparison: [%d = %d]\n", __FUNCTION__, value, comparison);\ - //dsHostTerm();\ + dsHostTerm();\ UT_FAIL();\ }\ }\ @@ -90,7 +90,7 @@ static int gTestID = 1; #define DS_ASSERT_AUTO_TERM_STRING(value, comparison){\ if(strcmp(value, comparison) != 0){\ UT_LOG("\n In %s Comparison: [%s = %s]\n", __FUNCTION__, value, comparison);\ - //dsHostTerm();\ + dsHostTerm();\ UT_FAIL();\ }\ }\ @@ -175,7 +175,7 @@ void test_l1_dsHost_negative_dsHostInit(void) { // Step 02: Call dsHostInit() Attempt to initialize dsHost again result = dsHostInit(); #ifdef ENABLE_ENHANCED_ERROR_CODE - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_ALREADY_INITIALIZED); + UT_ASSERT_EQUAL(result, dsERR_ALREADY_INITIALIZED); UT_LOG("Step 02: Attempt to initialize dsHost again -> Expected: dsERR_ALREADY_INITIALIZED, Got: %d\n", result); #else UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -325,12 +325,12 @@ void test_l1_dsHost_positive_dsGetCPUTemperature(void) { // Step 02: dsGetCPUTemperature() Call with valid pointer to store temperature result = dsGetCPUTemperature(&temperatureValue); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); UT_LOG("Step 02: Fetch CPU Temperature (1st time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 03: dsGetCPUTemperature() Call with valid pointer to store temperature again result = dsGetCPUTemperature(&temperatureValue); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); UT_LOG("Step 03: Fetch CPU Temperature (2nd time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 04: dsHostTerm() Terminate dsHost @@ -385,7 +385,7 @@ void test_l1_dsHost_negative_dsGetCPUTemperature(void) { // Step 03: dsGetCPUTemperature() Call with NULL pointer result = dsGetCPUTemperature(NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); UT_LOG("Step 03: Fetch CPU Temperature with NULL pointer -> Expected: dsERR_INVALID_PARAM, Got: %d\n", result); @@ -441,16 +441,16 @@ void test_l1_dsHost_positive_dsGetSocIDFromSDK(void) { // Step 02: dsGetSocIDFromSDK() Call with a valid pointer to store the SOC ID result = dsGetSocIDFromSDK(socID1); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); UT_LOG("Step 02: Fetch SOC ID (1st time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 03: dsGetSocIDFromSDK() Call with a valid pointer to store the SOC ID again result = dsGetSocIDFromSDK(socID2); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); UT_LOG("Step 03: Fetch SOC ID (2nd time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 04: Compare return values from step 2/3 to ensure they are the same - DS_ASSERT_AUTO_TERM_NUMERICAL(strcmp(socID1, socID2),0); + UT_ASSERT_EQUAL(strcmp(socID1, socID2),0); UT_LOG("Step 04: Compare SOC IDs from Step 2 and Step 3 -> Expected: Match, Result: Matched\n"); // Step 05: dsHostTerm() Terminate dsHost @@ -491,11 +491,12 @@ void test_l1_dsHost_negative_dsGetSocIDFromSDK(void) { char socID[1024] = {0}; // Step 01: dsGetSocIDFromSDK() Call without prior initialization - dsError_t result = dsERROR_NONE; + dsError_t result = dsGetSocIDFromSDK(socID); #ifdef ENABLE_ENHANCED_ERROR_CODE - result = dsGetSocIDFromSDK(socID); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); UT_LOG("Step 01: Fetch SOC ID without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // Step 02: dsHostInit() Initialize dsHost @@ -505,7 +506,7 @@ void test_l1_dsHost_negative_dsGetSocIDFromSDK(void) { // Step 03: dsGetSocIDFromSDK() Call with NULL pointer result = dsGetSocIDFromSDK(NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); UT_LOG("Step 03: Fetch SOC ID with NULL pointer -> Expected: dsERR_INVALID_PARAM, Got: %d\n", result); // Step 04: dsHostTerm() Terminate dsHost @@ -562,17 +563,17 @@ void test_l1_dsHost_positive_dsGetHostEDID(void) { // Step 02: dsGetHostEDID() Call with valid pointers for edid and length result = dsGetHostEDID(edid1, &length1); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); UT_LOG("Step 02: Fetch Host EDID (1st time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 03: dsGetHostEDID() Call with valid pointers for edid and length again result = dsGetHostEDID(edid2, &length2); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); UT_LOG("Step 03: Fetch Host EDID (2nd time) -> Expected: dsERR_NONE, Got: %d\n", result); // Step 04: Compare EDIDs from step 2/3 and verify they are the same - DS_ASSERT_AUTO_TERM_NUMERICAL(length1, length2); - DS_ASSERT_AUTO_TERM_NUMERICAL(memcmp(edid1, edid2, length1), 0); + UT_ASSERT_EQUAL(length1, length2); + UT_ASSERT_EQUAL(memcmp(edid1, edid2, length1), 0); UT_LOG("Step 04: Compare EDIDs from Step 2 and Step 3 -> Expected: Match, Result: Matched\n"); // Step 05: dsHostTerm() Terminate dsHost @@ -614,11 +615,12 @@ void test_l1_dsHost_negative_dsGetHostEDID(void) { int length; // Step 01: dsGetHostEDID() Call without prior initialization - dsError_t result = dsERROR_NONE; -#ifdef ENABLE_ENHANCED_ERROR_CODE - result = dsGetHostEDID(edid, &length); + dsError_t result = dsGetHostEDID(edid, &length); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); UT_LOG("Step 01: Fetch Host EDID without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // Step 02: dsHostInit() Initialize dsHost @@ -628,12 +630,12 @@ void test_l1_dsHost_negative_dsGetHostEDID(void) { // Step 03: dsGetHostEDID() Call with NULL pointers result = dsGetHostEDID(edid, NULL); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); UT_LOG("Step 03: Fetch Host EDID with NULL pointers -> Expected: dsERR_INVALID_PARAM, Got: %d\n", result); // Step 04: dsGetHostEDID() Call with NULL pointers result = dsGetHostEDID(NULL, &length); - DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); UT_LOG("Step 03: Fetch Host EDID with NULL pointers -> Expected: dsERR_INVALID_PARAM, Got: %d\n", result); // Step 05: dsHostTerm() Terminate dsHost From e7d84f533cedb4e44ec15aa9be1b9e3cd0a86032 Mon Sep 17 00:00:00 2001 From: Sumip98 <167012926+Sumip98@users.noreply.github.com> Date: Wed, 15 May 2024 05:01:51 +0000 Subject: [PATCH 26/38] Updated with enhanced error code disabled checked in test_l1_dsDisplay.c --- src/test_l1_dsDisplay.c | 74 ++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/test_l1_dsDisplay.c b/src/test_l1_dsDisplay.c index 3f947a59..b931c820 100644 --- a/src/test_l1_dsDisplay.c +++ b/src/test_l1_dsDisplay.c @@ -358,15 +358,15 @@ void test_l1_dsDisplay_positive_dsGetDisplay(void) { // Step 02: Call dsGetDisplay() for each valid port result = dsGetDisplay(vType, i, &displayHandle1); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); UT_LOG("Display handle for port type %d: %ld\n", vType, (long)displayHandle1); // Step 03: Call the last value again, and compare the results result = dsGetDisplay(vType, i, &displayHandle2); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, displayHandle1, displayHandle2); - // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); UT_LOG("\n In %s Comparison: [%d = %d]\n", __FUNCTION__, result); - // DS_ASSERT_AUTO_TERM_NUMERICAL(displayHandle1, displayHandle2); + UT_ASSERT_EQUAL(displayHandle1, displayHandle2); UT_LOG("Repeated display handle for port type %d: %ld\n", vType, (long)displayHandle2); } @@ -431,17 +431,17 @@ void test_l1_dsDisplay_negative_dsGetDisplay(void) { // Step 03: Call dsGetDisplay() with invalid video type result = dsGetDisplay(dsVIDEOPORT_TYPE_MAX, (int)dsVIDEOPORT_TYPE_MAX, &displayHandle); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 04: Call dsGetDisplay() with invalid index result = dsGetDisplay(kSupportedPortTypes[0], -1, &displayHandle); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 05: Call dsGetDisplay() with NULL handle result = dsGetDisplay(kSupportedPortTypes[0], 0, NULL); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 06: Terminate the display sub-system result = dsDisplayTerm(); @@ -506,29 +506,29 @@ void test_l1_dsDisplay_positive_dsGetEDID(void) { // Step 02: Get the display device handle if(kSupportedPortTypes[i] == dsVIDEOPORT_TYPE_INTERNAL || kSupportedPortTypes[i] == dsVIDEOPORT_TYPE_HDMI || kSupportedPortTypes[i] == dsVIDEOPORT_TYPE_HDMI_INPUT){ result = dsGetDisplay(kSupportedPortTypes[i], i, &displayHandle); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 03: Call dsGetEDID() with the obtained handle result = dsGetEDID(displayHandle, edid1); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: Call dsGetEDID() again with the same handle result = dsGetEDID(displayHandle, edid2); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 05: Compare the returned results - // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->productCode , edid2->productCode); - // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->serialNumber , edid2->serialNumber); - // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->manufactureYear , edid2->manufactureYear); - // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->manufactureWeek , edid2->manufactureWeek); - // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->hdmiDeviceType , edid2->hdmiDeviceType); - // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->isRepeater , edid2->isRepeater); - // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->physicalAddressA , edid2->physicalAddressA); - // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->physicalAddressB , edid2->physicalAddressB); - // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->physicalAddressC , edid2->physicalAddressC); - // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->physicalAddressD , edid2->physicalAddressD); - // DS_ASSERT_AUTO_TERM_NUMERICAL(edid1->numOfSupportedResolution , edid2->numOfSupportedResolution); - // DS_ASSERT_AUTO_TERM_STRING(edid2->monitorName, edid2->monitorName) + UT_ASSERT_EQUAL(edid1->productCode , edid2->productCode); + UT_ASSERT_EQUAL(edid1->serialNumber , edid2->serialNumber); + UT_ASSERT_EQUAL(edid1->manufactureYear , edid2->manufactureYear); + UT_ASSERT_EQUAL(edid1->manufactureWeek , edid2->manufactureWeek); + UT_ASSERT_EQUAL(edid1->hdmiDeviceType , edid2->hdmiDeviceType); + UT_ASSERT_EQUAL(edid1->isRepeater , edid2->isRepeater); + UT_ASSERT_EQUAL(edid1->physicalAddressA , edid2->physicalAddressA); + UT_ASSERT_EQUAL(edid1->physicalAddressB , edid2->physicalAddressB); + UT_ASSERT_EQUAL(edid1->physicalAddressC , edid2->physicalAddressC); + UT_ASSERT_EQUAL(edid1->physicalAddressD , edid2->physicalAddressD); + UT_ASSERT_EQUAL(edid1->numOfSupportedResolution , edid2->numOfSupportedResolution); + UT_ASSERT_EQUAL(edid2->monitorName, edid2->monitorName); } } @@ -596,15 +596,15 @@ void test_l1_dsDisplay_negative_dsGetEDID(void) { // Step 03: Obtain a display device handle for (int i = 0; i < sizeof(kSupportedPortTypes) / sizeof(kSupportedPortTypes[0]); i++) { result = dsGetDisplay(kSupportedPortTypes[i], i, &displayHandle); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: Call dsGetEDID() with an invalid handle result = dsGetEDID((intptr_t)NULL, edid); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 05: Call dsGetEDID() with a NULL dsDisplayEDID_t result = dsGetEDID(displayHandle, NULL); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); } // Step 06: Terminate the display sub-system @@ -780,7 +780,7 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { // Step 03: Loop through all valid ports for (int i = 0; i < sizeof(kSupportedPortTypes) / sizeof(kSupportedPortTypes[0]); i++) { result = dsGetDisplay(kSupportedPortTypes[i], i, &displayHandle); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); if(result != dsERR_NONE) { UT_FAIL("Failed to get displayHandle"); @@ -882,18 +882,18 @@ void test_l1_dsDisplay_positive_dsGetDisplayAspectRatio(void) { // Step 02: Loop through all valid ports in kSupportedPortTypes for (int i = 0; i < sizeof(kSupportedPortTypes) / sizeof(kSupportedPortTypes[0]); i++) { result = dsGetDisplay(kSupportedPortTypes[i], i, &displayHandle); - // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 03: Call dsGetDisplayAspectRatio() with the obtained handle result = dsGetDisplayAspectRatio(displayHandle, &aspectRatio1); - // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: Call dsGetDisplayAspectRatio() again with the same handle result = dsGetDisplayAspectRatio(displayHandle, &aspectRatio2); - // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 05: Compare the results - // DS_ASSERT_AUTO_TERM_NUMERICAL(aspectRatio1, aspectRatio2); + UT_ASSERT_EQUAL(aspectRatio1, aspectRatio2); } // Step 06: Terminate the display sub-system @@ -956,15 +956,15 @@ void test_l1_dsDisplay_negative_dsGetDisplayAspectRatio(void) { // Step 03: Loop through all valid ports in kSupportedPortTypes for (int i = 0; i < sizeof(kSupportedPortTypes) / sizeof(kSupportedPortTypes[0]); i++) { result = dsGetDisplay(kSupportedPortTypes[i], i, &displayHandle); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 04: Call dsGetDisplayAspectRatio() with an invalid handle result = dsGetDisplayAspectRatio((intptr_t)NULL, &aspectRatio); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 05: Call dsGetDisplayAspectRatio() with a NULL aspectRatio result = dsGetDisplayAspectRatio(displayHandle, NULL); - // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); } // Step 06: Terminate the display sub-system @@ -1026,11 +1026,11 @@ void test_l1_dsDisplay_positive_dsRegisterDisplayEventCallback(void) { // Step 02: Loop through all valid ports in kSupportedPortTypes for (int i = 0; i < sizeof(kSupportedPortTypes) / sizeof(kSupportedPortTypes[0]); i++) { result = dsGetDisplay(kSupportedPortTypes[i], i, &displayHandle); - // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 03: Call dsRegisterDisplayEventCallback() with the obtained handle and a valid callback function result = dsRegisterDisplayEventCallback(displayHandle, testDisplayCallback); - // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); } // Step 04: Terminate the display sub-system @@ -1093,15 +1093,15 @@ void test_l1_dsDisplay_negative_dsRegisterDisplayEventCallback(void) { for (int i = 0; i < portCount; ++i) { // Obtain a display device handle result = dsGetDisplay(kSupportedPortTypes[i], i, &displayHandle); - // DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_NONE); + UT_ASSERT_EQUAL(result, dsERR_NONE); // Call dsRegisterDisplayEventCallback() with a NULL handle result = dsRegisterDisplayEventCallback((intptr_t)NULL, testDisplayCallback); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Call dsRegisterDisplayEventCallback() with a NULL callback function result = dsRegisterDisplayEventCallback(displayHandle, NULL); - //DS_ASSERT_AUTO_TERM_NUMERICAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); } // Step 05: Terminate the display sub-system From d032f209eb57ce01138fc6606c91ebea0d827b0d Mon Sep 17 00:00:00 2001 From: Sumip98 <167012926+Sumip98@users.noreply.github.com> Date: Wed, 15 May 2024 06:30:42 +0000 Subject: [PATCH 27/38] Enhanced Error code for device settings Updated with enhanced error code disabled checked in test_l1_dsDisplay.c --- src/test_l1_dsDisplay.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/test_l1_dsDisplay.c b/src/test_l1_dsDisplay.c index b931c820..341aa843 100644 --- a/src/test_l1_dsDisplay.c +++ b/src/test_l1_dsDisplay.c @@ -757,8 +757,8 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { int length = 0; // Step 01: Call dsGetEDIDBytes() without initializing or obtaining a handle + result = dsGetEDIDBytes(displayHandle, edid, &length); #ifdef ENABLE_ENHANCED_ERROR_CODE - result = dsGetEDIDBytes(displayHandle, edid, &length); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); if(result != dsERR_NOT_INITIALIZED) { @@ -766,6 +766,8 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { free(edid); return; } +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // Step 02: Initialize the display sub-system result = dsDisplayInit(); @@ -823,8 +825,8 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { } // Step 08: Call dsGetEDIDBytes() without initializing or obtaining a handle + result = dsGetEDIDBytes(displayHandle, edid, &length); #ifdef ENABLE_ENHANCED_ERROR_CODE - result = dsGetEDIDBytes(displayHandle, edid, &length); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); if(result != dsERR_NOT_INITIALIZED) { @@ -834,6 +836,8 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { } free(edid); +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // End of the test @@ -942,10 +946,13 @@ void test_l1_dsDisplay_negative_dsGetDisplayAspectRatio(void) { dsVideoAspectRatio_t aspectRatio; // Step 01: Call dsGetDisplayAspectRatio() without initializing the display sub-system -#ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDisplayAspectRatio(displayHandle, &aspectRatio); + +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // Step 02: Initialize the display sub-system @@ -973,10 +980,12 @@ void test_l1_dsDisplay_negative_dsGetDisplayAspectRatio(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 07: Call dsGetDisplayAspectRatio() without initializing the display sub-system -#ifdef ENABLE_ENHANCED_ERROR_CODE result = dsGetDisplayAspectRatio(displayHandle, &aspectRatio); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif // End of the test @@ -1078,10 +1087,13 @@ void test_l1_dsDisplay_negative_dsRegisterDisplayEventCallback(void) { const int portCount = sizeof(kSupportedPortTypes) / sizeof(kSupportedPortTypes[0]); // Step 01: Call dsRegisterDisplayEventCallback() without initializing the display sub-system -#ifdef ENABLE_ENHANCED_ERROR_CODE result = dsRegisterDisplayEventCallback(displayHandle, testDisplayCallback); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); + #endif // Step 02: Initialize the display sub-system @@ -1110,12 +1122,13 @@ void test_l1_dsDisplay_negative_dsRegisterDisplayEventCallback(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 06: Call dsRegisterDisplayEventCallback() without reinitializing the display sub-system -#ifdef ENABLE_ENHANCED_ERROR_CODE result = dsRegisterDisplayEventCallback(displayHandle, testDisplayCallback); +#ifdef ENABLE_ENHANCED_ERROR_CODE UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); +#else + UT_ASSERT_EQUAL(result, dsERR_NONE); #endif - // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } From 52242e000375f66206950208e5a1823ef093f273 Mon Sep 17 00:00:00 2001 From: akhilbhas <13413713+akhilbhas@users.noreply.github.com> Date: Wed, 22 May 2024 21:03:50 +0530 Subject: [PATCH 28/38] Enhanced Error code moved to kvp profiler * Moved macro to kvp check --- src/test_l1_dsAudio.c | 955 ++++++++---------------------------------- 1 file changed, 182 insertions(+), 773 deletions(-) diff --git a/src/test_l1_dsAudio.c b/src/test_l1_dsAudio.c index 3c16a5b2..824bd469 100644 --- a/src/test_l1_dsAudio.c +++ b/src/test_l1_dsAudio.c @@ -80,10 +80,25 @@ #define MAX_PROFILE_NAME_LEN 10 #define INT_ARRAY_INIT 0 +#define CHECK_FOR_EXTENDED_ERROR_CODE( result, enhanced, old )\ +{\ + if ( extendedEnumsSupported == true )\ + {\ + UT_ASSERT_EQUAL( enhanced, result );\ + }\ + else\ + {\ + UT_ASSERT_EQUAL( old, result );\ + }\ +} + static int gTestGroup = 1; static int gTestID = 1; intptr_t null_handle = 0; +/* Global flags to support features */ +static bool extendedEnumsSupported=false; //Default to not supported + /** * @brief Ensure dsAudioPortInit() returns correct status codes during positive scenarios * @@ -161,11 +176,7 @@ void test_l1_dsAudio_negative_dsAudioPortInit (void) // Step 02: Call dsAudioPortInit() Attempt to initialize dsAudio again result = dsAudioPortInit(); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_ALREADY_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_ALREADY_INITIALIZED, dsERR_NONE ); // Step 03: Call dsAudioPortTerm() Terminate dsAudio result = dsAudioPortTerm(); @@ -249,11 +260,7 @@ void test_l1_dsAudio_negative_dsAudioPortTerm (void) // Step 01: dsAudioPortTerm() Attempt to terminate dsAudio without initialization dsError_t result = dsAudioPortTerm(); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // Step 02: dsAudioPortInit() Initialize dsAudio result = dsAudioPortInit(); @@ -265,11 +272,7 @@ void test_l1_dsAudio_negative_dsAudioPortTerm (void) // Step 04: dsAudioPortTerm() Attempt to terminate dsAudio again result = dsAudioPortTerm(); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); UT_LOG("\n Out %s\n",__FUNCTION__); } @@ -365,11 +368,7 @@ void test_l1_dsAudio_negative_dsGetAudioPort(void) { // Step 01: Attempt to get the Audio Port handle without initializing result = dsGetAudioPort(kPorts[0].id.type, kPorts[0].id.index, &handle[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -400,11 +399,7 @@ void test_l1_dsAudio_negative_dsGetAudioPort(void) { // Step 07: Attempt to get the audio port handle after termination result = dsGetAudioPort(kPorts[0].id.type, kPorts[0].id.index, &handle[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -513,12 +508,8 @@ void test_l1_dsAudio_negative_dsGetAudioEncoding(void) { // Step 01: Get audio encoding without initializing result = dsGetAudioEncoding(-1, &encoding[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif - + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); + // Step 02: Initialize audio ports result = dsAudioPortInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -544,11 +535,7 @@ void test_l1_dsAudio_negative_dsGetAudioEncoding(void) { // Step 07: Attempt to get the audio encoding type after termination result = dsGetAudioEncoding(handle[0], &encoding[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result,dsERR_INVALID_PARAM ); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -660,11 +647,7 @@ void test_l1_dsAudio_negative_dsSetAudioEncoding(void) { // Step 01: Attempt to set Audio Encoding without initializing result = dsSetAudioEncoding(-1 , kSupportedSPEAKEREncodings[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result,dsERR_INVALID_PARAM ); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -691,11 +674,7 @@ void test_l1_dsAudio_negative_dsSetAudioEncoding(void) { // Step 07: Attempt to set Audio Encoding after termination result = dsSetAudioEncoding(handle[0], kSupportedSPEAKEREncodings[0]); // Replace with valid handle and encoding -#ifdef ENABLE_ENHANCED_TESTS - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -802,11 +781,7 @@ void test_l1_dsAudio_negative_dsGetAudioFormat(void) { // Step 01: Attempt to get audio format without initializing result = dsGetAudioFormat(-1, &audioFormat[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -833,11 +808,7 @@ void test_l1_dsAudio_negative_dsGetAudioFormat(void) { // Step 07: Attempt to get audio format after termination result = dsGetAudioFormat(handle[0], &audioFormat[0]); // Replace with valid handle -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -938,11 +909,7 @@ void test_l1_dsAudio_negative_dsGetAudioCompression(void) { // Step 01: Attempt to get audio compression without initializing result = dsGetAudioCompression(-1, &compression[0]); // Replace with valid handle -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -971,11 +938,7 @@ void test_l1_dsAudio_negative_dsGetAudioCompression(void) { // Step 07: Attempt to get audio compression after termination result = dsGetAudioCompression(handle[0], &compression[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1077,11 +1040,7 @@ void test_l1_dsAudio_negative_dsSetAudioCompression(void) { // Step 01: Attempt to set audio compression with an invalid handle result = dsSetAudioCompression(-1, max_compression); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -1112,11 +1071,7 @@ void test_l1_dsAudio_negative_dsSetAudioCompression(void) { // Step 08: Attempt to set audio compression after termination result = dsSetAudioCompression(handle[0], max_compression); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1210,11 +1165,7 @@ void test_l1_dsAudio_negative_dsGetDialogEnhancement(void) { // Step 01: Attempt to get dialog enhancement without initializing result = dsGetDialogEnhancement(-1, &dialogEnhancementLevel[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -1241,11 +1192,7 @@ void test_l1_dsAudio_negative_dsGetDialogEnhancement(void) { // Step 07: Attempt to get dialog enhancement after termination result = dsGetDialogEnhancement(handle[0], &dialogEnhancementLevel[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1348,11 +1295,7 @@ void test_l1_dsAudio_negative_dsSetDialogEnhancement(void) { // Step 01: Attempt to set dialog enhancement without initializing result = dsSetDialogEnhancement(-1, valid_de_level); // Assume INVALID_HANDLE is an invalid handle -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -1382,12 +1325,8 @@ void test_l1_dsAudio_negative_dsSetDialogEnhancement(void) { UT_ASSERT_EQUAL(result, dsERR_NONE); // Step 08: Attempt to set dialog enhancement after termination - result = dsSetDialogEnhancement(handle[0], valid_de_level); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + result = dsSetDialogEnhancement(handle[0], valid_de_level); + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1480,11 +1419,7 @@ void test_l1_dsAudio_negative_dsGetDolbyVolumeMode(void) { // Step 01: Attempt to get Dolby Volume mode without initializing result = dsGetDolbyVolumeMode(-1, &dolbyVolumeMode[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -1511,11 +1446,7 @@ void test_l1_dsAudio_negative_dsGetDolbyVolumeMode(void) { // Step 07: Attempt to get Dolby Volume mode after termination result = dsGetDolbyVolumeMode(handle[0], &dolbyVolumeMode[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1606,11 +1537,7 @@ void test_l1_dsAudio_negative_dsSetDolbyVolumeMode(void) { // Step 01: Attempt to set the Dolby Volume Mode without initializing result = dsSetDolbyVolumeMode(-1, validMode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -1633,11 +1560,7 @@ void test_l1_dsAudio_negative_dsSetDolbyVolumeMode(void) { // Step 06: Attempt to set Dolby Volume Mode after termination result = dsSetDolbyVolumeMode(handle[0], validMode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1729,11 +1652,7 @@ void test_l1_dsAudio_negative_dsGetIntelligentEqualizerMode(void) { // Step 01: Attempt to get Intelligent Equalizer Mode without initializing result = dsGetIntelligentEqualizerMode(-1, &intelligentEqualizerMode[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -1760,11 +1679,7 @@ void test_l1_dsAudio_negative_dsGetIntelligentEqualizerMode(void) { // Step 07: Attempt to get Intelligent Equalizer Mode after termination result = dsGetIntelligentEqualizerMode(handle[0], &intelligentEqualizerMode[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1856,11 +1771,7 @@ void test_l1_dsAudio_negative_dsSetIntelligentEqualizerMode(void) { // Step 01: Attempt to set Intelligent Equalizer Mode without initializing result = dsSetIntelligentEqualizerMode(-1, valid_mode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -1887,11 +1798,7 @@ void test_l1_dsAudio_negative_dsSetIntelligentEqualizerMode(void) { // Step 07: Attempt to set Intelligent Equalizer Mode after termination result = dsSetIntelligentEqualizerMode(handle[0], valid_mode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -1982,11 +1889,7 @@ void test_l1_dsAudio_negative_dsGetVolumeLeveller(void) { // Step 01: Attempt to get Volume Leveller settings without initializing result = dsGetVolumeLeveller(-1, &volLeveller[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -2015,11 +1918,7 @@ void test_l1_dsAudio_negative_dsGetVolumeLeveller(void) { // Step 07: Attempt to get Volume Leveller settings after termination result = dsGetVolumeLeveller(handle[0], &volLeveller[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2121,11 +2020,7 @@ void test_l1_dsAudio_negative_dsSetVolumeLeveller(void) { volLeveller.mode = valid_mode; volLeveller.level = valid_level; result = dsSetVolumeLeveller(-1, volLeveller); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -2167,11 +2062,7 @@ void test_l1_dsAudio_negative_dsSetVolumeLeveller(void) { volLeveller.mode = valid_mode; volLeveller.level = valid_level; result = dsSetVolumeLeveller(handle[0],volLeveller); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2272,11 +2163,7 @@ void test_l1_dsAudio_negative_dsGetBassEnhancer(void) { // Step 01: Attempt to get Bass Enhancer without initializing result = dsGetBassEnhancer(-1, &boost); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -2303,11 +2190,7 @@ void test_l1_dsAudio_negative_dsGetBassEnhancer(void) { // Step 07: Attempt to get Bass Enhancer after termination result = dsGetBassEnhancer(handle[0], &boost); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2403,12 +2286,8 @@ void test_l1_dsAudio_negative_dsSetBassEnhancer(void) { int boost = 75, invalidBoost_pos = 101, invalidBoost_neg = -20; // Step 01: Attempt to set Bass Enhancer without initializing - result = dsSetBassEnhancer(-1, boost); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + result = dsSetBassEnhancer(-1, boost); + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -2438,11 +2317,7 @@ void test_l1_dsAudio_negative_dsSetBassEnhancer(void) { // Step 07: Attempt to set Bass Enhancer after termination result = dsSetBassEnhancer(handle[0], boost); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2533,11 +2408,7 @@ void test_l1_dsAudio_negative_dsIsSurroundDecoderEnabled(void) { // Step 01: Attempt to check Surround Decoder status without initializing result = dsIsSurroundDecoderEnabled(-1, &surroundDecoderEnabled); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -2564,11 +2435,7 @@ void test_l1_dsAudio_negative_dsIsSurroundDecoderEnabled(void) { // Step 07: Attempt to check Surround Decoder status after termination result = dsIsSurroundDecoderEnabled(handle[0], &surroundDecoderEnabled); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2659,11 +2526,7 @@ void test_l1_dsAudio_negative_dsEnableSurroundDecoder(void) { // Step 01: Attempt to enable Surround Decoder without initializing result = dsEnableSurroundDecoder(-1, enabled); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -2686,11 +2549,7 @@ void test_l1_dsAudio_negative_dsEnableSurroundDecoder(void) { // Step 06: Attempt to enable Surround Decoder after termination result = dsEnableSurroundDecoder(handle[0], enabled); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2795,11 +2654,7 @@ void test_l1_dsAudio_negative_dsGetDRCMode(void) { // Step 01: Attempt to get DRC Mode without initializing result = dsGetDRCMode(-1, &drcMode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -2826,11 +2681,7 @@ void test_l1_dsAudio_negative_dsGetDRCMode(void) { // Step 07: Attempt to get DRC Mode after termination result = dsGetDRCMode(handle[0], &drcMode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -2922,11 +2773,7 @@ void test_l1_dsAudio_negative_dsSetDRCMode(void) { // Step 01: Attempt to set DRC Mode without initializing result = dsSetDRCMode(-1, validMode); // Assume INVALID_HANDLE is an invalid handle -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -2953,11 +2800,7 @@ void test_l1_dsAudio_negative_dsSetDRCMode(void) { // Step 08: Attempt to set DRC Mode after termination result = dsSetDRCMode(handle[0], validMode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3064,11 +2907,7 @@ void test_l1_dsAudio_negative_dsGetSurroundVirtualizer(void) { // Step 01: Attempt to get Surround Virtualizer without initializing result = dsGetSurroundVirtualizer(-1, &virtualizerLevel); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -3095,11 +2934,7 @@ void test_l1_dsAudio_negative_dsGetSurroundVirtualizer(void) { // Step 07: Attempt to get Surround Virtualizer after termination result = dsGetSurroundVirtualizer(handle[0], &virtualizerLevel); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3210,11 +3045,7 @@ void test_l1_dsAudio_negative_dsSetSurroundVirtualizer(void) { virtualizer.mode = valid_mode; virtualizer.boost = valid_boost; result = dsSetSurroundVirtualizer(-1, virtualizer); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -3252,11 +3083,7 @@ void test_l1_dsAudio_negative_dsSetSurroundVirtualizer(void) { virtualizer.mode = valid_mode; virtualizer.boost = valid_boost; result = dsSetSurroundVirtualizer(handle[0], virtualizer); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3362,11 +3189,7 @@ void test_l1_dsAudio_negative_dsGetMISteering(void) { // Step 01: Attempt to get MI Steering without initializing result = dsGetMISteering(-1, &miSteeringEnabled); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -3393,11 +3216,7 @@ void test_l1_dsAudio_negative_dsGetMISteering(void) { // Step 07: Attempt to get MI Steering after termination result = dsGetMISteering(handle[0], &miSteeringEnabled); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3486,11 +3305,7 @@ void test_l1_dsAudio_negative_dsSetMISteering(void) { // Step 01: Attempt to set MI Steering without initializing result = dsSetMISteering(-1, enabled); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -3513,11 +3328,7 @@ void test_l1_dsAudio_negative_dsSetMISteering(void) { // Step 06: Attempt to set MI Steering after termination result = dsSetMISteering(handle[0], enabled); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3624,11 +3435,7 @@ void test_l1_dsAudio_negative_dsGetGraphicEqualizerMode(void) { // Step 01: Attempt to get Graphic Equalizer Mode without initializing result = dsGetGraphicEqualizerMode(-1, &graphicEqMode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -3655,11 +3462,7 @@ void test_l1_dsAudio_negative_dsGetGraphicEqualizerMode(void) { // Step 07: Attempt to get Graphic Equalizer Mode after termination result = dsGetGraphicEqualizerMode(handle[0], &graphicEqMode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3752,11 +3555,7 @@ void test_l1_dsAudio_negative_dsSetGraphicEqualizerMode(void) { // Step 01: Attempt to set Graphic Equalizer Mode without initializing result = dsSetGraphicEqualizerMode(-1, valid_mode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -3786,11 +3585,7 @@ void test_l1_dsAudio_negative_dsSetGraphicEqualizerMode(void) { // Step 07: Attempt to set Graphic Equalizer Mode after termination result = dsSetGraphicEqualizerMode(handle[0], valid_mode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -3907,11 +3702,7 @@ void test_l1_dsAudio_negative_dsGetMS12AudioProfileList(void) { // Step 01: Attempt to get MS12 Audio Profile List without initializing result = dsGetMS12AudioProfileList(-1, &profileList); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -3938,11 +3729,7 @@ void test_l1_dsAudio_negative_dsGetMS12AudioProfileList(void) { // Step 07: Attempt to get MS12 Audio Profile List after termination result = dsGetMS12AudioProfileList(handle[0], &profileList); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4044,11 +3831,7 @@ void test_l1_dsAudio_negative_dsGetMS12AudioProfile(void) { // Step 01: Attempt to get MS12 Audio Profile without initializing result = dsGetMS12AudioProfile(-1, currentProfile); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -4077,11 +3860,7 @@ void test_l1_dsAudio_negative_dsGetMS12AudioProfile(void) { // Step 07: Attempt to get MS12 Audio Profile after termination result = dsGetMS12AudioProfile(handle[0], currentProfile); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4181,11 +3960,7 @@ void test_l1_dsAudio_negative_dsGetStereoMode(void) { // Step 01: Attempt to get stereo mode without initializing result = dsGetStereoMode(-1, &stereoMode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -4212,11 +3987,7 @@ void test_l1_dsAudio_negative_dsGetStereoMode(void) { // Step 07: Attempt to get stereo mode again after termination result = dsGetStereoMode(handle[0], &stereoMode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4306,12 +4077,8 @@ void test_l1_dsAudio_negative_dsSetStereoMode(void) { intptr_t handle[NUM_OF_PORTS] = {INT_ARRAY_INIT}; // Step 01: Attempt to set stereo mode without initializing - result = dsSetStereoMode(-1, dsAUDIO_STEREO_SURROUND); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + result = dsSetStereoMode(-1, dsAUDIO_STEREO_SURROUND); + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -4335,12 +4102,9 @@ void test_l1_dsAudio_negative_dsSetStereoMode(void) { // Step 05: Terminate audio ports result = dsAudioPortTerm(); UT_ASSERT_EQUAL(result, dsERR_NONE); - result = dsSetStereoMode(handle[0], dsAUDIO_STEREO_SURROUND); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + + result = dsSetStereoMode(handle[0], dsAUDIO_STEREO_SURROUND); + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4439,11 +4203,7 @@ void test_l1_dsAudio_negative_dsGetStereoAuto(void) { // Step 01: Attempt to get stereo auto without initializing result = dsGetStereoAuto(-1, &autoMode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -4470,11 +4230,7 @@ void test_l1_dsAudio_negative_dsGetStereoAuto(void) { //Step 07: Attempt to get Stereo Auto after termination result = dsGetStereoAuto(handle[0], &autoMode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4565,11 +4321,7 @@ void test_l1_dsAudio_negative_dsSetStereoAuto(void) { // Step 01: Attempt to set stereo auto without initializing result = dsSetStereoAuto(-1, autoMode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -4597,11 +4349,7 @@ void test_l1_dsAudio_negative_dsSetStereoAuto(void) { // Step 07: Attempt to set auto mode after terminating audio ports result = dsSetStereoAuto(handle[0], autoMode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4702,11 +4450,7 @@ void test_l1_dsAudio_negative_dsGetAudioGain(void) { // Step 01: Attempt to get audio gain without initializing result = dsGetAudioGain(-1, &gain); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -4733,11 +4477,7 @@ void test_l1_dsAudio_negative_dsGetAudioGain(void) { // Step 07: Attempt to get the Audio Gain after termination result = dsGetAudioGain(handle[0], &gain); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4834,11 +4574,7 @@ void test_l1_dsAudio_negative_dsSetAudioGain(void) { // Step 01: Attempt to set audio gain without initializing result = dsSetAudioGain(-1, gainValue); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -4868,11 +4604,7 @@ void test_l1_dsAudio_negative_dsSetAudioGain(void) { // Step 07: Attempt t set audio gain after termination result = dsSetAudioGain(handle[0], gainValue); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -4975,11 +4707,7 @@ void test_l1_dsAudio_negative_dsGetAudioDB(void) { // Step 01: Attempt to call dsGetAudioDB without initializing audio ports result = dsGetAudioDB(-1, &db); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -5006,11 +4734,7 @@ void test_l1_dsAudio_negative_dsGetAudioDB(void) { // Step 07: Attempt to call dsGetAudioDB after audio ports have been terminated result = dsGetAudioDB(handle[0], &db); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -5107,11 +4831,7 @@ void test_l1_dsAudio_negative_dsSetAudioDB(void) { // Step 01: Attempt to call dsSetAudioDB without initializing audio ports result = dsSetAudioDB(-1, valid_db); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -5141,11 +4861,7 @@ void test_l1_dsAudio_negative_dsSetAudioDB(void) { // Step 07: Attempt to call dsSetAudioDB after audio ports have been terminated result = dsSetAudioDB(handle[0], valid_db); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Logging at the end UT_LOG("\n Out %s\n", __FUNCTION__); @@ -5251,11 +4967,7 @@ void test_l1_dsAudio_negative_dsGetAudioLevel(void) { // Step 01: Attempt to get audio level without initializing audio ports result = dsGetAudioLevel(-1, &audioLevel); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -5282,11 +4994,7 @@ void test_l1_dsAudio_negative_dsGetAudioLevel(void) { // Step 07: Attempt to get audio level after terminating audio ports result = dsGetAudioLevel(handle[0], &audioLevel); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -5381,11 +5089,7 @@ void test_l1_dsAudio_negative_dsSetAudioLevel(void) { // Step 01: Attempt to set audio level without initializing audio ports result = dsSetAudioLevel(-1, audio_level); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -5415,11 +5119,7 @@ void test_l1_dsAudio_negative_dsSetAudioLevel(void) { // Step 07: Attempt to set audio level after terminating audio ports result = dsSetAudioLevel(handle[0], audio_level); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -5522,11 +5222,7 @@ void test_l1_dsAudio_negative_dsGetAudioMaxDB(void) { // Step 01: Attempt to get max dB without initializing audio ports result = dsGetAudioMaxDB(-1, &maxDb); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -5553,11 +5249,7 @@ void test_l1_dsAudio_negative_dsGetAudioMaxDB(void) { // Step 07: Attempt to get max dB after terminating audio ports result = dsGetAudioMaxDB(handle[0], &maxDb); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -5660,11 +5352,7 @@ void test_l1_dsAudio_negative_dsGetAudioMinDB(void) { // Step 01: Attempt to get min dB without initializing audio ports result = dsGetAudioMinDB(-1, &minDb); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -5691,11 +5379,7 @@ void test_l1_dsAudio_negative_dsGetAudioMinDB(void) { // Step 07: Attempt to get min dB after terminating audio ports result = dsGetAudioMinDB(handle[0], &minDb); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -5796,11 +5480,7 @@ void test_l1_dsAudio_negative_dsGetAudioOptimalLevel(void) { // Step 01: Attempt to get optimal dB without initializing audio ports result = dsGetAudioOptimalLevel(-1, &optimalLevel); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -5827,11 +5507,7 @@ void test_l1_dsAudio_negative_dsGetAudioOptimalLevel(void) { // Step 07: Attempt to get optimal dB after terminating audio ports result = dsGetAudioOptimalLevel(handle[0], &optimalLevel); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -5934,11 +5610,7 @@ void test_l1_dsAudio_negative_dsGetAudioDelay(void) { // Step 01: Attempt to get audio delay without initializing audio ports result = dsGetAudioDelay(-1, &audioDelay); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -5965,11 +5637,7 @@ void test_l1_dsAudio_negative_dsGetAudioDelay(void) { // Step 07: Attempt to get audio delay after terminating audio ports result = dsGetAudioDelay(handle[0], &audioDelay); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6066,11 +5734,7 @@ void test_l1_dsAudio_negative_dsSetAudioDelay(void) { // Step 01: Attempt to set audio delay without initializing audio ports result = dsSetAudioDelay(-1, audio_delay); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6096,11 +5760,7 @@ void test_l1_dsAudio_negative_dsSetAudioDelay(void) { // Step 05: Attempt to set audio delay after terminating audio ports result = dsSetAudioDelay(handle[0], audio_delay); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6201,11 +5861,7 @@ void test_l1_dsAudio_negative_dsGetAudioDelayOffset(void) { // Step 01: Attempt to retrieve audio delay offset without initializing audio ports result = dsGetAudioDelayOffset(-1, &audioDelayOffsetMs); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6232,11 +5888,7 @@ void test_l1_dsAudio_negative_dsGetAudioDelayOffset(void) { // Step 07: Attempt to retrieve audio delay offset after terminating audio ports result = dsGetAudioDelayOffset(handle[0], &audioDelayOffsetMs); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6326,11 +5978,7 @@ void test_l1_dsAudio_negative_dsSetAudioDelayOffset(void) { // Step 01: Attempt to set audio delay offset without initializing audio ports result = dsSetAudioDelayOffset(-1, audio_delay_offset); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6357,11 +6005,7 @@ void test_l1_dsAudio_negative_dsSetAudioDelayOffset(void) { // Step 07: Attempt to set audio delay offset after terminating audio ports result = dsSetAudioDelayOffset(handle[0], audio_delay_offset); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6455,11 +6099,7 @@ void test_l1_dsAudio_negative_dsSetAudioAtmosOutputMode(void) { // Step 01: Attempt to set ATMOS Output mode without initializing audio ports result = dsSetAudioAtmosOutputMode(-1, valid_value); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_GENERAL); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_GENERAL ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6482,11 +6122,7 @@ void test_l1_dsAudio_negative_dsSetAudioAtmosOutputMode(void) { // Step 06: Attempt to set ATMOS Output mode after terminating audio ports result = dsSetAudioAtmosOutputMode(handle[0], valid_value); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_GENERAL); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_GENERAL ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6587,11 +6223,7 @@ void test_l1_dsAudio_negative_dsGetSinkDeviceAtmosCapability(void) { // Step 01: Attempt to get ATMOS capability without initializing audio ports result = dsGetSinkDeviceAtmosCapability(-1, &atmosCapability); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6619,11 +6251,7 @@ void test_l1_dsAudio_negative_dsGetSinkDeviceAtmosCapability(void) { // Step 07: Attempt to get ATMOS capability after terminating audio ports result = dsGetSinkDeviceAtmosCapability(handle[0], &atmosCapability); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6724,11 +6352,7 @@ void test_l1_dsAudio_negative_dsIsAudioLoopThru(void) { // Step 01: Attempt to check Loop-Thru status without initializing audio ports result = dsIsAudioLoopThru(-1, &loopThru); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6751,11 +6375,7 @@ void test_l1_dsAudio_negative_dsIsAudioLoopThru(void) { // Step 07: Attempt to check Loop-Thru status after terminating audio ports result = dsIsAudioLoopThru(handle[0], &loopThru); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6855,11 +6475,7 @@ void test_l1_dsAudio_negative_dsIsAudioMute(void) { // Step 01: Attempt to check Mute status without initializing audio ports result = dsIsAudioMute(-1, &muted); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -6882,11 +6498,7 @@ void test_l1_dsAudio_negative_dsIsAudioMute(void) { // Step 07: Attempt to check Mute status after terminating audio ports result = dsIsAudioMute(handle[0], &muted); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -6986,11 +6598,7 @@ void test_l1_dsAudio_negative_dsIsAudioPortEnabled(void) { // Step 01: Attempt to check Enabled status without initializing audio ports result = dsIsAudioPortEnabled(-1, &isEnabled); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7013,11 +6621,7 @@ void test_l1_dsAudio_negative_dsIsAudioPortEnabled(void) { // Step 07: Attempt to check Enabled status after terminating audio ports result = dsIsAudioPortEnabled(handle[0], &isEnabled); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -7122,11 +6726,7 @@ void test_l1_dsAudio_negative_dsEnableAudioPort(void) { // Step 01: Attempt to enable/disable audio ports without initializing result = dsEnableAudioPort(-1, true); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7149,11 +6749,7 @@ void test_l1_dsAudio_negative_dsEnableAudioPort(void) { // Step 06: Attempt to enable/disable after terminating result = dsEnableAudioPort(handle[0], true); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -7250,9 +6846,7 @@ void test_l1_dsAudio_negative_dsEnableMS12Config(void) { // Step 01: Attempt to enable MS12 Configs without initializing result = dsEnableMS12Config(-1, dsMS12FEATURE_DAPV2 , true); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7279,9 +6873,7 @@ void test_l1_dsAudio_negative_dsEnableMS12Config(void) { // Step 07: Attempt to enable MS12 Configs after terminating result = dsEnableMS12Config(handle[0], dsMS12FEATURE_DAPV2, true); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -7370,11 +6962,7 @@ void test_l1_dsAudio_negative_dsEnableLEConfig(void) { // Step 01: Attempt to enable LE without initializing result = dsEnableLEConfig(-1, true); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7397,11 +6985,7 @@ void test_l1_dsAudio_negative_dsEnableLEConfig(void) { // Step 06: Attempt to enable LE after terminating result = dsEnableLEConfig(handle[0], false); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -7502,11 +7086,7 @@ void test_l1_dsAudio_negative_dsGetLEConfig(void) { // Step 01: Attempt to get LE Config without initializing result = dsGetLEConfig(-1, &enable); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7533,11 +7113,7 @@ void test_l1_dsAudio_negative_dsGetLEConfig(void) { // Step 07: Attempt to get LE Config after terminating result = dsGetLEConfig(handle[0], &enable); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -7630,11 +7206,7 @@ void test_l1_dsAudio_negative_dsSetMS12AudioProfile(void) { // Step 01: Attempt to set MS12 Audio Profile without initializing result = dsSetMS12AudioProfile(-1, validProfile); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7661,11 +7233,7 @@ void test_l1_dsAudio_negative_dsSetMS12AudioProfile(void) { // Step 07: Attempt to set MS12 Audio Profile after terminating result = dsSetMS12AudioProfile(handle[0], validProfile); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -7770,9 +7338,7 @@ void test_l1_dsAudio_negative_dsSetAudioDucking(void) { // Step 01: Attempt to set Audio Ducking without initializing result = dsSetAudioDucking(-1, valid_action, vaild_type, valid_level); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7808,9 +7374,7 @@ void test_l1_dsAudio_negative_dsSetAudioDucking(void) { // Step 09: Attempt to set Audio Ducking after terminating result = dsSetAudioDucking(handle[0], valid_action, vaild_type, valid_level); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -7904,11 +7468,7 @@ void test_l1_dsAudio_negative_dsEnableLoopThru(void) { // Step 01: Attempt to enable loop-through without initializing result = dsEnableLoopThru(-1, true); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_OPERATION_NOT_SUPPORTED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_OPERATION_NOT_SUPPORTED ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -7931,11 +7491,7 @@ void test_l1_dsAudio_negative_dsEnableLoopThru(void) { // Step 06: Attempt to enable loop-through after terminating result = dsEnableLoopThru(handle[0], true); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_OPERATION_NOT_SUPPORTED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_OPERATION_NOT_SUPPORTED ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -8031,11 +7587,7 @@ void test_l1_dsAudio_negative_dsSetAudioMute(void) { // Step 01: Attempt to set mute without initializing result = dsSetAudioMute(-1, valid_value); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -8058,11 +7610,7 @@ void test_l1_dsAudio_negative_dsSetAudioMute(void) { // Step 06: Attempt to set mute after terminating result = dsSetAudioMute(handle[0], true); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -8153,11 +7701,7 @@ void test_l1_dsAudio_negative_dsIsAudioMSDecode(void) { // Step 01: Attempt to check MS11 Decode without initializing result = dsIsAudioMSDecode(-1, &hasMS11Decode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -8185,11 +7729,7 @@ void test_l1_dsAudio_negative_dsIsAudioMSDecode(void) { // Step 07: Attempt to check MS11 Decode after terminating result = dsIsAudioMSDecode(handle[0], &hasMS11Decode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -8280,9 +7820,7 @@ void test_l1_dsAudio_negative_dsIsAudioMS12Decode(void) { // Step 01: Attempt to check MS12 Decode without initializing result = dsIsAudioMS12Decode(-1, &hasMS12Decode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -8309,9 +7847,7 @@ void test_l1_dsAudio_negative_dsIsAudioMS12Decode(void) { // Step 07: Attempt to check MS12 Decode after terminating result = dsIsAudioMS12Decode(handle[0], &hasMS12Decode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -8402,11 +7938,7 @@ void test_l1_dsAudio_negative_dsAudioOutIsConnected(void) { // Step 01: Attempt to check connection status without initializing result = dsAudioOutIsConnected(-1, &isConnected); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -8433,11 +7965,7 @@ void test_l1_dsAudio_negative_dsAudioOutIsConnected(void) { // Step 07: Attempt to check connection status after terminating result = dsAudioOutIsConnected(handle[0], &isConnected); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -8518,11 +8046,7 @@ void test_l1_dsAudio_negative_dsAudioOutRegisterConnectCB(void) { // Step 01: Attempt to register callback without initializing ports result = dsAudioOutRegisterConnectCB(NULL); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -8616,11 +8140,7 @@ void test_l1_dsAudio_negative_dsAudioFormatUpdateRegisterCB(void) { // Step 01: Attempt to register callback without initializing ports result = dsAudioFormatUpdateRegisterCB(NULL); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -8729,11 +8249,7 @@ void test_l1_dsAudio_negative_dsGetAudioCapabilities(void) { // Step 01: Call without initializing result = dsGetAudioCapabilities(-1, &capabilities); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -8760,11 +8276,7 @@ void test_l1_dsAudio_negative_dsGetAudioCapabilities(void) { // Step 07: Call again after terminating result = dsGetAudioCapabilities(handle[0], &capabilities); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -8865,9 +8377,7 @@ void test_l1_dsAudio_negative_dsGetMS12Capabilities(void) { // Step 01: Call without initializing result = dsGetMS12Capabilities(-1, &ms12Capabilities); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -8894,9 +8404,7 @@ void test_l1_dsAudio_negative_dsGetMS12Capabilities(void) { // Step 07: Call again after terminating result = dsGetMS12Capabilities(handle[0], &ms12Capabilities); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -8984,11 +8492,7 @@ void test_l1_dsAudio_negative_dsResetDialogEnhancement(void) { // Step 01: Call without initializing result = dsResetDialogEnhancement(-1); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -9012,11 +8516,7 @@ void test_l1_dsAudio_negative_dsResetDialogEnhancement(void) { // Step 05: Call again after terminating result = dsResetDialogEnhancement(handle[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -9105,9 +8605,7 @@ void test_l1_dsAudio_negative_dsResetBassEnhancer(void) { // Step 01: Call without initializing result = dsResetBassEnhancer(-1); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -9130,9 +8628,7 @@ void test_l1_dsAudio_negative_dsResetBassEnhancer(void) { // Step 06: Call again after terminating result = dsResetBassEnhancer(handle[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -9219,9 +8715,7 @@ void test_l1_dsAudio_negative_dsResetSurroundVirtualizer(void) { // Step 01: Call without initializing result = dsResetSurroundVirtualizer(-1); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -9244,9 +8738,7 @@ void test_l1_dsAudio_negative_dsResetSurroundVirtualizer(void) { // Step 06: Call again after terminating result = dsResetSurroundVirtualizer(handle[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -9334,9 +8826,7 @@ void test_l1_dsAudio_negative_dsResetVolumeLeveller(void) { // Step 01: Call without initializing result = dsResetVolumeLeveller(-1); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -9359,9 +8849,7 @@ void test_l1_dsAudio_negative_dsResetVolumeLeveller(void) { // Step 06: Call again after terminating result = dsResetVolumeLeveller(handle[0]); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -9453,11 +8941,7 @@ void test_l1_dsAudio_negative_dsSetAssociatedAudioMixing(void) { // Step 01: Call without initializing result = dsSetAssociatedAudioMixing(-1, true); // Example invalid handle -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_GENERAL); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_GENERAL ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -9465,11 +8949,7 @@ void test_l1_dsAudio_negative_dsSetAssociatedAudioMixing(void) { // Step 03: Call with invalid handle result = dsSetAssociatedAudioMixing(handle[0], true); // Example invalid handle -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_GENERAL); -#endif + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); // Step 04: Loop through kPorts to get audio port handle for (int i = 0; i < NUM_OF_PORTS; i++) { @@ -9484,11 +8964,7 @@ void test_l1_dsAudio_negative_dsSetAssociatedAudioMixing(void) { // Step 06: Call again after terminating result = dsSetAssociatedAudioMixing(handle[0], true); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_GENERAL); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_GENERAL ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -9589,11 +9065,7 @@ void test_l1_dsAudio_negative_dsGetAssociatedAudioMixing(void) { // Step 01: Call without initializing result = dsGetAssociatedAudioMixing(-1, &mixing); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -9620,11 +9092,7 @@ void test_l1_dsAudio_negative_dsGetAssociatedAudioMixing(void) { // Step 07: Call again after terminating result = dsGetAssociatedAudioMixing(handle[0], &mixing); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -9721,11 +9189,7 @@ void test_l1_dsAudio_negative_dsSetFaderControl(void) { // Step 01: Call without initializing int mixerBalance = 0; //valid value result = dsSetFaderControl(-1, mixerBalance); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -9752,11 +9216,7 @@ void test_l1_dsAudio_negative_dsSetFaderControl(void) { // Step 07: Call again after terminating result = dsSetFaderControl(handle[0], mixerBalance); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -9857,11 +9317,7 @@ void test_l1_dsAudio_negative_dsGetFaderControl(void) { // Step 01: Call dsGetFaderControl() without initializing audio ports result = dsGetFaderControl(-1, &mixerBalance); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -9888,11 +9344,7 @@ void test_l1_dsAudio_negative_dsGetFaderControl(void) { // Step 07: Call dsGetFaderControl() after terminating audio ports result = dsGetFaderControl(handle[0], &mixerBalance); // using last valid handle obtained -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -9984,11 +9436,7 @@ void test_l1_dsAudio_negative_dsSetPrimaryLanguage(void) { // Step 01: Call without initializing audio ports result = dsSetPrimaryLanguage(-1, "ENG"); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -10019,11 +9467,7 @@ void test_l1_dsAudio_negative_dsSetPrimaryLanguage(void) { // Step 07: Call after terminating audio ports result = dsSetPrimaryLanguage(handle[0], "ENG"); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -10124,11 +9568,7 @@ void test_l1_dsAudio_negative_dsGetPrimaryLanguage(void) { // Step 01: Call without initializing audio ports result = dsGetPrimaryLanguage(-1, primaryLanguage); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -10155,11 +9595,7 @@ void test_l1_dsAudio_negative_dsGetPrimaryLanguage(void) { // Step 07: Call after terminating audio ports result = dsGetPrimaryLanguage(handle[0], primaryLanguage); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -10249,11 +9685,7 @@ void test_l1_dsAudio_negative_dsSetSecondaryLanguage(void) { // Step 01: Call without initializing audio ports result = dsSetSecondaryLanguage(-1, "ENG"); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -10284,11 +9716,7 @@ void test_l1_dsAudio_negative_dsSetSecondaryLanguage(void) { // Step 08: Call after terminating audio ports result = dsSetSecondaryLanguage(handle[0], "ENG"); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -10389,11 +9817,7 @@ void test_l1_dsAudio_negative_dsGetSecondaryLanguage(void) { // Step 01: Call without initializing audio ports result = dsGetSecondaryLanguage(-1, languageCode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -10420,11 +9844,7 @@ void test_l1_dsAudio_negative_dsGetSecondaryLanguage(void) { // Step 07: Call after terminating audio ports result = dsGetSecondaryLanguage(handle[0], languageCode); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -10502,9 +9922,7 @@ void test_l1_dsAudio_negative_dsGetHDMIARCPortId(void) { // Step 01: Call without initializing audio ports result = dsGetHDMIARCPortId(NULL); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // Step 02: Initialize audio ports result = dsAudioPortInit(); @@ -10520,9 +9938,7 @@ void test_l1_dsAudio_negative_dsGetHDMIARCPortId(void) { // Step 05: Call after terminating audio ports result = dsGetHDMIARCPortId(NULL); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -10623,11 +10039,7 @@ void test_l1_dsAudio_negative_dsSetAudioMixerLevels(void) { // Step 01: Call dsSetAudioMixerLevels() without prior initialization of Audio Port result = dsSetAudioMixerLevels((intptr_t)NULL, dsAUDIO_INPUT_PRIMARY, valid_vol_level); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // Step 02: Initialize Audio Port using dsAudioPortInit() result = dsAudioPortInit(); @@ -10661,11 +10073,7 @@ void test_l1_dsAudio_negative_dsSetAudioMixerLevels(void) { // Step 08: Call dsSetAudioMixerLevels() after termination result = dsSetAudioMixerLevels(handle[0], dsAUDIO_INPUT_PRIMARY, valid_vol_level); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM ); // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -10850,6 +10258,7 @@ int test_l1_dsAudio_register ( void ) UT_add_test( pSuite, "dsSetAudioMixerLevels_l1_positive" ,test_l1_dsAudio_positive_dsSetAudioMixerLevels ); UT_add_test( pSuite, "dsSetAudioMixerLevels_l1_negative" ,test_l1_dsAudio_negative_dsSetAudioMixerLevels ); + extendedEnumsSupported = ut_kvp_getBoolField( ut_kvp_profile_getInstance(), "dsAudio/features/extendedEnumsSupported" ); return 0; } From 130f0ce38206c496acb78e81b3fce723eeca06ac Mon Sep 17 00:00:00 2001 From: drissya-k <167057835+drissya-k@users.noreply.github.com> Date: Thu, 23 May 2024 06:09:35 +0000 Subject: [PATCH 29/38] Enhanced Error Code moved to kvp profiler *Adding macro function to check enhanced error code --- src/test_l1_dsHdmiIn.c | 458 ++++++++++-------------------------- src/test_l1_dsVideoDevice.c | 187 ++++----------- 2 files changed, 167 insertions(+), 478 deletions(-) diff --git a/src/test_l1_dsHdmiIn.c b/src/test_l1_dsHdmiIn.c index b9e1a5b0..264a10be 100644 --- a/src/test_l1_dsHdmiIn.c +++ b/src/test_l1_dsHdmiIn.c @@ -94,6 +94,21 @@ static int gTestID = 1; }\ }\ +#define CHECK_FOR_EXTENDED_ERROR_CODE( result, enhanced, old )\ +{\ + if ( extendedEnumsSupported == true )\ + {\ + UT_ASSERT_EQUAL( enhanced, result );\ + }\ + else\ + {\ + UT_ASSERT_EQUAL( old, result );\ + }\ +} + +/* Global flags to support features */ +static bool extendedEnumsSupported=false; //Default to not supported + /** * @brief Ensure dsHdmiInInit() correctly initializes the HDMI input sub-system during positive scenarios. * @@ -155,11 +170,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInInit(void) { UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 2: Call dsHdmiInInit() again without terminating the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_ALREADY_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); - #endif + dsError_t result = dsHdmiInInit(); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_ALREADY_INITIALIZED, dsERR_NONE); // Step 3: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); @@ -227,11 +239,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInTerm(void) { gTestID = 4; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInTerm() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); - #endif + dsError_t result = dsHdmiInTerm(); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -240,11 +249,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInTerm(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 4: Call dsHdmiInTerm() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); - #endif + result = dsHdmiInTerm(); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -318,31 +324,21 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetNumberOfInputs(void) { uint8_t numInputs; // Step 1: Call dsHdmiInGetNumberOfInputs() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInGetNumberOfInputs(&numInputs), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInGetNumberOfInputs(&numInputs), dsERR_NONE); - #endif + dsError_t result = dsHdmiInGetNumberOfInputs(&numInputs); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsHdmiInGetNumberOfInputs() with NULL as the parameter - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInGetNumberOfInputs(NULL), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsHdmiInGetNumberOfInputs(NULL), dsERR_NONE); - #endif + UT_ASSERT_EQUAL(dsHdmiInGetNumberOfInputs(NULL),dsERR_INVALID_PARAM); // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInGetNumberOfInputs() after termination of the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInGetNumberOfInputs(&numInputs), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInGetNumberOfInputs(&numInputs), dsERR_NONE); - #endif + result = dsHdmiInGetNumberOfInputs(&numInputs); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -424,31 +420,21 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetStatus(void) { dsHdmiInStatus_t status; // Step 1: Call dsHdmiInGetStatus() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInGetStatus(&status), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInGetStatus(&status), dsERR_NONE); - #endif + dsError_t result = dsHdmiInGetStatus(&status); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsHdmiInGetStatus() with NULL as the parameter - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInGetStatus(NULL), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsHdmiInGetStatus(NULL), dsERR_GENERAL); - #endif + UT_ASSERT_EQUAL(dsHdmiInGetStatus(NULL),dsERR_INVALID_PARAM); // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInGetStatus() after terminating the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInGetStatus(&status), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInGetStatus(&status), dsERR_NONE); - #endif + result = dsHdmiInGetStatus(&status); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -519,12 +505,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInSelectPort(void) { gTestID = 10; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInSelectPort() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false), dsERR_NONE); - #endif - + dsError_t result = dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); + // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -538,11 +521,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInSelectPort(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 6: Call dsHdmiInSelectPort() after terminating the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false), dsERR_NONE); - #endif + result = dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -618,11 +598,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInScaleVideo(void) { gTestID = 12; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInScaleVideo() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInScaleVideo(0, 0, 800, 600), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInScaleVideo(0, 0, 800, 600), dsERR_NONE); - #endif + dsError_t result = dsHdmiInScaleVideo(0, 0, 800, 600); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -652,11 +629,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInScaleVideo(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 11: dsHdmiInScaleVideo() after terminating the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInScaleVideo(0, 0, 800, 600), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInScaleVideo(0, 0, 800, 600), dsERR_NONE); - #endif + result = dsHdmiInScaleVideo(0, 0, 800, 600); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -721,31 +695,21 @@ void test_l1_dsHdmiIn_negative_dsHdmiInSelectZoomMode(void) { gTestID = 14; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInSelectZoomMode() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_NONE), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_NONE), dsERR_NONE); - #endif + dsError_t result = dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_NONE); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsHdmiInSelectZoomMode() with invalid value (dsVIDEO_ZOOM_MAX) - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_MAX), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_MAX), dsERR_GENERAL); - #endif - + UT_ASSERT_EQUAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_MAX),dsERR_INVALID_PARAM); + // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInSelectZoomMode() without terminating the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_NONE), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_NONE), dsERR_NONE); - #endif + result = dsHdmiInSelectZoomMode(dsVIDEO_ZOOM_NONE); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -827,31 +791,21 @@ void test_l1_dsHdmiIn_negative_dsHdmiInGetCurrentVideoMode(void) { UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInGetCurrentVideoMode() without initializing the HDMI input sub-system dsVideoPortResolution_t resolution; - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInGetCurrentVideoMode(&resolution), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInGetCurrentVideoMode(&resolution), dsERR_NONE); - #endif + dsError_t result = dsHdmiInGetCurrentVideoMode(&resolution); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: dsHdmiInGetCurrentVideoMode() with NULL `resolution` pointer - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInGetCurrentVideoMode(NULL), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsHdmiInGetCurrentVideoMode(NULL), dsERR_GENERAL); - #endif + UT_ASSERT_EQUAL(dsHdmiInGetCurrentVideoMode(NULL),dsERR_INVALID_PARAM); // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInGetCurrentVideoMode() after terminating the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInGetCurrentVideoMode(&resolution), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInGetCurrentVideoMode(&resolution), dsERR_NONE); - #endif + result = dsHdmiInGetCurrentVideoMode(&resolution); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -917,11 +871,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterConnectCB(void) { gTestID = 18; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInRegisterConnectCB() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInRegisterConnectCB(mockConnectCallback), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInRegisterConnectCB(mockConnectCallback), dsERR_NONE); - #endif + dsError_t result = dsHdmiInRegisterConnectCB(mockConnectCallback); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -933,11 +884,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterConnectCB(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInRegisterConnectCB() after termination the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInRegisterConnectCB(mockConnectCallback), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInRegisterConnectCB(mockConnectCallback), dsERR_NONE); - #endif + result = dsHdmiInRegisterConnectCB(mockConnectCallback); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1003,11 +951,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterSignalChangeCB(void) { gTestID = 20; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInRegisterSignalChangeCB() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInRegisterSignalChangeCB(mockSignalCallback), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInRegisterSignalChangeCB(mockSignalCallback), dsERR_NONE); - #endif + dsError_t result = dsHdmiInRegisterSignalChangeCB(mockSignalCallback); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -1019,11 +964,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterSignalChangeCB(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInRegisterSignalChangeCB() after terminating the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInRegisterSignalChangeCB(mockSignalCallback), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInRegisterSignalChangeCB(mockSignalCallback), dsERR_NONE); - #endif + result = dsHdmiInRegisterSignalChangeCB(mockSignalCallback); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1089,11 +1031,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterStatusChangeCB(void) { gTestID = 22; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInRegisterStatusChangeCB() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInRegisterStatusChangeCB(mockStatusChangeCallback), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInRegisterStatusChangeCB(mockStatusChangeCallback), dsERR_NONE); - #endif + dsError_t result = dsHdmiInRegisterStatusChangeCB(mockStatusChangeCallback); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -1105,11 +1044,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterStatusChangeCB(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInRegisterStatusChangeCB() after terminating the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInRegisterStatusChangeCB(mockStatusChangeCallback), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInRegisterStatusChangeCB(mockStatusChangeCallback), dsERR_NONE); - #endif + result = dsHdmiInRegisterStatusChangeCB(mockStatusChangeCallback); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1175,11 +1111,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterVideoModeUpdateCB(void) { gTestID = 24; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInRegisterVideoModeUpdateCB() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInRegisterVideoModeUpdateCB(mockVideoModeUpdateCallback), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInRegisterVideoModeUpdateCB(mockVideoModeUpdateCallback), dsERR_NONE); - #endif + dsError_t result = dsHdmiInRegisterVideoModeUpdateCB(mockVideoModeUpdateCallback); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -1191,11 +1124,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterVideoModeUpdateCB(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInRegisterVideoModeUpdateCB() after terminating the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInRegisterVideoModeUpdateCB(mockVideoModeUpdateCallback), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInRegisterVideoModeUpdateCB(mockVideoModeUpdateCallback), dsERR_NONE); - #endif + result = dsHdmiInRegisterVideoModeUpdateCB(mockVideoModeUpdateCallback); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1262,11 +1192,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAllmChangeCB(void) { gTestID = 26; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInRegisterAllmChangeCB() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInRegisterAllmChangeCB(mockALLMChangeCallback), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInRegisterAllmChangeCB(mockALLMChangeCallback), dsERR_NONE); - #endif + dsError_t result = dsHdmiInRegisterAllmChangeCB(mockALLMChangeCallback); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -1278,11 +1205,9 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAllmChangeCB(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInRegisterAllmChangeCB() after terminating the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInRegisterAllmChangeCB(mockALLMChangeCallback), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInRegisterAllmChangeCB(mockALLMChangeCallback), dsERR_NONE); - #endif + result = dsHdmiInRegisterAllmChangeCB(mockALLMChangeCallback); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); + UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1347,11 +1272,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAVLatencyChangeCB(void) { gTestID = 28; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInRegisterAVLatencyChangeCB() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInRegisterAVLatencyChangeCB(mockLatencyChangeCallback), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInRegisterAVLatencyChangeCB(mockLatencyChangeCallback), dsERR_NONE); - #endif + dsError_t result = dsHdmiInRegisterAVLatencyChangeCB(mockLatencyChangeCallback); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -1363,11 +1285,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAVLatencyChangeCB(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInRegisterAVLatencyChangeCB() after terminating the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInRegisterAVLatencyChangeCB(mockLatencyChangeCallback), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInRegisterAVLatencyChangeCB(mockLatencyChangeCallback), dsERR_NONE); - #endif + result = dsHdmiInRegisterAVLatencyChangeCB(mockLatencyChangeCallback); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1434,11 +1353,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAviContentTypeChangeCB(void) { gTestID = 30; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInRegisterAviContentTypeChangeCB() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInRegisterAviContentTypeChangeCB(mockAviContentCallback), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInRegisterAviContentTypeChangeCB(mockAviContentCallback), dsERR_NONE); - #endif + dsError_t result = dsHdmiInRegisterAviContentTypeChangeCB(mockAviContentCallback); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -1450,11 +1366,8 @@ void test_l1_dsHdmiIn_negative_dsHdmiInRegisterAviContentTypeChangeCB(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsHdmiInRegisterAviContentTypeChangeCB() after terminating the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsHdmiInRegisterAviContentTypeChangeCB(mockAviContentCallback), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsHdmiInRegisterAviContentTypeChangeCB(mockAviContentCallback), dsERR_NONE); - #endif + result = dsHdmiInRegisterAviContentTypeChangeCB(mockAviContentCallback); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1535,11 +1448,8 @@ void test_l1_dsHdmiIn_negative_dsIsHdmiARCPort(void) { gTestID = 32; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsIsHdmiARCPort() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, NULL), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, NULL), dsERR_NONE); - #endif + dsError_t result = dsIsHdmiARCPort(dsHDMI_IN_PORT_0, NULL); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -1547,28 +1457,17 @@ void test_l1_dsHdmiIn_negative_dsIsHdmiARCPort(void) { bool isArcPort; // Step 3: Call dsIsHdmiARCPort() with invalid value (dsHDMI_IN_PORT_MAX) - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_MAX, &isArcPort), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_MAX, &isArcPort), dsERR_NONE); - #endif + UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_MAX, &isArcPort),dsERR_INVALID_PARAM); // Step 4: Call dsIsHdmiARCPort() with invalid value (dsHDMI_IN_PORT_0) and NULL pointer - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, NULL), dsERR_NONE); - #endif + UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, NULL),dsERR_INVALID_PARAM); // Step 5: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 6: Call dsIsHdmiARCPort() after terminating the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, &isArcPort), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsIsHdmiARCPort(dsHDMI_IN_PORT_0, &isArcPort), dsERR_NONE); - #endif + result = dsIsHdmiARCPort(dsHDMI_IN_PORT_0, &isArcPort); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1669,45 +1568,27 @@ void test_l1_dsHdmiIn_negative_dsGetEDIDBytesInfo(void) { int edidSize; // Step 1: Call dsGetEDIDBytesInfo() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, &edidSize), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, &edidSize), dsERR_NONE); - #endif + dsError_t result = dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, &edidSize); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsGetEDIDBytesInfo() with invalid value (dsHDMI_IN_PORT_MAX) - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_MAX, edidBytes, &edidSize), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_MAX, edidBytes, &edidSize), dsERR_GENERAL); - #endif + UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_MAX, edidBytes, &edidSize),dsERR_INVALID_PARAM); // Step 4: Call dsGetEDIDBytesInfo() with invalid value (NULL pointer) - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, NULL, &edidSize), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, NULL, &edidSize), dsERR_GENERAL); - #endif + UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, NULL, &edidSize),dsERR_INVALID_PARAM); // Step 5: Call dsGetEDIDBytesInfo() with invalid value (NULL pointer) - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, NULL), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, NULL), dsERR_GENERAL); - #endif + UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, NULL),dsERR_INVALID_PARAM); // Step 6: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 7: Call dsGetEDIDBytesInfo() after terminating the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, &edidSize), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, &edidSize), dsERR_NONE); - #endif + result = dsGetEDIDBytesInfo(dsHDMI_IN_PORT_0, edidBytes, &edidSize); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); free(edidBytes); @@ -1801,38 +1682,24 @@ void test_l1_dsHdmiIn_negative_dsGetHDMISPDInfo(void) { unsigned char* spdInfo1 = (unsigned char*) malloc(sizeof(struct dsSpd_infoframe_st)); // Step 1: Call dsGetHDMISPDInfo() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, spdInfo1), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, spdInfo1), dsERR_NONE); - #endif + dsError_t result = dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, spdInfo1); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsGetHDMISPDInfo() with invalid values (dsHDMI_IN_PORT_MAX) - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_MAX, spdInfo1), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_MAX, spdInfo1), dsERR_GENERAL); - #endif // Step 4: Call dsGetHDMISPDInfo() with invalid values (NULL pointer) - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, NULL), dsERR_GENERAL); - #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 6: Call dsGetHDMISPDInfo() after terminating the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, spdInfo1), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, spdInfo1), dsERR_NONE); - #endif + result = dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, spdInfo1); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); free(spdInfo1); @@ -1909,39 +1776,24 @@ void test_l1_dsHdmiIn_negative_dsSetEdidVersion(void) { gTestID = 38; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsSetEdidVersion() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_14), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_14), dsERR_NONE); - #endif + dsError_t result = dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_14); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsSetEdidVersion() with invalid inputs (dsHDMI_IN_PORT_MAX) - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_MAX, HDMI_EDID_VER_14), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_MAX, HDMI_EDID_VER_14), dsERR_GENERAL); - #endif // Step 4: Call dsSetEdidVersion() with invalid inputs (HDMI_EDID_VER_MAX) - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_MAX), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_MAX), dsERR_GENERAL); - #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 6: Call dsSetEdidVersion() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_14), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_14), dsERR_NONE); - #endif - + result = dsSetEdidVersion(dsHDMI_IN_PORT_0, HDMI_EDID_VER_14); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2012,38 +1864,24 @@ void test_l1_dsHdmiIn_negative_dsGetEdidVersion(void) { UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsGetEdidVersion() without initializing the HDMI input sub-system tv_hdmi_edid_version_t edid_version; - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, &edid_version), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, &edid_version), dsERR_NONE); - #endif + dsError_t result = dsGetEdidVersion(dsHDMI_IN_PORT_0, &edid_version); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsGetEdidVersion() with invalid inputs (dsHDMI_IN_PORT_MAX) - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_MAX, &edid_version), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_MAX, &edid_version), dsERR_GENERAL); - #endif // Step 4: Call dsGetEdidVersion() with invalid inputs (NULL) - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, NULL), dsERR_GENERAL); - #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 6: Call dsGetEdidVersion() without initializing the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, &edid_version), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsGetEdidVersion(dsHDMI_IN_PORT_0, &edid_version), dsERR_NONE); - #endif + result = dsGetEdidVersion(dsHDMI_IN_PORT_0, &edid_version); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2125,38 +1963,24 @@ void test_l1_dsHdmiIn_negative_dsGetAllmStatus(void) { UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsGetAllmStatus() without initializing the HDMI input sub-system bool allm_status; - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, &allm_status), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, &allm_status), dsERR_NONE); - #endif + dsError_t result = dsGetAllmStatus(dsHDMI_IN_PORT_0, &allm_status); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsGetAllmStatus() without valid inputs (dsHDMI_IN_PORT_MAX) - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_MAX, &allm_status), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_MAX, &allm_status), dsERR_GENERAL); - #endif // Step 4: Call dsGetAllmStatus() without valid inputs (NULL) - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, NULL), dsERR_GENERAL); - #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 6: Call dsGetAllmStatus() after termination the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, &allm_status), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsGetAllmStatus(dsHDMI_IN_PORT_0, &allm_status), dsERR_NONE); - #endif + result = dsGetAllmStatus(dsHDMI_IN_PORT_0, &allm_status); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2230,32 +2054,21 @@ void test_l1_dsHdmiIn_negative_dsGetSupportedGameFeaturesList(void) { UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsGetSupportedGameFeaturesList() without initializing the HDMI input sub-system dsSupportedGameFeatureList_t supported_features; - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsGetSupportedGameFeaturesList(&supported_features), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsGetSupportedGameFeaturesList(&supported_features), dsERR_NONE); - #endif + dsError_t result = dsGetSupportedGameFeaturesList(&supported_features); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsGetSupportedGameFeaturesList() with invalid input (NULL) - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetSupportedGameFeaturesList(NULL), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsGetSupportedGameFeaturesList(NULL), dsERR_GENERAL); - #endif // Step 4: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsGetSupportedGameFeaturesList() after terminating the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsGetSupportedGameFeaturesList(&supported_features), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsGetSupportedGameFeaturesList(&supported_features), dsERR_NONE); - #endif - + result = dsGetSupportedGameFeaturesList(&supported_features); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2323,38 +2136,24 @@ void test_l1_dsHdmiIn_negative_dsGetAVLatency(void) { UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsGetAVLatency() without initializing the HDMI input sub-system int audioLatency, videoLatency; - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsGetAVLatency(&audioLatency, &videoLatency), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsGetAVLatency(&audioLatency, &videoLatency), dsERR_NONE); - #endif + dsError_t result = dsGetAVLatency(&audioLatency, &videoLatency); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsGetAVLatency() with valid inputs (NULL, int*) - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetAVLatency(NULL, &videoLatency), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsGetAVLatency(NULL, &videoLatency), dsERR_NONE); - #endif // Step 4: Call dsGetAVLatency() with valid inputs (int*, NULL) - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetAVLatency(&audioLatency, NULL), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsGetAVLatency(&audioLatency, NULL), dsERR_NONE); - #endif // Step 5: Call dsHdmiInTerm() to ensure deinitialization UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 6: Call dsGetAVLatency() after terminating the HDMI input sub-system - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsGetAVLatency(&audioLatency, &videoLatency), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsGetAVLatency(&audioLatency, &videoLatency), dsERR_NONE); - #endif + result = dsGetAVLatency(&audioLatency, &videoLatency); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2422,31 +2221,21 @@ void test_l1_dsHdmiIn_negative_dsSetEdid2AllmSupport(void) { gTestID = 48; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsSetEdid2AllmSupport() without prior initialization of HDMI input - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_0, true), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_0, true), dsERR_NONE); - #endif + dsError_t result = dsSetEdid2AllmSupport(dsHDMI_IN_PORT_0, true); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 2: Initialize HDMI input using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); // Step 3: Call dsSetEdid2AllmSupport() with an invalid HDMI port - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_MAX, true), dsERR_INVALID_PARAM); - #else - UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_MAX, true), dsERR_GENERAL); - #endif // Step 4: Terminate the HDMI input using dsHdmiInTerm() UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 5: Call dsSetEdid2AllmSupport() after termination - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_0, true), dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(dsSetEdid2AllmSupport(dsHDMI_IN_PORT_0, true), dsERR_NONE); - #endif + result = dsSetEdid2AllmSupport(dsHDMI_IN_PORT_0, true); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2520,9 +2309,7 @@ void test_l1_dsHdmiIn_negative_dsGetEdid2AllmSupport(void) { gTestID = 50; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); bool allmSupport; - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_0, &allmSupport), dsERR_NOT_INITIALIZED); - #endif // Step 2: Initialize HDMI input using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -2537,9 +2324,7 @@ void test_l1_dsHdmiIn_negative_dsGetEdid2AllmSupport(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 6: Call dsGetEdid2AllmSupport() without initializing the HDMI input sub-system again - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_0, &allmSupport), dsERR_NOT_INITIALIZED); - #endif UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2616,6 +2401,7 @@ int test_l1_dsHdmiIn_register ( void ) UT_add_test( pSuite2, "dsGetEdid2AllmSupport_l1_negative" ,test_l1_dsHdmiIn_negative_dsGetEdid2AllmSupport ); UT_add_test( pSuite2, "dsHdmiInGetStatus_L1_negative" ,test_l1_dsHdmiIn_negative_dsHdmiInGetStatus ); UT_add_test( pSuite2, "dsIsHdmiARCPort_L1_negative" ,test_l1_dsHdmiIn_negative_dsIsHdmiARCPort ); + extendedEnumsSupported = ut_kvp_getBoolField( ut_kvp_profile_getInstance(), "dsHdmiIn/features/extendedEnumsSupported" ); diff --git a/src/test_l1_dsVideoDevice.c b/src/test_l1_dsVideoDevice.c index 5347119f..274e73df 100644 --- a/src/test_l1_dsVideoDevice.c +++ b/src/test_l1_dsVideoDevice.c @@ -94,6 +94,21 @@ static int gTestID = 1; }\ }\ +#define CHECK_FOR_EXTENDED_ERROR_CODE( result, enhanced, old )\ +{\ + if ( extendedEnumsSupported == true )\ + {\ + UT_ASSERT_EQUAL( enhanced, result );\ + }\ + else\ + {\ + UT_ASSERT_EQUAL( old, result );\ + }\ +} + +/* Global flags to support features */ +static bool extendedEnumsSupported=false; //Default to not supported + /** * @brief Ensure dsVideoDeviceInit() correctly initializes all video devices during positive scenarios. * @@ -166,11 +181,7 @@ void test_l1_dsVideoDevice_negative_dsVideoDeviceInit(void) // Step 02: Try initializing again without terminating result = dsVideoDeviceInit(); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_ALREADY_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_ALREADY_INITIALIZED, dsERR_NONE); // Step 03: De-initialize the video devices for cleanup result = dsVideoDeviceTerm(); @@ -248,11 +259,7 @@ void test_l1_dsVideoDevice_negative_dsVideoDeviceTerm(void) // Step 01: Call de-initialization without prior initialization int result = dsVideoDeviceTerm(); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -264,11 +271,7 @@ void test_l1_dsVideoDevice_negative_dsVideoDeviceTerm(void) // Step 04: Call de-initialization again without re-initialization result = dsVideoDeviceTerm(); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -343,11 +346,7 @@ void test_l1_dsVideoDevice_negative_dsGetVideoDevice(void) // Step 01: Get the video device handle without prior initialization intptr_t handle = -1; int result = dsGetVideoDevice(0, &handle); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -367,11 +366,7 @@ void test_l1_dsVideoDevice_negative_dsGetVideoDevice(void) // Step 06: Get the video device handle after prior termination result = dsGetVideoDevice(0, &handle); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -469,11 +464,7 @@ void test_l1_dsVideoDevice_negative_dsSetDFC (void) // 01: Call dsSetDFC() without initialization result = dsSetDFC(-1, dsVIDEO_ZOOM_NONE); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // 02: Initialize video devices result = dsVideoDeviceInit(); @@ -498,11 +489,8 @@ void test_l1_dsVideoDevice_negative_dsSetDFC (void) // 07: Call dsSetDFC() after termination result = dsSetDFC(handle, dsVIDEO_ZOOM_NONE); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); + UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -600,11 +588,7 @@ void test_l1_dsVideoDevice_negative_dsGetDFC(void) // Step 01: Call dsGetDFC() without prior initialization result = dsGetDFC(handle, &dfc_mode); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -629,11 +613,8 @@ void test_l1_dsVideoDevice_negative_dsGetDFC(void) // Step 07: Call dsGetDFC() after termination result = dsGetDFC(handle, &dfc_mode); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); + UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -732,11 +713,7 @@ void test_l1_dsVideoDevice_negative_dsGetHDRCapabilities(void) // Step 01: Call dsGetHDRCapabilities() without prior initialization result = dsGetHDRCapabilities(handle, &hdr_capabilities); // Note: using handle for HDR capabilities for this error case - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -761,11 +738,8 @@ void test_l1_dsVideoDevice_negative_dsGetHDRCapabilities(void) // Step 07: Call dsGetHDRCapabilities() after termination result = dsGetHDRCapabilities(handle, &hdr_capabilities); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); + UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -863,11 +837,7 @@ void test_l1_dsVideoDevice_negative_dsGetSupportedVideoCodingFormats(void) // Step 01: Call dsGetSupportedVideoCodingFormats() without prior initialization result = dsGetSupportedVideoCodingFormats(handle, &supported_formats); // Note: using handle for supported formats for this error case - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -892,11 +862,8 @@ void test_l1_dsVideoDevice_negative_dsGetSupportedVideoCodingFormats(void) // Step 07: Call dsGetSupportedVideoCodingFormats() after termination result = dsGetSupportedVideoCodingFormats(handle, &supported_formats); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); + UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -943,35 +910,19 @@ void test_l1_dsVideoDevice_positive_dsGetVideoCodecInfo(void) // Step 03: Get video codec information with dsVIDEO_CODEC_MPEGHPART2 result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEGHPART2, &codecInfo); - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NONE); - #else - UT_ASSERT_EQUAL(result, dsERR_OPERATION_NOT_SUPPORTED); - #endif // Step 04: Get video codec information with dsVIDEO_CODEC_MPEG4PART10 result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEG4PART10, &codecInfo); - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NONE); - #else - UT_ASSERT_EQUAL(result, dsERR_OPERATION_NOT_SUPPORTED); - #endif // Step 05: Get video codec information with dsVIDEO_CODEC_MPEG2 result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEG2, &codecInfo); - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NONE); - #else - UT_ASSERT_EQUAL(result, dsERR_OPERATION_NOT_SUPPORTED); - #endif // Step 06: Get video codec information with dsVIDEO_CODEC_MPEG2 (again to replicate the provided test case) result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEG2, &codecInfo); - #ifdef ENABLE_ENHANCED_ERROR_CODE UT_ASSERT_EQUAL(result, dsERR_NONE); - #else - UT_ASSERT_EQUAL(result, dsERR_OPERATION_NOT_SUPPORTED); - #endif // Step 07: De-initialize the video devices result = dsVideoDeviceTerm(); @@ -1017,11 +968,7 @@ void test_l1_dsVideoDevice_negative_dsGetVideoCodecInfo(void) // Step 01: Call dsGetVideoCodecInfo() without prior initialization result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEGHPART2, &codecInfo); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_OPERATION_NOT_SUPPORTED); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_OPERATION_NOT_SUPPORTED); // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -1050,11 +997,7 @@ void test_l1_dsVideoDevice_negative_dsGetVideoCodecInfo(void) // Step 08: Call dsGetVideoCodecInfo() after termination result = dsGetVideoCodecInfo(handle, dsVIDEO_CODEC_MPEGHPART2, &codecInfo); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_OPERATION_NOT_SUPPORTED); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_OPERATION_NOT_SUPPORTED); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1146,11 +1089,7 @@ void test_l1_dsVideoDevice_negative_dsForceDisableHDRSupport(void) // Step 01: Call dsForceDisableHDRSupport() without prior initialization result = dsForceDisableHDRSupport(handle, true); // Note: uninitialized 'handle' used here - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -1171,11 +1110,7 @@ void test_l1_dsVideoDevice_negative_dsForceDisableHDRSupport(void) // Step 06: Call dsForceDisableHDRSupport() after termination result = dsForceDisableHDRSupport(handle, true); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1264,11 +1199,7 @@ void test_l1_dsVideoDevice_negative_dsSetFRFMode(void) // Step 01: Call dsSetFRFMode() without prior initialization result = dsSetFRFMode(handle, 60); // Note: uninitialized 'handle' used here - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -1293,11 +1224,7 @@ void test_l1_dsVideoDevice_negative_dsSetFRFMode(void) // Step 07: Call dsSetFRFMode() after termination result = dsSetFRFMode(handle, 60); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1397,11 +1324,7 @@ void test_l1_dsVideoDevice_negative_dsGetFRFMode(void) // Step 01: Call dsGetFRFMode() without prior initialization result = dsGetFRFMode(handle, &fetchedFRFMode); // Note: uninitialized 'handle' used here - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -1426,11 +1349,7 @@ void test_l1_dsVideoDevice_negative_dsGetFRFMode(void) // Step 07: Call dsGetFRFMode() after termination result = dsGetFRFMode(handle, &fetchedFRFMode); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1530,11 +1449,7 @@ void test_l1_dsVideoDevice_negative_dsGetCurrentDisplayframerate(void) // Step 01: Call dsGetCurrentDisplayframerate() without prior initialization result = dsGetCurrentDisplayframerate(handle, fetchedFramerate); // Note: uninitialized 'handle' used here - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -1559,11 +1474,7 @@ void test_l1_dsVideoDevice_negative_dsGetCurrentDisplayframerate(void) // Step 07: Call dsGetCurrentDisplayframerate() after termination result = dsGetCurrentDisplayframerate(handle, fetchedFramerate); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1653,11 +1564,7 @@ void test_l1_dsVideoDevice_negative_dsSetDisplayframerate(void) // Step 01: Call dsSetDisplayframerate() without prior initialization result = dsSetDisplayframerate(handle, "30fps"); // Note: uninitialized 'handle' used here - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 02: Initialize video devices result = dsVideoDeviceInit(); @@ -1686,11 +1593,7 @@ void test_l1_dsVideoDevice_negative_dsSetDisplayframerate(void) // Step 08: Call dsSetDisplayframerate() after termination result = dsSetDisplayframerate(handle, "30fps"); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(result, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1747,7 +1650,7 @@ int test_l1_dsVideoDevice_register ( void ) UT_add_test( pSuite2, "dsForceDisableHDRSupport_L1_positive" ,test_l1_dsVideoDevice_positive_dsForceDisableHDRSupport ); UT_add_test( pSuite2, "dsGetDFC_L1_negative" ,test_l1_dsVideoDevice_negative_dsGetDFC ); UT_add_test( pSuite2, "dsForceDisableHDRSupport_L1_negative" ,test_l1_dsVideoDevice_negative_dsForceDisableHDRSupport ); - + extendedEnumsSupported = ut_kvp_getBoolField( ut_kvp_profile_getInstance(), "dsVideoDevice/features/extendedEnumsSupported" ); return 0; } From a0594df5b6c4c7a9021c3446eaa44101f74a4470 Mon Sep 17 00:00:00 2001 From: thanushreevani <157587255+thanushreevani@users.noreply.github.com> Date: Thu, 23 May 2024 08:26:47 +0000 Subject: [PATCH 30/38] update dsVideoPort for adding the MACRO for enhance code --- src/test_l1_dsVideoPort.c | 519 ++++++++------------------------------ 1 file changed, 99 insertions(+), 420 deletions(-) diff --git a/src/test_l1_dsVideoPort.c b/src/test_l1_dsVideoPort.c index fab2fc5e..fb6d3347 100644 --- a/src/test_l1_dsVideoPort.c +++ b/src/test_l1_dsVideoPort.c @@ -91,6 +91,21 @@ static int gTestID = 1; }\ }\ +/* Global flags to support features */ +static bool extendedEnumsSupported=false; //Default to not supported + +#define CHECK_FOR_EXTENDED_ERROR_CODE( result, enhanced, old )\ +{\ + if ( extendedEnumsSupported == true )\ + {\ + UT_ASSERT_EQUAL( result, enhanced );\ + }\ + else\ + {\ + UT_ASSERT_EQUAL( result, old );\ + }\ +} + /** * @brief Ensure dsVideoPortInit() returns correct status codes during positive scenarios * @@ -171,11 +186,7 @@ void test_l1_dsVideoPort_negative_dsVideoPortInit(void) { // Step 02: Attempt to initialize again without terminating the first initialization status = dsVideoPortInit(); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_ALREADY_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_GENERAL); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_ALREADY_INITIALIZED, dsERR_GENERAL); // Step 03: Terminate video port system status = dsVideoPortTerm(); @@ -263,11 +274,7 @@ void test_l1_dsVideoPort_negative_dsVideoPortTerm(void) { // Step 01: Attempt to terminate the video port without prior initialization status = dsVideoPortTerm(); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 02: Initialize the video port system status = dsVideoPortInit(); @@ -279,11 +286,7 @@ void test_l1_dsVideoPort_negative_dsVideoPortTerm(void) { // Step 04: Attempt to terminate the video port again after termination status = dsVideoPortTerm(); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -384,11 +387,7 @@ void test_l1_dsVideoPort_negative_dsGetVideoPort(void) { // Step 01: Attempt to get the Video Port handle without initializing status = dsGetVideoPort(kPorts[0].id.type, kPorts[0].id.index, &(handle[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -397,11 +396,7 @@ void test_l1_dsVideoPort_negative_dsGetVideoPort(void) { // Step 03: Attempt to get the Video Port handle with invalid port type for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(dsVIDEOPORT_TYPE_MAX, kPorts[i].id.index, &(handle[i])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_OPERATION_NOT_SUPPORTED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_OPERATION_NOT_SUPPORTED, dsERR_INVALID_PARAM); } // Step 04: Attempt to get the Video Port handle invalid port index @@ -422,11 +417,7 @@ void test_l1_dsVideoPort_negative_dsGetVideoPort(void) { // Step 07: Attempt to get the video port handle again after termination status = dsGetVideoPort(kPorts[0].id.type, kPorts[0].id.index, &(handle[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -537,11 +528,7 @@ void test_l1_dsVideoPort_negative_dsIsVideoPortEnabled(void) { // Step 01: Attempt to check enabled status without initialization status = dsIsVideoPortEnabled(-1, &enabled[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -570,11 +557,7 @@ void test_l1_dsVideoPort_negative_dsIsVideoPortEnabled(void) { // Step 07: Check enabled status after termination status = dsIsVideoPortEnabled(handle[0], &enabled[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -684,11 +667,7 @@ void test_l1_dsVideoPort_negative_dsIsDisplayConnected(void) { // Step 01: Attempt to check connection status without initialization status = dsIsDisplayConnected(-1 , &(connected[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -716,11 +695,7 @@ void test_l1_dsVideoPort_negative_dsIsDisplayConnected(void) { // Step 07: Check connection status after termination status = dsIsDisplayConnected(handle[0], &connected[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -829,11 +804,7 @@ void test_l1_dsVideoPort_negative_dsIsDisplaySurround(void) { // Step 01: Attempt to check audio surround support without initialization status = dsIsDisplaySurround(-1, &surround[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -861,11 +832,7 @@ void test_l1_dsVideoPort_negative_dsIsDisplaySurround(void) { // Step 07: Check audio surround support after termination status = dsIsDisplaySurround(handle[0], &surround[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -976,11 +943,7 @@ void test_l1_dsVideoPort_negative_dsGetSurroundMode(void) { // Step 01: Attempt to get surround mode without initialization status = dsGetSurroundMode(-1, &surroundMode[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -1008,11 +971,7 @@ void test_l1_dsVideoPort_negative_dsGetSurroundMode(void) { // Step 07: Attempt to get surround mode after termination status = dsGetSurroundMode(handle[0], &surroundMode[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1124,11 +1083,7 @@ void test_l1_dsVideoPort_negative_dsIsVideoPortActive(void) { // Step 01: Attempt to check active status without initialization status = dsIsVideoPortActive(-1, &active[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -1156,11 +1111,7 @@ void test_l1_dsVideoPort_negative_dsIsVideoPortActive(void) { // Step 07: Attempt to check active status after termination status = dsIsVideoPortActive(handle[0], &active[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1256,11 +1207,7 @@ void test_l1_dsVideoPort_negative_dsEnableDTCP(void) { // Step 01: Attempt to enable DTCP without initialization status = dsEnableDTCP(-1, enableDTCP); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -1282,11 +1229,7 @@ void test_l1_dsVideoPort_negative_dsEnableDTCP(void) { // Step 06: Attempt to enable DTCP after termination status = dsEnableDTCP(handle[0], enableDTCP); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1387,11 +1330,7 @@ void test_l1_dsVideoPort_negative_dsEnableHDCP(void) { // Step 01: Attempt to enable HDCP without initialization status = dsEnableHDCP(-1, enableHDCP, hdcpKey, keySize); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -1421,11 +1360,7 @@ void test_l1_dsVideoPort_negative_dsEnableHDCP(void) { // Step 08: Attempt to enable HDCP after termination status = dsEnableHDCP(handle[0], enableHDCP, hdcpKey, keySize); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1535,11 +1470,7 @@ void test_l1_dsVideoPort_negative_dsIsDTCPEnabled(void) { // Step 01: Attempt to get DTCP status without initialization status = dsIsDTCPEnabled(-1, &isDTCPEnabled[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -1567,11 +1498,7 @@ void test_l1_dsVideoPort_negative_dsIsDTCPEnabled(void) { // Step 07: Attempt to get DTCP status after termination status = dsIsDTCPEnabled(handle[0], &isDTCPEnabled[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1681,11 +1608,7 @@ void test_l1_dsVideoPort_negative_dsIsHDCPEnabled(void) { // Step 01: Attempt to get HDCP status without initialization status = dsIsHDCPEnabled(-1, &(contentProtected[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -1713,11 +1636,7 @@ void test_l1_dsVideoPort_negative_dsIsHDCPEnabled(void) { // Step 07: Attempt to get HDCP status after termination status = dsIsHDCPEnabled(handle[0], &(contentProtected[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1811,11 +1730,7 @@ void test_l1_dsVideoPort_negative_dsEnableVideoPort(void) { // Step 01: Attempt to enable/disable video port without initialization status = dsEnableVideoPort(-1, enabled); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -1837,11 +1752,7 @@ void test_l1_dsVideoPort_negative_dsEnableVideoPort(void) { // Step 06: Attempt to enable/disable video port after termination status = dsEnableVideoPort(handle[0], enabled); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1940,11 +1851,7 @@ void test_l1_dsVideoPort_negative_dsSetResolution(void) { // Step 01: Attempt to set resolution without initialization status = dsSetResolution(-1, &(kResolutions[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -1979,11 +1886,7 @@ void test_l1_dsVideoPort_negative_dsSetResolution(void) { // Step 08: Attempt to set resolution after termination status = dsSetResolution(handle[0], &(kResolutions[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2098,11 +2001,7 @@ void test_l1_dsVideoPort_negative_dsGetResolution(void) { // Step 01: Attempt to get resolution without initialization status = dsGetResolution(-1, &(resolution[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -2130,11 +2029,7 @@ void test_l1_dsVideoPort_negative_dsGetResolution(void) { // Step 07: Attempt to get resolution after termination status = dsGetResolution(handle[0], &(resolution[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2226,11 +2121,7 @@ void test_l1_dsVideoPort_negative_dsSetActiveSource(void) { // Step 01: Attempt to set active source without initialization status = dsSetActiveSource(-1); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -2252,11 +2143,7 @@ void test_l1_dsVideoPort_negative_dsSetActiveSource(void) { // Step 06: Attempt to set active source after termination status = dsSetActiveSource(handle[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2341,11 +2228,7 @@ void test_l1_dsVideoPort_negative_dsVideoFormatUpdateRegisterCB(void) { // Step 01: Attempt to register callback without initialization status = dsVideoFormatUpdateRegisterCB(mockVideoFormatCallback); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -2361,11 +2244,7 @@ void test_l1_dsVideoPort_negative_dsVideoFormatUpdateRegisterCB(void) { // Step 05: Attempt to register callback after termination status = dsVideoFormatUpdateRegisterCB(mockVideoFormatCallback); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2468,11 +2347,7 @@ void test_l1_dsVideoPort_negative_dsRegisterHdcpStatusCallback(void) { // Step 01: Attempt to register HDCP status callback without initialization status = dsRegisterHdcpStatusCallback(-1, validHdcpStatusCallback); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -2499,11 +2374,7 @@ void test_l1_dsVideoPort_negative_dsRegisterHdcpStatusCallback(void) { // Step 07: Attempt to register HDCP status callback after termination status = dsRegisterHdcpStatusCallback(handle[0], validHdcpStatusCallback); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2614,11 +2485,7 @@ void test_l1_dsVideoPort_negative_dsGetHDCPStatus(void) { // Step 01: Attempt to get HDCP status without initialization status = dsGetHDCPStatus(-1, &(hdcpStatus[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -2646,11 +2513,7 @@ void test_l1_dsVideoPort_negative_dsGetHDCPStatus(void) { // Step 07: Attempt to get HDCP status after termination status = dsGetHDCPStatus(handle[0], &(hdcpStatus[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2761,11 +2624,7 @@ void test_l1_dsVideoPort_negative_dsGetHDCPProtocol(void) { // Step 01: Attempt to get HDCP protocol without initialization status = dsGetHDCPProtocol(-1, &(protocolVersion[0])); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -2793,11 +2652,7 @@ void test_l1_dsVideoPort_negative_dsGetHDCPProtocol(void) { // Step 07: Attempt to get HDCP protocol after termination status = dsGetHDCPProtocol(handle[0], &protocolVersion[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2909,11 +2764,7 @@ void test_l1_dsVideoPort_negative_dsGetHDCPReceiverProtocol(void) { // Step 01: Attempt to get Receiver HDCP protocol without initialization status = dsGetHDCPReceiverProtocol(-1, &receiverProtocolVersion[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -2941,11 +2792,7 @@ void test_l1_dsVideoPort_negative_dsGetHDCPReceiverProtocol(void) { // Step 07: Attempt to get Receiver HDCP protocol after termination status = dsGetHDCPReceiverProtocol(handle[0], &receiverProtocolVersion[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3056,11 +2903,7 @@ void test_l1_dsVideoPort_negative_dsGetHDCPCurrentProtocol(void) { // Step 01: Attempt to get current negotiated HDCP protocol without initialization status = dsGetHDCPCurrentProtocol(-1, ¤tProtocolVersion[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -3088,11 +2931,7 @@ void test_l1_dsVideoPort_negative_dsGetHDCPCurrentProtocol(void) { // Step 07: Attempt to get current negotiated HDCP protocol after termination status = dsGetHDCPCurrentProtocol(handle[0], ¤tProtocolVersion[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3203,11 +3042,7 @@ void test_l1_dsVideoPort_negative_dsGetTVHDRCapabilities(void) { // Step 01: Attempt to get HDR capabilities without initialization status = dsGetTVHDRCapabilities(-1, &capabilities[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -3235,11 +3070,7 @@ void test_l1_dsVideoPort_negative_dsGetTVHDRCapabilities(void) { // Step 07: Attempt to get HDR capabilities after termination status = dsGetTVHDRCapabilities(handle[0], &capabilities[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3350,11 +3181,7 @@ void test_l1_dsVideoPort_negative_dsSupportedTvResolutions(void) { // Step 01: Attempt to get supported resolutions without initialization status = dsSupportedTvResolutions(-1, &resolutions[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -3382,11 +3209,7 @@ void test_l1_dsVideoPort_negative_dsSupportedTvResolutions(void) { // Step 07: Attempt to get supported resolutions after termination status = dsSupportedTvResolutions(handle[0], &resolutions[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3482,11 +3305,7 @@ void test_l1_dsVideoPort_negative_dsSetForceDisable4KSupport(void) { // Step 01: Attempt to set force disable 4K support without initialization status = dsSetForceDisable4KSupport(-1, disable4K); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -3508,11 +3327,7 @@ void test_l1_dsVideoPort_negative_dsSetForceDisable4KSupport(void) { // Step 06: Attempt to set force disable 4K support after termination status = dsSetForceDisable4KSupport(handle[0], disable4K); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3623,11 +3438,7 @@ void test_l1_dsVideoPort_negative_dsGetForceDisable4KSupport(void) { // Step 01: Attempt to get 4K support status without initialization status = dsGetForceDisable4KSupport(-1, &disable4K[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -3655,11 +3466,7 @@ void test_l1_dsVideoPort_negative_dsGetForceDisable4KSupport(void) { // Step 07: Attempt to get 4K support status after termination status = dsGetForceDisable4KSupport(handle[0], &disable4K[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3770,11 +3577,7 @@ void test_l1_dsVideoPort_negative_dsGetVideoEOTF(void) { // Step 01: Attempt to get EOTF without initialization status = dsGetVideoEOTF(-1, &eotf[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -3802,11 +3605,7 @@ void test_l1_dsVideoPort_negative_dsGetVideoEOTF(void) { // Step 07: Attempt to get EOTF after termination status = dsGetVideoEOTF(handle[0], &eotf[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -3917,11 +3716,7 @@ void test_l1_dsVideoPort_negative_dsGetMatrixCoefficients(void) { // Step 01: Attempt to get matrix coefficients without initialization status = dsGetMatrixCoefficients(-1, &matrixCoefficients[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -3949,11 +3744,7 @@ void test_l1_dsVideoPort_negative_dsGetMatrixCoefficients(void) { // Step 07: Attempt to get matrix coefficients after termination status = dsGetMatrixCoefficients(handle[0], &matrixCoefficients[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4064,11 +3855,7 @@ void test_l1_dsVideoPort_negative_dsGetColorDepth(void) { // Step 01: Attempt to get color depth without initialization status = dsGetColorDepth(-1, &colorDepth[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -4096,11 +3883,7 @@ void test_l1_dsVideoPort_negative_dsGetColorDepth(void) { // Step 07: Attempt to get color depth after termination status = dsGetColorDepth(handle[0], &colorDepth[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4210,11 +3993,7 @@ void test_l1_dsVideoPort_negative_dsGetColorSpace(void) { // Step 01: Attempt to get color space without initialization status = dsGetColorSpace(-1, &colorSpace[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -4242,11 +4021,7 @@ void test_l1_dsVideoPort_negative_dsGetColorSpace(void) { // Step 07: Attempt to get color space after termination status = dsGetColorSpace(handle[0], &colorSpace[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4355,11 +4130,7 @@ void test_l1_dsVideoPort_negative_dsGetQuantizationRange(void) { // Step 01: Attempt to get quantization range without initialization status = dsGetQuantizationRange(-1, &quantizationRange[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -4387,11 +4158,7 @@ void test_l1_dsVideoPort_negative_dsGetQuantizationRange(void) { // Step 07: Attempt to get quantization range after termination status = dsGetQuantizationRange(handle[0], &quantizationRange[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4524,11 +4291,7 @@ void test_l1_dsVideoPort_negative_dsGetCurrentOutputSettings(void) { // Step 01: Attempt to get output settings without initialization status = dsGetCurrentOutputSettings(-1, &hdrstandardarray[0], &matrixcoefarray[0], &colorspacearray[0],\ &colordeptharray[0], &quant_rangearray[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -4587,11 +4350,7 @@ void test_l1_dsVideoPort_negative_dsGetCurrentOutputSettings(void) { // Step 11: Attempt to get output settings after termination status = dsGetCurrentOutputSettings(handle[0], &hdrstandardarray[0], &matrixcoefarray[0], &colorspacearray[0],\ &colordeptharray[0], &quant_rangearray[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4703,11 +4462,7 @@ void test_l1_dsVideoPort_negative_dsIsOutputHDR(void) { // Step 01: Attempt to check HDR status without initialization status = dsIsOutputHDR(-1, &hdrStatus[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -4735,11 +4490,7 @@ void test_l1_dsVideoPort_negative_dsIsOutputHDR(void) { // Step 07: Attempt to check HDR status after termination status = dsIsOutputHDR(handle[0], &hdrStatus[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4819,11 +4570,7 @@ void test_l1_dsVideoPort_negative_dsResetOutputToSDR(void) { // Step 01: Attempt reset without initialization status = dsResetOutputToSDR(); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_NONE); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -4835,11 +4582,7 @@ void test_l1_dsVideoPort_negative_dsResetOutputToSDR(void) { // Step 04: Attempt reset after termination status = dsResetOutputToSDR(); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_NONE); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -4938,11 +4681,7 @@ void test_l1_dsVideoPort_negative_dsSetHdmiPreference(void) { // Step 01: Attempt set HDMI preference without initialization status = dsSetHdmiPreference(-1, &in_range); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -4970,11 +4709,7 @@ void test_l1_dsVideoPort_negative_dsSetHdmiPreference(void) { // Step 07: Attempt set HDMI preference after termination status = dsSetHdmiPreference(handle[0], &in_range); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5085,11 +4820,7 @@ void test_l1_dsVideoPort_negative_dsGetHdmiPreference(void) { // Step 01: Attempt to get HDMI preference without initialization status = dsGetHdmiPreference(-1, &hdcpCurrentProtocol[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -5117,11 +4848,7 @@ void test_l1_dsVideoPort_negative_dsGetHdmiPreference(void) { // Step 07: Attempt to get HDMI preference after termination status = dsGetHdmiPreference(handle[0], &hdcpCurrentProtocol[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5232,11 +4959,7 @@ void test_l1_dsVideoPort_negative_dsGetIgnoreEDIDStatus(void) { // Step 01: Attempt to get IgnoreEDID status without initialization status = dsGetIgnoreEDIDStatus(-1, &ignoreEDIDStatus[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -5264,11 +4987,7 @@ void test_l1_dsVideoPort_negative_dsGetIgnoreEDIDStatus(void) { // Step 07: Attempt to get IgnoreEDID status after termination status = dsGetIgnoreEDIDStatus(handle[0], &ignoreEDIDStatus[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5363,11 +5082,7 @@ void test_l1_dsVideoPort_negative_dsSetBackgroundColor(void) { // Step 01: Attempt to set background color without initialization status = dsSetBackgroundColor(-1, dsVIDEO_BGCOLOR_BLUE); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -5395,11 +5110,7 @@ void test_l1_dsVideoPort_negative_dsSetBackgroundColor(void) { // Step 07: Attempt to set background color after termination status = dsSetBackgroundColor(handle[0], dsVIDEO_BGCOLOR_BLACK); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5494,11 +5205,7 @@ void test_l1_dsVideoPort_negative_dsSetForceHDRMode(void) { // Step 01: Attempt to set HDR mode without initialization status = dsSetForceHDRMode(-1, dsHDRSTANDARD_HDR10 ); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -5526,11 +5233,7 @@ void test_l1_dsVideoPort_negative_dsSetForceHDRMode(void) { // Step 07: Attempt to set HDR mode after termination status = dsSetForceHDRMode(handle[0], dsHDRSTANDARD_HDR10); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5641,11 +5344,7 @@ void test_l1_dsVideoPort_negative_dsColorDepthCapabilities(void) { // Step 01: Attempt to get capabilities without initialization status = dsColorDepthCapabilities(-1, &colorDepthCapability[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -5673,11 +5372,7 @@ void test_l1_dsVideoPort_negative_dsColorDepthCapabilities(void) { // Step 07: Attempt to get capabilities after termination status = dsColorDepthCapabilities(handle[0], &colorDepthCapability[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5788,11 +5483,7 @@ void test_l1_dsVideoPort_negative_dsGetPreferredColorDepth(void) { // Step 01: Attempt to get color depth without initialization status = dsGetPreferredColorDepth(-1, &colorDepth[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -5820,11 +5511,7 @@ void test_l1_dsVideoPort_negative_dsGetPreferredColorDepth(void) { // Step 07: Attempt to get color depth after termination status = dsGetPreferredColorDepth(handle[0], &colorDepth[0]); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -5919,11 +5606,7 @@ void test_l1_dsVideoPort_negative_dsSetPreferredColorDepth(void) { // Step 01: Attempt to set color depth without initialization status = dsSetPreferredColorDepth(-1, dsDISPLAY_COLORDEPTH_8BIT ); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 02: Initialize video port system status = dsVideoPortInit(); @@ -5951,11 +5634,7 @@ void test_l1_dsVideoPort_negative_dsSetPreferredColorDepth(void) { // Step 07: Attempt to set color depth after termination status = dsSetPreferredColorDepth(handle[0], dsDISPLAY_COLORDEPTH_12BIT ); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(status, dsERR_NOT_INITIALIZED); - #else - UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); - #endif + CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } From 7cbb31d55c63490bd50c9a2ea27d3ef3d8303ba3 Mon Sep 17 00:00:00 2001 From: Sumip98 <167012926+Sumip98@users.noreply.github.com> Date: Thu, 23 May 2024 09:01:37 +0000 Subject: [PATCH 31/38] =?UTF-8?q?Enhanced=20error=20code=20moved=20to=20kv?= =?UTF-8?q?p=C2=A0=20profiler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding macro to check enhanced error code --- src/test_l1_dsDisplay.c | 151 +++++++++++++++------------------------- src/test_l1_dsHost.c | 95 ++++++++++++------------- 2 files changed, 101 insertions(+), 145 deletions(-) diff --git a/src/test_l1_dsDisplay.c b/src/test_l1_dsDisplay.c index 341aa843..ce66201e 100644 --- a/src/test_l1_dsDisplay.c +++ b/src/test_l1_dsDisplay.c @@ -81,6 +81,7 @@ static int gTestGroup = 1; static int gTestID = 1; +static bool extendedEnumsSupported=false; #define DS_ASSERT_AUTO_TERM_NUMERICAL(value, comparison){\ if(value != comparison){\ @@ -98,6 +99,19 @@ static int gTestID = 1; }\ }\ +#define CHECK_FOR_EXTENDED_ERROR_CODE( result, enhanced, old )\ +{\ + if ( extendedEnumsSupported == true )\ + {\ + UT_ASSERT_EQUAL( enhanced, result );\ + }\ + else\ + {\ + UT_ASSERT_EQUAL( old, result );\ + }\ +} + + /** * @brief Ensure dsDisplayInit() initializes the DS Display sub-system correctly during positive scenarios * @@ -184,15 +198,10 @@ void test_l1_dsDisplay_negative_dsDisplayInit(void) { // Step 02: Attempt to initialize the display module again result = dsDisplayInit(); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - UT_ASSERT_EQUAL(result, dsERR_ALREADY_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_ALREADY_INITIALIZED, dsERR_NONE); + UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); + - - // Step 03: Terminate the display module result = dsDisplayTerm(); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); @@ -285,12 +294,9 @@ void test_l1_dsDisplay_negative_dsDisplayTerm(void) { // Step 01: Call dsDisplayTerm() without initializing the display sub-system result = dsDisplayTerm(); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); + UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); + // Step 02: Initialize the display sub-system result = dsDisplayInit(); @@ -304,12 +310,9 @@ void test_l1_dsDisplay_negative_dsDisplayTerm(void) { // Step 04: Call dsDisplayTerm() again after termination result = dsDisplayTerm(); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); + UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -416,12 +419,9 @@ void test_l1_dsDisplay_negative_dsGetDisplay(void) { // Step 01: Call dsGetDisplay() without initializing the display sub-system result = dsGetDisplay(kSupportedPortTypes[0], 0, &displayHandle); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); + UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); + // Step 02: Initialize the display sub-system result = dsDisplayInit(); @@ -431,7 +431,9 @@ void test_l1_dsDisplay_negative_dsGetDisplay(void) { // Step 03: Call dsGetDisplay() with invalid video type result = dsGetDisplay(dsVIDEOPORT_TYPE_MAX, (int)dsVIDEOPORT_TYPE_MAX, &displayHandle); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL( result, dsERR_INVALID_PARAM); + + // Step 04: Call dsGetDisplay() with invalid index result = dsGetDisplay(kSupportedPortTypes[0], -1, &displayHandle); @@ -450,12 +452,10 @@ void test_l1_dsDisplay_negative_dsGetDisplay(void) { // Step 07: Call dsGetDisplay() again after termination result = dsGetDisplay(kSupportedPortTypes[0], 0, &displayHandle); -#ifdef ENABLE_ENHANCED_ERROR_CODE + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -581,12 +581,9 @@ void test_l1_dsDisplay_negative_dsGetEDID(void) { // Step 01: Call dsGetEDID() without initializing the display sub-system result = dsGetEDID(displayHandle, edid); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); + UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); + // Step 02: Initialize the display sub-system result = dsDisplayInit(); @@ -600,7 +597,9 @@ void test_l1_dsDisplay_negative_dsGetEDID(void) { // Step 04: Call dsGetEDID() with an invalid handle result = dsGetEDID((intptr_t)NULL, edid); - UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); + + // Step 05: Call dsGetEDID() with a NULL dsDisplayEDID_t result = dsGetEDID(displayHandle, NULL); @@ -614,12 +613,9 @@ void test_l1_dsDisplay_negative_dsGetEDID(void) { // Step 07: Call dsGetEDID() without initializing the display sub-system result = dsGetEDID(displayHandle, edid); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); + UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -757,18 +753,11 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { int length = 0; // Step 01: Call dsGetEDIDBytes() without initializing or obtaining a handle - result = dsGetEDIDBytes(displayHandle, edid, &length); -#ifdef ENABLE_ENHANCED_ERROR_CODE + result = dsGetEDIDBytes(displayHandle, edid, &length); + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - if(result != dsERR_NOT_INITIALIZED) - { - UT_FAIL("Incorrect error return"); - free(edid); - return; - } -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + + // Step 02: Initialize the display sub-system result = dsDisplayInit(); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); @@ -826,19 +815,10 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { // Step 08: Call dsGetEDIDBytes() without initializing or obtaining a handle result = dsGetEDIDBytes(displayHandle, edid, &length); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - if(result != dsERR_NOT_INITIALIZED) - { - UT_FAIL("ncorrect error return"); - free(edid); - return; - } + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); - free(edid); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); @@ -947,14 +927,9 @@ void test_l1_dsDisplay_negative_dsGetDisplayAspectRatio(void) { // Step 01: Call dsGetDisplayAspectRatio() without initializing the display sub-system result = dsGetDisplayAspectRatio(displayHandle, &aspectRatio); - -#ifdef ENABLE_ENHANCED_ERROR_CODE + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif - + // Step 02: Initialize the display sub-system result = dsDisplayInit(); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); @@ -981,13 +956,9 @@ void test_l1_dsDisplay_negative_dsGetDisplayAspectRatio(void) { // Step 07: Call dsGetDisplayAspectRatio() without initializing the display sub-system result = dsGetDisplayAspectRatio(displayHandle, &aspectRatio); -#ifdef ENABLE_ENHANCED_ERROR_CODE + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif - + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1088,13 +1059,9 @@ void test_l1_dsDisplay_negative_dsRegisterDisplayEventCallback(void) { // Step 01: Call dsRegisterDisplayEventCallback() without initializing the display sub-system result = dsRegisterDisplayEventCallback(displayHandle, testDisplayCallback); -#ifdef ENABLE_ENHANCED_ERROR_CODE + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); - -#endif + // Step 02: Initialize the display sub-system result = dsDisplayInit(); @@ -1123,12 +1090,9 @@ void test_l1_dsDisplay_negative_dsRegisterDisplayEventCallback(void) { // Step 06: Call dsRegisterDisplayEventCallback() without reinitializing the display sub-system result = dsRegisterDisplayEventCallback(displayHandle, testDisplayCallback); -#ifdef ENABLE_ENHANCED_ERROR_CODE + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1166,7 +1130,8 @@ int test_l1_dsDisplay_register ( void ) UT_add_test( pSuite, "dsGetDisplayAspectRatio_L1_negative" ,test_l1_dsDisplay_negative_dsGetDisplayAspectRatio ); UT_add_test( pSuite, "dsRegisterDisplayEventCallback_L1_positive" ,test_l1_dsDisplay_positive_dsRegisterDisplayEventCallback ); UT_add_test( pSuite, "dsRegisterDisplayEventCallback_L1_negative" ,test_l1_dsDisplay_negative_dsRegisterDisplayEventCallback ); - + + extendedEnumsSupported = ut_kvp_getBoolField( ut_kvp_profile_getInstance(), "dsDisplay/features/extendedEnumsSupported" ); return 0; } diff --git a/src/test_l1_dsHost.c b/src/test_l1_dsHost.c index c2ae537f..5ff58324 100644 --- a/src/test_l1_dsHost.c +++ b/src/test_l1_dsHost.c @@ -71,6 +71,7 @@ #include #include +#include #include #include #include "dsHost.h" @@ -79,6 +80,10 @@ static int gTestGroup = 1; static int gTestID = 1; +/* Global flags to support features */ +static bool extendedEnumsSupported=false; //Default to not supported + + #define DS_ASSERT_AUTO_TERM_NUMERICAL(value, comparison){\ if(value != comparison){\ UT_LOG("\n In %s Comparison: [%d = %d]\n", __FUNCTION__, value, comparison);\ @@ -95,6 +100,20 @@ static int gTestID = 1; }\ }\ +#define CHECK_FOR_EXTENDED_ERROR_CODE( result, enhanced, old )\ +{\ + if ( extendedEnumsSupported == true )\ + {\ + UT_ASSERT_EQUAL( enhanced, result );\ + }\ + else\ + {\ + UT_ASSERT_EQUAL( old, result );\ + }\ +} + + + /** * @brief Ensure dsHostInit() returns correct error codes during positive scenarios * @@ -174,12 +193,9 @@ void test_l1_dsHost_negative_dsHostInit(void) { // Step 02: Call dsHostInit() Attempt to initialize dsHost again result = dsHostInit(); - #ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_ALREADY_INITIALIZED); + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_ALREADY_INITIALIZED, dsERR_NONE); UT_LOG("Step 02: Attempt to initialize dsHost again -> Expected: dsERR_ALREADY_INITIALIZED, Got: %d\n", result); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + // Step 03: Call dsHostTerm() Terminate dsHost result = dsHostTerm(); @@ -263,12 +279,9 @@ void test_l1_dsHost_negative_dsHostTerm(void) { // Step 01: dsHostTerm() Attempt to terminate dsHost without initialization dsError_t result = dsHostTerm(); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - UT_LOG("Step 01: Attempt to terminate dsHost without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); + UT_LOG("Step 01: Attempt to terminate dsHost without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); + // Step 02: dsHostInit() Initialize dsHost result = dsHostInit(); @@ -282,12 +295,9 @@ void test_l1_dsHost_negative_dsHostTerm(void) { // Step 04: dsHostTerm() Attempt to terminate dsHost again result = dsHostTerm(); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - UT_LOG("Step 04: Attempt to terminate dsHost again -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); + UT_LOG("Step 04: Attempt to terminate dsHost again -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); + UT_LOG("\n Out %s\n",__FUNCTION__); } @@ -371,12 +381,9 @@ void test_l1_dsHost_negative_dsGetCPUTemperature(void) { // Step 01: dsGetCPUTemperature() Call without prior initialization dsError_t result = dsGetCPUTemperature(&temperatureValue); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - UT_LOG("Step 01: Fetch CPU Temperature without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); + UT_LOG("Step 01: Fetch CPU Temperature without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); + // Step 02: dsHostInit() Initialize dsHost result = dsHostInit(); @@ -396,13 +403,9 @@ void test_l1_dsHost_negative_dsGetCPUTemperature(void) { // Step 05: dsGetCPUTemperature() Call after termination result = dsGetCPUTemperature(&temperatureValue); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - UT_LOG("Step 05: Fetch CPU Temperature after termination -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif - UT_LOG("\n Out %s\n",__FUNCTION__); + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); + UT_LOG("Step 05: Fetch CPU Temperature after termination -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); + UT_LOG("\n Out %s\n",__FUNCTION__); } /** @@ -492,12 +495,9 @@ void test_l1_dsHost_negative_dsGetSocIDFromSDK(void) { // Step 01: dsGetSocIDFromSDK() Call without prior initialization dsError_t result = dsGetSocIDFromSDK(socID); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("Step 01: Fetch SOC ID without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + // Step 02: dsHostInit() Initialize dsHost result = dsHostInit(); @@ -516,13 +516,10 @@ void test_l1_dsHost_negative_dsGetSocIDFromSDK(void) { // Step 05: dsGetSocIDFromSDK() Call after termination result = dsGetSocIDFromSDK(socID); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); - UT_LOG("Step 05: Fetch SOC ID after termination -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif - UT_LOG("\n Out %s\n",__FUNCTION__); + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); + UT_LOG("Step 05: Fetch SOC ID after termination -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); + + UT_LOG("\n Out %s\n",__FUNCTION__); } /** @@ -616,12 +613,8 @@ void test_l1_dsHost_negative_dsGetHostEDID(void) { // Step 01: dsGetHostEDID() Call without prior initialization dsError_t result = dsGetHostEDID(edid, &length); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("Step 01: Fetch Host EDID without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif // Step 02: dsHostInit() Initialize dsHost result = dsHostInit(); @@ -645,12 +638,9 @@ void test_l1_dsHost_negative_dsGetHostEDID(void) { // Step 06: dsGetHostEDID() Call after termination result = dsGetHostEDID(edid, &length); -#ifdef ENABLE_ENHANCED_ERROR_CODE - UT_ASSERT_EQUAL(result, dsERR_NOT_INITIALIZED); + CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("Step 05: Fetch Host EDID after termination -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); -#else - UT_ASSERT_EQUAL(result, dsERR_NONE); -#endif + UT_LOG("\n Out %s\n",__FUNCTION__); } @@ -690,6 +680,7 @@ int test_l1_dsHost_register ( void ) UT_add_test( pSuite2, "dsGetHostEDID_L1_positive" ,test_l1_dsHost_positive_dsGetHostEDID ); UT_add_test( pSuite2, "dsGetHostEDID_L1_negative" ,test_l1_dsHost_negative_dsGetHostEDID ); + extendedEnumsSupported = ut_kvp_getBoolField( ut_kvp_profile_getInstance(), "dsHost/features/extendedEnumsSupported" ); return 0; } From e8a95ccf46dfee378ab7f0d0de2269ca5fcc4fc1 Mon Sep 17 00:00:00 2001 From: akhilbhas <13413713+akhilbhas@users.noreply.github.com> Date: Thu, 23 May 2024 14:48:06 +0530 Subject: [PATCH 32/38] Enhanced Error Code Profile * Adding profile YAML file for device settings * Adding function to get the profile in dsVideoPort.c --- ...viceSettingsExtendedEnumsNotSupported.yaml | 19 +++++++++++++++++++ src/test_l1_dsVideoPort.c | 2 ++ 2 files changed, 21 insertions(+) create mode 100644 profile/deviceSettingsExtendedEnumsNotSupported.yaml diff --git a/profile/deviceSettingsExtendedEnumsNotSupported.yaml b/profile/deviceSettingsExtendedEnumsNotSupported.yaml new file mode 100644 index 00000000..00a95f37 --- /dev/null +++ b/profile/deviceSettingsExtendedEnumsNotSupported.yaml @@ -0,0 +1,19 @@ +--- +dsAudio: + features: + extendedEnumsSupported: false +dsHdmiIn: + features: + extendedEnumsSupported: false +dsVideoDevice: + features: + extendedEnumsSupported: false +dsDisplay: + features: + extendedEnumsSupported: false +dsHost: + features: + extendedEnumsSupported: false +dsVideoPort: + features: + extendedEnumsSupported: false \ No newline at end of file diff --git a/src/test_l1_dsVideoPort.c b/src/test_l1_dsVideoPort.c index fb6d3347..922447a2 100644 --- a/src/test_l1_dsVideoPort.c +++ b/src/test_l1_dsVideoPort.c @@ -5740,6 +5740,8 @@ int test_l1_dsVideoPort_register ( void ) UT_add_test( pSuite, "dsGetPreferredColorDepth_L1_negative" ,test_l1_dsVideoPort_negative_dsGetPreferredColorDepth ); UT_add_test( pSuite, "dsSetPreferredColorDepth_L1_positive" ,test_l1_dsVideoPort_positive_dsSetPreferredColorDepth ); UT_add_test( pSuite, "dsSetPreferredColorDepth_L1_negative" ,test_l1_dsVideoPort_negative_dsSetPreferredColorDepth ); + + extendedEnumsSupported = ut_kvp_getBoolField( ut_kvp_profile_getInstance(), "dsVideoPort/features/extendedEnumsSupported" ); return 0; From 5a9edafea79915ab6a4cb902f76450c6b9855cfc Mon Sep 17 00:00:00 2001 From: akhilbhas <13413713+akhilbhas@users.noreply.github.com> Date: Thu, 23 May 2024 15:40:13 +0530 Subject: [PATCH 33/38] gh #43 Enhanced Error code kvp profile * Adding the ut header file to remove build warnings * Renaming yaml path --- .../deviceSettingsExtendedEnumsNotSupported.yaml | 0 src/test_l1_dsAudio.c | 1 + src/test_l1_dsDisplay.c | 1 + src/test_l1_dsHdmiIn.c | 1 + src/test_l1_dsHost.c | 2 +- src/test_l1_dsVideoDevice.c | 1 + src/test_l1_dsVideoPort.c | 1 + 7 files changed, 6 insertions(+), 1 deletion(-) rename {profile => profiles}/deviceSettingsExtendedEnumsNotSupported.yaml (100%) diff --git a/profile/deviceSettingsExtendedEnumsNotSupported.yaml b/profiles/deviceSettingsExtendedEnumsNotSupported.yaml similarity index 100% rename from profile/deviceSettingsExtendedEnumsNotSupported.yaml rename to profiles/deviceSettingsExtendedEnumsNotSupported.yaml diff --git a/src/test_l1_dsAudio.c b/src/test_l1_dsAudio.c index 824bd469..9b3f7b22 100644 --- a/src/test_l1_dsAudio.c +++ b/src/test_l1_dsAudio.c @@ -75,6 +75,7 @@ #include "dsAudioSettings.h" #include #include +#include #define NUM_OF_PORTS (sizeof(kPorts) / sizeof(kPorts[0])) #define MAX_PROFILE_NAME_LEN 10 diff --git a/src/test_l1_dsDisplay.c b/src/test_l1_dsDisplay.c index ce66201e..87977f10 100644 --- a/src/test_l1_dsDisplay.c +++ b/src/test_l1_dsDisplay.c @@ -75,6 +75,7 @@ #include #include +#include #include "stdint.h" #include "dsDisplay.h" #include "dsVideoPortSettings.h" diff --git a/src/test_l1_dsHdmiIn.c b/src/test_l1_dsHdmiIn.c index 264a10be..1438bebc 100644 --- a/src/test_l1_dsHdmiIn.c +++ b/src/test_l1_dsHdmiIn.c @@ -74,6 +74,7 @@ #include #include +#include static int gTestGroup = 1; static int gTestID = 1; diff --git a/src/test_l1_dsHost.c b/src/test_l1_dsHost.c index 5ff58324..571f521d 100644 --- a/src/test_l1_dsHost.c +++ b/src/test_l1_dsHost.c @@ -71,9 +71,9 @@ #include #include -#include #include #include +#include #include "dsHost.h" #include "dsError.h" diff --git a/src/test_l1_dsVideoDevice.c b/src/test_l1_dsVideoDevice.c index 274e73df..3e348f04 100644 --- a/src/test_l1_dsVideoDevice.c +++ b/src/test_l1_dsVideoDevice.c @@ -74,6 +74,7 @@ #include #include +#include #include "dsVideoDevice.h" static int gTestGroup = 1; diff --git a/src/test_l1_dsVideoPort.c b/src/test_l1_dsVideoPort.c index 922447a2..5a26f504 100644 --- a/src/test_l1_dsVideoPort.c +++ b/src/test_l1_dsVideoPort.c @@ -76,6 +76,7 @@ #include #include +#include static int gTestGroup = 1; static int gTestID = 1; From 041fca25b5e8d30931ea38f58f0026bc8156bb47 Mon Sep 17 00:00:00 2001 From: drissya-k <167057835+drissya-k@users.noreply.github.com> Date: Fri, 24 May 2024 09:54:56 +0000 Subject: [PATCH 34/38] gh #43 Enhanced error code moved to kvp profiler Updating macro to check enhanced error code --- src/test_l1_dsHdmiIn.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/test_l1_dsHdmiIn.c b/src/test_l1_dsHdmiIn.c index 1438bebc..ac78f346 100644 --- a/src/test_l1_dsHdmiIn.c +++ b/src/test_l1_dsHdmiIn.c @@ -507,7 +507,7 @@ void test_l1_dsHdmiIn_negative_dsHdmiInSelectPort(void) { UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); // Step 1: Call dsHdmiInSelectPort() without initializing the HDMI input sub-system dsError_t result = dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false); - CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -523,7 +523,7 @@ void test_l1_dsHdmiIn_negative_dsHdmiInSelectPort(void) { // Step 6: Call dsHdmiInSelectPort() after terminating the HDMI input sub-system result = dsHdmiInSelectPort(dsHDMI_IN_PORT_0, false, dsVideoPlane_PRIMARY, false); - CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_INVALID_PARAM); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -1684,7 +1684,7 @@ void test_l1_dsHdmiIn_negative_dsGetHDMISPDInfo(void) { // Step 1: Call dsGetHDMISPDInfo() without initializing the HDMI input sub-system dsError_t result = dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, spdInfo1); - CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_GENERAL); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -1700,7 +1700,7 @@ void test_l1_dsHdmiIn_negative_dsGetHDMISPDInfo(void) { // Step 6: Call dsGetHDMISPDInfo() after terminating the HDMI input sub-system result = dsGetHDMISPDInfo(dsHDMI_IN_PORT_0, spdInfo1); - CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_GENERAL); free(spdInfo1); @@ -2056,7 +2056,7 @@ void test_l1_dsHdmiIn_negative_dsGetSupportedGameFeaturesList(void) { // Step 1: Call dsGetSupportedGameFeaturesList() without initializing the HDMI input sub-system dsSupportedGameFeatureList_t supported_features; dsError_t result = dsGetSupportedGameFeaturesList(&supported_features); - CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_GENERAL); // Step 2: Initialize the HDMI input sub-system using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -2069,7 +2069,7 @@ void test_l1_dsHdmiIn_negative_dsGetSupportedGameFeaturesList(void) { // Step 5: Call dsGetSupportedGameFeaturesList() after terminating the HDMI input sub-system result = dsGetSupportedGameFeaturesList(&supported_features); - CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_NONE); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_GENERAL); UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -2310,7 +2310,8 @@ void test_l1_dsHdmiIn_negative_dsGetEdid2AllmSupport(void) { gTestID = 50; UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID); bool allmSupport; - UT_ASSERT_EQUAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_0, &allmSupport), dsERR_NOT_INITIALIZED); + dsError_t result = dsGetEdid2AllmSupport(dsHDMI_IN_PORT_0, &allmSupport); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_OPERATION_NOT_SUPPORTED); // Step 2: Initialize HDMI input using dsHdmiInInit() UT_ASSERT_EQUAL(dsHdmiInInit(), dsERR_NONE); @@ -2325,7 +2326,8 @@ void test_l1_dsHdmiIn_negative_dsGetEdid2AllmSupport(void) { UT_ASSERT_EQUAL(dsHdmiInTerm(), dsERR_NONE); // Step 6: Call dsGetEdid2AllmSupport() without initializing the HDMI input sub-system again - UT_ASSERT_EQUAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_0, &allmSupport), dsERR_NOT_INITIALIZED); + result = dsGetEdid2AllmSupport(dsHDMI_IN_PORT_0, &allmSupport); + CHECK_FOR_EXTENDED_ERROR_CODE(result, dsERR_NOT_INITIALIZED, dsERR_OPERATION_NOT_SUPPORTED); UT_LOG("\n Out %s\n", __FUNCTION__); } From 34bc7c023eb00cef83a72817d880bfbe70337b8d Mon Sep 17 00:00:00 2001 From: Sumip98 <167012926+Sumip98@users.noreply.github.com> Date: Fri, 24 May 2024 11:16:11 +0000 Subject: [PATCH 35/38] gh #43 Enhanced error code moved to kvp profiler Updating macro to check enhanced error code removed the extra lines added as part of the modification in all APIs --- src/test_l1_dsDisplay.c | 24 +----------------------- src/test_l1_dsHost.c | 5 ----- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/src/test_l1_dsDisplay.c b/src/test_l1_dsDisplay.c index 87977f10..313f9aeb 100644 --- a/src/test_l1_dsDisplay.c +++ b/src/test_l1_dsDisplay.c @@ -202,7 +202,6 @@ void test_l1_dsDisplay_negative_dsDisplayInit(void) { CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_ALREADY_INITIALIZED, dsERR_NONE); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - // Step 03: Terminate the display module result = dsDisplayTerm(); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); @@ -213,7 +212,6 @@ void test_l1_dsDisplay_negative_dsDisplayInit(void) { } - /** * @brief Ensure dsDisplayTerm() terminates the display sub-system correctly during positive scenarios * @@ -298,7 +296,6 @@ void test_l1_dsDisplay_negative_dsDisplayTerm(void) { CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - // Step 02: Initialize the display sub-system result = dsDisplayInit(); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); @@ -314,13 +311,11 @@ void test_l1_dsDisplay_negative_dsDisplayTerm(void) { CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } - /** * @brief Ensure dsGetDisplay() retrieves the handle of the connected display device correctly during positive scenarios * @@ -384,8 +379,6 @@ void test_l1_dsDisplay_positive_dsGetDisplay(void) { } - - /** * @brief Ensure dsGetDisplay() returns correct error codes during negative scenarios * @@ -421,8 +414,7 @@ void test_l1_dsDisplay_negative_dsGetDisplay(void) { // Step 01: Call dsGetDisplay() without initializing the display sub-system result = dsGetDisplay(kSupportedPortTypes[0], 0, &displayHandle); CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); - UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - + UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); // Step 02: Initialize the display sub-system result = dsDisplayInit(); @@ -434,8 +426,6 @@ void test_l1_dsDisplay_negative_dsGetDisplay(void) { UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); UT_ASSERT_EQUAL( result, dsERR_INVALID_PARAM); - - // Step 04: Call dsGetDisplay() with invalid index result = dsGetDisplay(kSupportedPortTypes[0], -1, &displayHandle); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); @@ -456,8 +446,6 @@ void test_l1_dsDisplay_negative_dsGetDisplay(void) { CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - - // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -544,7 +532,6 @@ void test_l1_dsDisplay_positive_dsGetEDID(void) { } - /** * @brief Ensure dsGetEDID() returns correct error codes during negative scenarios * @@ -585,7 +572,6 @@ void test_l1_dsDisplay_negative_dsGetEDID(void) { CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - // Step 02: Initialize the display sub-system result = dsDisplayInit(); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); @@ -600,8 +586,6 @@ void test_l1_dsDisplay_negative_dsGetEDID(void) { result = dsGetEDID((intptr_t)NULL, edid); UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); - - // Step 05: Call dsGetEDID() with a NULL dsDisplayEDID_t result = dsGetEDID(displayHandle, NULL); UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); @@ -758,7 +742,6 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - // Step 02: Initialize the display sub-system result = dsDisplayInit(); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); @@ -820,7 +803,6 @@ void test_l1_dsDisplay_negative_dsGetEDIDBytes(void) { UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - // End of the test UT_LOG("\n Out %s\n", __FUNCTION__); } @@ -986,7 +968,6 @@ void test_l1_dsDisplay_negative_dsGetDisplayAspectRatio(void) { * @note valid ports can be retrieved from kSupportedPortTypes which can be retrieved from dsVideoPortSettings. * */ - void testDisplayCallback(int handle, dsDisplayEvent_t event,void* eventData) { // Callback function logic } @@ -1047,8 +1028,6 @@ void test_l1_dsDisplay_positive_dsRegisterDisplayEventCallback(void) { * * @note The ability to test scenarios like dsERR_OPERATION_NOT_SUPPORTED and dsERR_GENERAL might require specific setup or environment configuration. */ - - void test_l1_dsDisplay_negative_dsRegisterDisplayEventCallback(void) { // Start of the test gTestID = 14; @@ -1063,7 +1042,6 @@ void test_l1_dsDisplay_negative_dsRegisterDisplayEventCallback(void) { CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); - // Step 02: Initialize the display sub-system result = dsDisplayInit(); UT_LOG("\n In %s Return value: [%d]\n", __FUNCTION__, result); diff --git a/src/test_l1_dsHost.c b/src/test_l1_dsHost.c index 571f521d..1b49a7c8 100644 --- a/src/test_l1_dsHost.c +++ b/src/test_l1_dsHost.c @@ -196,7 +196,6 @@ void test_l1_dsHost_negative_dsHostInit(void) { CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_ALREADY_INITIALIZED, dsERR_NONE); UT_LOG("Step 02: Attempt to initialize dsHost again -> Expected: dsERR_ALREADY_INITIALIZED, Got: %d\n", result); - // Step 03: Call dsHostTerm() Terminate dsHost result = dsHostTerm(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -282,7 +281,6 @@ void test_l1_dsHost_negative_dsHostTerm(void) { CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("Step 01: Attempt to terminate dsHost without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); - // Step 02: dsHostInit() Initialize dsHost result = dsHostInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -384,7 +382,6 @@ void test_l1_dsHost_negative_dsGetCPUTemperature(void) { CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("Step 01: Fetch CPU Temperature without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); - // Step 02: dsHostInit() Initialize dsHost result = dsHostInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -395,7 +392,6 @@ void test_l1_dsHost_negative_dsGetCPUTemperature(void) { UT_ASSERT_EQUAL(result, dsERR_INVALID_PARAM); UT_LOG("Step 03: Fetch CPU Temperature with NULL pointer -> Expected: dsERR_INVALID_PARAM, Got: %d\n", result); - // Step 04: dsHostTerm() Terminate dsHost result = dsHostTerm(); UT_ASSERT_EQUAL(result, dsERR_NONE); @@ -498,7 +494,6 @@ void test_l1_dsHost_negative_dsGetSocIDFromSDK(void) { CHECK_FOR_EXTENDED_ERROR_CODE( result, dsERR_NOT_INITIALIZED, dsERR_NONE); UT_LOG("Step 01: Fetch SOC ID without initialization -> Expected: dsERR_NOT_INITIALIZED, Got: %d\n", result); - // Step 02: dsHostInit() Initialize dsHost result = dsHostInit(); UT_ASSERT_EQUAL(result, dsERR_NONE); From cc52c02e87564ae3b24de2f9909c559385fa9648 Mon Sep 17 00:00:00 2001 From: Sumip98 <167012926+Sumip98@users.noreply.github.com> Date: Fri, 31 May 2024 14:00:48 +0100 Subject: [PATCH 36/38] gh #43 Update test_l1_dsVideoPort.c Adding the correct return code for the invalid port type. --- src/test_l1_dsVideoPort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_l1_dsVideoPort.c b/src/test_l1_dsVideoPort.c index 5a26f504..ef750205 100644 --- a/src/test_l1_dsVideoPort.c +++ b/src/test_l1_dsVideoPort.c @@ -397,7 +397,7 @@ void test_l1_dsVideoPort_negative_dsGetVideoPort(void) { // Step 03: Attempt to get the Video Port handle with invalid port type for (int i = 0; i < NUM_OF_PORTS; i++) { status = dsGetVideoPort(dsVIDEOPORT_TYPE_MAX, kPorts[i].id.index, &(handle[i])); - CHECK_FOR_EXTENDED_ERROR_CODE(status, dsERR_OPERATION_NOT_SUPPORTED, dsERR_INVALID_PARAM); + UT_ASSERT_EQUAL(status, dsERR_INVALID_PARAM); } // Step 04: Attempt to get the Video Port handle invalid port index From 8045051129f464018639b37dfa5919c2e7cde5ed Mon Sep 17 00:00:00 2001 From: hari22yuva <56021398+hari22yuva@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:33:37 +0100 Subject: [PATCH 37/38] Updated README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3c82b0e1..402ef508 100644 --- a/README.md +++ b/README.md @@ -49,3 +49,5 @@ This repository contains the Unit Test Suites (L1) for the following submodules - All APIs in each individual sub-module need to be implemented in this current version. If any API is not supported, please add stub implementation with return type dsERR_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. - The configuration/settings file(s) for certain `DS` sub-modules, specific to a platform (templates in [DS HAL README.md](https://github.com/rdkcentral/rdk-halif-device_settings/blob/main/docs/pages/README.md "DS HAL README.md")), should be added in the `profiles/include` directory within the root directory of the DS HAL Test repository. +- 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 deviceSettingsExtendedEnumsNotSupported.yaml` +- Profiles file available in [profile yaml file](./profiles/deviceSettingsExtendedEnumsNotSupported.yaml) From bb5d5098cc96aa3f2511f451a317062d16d62959 Mon Sep 17 00:00:00 2001 From: hari22yuva <56021398+hari22yuva@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:34:42 +0100 Subject: [PATCH 38/38] Bumped CHANGELOG.md - 2.1.0 --- CHANGELOG.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae62c5ad..cadded1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,19 @@ 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). -#### [2.0.0](https://github.com/rdkcentral/rdk-halif-test-device_settings/compare/1.0.3...2.0.0) +#### [2.1.0](https://github.com/rdkcentral/rdk-halif-test-device_settings/compare/2.0.0...2.1.0) + +- gh #43 deviceSettings: Enhanced Error code for device settings [`#45`](https://github.com/rdkcentral/rdk-halif-test-device_settings/pull/45) +- Updated with enhanced error code disabled checked in test_l1_dsAudio.c [`#46`](https://github.com/rdkcentral/rdk-halif-test-device_settings/pull/46) +- updating the dsDisplay test spec [`#13`](https://github.com/rdkcentral/rdk-halif-test-device_settings/pull/13) +- Adding testing scope changes for composite test spec [`#16`](https://github.com/rdkcentral/rdk-halif-test-device_settings/pull/16) +- revert previous commit [`b33cd08`](https://github.com/rdkcentral/rdk-halif-test-device_settings/commit/b33cd0829396c87ad89d39d551e265830425ed5d) +- gh #43 remove DS_ASSERT_AUTO_TERM_NUMERICAL [`0988071`](https://github.com/rdkcentral/rdk-halif-test-device_settings/commit/098807153c12c0183acf9d9aa1a40c2c5d418c4f) +- Enhanced Error code moved to kvp profiler [`52242e0`](https://github.com/rdkcentral/rdk-halif-test-device_settings/commit/52242e000375f66206950208e5a1823ef093f273) + +### [2.0.0](https://github.com/rdkcentral/rdk-halif-test-device_settings/compare/1.0.3...2.0.0) + +> 22 March 2024 - gh #21 L1 TCs for dsSetAudioMixerLevels API [`#22`](https://github.com/rdkcentral/rdk-halif-test-device_settings/pull/22) - gh #21 Replaced DS_ASSERT with UT_ASSERT and review comment addressal [`63cee4e`](https://github.com/rdkcentral/rdk-halif-test-device_settings/commit/63cee4ed3e0d64d3f2db43d4bfd5b09430ef80ff)