Skip to content

Commit

Permalink
gh #138 cleaned for L1
Browse files Browse the repository at this point in the history
  • Loading branch information
thanushreevani authored Aug 28, 2024
1 parent 06bd9e9 commit a08116d
Showing 1 changed file with 0 additions and 112 deletions.
112 changes: 0 additions & 112 deletions src/test_l1_dsHdmiIn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2434,116 +2434,6 @@ void test_l1_dsHdmiIn_negative_dsSetEdid2AllmSupport_sink(void) {
UT_LOG("\n Out %s\n", __FUNCTION__);
}

/**
* @brief Ensure dsGetEdid2AllmSupport() gets the EDID ALLM support correctly during positive scenarios.
*
* **Test Group ID:** Basic: 01@n
* **Test Case ID:** 049@n
*
* **Dependencies:** None@n
* **User Interaction:** None
*
* **Test Procedure:**@n
* |Variation / Step|Description|Test Data|Expected Result|Notes|
* |:--:|-----------|----------|--------------|-----|
* |01|Initialize HDMI input using dsHdmiInInit() | | dsERR_NONE | Should Pass |
* |02|Call dsGetEdid2AllmSupport() with all valid ports, and call the last port twice to verify EDID ALLM support | iHdmiPort: dsHDMI_IN_PORT_0, allmSupport: bool* | dsERR_NONE | Should Pass |
* |03|Compare the returned values from steps 2/3 and verify that they are the same | | success | The values should be the same |
* |04|Call dsGetEdid2AllmSupport() with valid ports | dsERR_OPERATION_NOT_SUPPORTED | For source devices
* |05|Terminate the HDMI input using dsHdmiInTerm() | | dsERR_NONE | Clean up after test |
*
* @note Ensure that the device supports querying of the EDID ALLM feature before running this test.
*
*/
void test_l1_dsHdmiIn_positive_dsGetEdid2AllmSupport_sink(void) {

gTestID = 49;
UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID);
bool allmSupport1 = 0;
bool allmSupport2 = 0;
dsError_t result = dsERR_NONE;
uint8_t numInputPorts = 0;

numInputPorts = UT_KVP_PROFILE_GET_UINT8("dsHdmiIn/numberOfPorts");

// Step 1: Initialize HDMI input using dsHdmiInInit()
UT_ASSERT_EQUAL_FATAL(dsHdmiInInit(), dsERR_NONE);

if (gSourceType == 0) {

// Step 2 to 3: Call dsGetEdid2AllmSupport() to verify EDID ALLM support
for (int port = dsHDMI_IN_PORT_0; port < numInputPorts; port++) {
result = dsGetEdid2AllmSupport(port, &allmSupport1);
UT_ASSERT_EQUAL(result, dsERR_NONE);

result = dsGetEdid2AllmSupport(port, &allmSupport2);
UT_ASSERT_EQUAL(result, dsERR_NONE);

UT_ASSERT_EQUAL(allmSupport1, allmSupport2);
}

} else if (gSourceType == 1) {
// Step 4:Call dsGetEdid2AllmSupport() with valid ports
UT_ASSERT_EQUAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_0, &allmSupport1), dsERR_OPERATION_NOT_SUPPORTED);
}

// Step 5: Terminate the HDMI input using dsHdmiInTerm()
UT_ASSERT_EQUAL_FATAL(dsHdmiInTerm(), dsERR_NONE);

UT_LOG("\n Out %s\n", __FUNCTION__);
}

