Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh #47 L1 Issue Fixes #48

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/test_l1_tvSettings.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <limits.h>

#include <ut.h>
#include <ut_log.h>
Expand All @@ -81,7 +82,8 @@ int gTestID = 1;
#define MAX_VIDEO_FORMAT 20
#define MAX_DIMMING_MODES 20
#define USER_DATA_SIZE 10

#define MIN_MAXGAIN_RANGE (1<<10)
#define MAX_MAXGAIN_RANGE INT_MAX

/* Global flags to support features */
static bool extendedEnumsSupported=false;
Expand Down Expand Up @@ -14239,7 +14241,7 @@ void test_l1_tvSettings_negative_SetCurrentComponentLuma (void)
componentColor = (tvDataComponentColor_t)UT_KVP_PROFILE_GET_UINT32(keyValue);
if((tvDataComponentColor_t) componentColor !=(tvDataComponentColor_t) i)
{
bModeMatched = false;
bModeMatched = true;
break;

}
Expand Down Expand Up @@ -15528,14 +15530,13 @@ void test_l1_tvSettings_positive_GetMaxGainValue (void)
int maxGain = -1;
int maxGainRetry = -1;


/* Step 01: Calling tvsettings initialization and expecting the API to return success */
result = TvInit();
UT_ASSERT_EQUAL_FATAL(result, tvERROR_NONE);

/* Step 02: Calling tvsettings GetMaxGainValue and expectinging the API to return success */
maxGain = GetMaxGainValue();
UT_ASSERT_TRUE( (maxGain >= (2^10)) && ( maxGain <= (2^31)-1) );
UT_ASSERT_TRUE( (maxGain >= MIN_MAXGAIN_RANGE) && ( maxGain <= MAX_MAXGAIN_RANGE));

/* Step 03: Calling tvsettings GetMaxGainValue and expectinging the API to return success */
maxGainRetry = GetMaxGainValue( );
Expand Down Expand Up @@ -15573,19 +15574,20 @@ void test_l1_tvSettings_negative_GetMaxGainValue (void)

tvError_t result = tvERROR_NONE ;
int maxGain = -1;

if (extendedEnumsSupported == true)
{
/* Step 01: Calling tvsettings to Set the GetMaxGainValue for value -1 and the API to return success */
maxGain = GetMaxGainValue();
UT_ASSERT_FALSE((maxGain >= (2 ^ 10)) && (maxGain <= (2 ^ 31) - 1));
UT_ASSERT_FALSE((maxGain >= MIN_MAXGAIN_RANGE) && (maxGain <= MAX_MAXGAIN_RANGE));
}
/* Step 02: Calling tvsettings initialization and expecting the API to return success */
result = TvInit();
UT_ASSERT_EQUAL_FATAL(result, tvERROR_NONE);

/* Step 03: Calling tvsettings to Set the GetMaxGainValue for value -1 and the API to return success */
maxGain = GetMaxGainValue( );
UT_ASSERT_TRUE( (maxGain >= (2^10)) && (maxGain <= (2^31)-1));
maxGain = GetMaxGainValue();
UT_ASSERT_TRUE((maxGain >= MIN_MAXGAIN_RANGE) && (maxGain <= MAX_MAXGAIN_RANGE));

/* Step 04: Calling tvsettings termination and expecting the API to return success */
result = TvTerm();
Expand All @@ -15595,7 +15597,7 @@ void test_l1_tvSettings_negative_GetMaxGainValue (void)
{
/* Step 05: Calling tvsettings to Set the GetMaxGainValue for value -1 and the API to return success */
maxGain = GetMaxGainValue();
UT_ASSERT_FALSE((maxGain >= (2 ^ 10)) && (maxGain <= (2 ^ 31) - 1));
UT_ASSERT_FALSE((maxGain >= MIN_MAXGAIN_RANGE) && (maxGain <= MAX_MAXGAIN_RANGE));
}
UT_LOG("Out %s",__FUNCTION__);
}
Expand Down