Skip to content

Commit

Permalink
Fix gh #78 : Fixing further review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kanjoe24 committed Dec 23, 2024
1 parent 8bb0234 commit ca3715d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
34 changes: 18 additions & 16 deletions tests/src/c_source/ut_test_kvp_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,22 +143,6 @@ void test_ut_kvp_profile_open( void )
{
UT_LOG_STEP( "test_ut_kvp_profile_open - start" );
ut_kvp_profile_open( KVP_VALID_TEST_ASSERT_YAML_FILE );
UT_LOG_STEP( "ut_kvp_profile_open - %s", KVP_VALID_TEST_ASSERT_YAML_FILE);

ut_kvp_instance_t *pInstance;

pInstance = ut_kvp_profile_getInstance();
char* kvpdata = ut_kvp_getData(pInstance);

if(kvpdata != NULL)
{
// Print the emitted KVP string
printf("%s\n", kvpdata);

// Free the emitted KVP string
free(kvpdata);
}

UT_LOG_STEP( "test_ut_kvp_profile_open - end" );
}

Expand Down Expand Up @@ -192,6 +176,8 @@ int test_ut_kvp_profile_cleanup( void )
void test_ut_kvp_get_instance( void )
{
bool result;
bool resultP1;
bool resultP2;
ut_kvp_instance_t *pInstance;

pInstance = ut_kvp_profile_getInstance();
Expand All @@ -206,6 +192,22 @@ void test_ut_kvp_get_instance( void )
// Check for decoding correctly a field from the platformProfile
result = ut_kvp_getBoolField( pInstance, "decodeTest/checkBoolTRUE" );
UT_ASSERT( result == true );
UT_LOG_STEP("Tested for profile : assets/test_kvp.yaml");
resultP1 = ut_kvp_getBoolField( pInstance, "components/0/ResourceList1/0/supportsFeatureX" );
UT_ASSERT( resultP1 == true );
if(resultP1 != true)
{
UT_LOG_ERROR("perhaps platform profile(assets/config-test.yaml) was not passed using -p switch");
}
UT_LOG_STEP("Tested for profile : assets/config-test.yaml");

resultP2 = ut_kvp_getBoolField( pInstance, "5/value" );
UT_ASSERT( resultP2 == true );
if(resultP2 != true)
{
UT_LOG_ERROR("perhaps platform profile(assets/include/5d.yaml) was not passed using -p switch");
}
UT_LOG_STEP("Tested for profile : assets/include/5d.yaml");
}

void register_kvp_profile_testing_functions(void)
Expand Down
2 changes: 1 addition & 1 deletion tests/src/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ mkdir -p ./logs

export LD_LIBRARY_PATH=/usr/lib:/lib:/home/root:${MY_DIR}

./ut-test -l ./logs -p ./assets/test_kvp.yaml $@
./ut-test -l ./logs -p ./assets/test_kvp.yaml -p assets/config-test.yaml -p assets/include/5d.yaml $@


0 comments on commit ca3715d

Please sign in to comment.