/**
* @brief Ensure dsGetEdid2AllmSupport() returns correct error codes during negative scenarios.
*
* **Test Group ID:** Basic: 01@n
* **Test Case ID:** 050@n
*
* **Dependencies:** None@n
* **User Interaction:** None
*
* **Test Procedure:**@n
* |Variation / Step|Description|Test Data|Expected Result|Notes|
* |:--:|-----------|----------|--------------|-----|
* |01|Call dsGetEdid2AllmSupport() without initializing the HDMI input sub-system | iHdmiPort: dsHDMI_IN_PORT_0, allmSupport: bool* | dsERR_NOT_INITIALIZED | Should Pass |
* |02|Initialize the HDMI input sub-system using dsHdmiInInit() | | dsERR_NONE | Should Pass |
* |03|Call dsGetEdid2AllmSupport() with invalid inputs | iHdmiPort: dsHDMI_IN_PORT_MAX, allmSupport: bool* | dsERR_INVALID_PARAM | Should Pass |
* |04|Call dsGetEdid2AllmSupport() with invalid inputs | iHdmiPort: dsHDMI_IN_PORT_0, allmSupport: NULL | dsERR_INVALID_PARAM | Should Pass |
* |05|Call dsHdmiInTerm() to ensure deinitialization | | dsERR_NONE | Clean up after test |
* |06|Call dsGetEdid2AllmSupport() without initializing the HDMI input sub-system again | iHdmiPort: dsHDMI_IN_PORT_0, allmSupport: bool* | dsERR_NOT_INITIALIZED | Should Pass |
*
* @note Testing for the `dsERR_OPERATION_NOT_SUPPORTED` and `dsERR_OPERATION_FAILED` might be challenging since it requires a specific scenario where the attempted operation is not supported or fails due to other reasons.
*
*/
void test_l1_dsHdmiIn_negative_dsGetEdid2AllmSupport_sink(void) {

gTestID = 50;
UT_LOG("\n In %s [%02d%03d]\n", __FUNCTION__, gTestGroup, gTestID);
bool allmSupport = false;

// Step 1: Call dsGetEdid2AllmSupport() without initializing the HDMI input sub-system
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_FATAL(dsHdmiInInit(), dsERR_NONE);

// Step 3: Call dsGetEdid2AllmSupport() with invalid inputs
UT_ASSERT_EQUAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_MAX, &allmSupport), dsERR_INVALID_PARAM);

// Step 4: Call dsGetEdid2AllmSupport() with invalid inputs
UT_ASSERT_EQUAL(dsGetEdid2AllmSupport(dsHDMI_IN_PORT_0, NULL), dsERR_INVALID_PARAM);

// Step 5: Terminate the HDMI input using dsHdmiInTerm()
UT_ASSERT_EQUAL_FATAL(dsHdmiInTerm(), dsERR_NONE);

// Step 6: Call dsGetEdid2AllmSupport() without initializing the HDMI input sub-system again
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__);
}

static UT_test_suite_t * pSuite = NULL;
static UT_test_suite_t * pSuite2 = NULL;

Expand Down Expand Up @@ -2640,8 +2530,6 @@ int test_l1_dsHdmiIn_register ( void )
UT_add_test( pSuite, "dsGetSupportedGameFeaturesList_L1_negative" ,test_l1_dsHdmiIn_negative_dsGetSupportedGameFeaturesList_sink );
UT_add_test( pSuite, "dsGetAVLatency_L1_negative" ,test_l1_dsHdmiIn_negative_dsGetAVLatency_sink );
UT_add_test( pSuite, "dsSetEdid2AllmSupport_l1_negative" ,test_l1_dsHdmiIn_negative_dsSetEdid2AllmSupport_sink );
UT_add_test( pSuite2, "dsGetEdid2AllmSupport_l1_positive" ,test_l1_dsHdmiIn_positive_dsGetEdid2AllmSupport_sink );
UT_add_test( pSuite2, "dsGetEdid2AllmSupport_l1_negative" ,test_l1_dsHdmiIn_negative_dsGetEdid2AllmSupport_sink );
UT_add_test( pSuite2, "dsIsHdmiARCPort_L1_negative" ,test_l1_dsHdmiIn_negative_dsIsHdmiARCPort_sink );


Expand Down

0 comments on commit a08116d

Please sign in to comment.