From 27af7d029a4ba7d557c1b11469e0d635a2853278 Mon Sep 17 00:00:00 2001 From: HaseenaSainul Date: Thu, 27 Jul 2023 04:28:46 -0400 Subject: [PATCH] Test app alignment based on change in the static/generated code --- .../core/src/cpp/sdk/ctest/CMakeLists.txt | 2 +- src/sdks/core/src/cpp/sdk/ctest/main.c | 174 +++++++++--------- src/sdks/core/src/cpp/sdk/test/CMakeLists.txt | 11 +- .../cpp/sdk/test/CoreSDKTestGeneratedCode.c | 52 +++--- 4 files changed, 117 insertions(+), 122 deletions(-) diff --git a/src/sdks/core/src/cpp/sdk/ctest/CMakeLists.txt b/src/sdks/core/src/cpp/sdk/ctest/CMakeLists.txt index a21cbfb94..cf6a53d87 100644 --- a/src/sdks/core/src/cpp/sdk/ctest/CMakeLists.txt +++ b/src/sdks/core/src/cpp/sdk/ctest/CMakeLists.txt @@ -54,7 +54,7 @@ target_link_libraries(${TESTAPP} target_include_directories(${TESTAPP} PRIVATE - $ + $ $ $ ) diff --git a/src/sdks/core/src/cpp/sdk/ctest/main.c b/src/sdks/core/src/cpp/sdk/ctest/main.c index 67f572de8..b1451fb79 100644 --- a/src/sdks/core/src/cpp/sdk/ctest/main.c +++ b/src/sdks/core/src/cpp/sdk/ctest/main.c @@ -93,11 +93,11 @@ const char* get_skiprestriction_enum_string(Advertising_SkipRestriction skipRest } static const char deviceNameTestStr[] = "DeviceNameTestStr"; -static void NotifyDeviceNameChange(const void* userData, FireboltTypes_String_t handle) +static void NotifyDeviceNameChange(const void* userData, Firebolt_String_t handle) { if (handle) { - printf("Got new device.name :%s\n", FireboltTypes_String(handle)); - FireboltTypes_StringHandle_Release(handle); + printf("Got new device.name :%s\n", Firebolt_String(handle)); + Firebolt_String_Release(handle); } else { printf("device.name event handle is not valid\n"); } @@ -106,13 +106,13 @@ static void NotifyDeviceNameChange(const void* userData, FireboltTypes_String_t static const char deviceScreenResolutionTestStr[] = "deviceScreenResolutionTestStr"; static void NotifyDeviceScreenResolutionChange(const void* userData, Device_ResolutionArray_t handle) { - if (Device_ResolutionArrayHandle_IsValid(handle) == true) { + if (Device_ResolutionArray_IsValid(handle) == true) { uint32_t size = Device_ResolutionArray_Size(handle); printf("Device ScreenResolutions changed for %d numbers\n", size); for (uint32_t i = 0; i < size; ++i) { printf("New reslution[%d] = %d\n", i, Device_ResolutionArray_Get(handle, i)); } - Device_ResolutionArrayHandle_Release(handle); + Device_ResolutionArray_Release(handle); } else { printf("device.screenresolution event handle is not valid\n"); } @@ -121,11 +121,11 @@ static void NotifyDeviceScreenResolutionChange(const void* userData, Device_Reso static const char accessibilityVoiceGuidanceTestStr[] = "AccessibilityVoiceGuidanceTestStr"; static void NotifyAccessibilityVoiceGuidanceChange(const void* userData, Accessibility_VoiceGuidanceSettings_t handle) { - if (Accessibility_VoiceGuidanceSettingsHandle_IsValid(handle) == true) { + if (Accessibility_VoiceGuidanceSettings_IsValid(handle) == true) { bool enabled = Accessibility_VoiceGuidanceSettings_Get_Enabled(handle); uint32_t speed = Accessibility_VoiceGuidanceSettings_Get_Speed(handle); printf("VoiceGuidanceSettings: Enabled : %d, Speed : %d\n", enabled, speed); - Accessibility_VoiceGuidanceSettingsHandle_Release(handle); + Accessibility_VoiceGuidanceSettings_Release(handle); } else { printf("accessibility.voiceguidance event handle is not valid\n"); } @@ -134,10 +134,10 @@ static void NotifyAccessibilityVoiceGuidanceChange(const void* userData, Accessi static const char discoveryHomeIntentTestStr[] = "DiscoveryHomeIntentTestStr"; static void NotifyOnNavigateToHomeIntent(const void* userData, Intents_HomeIntent_t handle) { - if (Intents_HomeIntentHandle_IsValid(handle) == true) { + if (Intents_HomeIntent_IsValid(handle) == true) { char* action = Intents_HomeIntent_Get_Action(handle); printf("NavigateToHomeIntent: Action: %s\n", action); - Intents_HomeIntentHandle_Release(handle); + Intents_HomeIntent_Release(handle); } else { printf("discovery.onNavigateToChanged HomeIntent event handle is not valid\n"); } @@ -146,10 +146,10 @@ static void NotifyOnNavigateToHomeIntent(const void* userData, Intents_HomeInten static const char discoverySearchIntentTestStr[] = "DiscoverySearchIntentTestStr"; static void NotifyOnNavigateToSearchIntent(const void* userData, Intents_SearchIntent_t handle) { - if (Intents_SearchIntentHandle_IsValid(handle) == true) { + if (Intents_SearchIntent_IsValid(handle) == true) { char* action = Intents_SearchIntent_Get_Action(handle); printf("NavigateToSearchIntent: Action: %s\n", action); - Intents_SearchIntentHandle_Release(handle); + Intents_SearchIntent_Release(handle); } else { printf("discovery.onNavigateTo LauncIntent event handle is not valid\n"); } @@ -180,11 +180,11 @@ int main (int argc, char* argv[]) switch (option) { case 'I': { //Lets get the Device ID - FireboltTypes_String_t handle; + Firebolt_String_t handle; uint32_t result = Device_GetId(&handle); if (result == FireboltSDKErrorNone) { - printf("Device: Id:%s\n\n", FireboltTypes_String(handle)); - FireboltTypes_StringHandle_Release(handle); + printf("Device: Id:%s\n\n", Firebolt_String(handle)); + Firebolt_String_Release(handle); handle = NULL; } else { printf("Failed to get Device ID\n\n"); @@ -196,10 +196,10 @@ int main (int argc, char* argv[]) uint32_t result = Accessibility_GetClosedCaptionsSettings(&handle); if (result == FireboltSDKErrorNone) { - if (Accessibility_ClosedCaptionsSettingsHandle_IsValid(handle) == true) { + if (Accessibility_ClosedCaptionsSettings_IsValid(handle) == true) { printf("ClosedCaption Settings ------------------\n"); Accessibility_ClosedCaptionsStyles_t styleHandle = Accessibility_ClosedCaptionsSettings_Get_Styles(handle); - if (Accessibility_ClosedCaptionsStylesHandle_IsValid(styleHandle)) { + if (Accessibility_ClosedCaptionsStyles_IsValid(styleHandle)) { printf("ClosedCaptionStyles:\n"); char* fontFamily = Accessibility_ClosedCaptionsStyles_Get_FontFamily(styleHandle); printf("\tFontFamily : %s\n", fontFamily); @@ -221,11 +221,11 @@ int main (int argc, char* argv[]) printf("\tTextAlign : %s\n", txAlign); char* txAlignVertical = Accessibility_ClosedCaptionsStyles_Get_TextAlignVertical(styleHandle); printf("\tTextAlignVertical : %s\n", txAlignVertical); - Accessibility_ClosedCaptionsStylesHandle_Release(styleHandle); + Accessibility_ClosedCaptionsStyles_Release(styleHandle); } bool enabled = Accessibility_ClosedCaptionsSettings_Get_Enabled(handle); printf("Enabled: %d\n\n", enabled); - Accessibility_ClosedCaptionsSettingsHandle_Release(handle); + Accessibility_ClosedCaptionsSettings_Release(handle); } else { printf("Invalid ClosedCaptionsSettings_t\n\n"); } @@ -239,11 +239,11 @@ int main (int argc, char* argv[]) uint32_t result = Accessibility_GetVoiceGuidanceSettings(&handle); if (result == FireboltSDKErrorNone) { - if (Accessibility_VoiceGuidanceSettingsHandle_IsValid(handle) == true) { + if (Accessibility_VoiceGuidanceSettings_IsValid(handle) == true) { bool enabled = Accessibility_VoiceGuidanceSettings_Get_Enabled(handle); uint32_t speed = Accessibility_VoiceGuidanceSettings_Get_Speed(handle); printf("VoiceGuidanceSettings: Enabled : %d, Speed : %d\n", enabled, speed); - Accessibility_VoiceGuidanceSettingsHandle_Release(handle); + Accessibility_VoiceGuidanceSettings_Release(handle); } else { printf("Invalid VoiceGuidanceSettings_t\n\n"); } @@ -256,13 +256,13 @@ int main (int argc, char* argv[]) Advertising_AdPolicy_t handle; uint32_t result = Advertising_GetPolicy(&handle); if (result == FireboltSDKErrorNone) { - if (Advertising_AdPolicyHandle_IsValid(handle) == true) { + if (Advertising_AdPolicy_IsValid(handle) == true) { printf("AdPolicy: "); Advertising_SkipRestriction skipRestriction = Advertising_AdPolicy_Get_SkipRestriction(handle); printf("SkipRestriction = %s ", get_skiprestriction_enum_string(skipRestriction)); bool limitAdTracking = Advertising_AdPolicy_Get_LimitAdTracking(handle); printf("LimitAdTracking = %s \n", limitAdTracking? "true" : "false"); - Advertising_AdPolicyHandle_Release(handle); + Advertising_AdPolicy_Release(handle); } else { printf("Invalid Advertising_AdPolicy_t\n\n"); } @@ -272,11 +272,11 @@ int main (int argc, char* argv[]) break; } case 'U': { - FireboltTypes_String_t handle; + Firebolt_String_t handle; uint32_t result = Account_GetUid(&handle); if (result == FireboltSDKErrorNone) { - printf("Account: Uid:%s\n\n", FireboltTypes_String(handle)); - FireboltTypes_StringHandle_Release(handle); + printf("Account: Uid:%s\n\n", Firebolt_String(handle)); + Firebolt_String_Release(handle); handle = NULL; } else { printf("Failed to get Advertising Policy\n\n"); @@ -285,11 +285,11 @@ int main (int argc, char* argv[]) } case 'E': { { - Discovery_EntityInfoResult_t entityInfoResult = Discovery_EntityInfoResultHandle_Acquire(); - Entertainment_EntityInfo_t entityInfo = Entertainment_EntityInfoHandle_Acquire(); + Discovery_EntityInfoResult_t entityInfoResult = Discovery_EntityInfoResult_Acquire(); + Entertainment_EntityInfo_t entityInfo = Entertainment_EntityInfo_Acquire(); //Populate the ContentIdentifiers Object - Entertainment_ContentIdentifiers_t ci = Entertainment_ContentIdentifiersHandle_Acquire(); + Entertainment_ContentIdentifiers_t ci = Entertainment_ContentIdentifiers_Acquire(); Entertainment_ContentIdentifiers_Set_AssetId(ci, "12345678"); Entertainment_ContentIdentifiers_Set_EntityId(ci, "ABCDEFGH"); Entertainment_ContentIdentifiers_Set_SeasonId(ci, "1"); @@ -299,7 +299,7 @@ int main (int argc, char* argv[]) //Populate EntityInfo Object //Set the ContentIdentifiers Object to EntityInfo Object Entertainment_EntityInfo_Set_Identifiers(entityInfo, ci); - Entertainment_ContentIdentifiersHandle_Release(ci); + Entertainment_ContentIdentifiers_Release(ci); Entertainment_EntityInfo_Set_Title(entityInfo, "Game Of Thrones"); Entertainment_EntityInfo_Set_EntityType(entityInfo, "program"); Entertainment_EntityInfo_Set_ProgramType(entityInfo, ENTERTAINMENT_PROGRAMTYPE_SEASON); @@ -309,49 +309,49 @@ int main (int argc, char* argv[]) Entertainment_EntityInfo_Set_ReleaseDate(entityInfo, "2012-04-23T18:25:43.511Z"); { - Entertainment_EntityInfoContentRatingsContentRatingArray_t crArray = Entertainment_EntityInfoContentRatingsContentRatingArrayHandle_Acquire(); + Entertainment_ContentRatingArray_t crArray = Entertainment_ContentRatingArray_Acquire(); { //Populate the ContentRatings Handle for US TV scheme - Entertainment_ContentRating_t cr = Entertainment_ContentRatingHandle_Acquire(); - Entertainment_ContentRating_Set_Scheme(cr, ENTERTAINMENT_CONTENTRATINGSCHEME_US_TV); + Entertainment_ContentRating_t cr = Entertainment_ContentRating_Acquire(); + Entertainment_ContentRating_Set_Scheme(cr, ENTERTAINMENT_CONTENTRATING_SCHEME_US_TV); Entertainment_ContentRating_Set_Rating(cr, "TVMA"); - Entertainment_ContentRatingAdvisoriesArray_t crAdvisories = Entertainment_ContentRatingAdvisoriesArrayHandle_Acquire(); - Entertainment_ContentRatingAdvisoriesArray_Add(crAdvisories, "V"); - Entertainment_ContentRatingAdvisoriesArray_Add(crAdvisories, "S"); - Entertainment_ContentRatingAdvisoriesArray_Add(crAdvisories, "L"); + Entertainment_ContentRating_AdvisoriesArray_t crAdvisories = Entertainment_ContentRating_AdvisoriesArray_Acquire(); + Entertainment_ContentRating_AdvisoriesArray_Add(crAdvisories, "V"); + Entertainment_ContentRating_AdvisoriesArray_Add(crAdvisories, "S"); + Entertainment_ContentRating_AdvisoriesArray_Add(crAdvisories, "L"); Entertainment_ContentRating_Set_Advisories(cr, crAdvisories); - Entertainment_ContentRatingAdvisoriesArrayHandle_Release(crAdvisories); - Entertainment_EntityInfoContentRatingsContentRatingArray_Add(crArray, cr); + Entertainment_ContentRating_AdvisoriesArray_Release(crAdvisories); + Entertainment_ContentRatingArray_Add(crArray, cr); } { //Populate the ContentRatings Handle for US TV scheme - Entertainment_ContentRating_t cr = Entertainment_ContentRatingHandle_Acquire(); - Entertainment_ContentRating_Set_Scheme(cr, ENTERTAINMENT_CONTENTRATINGSCHEME_CA_TV); + Entertainment_ContentRating_t cr = Entertainment_ContentRating_Acquire(); + Entertainment_ContentRating_Set_Scheme(cr, ENTERTAINMENT_CONTENTRATING_SCHEME_CA_TV); Entertainment_ContentRating_Set_Rating(cr, "18+"); - Entertainment_ContentRatingAdvisoriesArray_t crAdvisories = Entertainment_ContentRatingAdvisoriesArrayHandle_Acquire(); - Entertainment_ContentRatingAdvisoriesArray_Add(crAdvisories, "18+"); + Entertainment_ContentRating_AdvisoriesArray_t crAdvisories = Entertainment_ContentRating_AdvisoriesArray_Acquire(); + Entertainment_ContentRating_AdvisoriesArray_Add(crAdvisories, "18+"); Entertainment_ContentRating_Set_Advisories(cr, crAdvisories); - Entertainment_ContentRatingAdvisoriesArrayHandle_Release(crAdvisories); - Entertainment_EntityInfoContentRatingsContentRatingArray_Add(crArray, cr); + Entertainment_ContentRating_AdvisoriesArray_Release(crAdvisories); + Entertainment_ContentRatingArray_Add(crArray, cr); } Entertainment_EntityInfo_Set_ContentRatings(entityInfo, crArray); - Entertainment_EntityInfoContentRatingsContentRatingArrayHandle_Release(crArray); + Entertainment_ContentRatingArray_Release(crArray); } //Populate WayToWatch Array in EntityInfo { //Populate the WayToWatch Object - Entertainment_WayToWatch_t w2w = Entertainment_WayToWatchHandle_Acquire(); + Entertainment_WayToWatch_t w2w = Entertainment_WayToWatch_Acquire(); { //Add the ContentIdentifiers Object in WayToWatch - Entertainment_ContentIdentifiers_t ciI = Entertainment_ContentIdentifiersHandle_Acquire(); + Entertainment_ContentIdentifiers_t ciI = Entertainment_ContentIdentifiers_Acquire(); Entertainment_ContentIdentifiers_Set_AssetId(ciI, "12345678"); Entertainment_ContentIdentifiers_Set_EntityId(ciI, "ABCDEFGH"); Entertainment_ContentIdentifiers_Set_SeasonId(ciI, "1"); Entertainment_ContentIdentifiers_Set_SeriesId(ciI, "9ER34FR"); Entertainment_ContentIdentifiers_Set_AppContentData(ciI, "Sample App Content Data"); Entertainment_WayToWatch_Set_Identifiers(w2w, ciI); - Entertainment_ContentIdentifiersHandle_Release(ciI); + Entertainment_ContentIdentifiers_Release(ciI); } Entertainment_WayToWatch_Set_Expires(w2w, "2014-04-23T18:25:43.511Z"); Entertainment_WayToWatch_Set_Entitled(w2w, true); @@ -360,71 +360,71 @@ int main (int argc, char* argv[]) Entertainment_WayToWatch_Set_HasAds(w2w, true); //Populate VideoQuality Array - Entertainment_WayToWatchVideoQualityArray_t vqArray = - Entertainment_WayToWatchVideoQualityArrayHandle_Acquire(); - Entertainment_WayToWatchVideoQualityArray_Add( - vqArray, ENTERTAINMENT_WAYTOWATCHVIDEOQUALITY_HD); - Entertainment_WayToWatchVideoQualityArray_Add( - vqArray, ENTERTAINMENT_WAYTOWATCHVIDEOQUALITY_UHD); + Entertainment_WayToWatch_VideoQualityArray_t vqArray = + Entertainment_WayToWatch_VideoQualityArray_Acquire(); + Entertainment_WayToWatch_VideoQualityArray_Add( + vqArray, ENTERTAINMENT_WAYTOWATCH_VIDEOQUALITY_HD); + Entertainment_WayToWatch_VideoQualityArray_Add( + vqArray, ENTERTAINMENT_WAYTOWATCH_VIDEOQUALITY_UHD); Entertainment_WayToWatch_Set_VideoQuality(w2w, vqArray); - Entertainment_WayToWatchVideoQualityArrayHandle_Release(vqArray); + Entertainment_WayToWatch_VideoQualityArray_Release(vqArray); //Populate AudioProfile Array - Entertainment_WayToWatchAudioProfileAudioProfileArray_t apArray = - Entertainment_WayToWatchAudioProfileAudioProfileArrayHandle_Acquire(); - Entertainment_WayToWatchAudioProfileAudioProfileArray_Add( + Entertainment_AudioProfileArray_t apArray = + Entertainment_AudioProfileArray_Acquire(); + Entertainment_AudioProfileArray_Add( apArray, TYPES_AUDIOPROFILE_STEREO); - Entertainment_WayToWatchAudioProfileAudioProfileArray_Add( + Entertainment_AudioProfileArray_Add( apArray, TYPES_AUDIOPROFILE_DOLBY_DIGITAL_5_1); - Entertainment_WayToWatchAudioProfileAudioProfileArray_Add( + Entertainment_AudioProfileArray_Add( apArray, TYPES_AUDIOPROFILE_DOLBY_DIGITAL_5_1_PLUS); Entertainment_WayToWatch_Set_AudioProfile(w2w, apArray); - Entertainment_WayToWatchAudioProfileAudioProfileArrayHandle_Release(apArray); + Entertainment_AudioProfileArray_Release(apArray); //Populate AudioLanguages Array - Entertainment_WayToWatchAudioLanguagesArray_t alArray = - Entertainment_WayToWatchAudioLanguagesArrayHandle_Acquire(); - Entertainment_WayToWatchAudioLanguagesArray_Add(alArray, "en"); - Entertainment_WayToWatchAudioLanguagesArray_Add(alArray, "fr"); + Entertainment_WayToWatch_AudioLanguagesArray_t alArray = + Entertainment_WayToWatch_AudioLanguagesArray_Acquire(); + Entertainment_WayToWatch_AudioLanguagesArray_Add(alArray, "en"); + Entertainment_WayToWatch_AudioLanguagesArray_Add(alArray, "fr"); Entertainment_WayToWatch_Set_AudioLanguages(w2w, alArray); - Entertainment_WayToWatchAudioLanguagesArrayHandle_Release(alArray); + Entertainment_WayToWatch_AudioLanguagesArray_Release(alArray); //Populate ClosedCaptions Array - Entertainment_WayToWatchClosedCaptionsArray_t ccArray = - Entertainment_WayToWatchClosedCaptionsArrayHandle_Acquire(); - Entertainment_WayToWatchClosedCaptionsArray_Add(ccArray, "en"); - Entertainment_WayToWatchClosedCaptionsArray_Add(ccArray, "fr"); + Entertainment_WayToWatch_ClosedCaptionsArray_t ccArray = + Entertainment_WayToWatch_ClosedCaptionsArray_Acquire(); + Entertainment_WayToWatch_ClosedCaptionsArray_Add(ccArray, "en"); + Entertainment_WayToWatch_ClosedCaptionsArray_Add(ccArray, "fr"); Entertainment_WayToWatch_Set_ClosedCaptions(w2w, ccArray); - Entertainment_WayToWatchClosedCaptionsArrayHandle_Release(ccArray); + Entertainment_WayToWatch_ClosedCaptionsArray_Release(ccArray); //Populate Subtitles Array - Entertainment_WayToWatchSubtitlesArray_t sbArray = - Entertainment_WayToWatchSubtitlesArrayHandle_Acquire(); - Entertainment_WayToWatchSubtitlesArray_Add(sbArray, "en"); - Entertainment_WayToWatchSubtitlesArray_Add(sbArray, "fr"); + Entertainment_WayToWatch_SubtitlesArray_t sbArray = + Entertainment_WayToWatch_SubtitlesArray_Acquire(); + Entertainment_WayToWatch_SubtitlesArray_Add(sbArray, "en"); + Entertainment_WayToWatch_SubtitlesArray_Add(sbArray, "fr"); Entertainment_WayToWatch_Set_Subtitles(w2w, sbArray); - Entertainment_WayToWatchSubtitlesArrayHandle_Release(sbArray); + Entertainment_WayToWatch_SubtitlesArray_Release(sbArray); //Populate AudioDescriptions Array - Entertainment_WayToWatchAudioDescriptionsArray_t adArray = - Entertainment_WayToWatchAudioDescriptionsArrayHandle_Acquire(); - Entertainment_WayToWatchAudioDescriptionsArray_Add(adArray, "en"); + Entertainment_WayToWatch_AudioDescriptionsArray_t adArray = + Entertainment_WayToWatch_AudioDescriptionsArray_Acquire(); + Entertainment_WayToWatch_AudioDescriptionsArray_Add(adArray, "en"); Entertainment_WayToWatch_Set_AudioDescriptions(w2w, adArray); - Entertainment_WayToWatchAudioDescriptionsArrayHandle_Release(adArray); + Entertainment_WayToWatch_AudioDescriptionsArray_Release(adArray); //Populate WayToWatch Array - Entertainment_EntityInfoWaysToWatchWayToWatchArray_t w2wArray = - Entertainment_EntityInfoWaysToWatchWayToWatchArrayHandle_Acquire(); - Entertainment_EntityInfoWaysToWatchWayToWatchArray_Add(w2wArray, w2w); + Entertainment_WayToWatchArray_t w2wArray = + Entertainment_WayToWatchArray_Acquire(); + Entertainment_WayToWatchArray_Add(w2wArray, w2w); Entertainment_EntityInfo_Set_WaysToWatch(entityInfo, w2wArray); - Entertainment_EntityInfoWaysToWatchWayToWatchArrayHandle_Release(w2wArray); - Entertainment_WayToWatchHandle_Release(w2w); + Entertainment_WayToWatchArray_Release(w2wArray); + Entertainment_WayToWatch_Release(w2w); } //Populate EntityInfoResult Object Discovery_EntityInfoResult_Set_Expires(entityInfoResult, "2012-06-23T18:25:43.511Z"); Discovery_EntityInfoResult_Set_Entity(entityInfoResult, entityInfo); - Entertainment_EntityInfoHandle_Release(entityInfo); + Entertainment_EntityInfo_Release(entityInfo); //All Set, Call the Push uint32_t result = Discovery_PushEntityInfo(entityInfoResult); @@ -434,7 +434,7 @@ int main (int argc, char* argv[]) } else { printf("\nFailed to Push entityInfo\n"); } - Discovery_EntityInfoResultHandle_Release(entityInfoResult); + Discovery_EntityInfoResult_Release(entityInfoResult); break; } } diff --git a/src/sdks/core/src/cpp/sdk/test/CMakeLists.txt b/src/sdks/core/src/cpp/sdk/test/CMakeLists.txt index ee0a629a4..9242ea10e 100644 --- a/src/sdks/core/src/cpp/sdk/test/CMakeLists.txt +++ b/src/sdks/core/src/cpp/sdk/test/CMakeLists.txt @@ -49,7 +49,6 @@ set_target_properties(${TESTLIB} PROPERTIES LINK_WHAT_YOU_USE TRUE FRAMEWORK FALSE ) -#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive") set(TESTAPP FireboltCoreSDKTestApp) @@ -71,20 +70,16 @@ target_include_directories(${TESTAPP} install( TARGETS ${TESTLIB} EXPORT ${TESTLIB}Targets - LIBRARY DESTINATION lib COMPONENT libs - PUBLIC_HEADER DESTINATION include/${FIREBOLT_NAMESPACE}Test COMPONENT devel # headers for mac (note the different component -> different package) - INCLUDES DESTINATION include/${FIREBOLT_NAMESPACE}Test # headers + ARCHIVE DESTINATION lib COMPONENT libs # static lib + LIBRARY DESTINATION lib COMPONENT libs # shared lib ) InstallCMakeConfig(TARGETS ${TESTLIB}) -InstallCMakeConfigs(TARGET ${TESTLIB} DESTINATION ${FIREBOLT_NAMESPACE}) -InstallHeaders(TARGET ${TESTLIB} HEADERS . NAMESPACE ${FIREBOLT_NAMESPACE} DESTINATION FireboltTest) -InstallLibraries(TARGET ${TESTLIB} LIBRARIES ${TESTLIB} DESTINATION ${FIREBOLT_NAMESPACE}) add_custom_command( TARGET ${TESTAPP} POST_BUILD COMMENT "=================== Installing TestApp ======================" COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/${FIREBOLT_NAMESPACE}/usr/bin - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${TESTAPP} ${CMAKE_BINARY_DIR}/${FIREBOLT_NAMESPACE}/usr/bin + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${TESTAPP} ${CMAKE_BINARY_DIR}/${FIREBOLT_NAMESPACE}/usr/bin ) diff --git a/src/sdks/core/src/cpp/sdk/test/CoreSDKTestGeneratedCode.c b/src/sdks/core/src/cpp/sdk/test/CoreSDKTestGeneratedCode.c index 5aa7bb93d..5931d6bcb 100644 --- a/src/sdks/core/src/cpp/sdk/test/CoreSDKTestGeneratedCode.c +++ b/src/sdks/core/src/cpp/sdk/test/CoreSDKTestGeneratedCode.c @@ -33,12 +33,12 @@ extern "C" { uint32_t test_generated_properties_get_device_id() { - FireboltTypes_String_t handle; + Firebolt_String_t handle; uint32_t result = Device_GetId(&handle); if (result == FireboltSDKErrorNone) { - printf("\nDevice: Id:%s\n", FireboltTypes_String(handle)); - FireboltTypes_StringHandle_Release(handle); + printf("\nDevice: Id:%s\n", Firebolt_String(handle)); + Firebolt_String_Release(handle); } EXPECT_EQ(result, FireboltSDKErrorNone); @@ -51,30 +51,30 @@ uint32_t test_generated_properties_get_device_version() uint32_t result = Device_GetVersion(&handle); if (result == FireboltSDKErrorNone) { - if (Device_VersionsHandle_IsValid(handle)) { + if (Device_Versions_IsValid(handle)) { Types_SemanticVersion_t sdkHandle = Device_Versions_Get_Sdk(handle); - if (Types_SemanticVersionHandle_IsValid(sdkHandle)) { + if (Types_SemanticVersion_IsValid(sdkHandle)) { uint32_t major = Types_SemanticVersion_Get_Major(sdkHandle); uint32_t minor = Types_SemanticVersion_Get_Minor(sdkHandle); uint32_t patch = Types_SemanticVersion_Get_Patch(sdkHandle); char* readable = Types_SemanticVersion_Get_Readable(sdkHandle); printf("\nDevice:SDK Version major:%d minor:%d patch:%d readable:%s\n", major, minor, patch, readable); - Types_SemanticVersionHandle_Release(sdkHandle); + Types_SemanticVersion_Release(sdkHandle); result = FireboltSDKErrorNone; } Types_SemanticVersion_t osHandle = Device_Versions_Get_Os(handle); - if (Types_SemanticVersionHandle_IsValid(osHandle)) { + if (Types_SemanticVersion_IsValid(osHandle)) { uint32_t major = Types_SemanticVersion_Get_Major(osHandle); uint32_t minor = Types_SemanticVersion_Get_Minor(osHandle); uint32_t patch = Types_SemanticVersion_Get_Patch(osHandle); const char* readable = Types_SemanticVersion_Get_Readable(osHandle); printf("\nDevice:OS Version major:%d minor:%d patch:%d readable:%s\n", major, minor, patch, readable); - Types_SemanticVersionHandle_Release(osHandle); + Types_SemanticVersion_Release(osHandle); result = FireboltSDKErrorNone; } - Device_VersionsHandle_Release(handle); + Device_Versions_Release(handle); } else { result = FireboltSDKErrorUnavailable; } @@ -90,10 +90,10 @@ uint32_t test_generated_properties_get_accessibility_closedcaption() uint32_t result = Accessibility_GetClosedCaptionsSettings(&handle); if (result == FireboltSDKErrorNone) { - if (Accessibility_ClosedCaptionsSettingsHandle_IsValid(handle) == true) { + if (Accessibility_ClosedCaptionsSettings_IsValid(handle) == true) { printf("ClosedCaption Settings ------------------\n"); Accessibility_ClosedCaptionsStyles_t styleHandle = Accessibility_ClosedCaptionsSettings_Get_Styles(handle); - if (Accessibility_ClosedCaptionsStylesHandle_IsValid(styleHandle)) { + if (Accessibility_ClosedCaptionsStyles_IsValid(styleHandle)) { printf("ClosedCaptionStyles:\n"); char* fontFamily = Accessibility_ClosedCaptionsStyles_Get_FontFamily(styleHandle); printf("\tFontFamily : %s\n", fontFamily); @@ -115,11 +115,11 @@ uint32_t test_generated_properties_get_accessibility_closedcaption() printf("\tTextAlign : %s\n", txAlign); char* txAlignVertical = Accessibility_ClosedCaptionsStyles_Get_TextAlignVertical(styleHandle); printf("\tTextAlignVertical : %s\n", txAlignVertical); - Accessibility_ClosedCaptionsStylesHandle_Release(styleHandle); + Accessibility_ClosedCaptionsStyles_Release(styleHandle); } bool enabled = Accessibility_ClosedCaptionsSettings_Get_Enabled(handle); printf("Enabled: %d\n", enabled); - Accessibility_ClosedCaptionsSettingsHandle_Release(handle); + Accessibility_ClosedCaptionsSettings_Release(handle); } else { result = FireboltSDKErrorUnavailable; } @@ -134,11 +134,11 @@ uint32_t test_generated_properties_get_accessibility_voiceguidancesettings() uint32_t result = Accessibility_GetVoiceGuidanceSettings(&handle); if (result == FireboltSDKErrorNone) { - if (Accessibility_VoiceGuidanceSettingsHandle_IsValid(handle) == true) { + if (Accessibility_VoiceGuidanceSettings_IsValid(handle) == true) { bool enabled = Accessibility_VoiceGuidanceSettings_Get_Enabled(handle); uint32_t speed = Accessibility_VoiceGuidanceSettings_Get_Speed(handle); printf("VoiceGuidanceSettings: Enabled : %d, Speed : %d\n", enabled, speed); - Accessibility_VoiceGuidanceSettingsHandle_Release(handle); + Accessibility_VoiceGuidanceSettings_Release(handle); } else { result = FireboltSDKErrorUnavailable; } @@ -174,13 +174,13 @@ uint32_t test_generated_properties_get_advertising_policy() Advertising_AdPolicy_t handle; uint32_t result = Advertising_GetPolicy(&handle); if (result == FireboltSDKErrorNone) { - if (Advertising_AdPolicyHandle_IsValid(handle) == true) { + if (Advertising_AdPolicy_IsValid(handle) == true) { printf("AdPolicy: "); Advertising_SkipRestriction skipRestriction = Advertising_AdPolicy_Get_SkipRestriction(handle); printf("SkipRestriction = %s ", get_skiprestriction_enum_string(skipRestriction)); bool limitAdTracking = Advertising_AdPolicy_Get_LimitAdTracking(handle); printf("LimitAdTracking = %s \n", limitAdTracking? "true" : "false"); - Advertising_AdPolicyHandle_Release(handle); + Advertising_AdPolicy_Release(handle); } else { result = FireboltSDKErrorUnavailable; } @@ -195,12 +195,12 @@ pthread_cond_t cond = PTHREAD_COND_INITIALIZER; pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; static const char deviceNameTestStr[] = "DeviceNameTestStr"; -static void NotifyDeviceNameChange(const void* userData, FireboltTypes_String_t handle) +static void NotifyDeviceNameChange(const void* userData, Firebolt_String_t handle) { EXPECT_NE(handle, NULL); if (handle) { - printf("\nGot new device.name :%s\n", FireboltTypes_String(handle)); - FireboltTypes_StringHandle_Release(handle); + printf("\nGot new device.name :%s\n", Firebolt_String(handle)); + Firebolt_String_Release(handle); } EXPECT_EQ(strncmp((const char*)userData, deviceNameTestStr, strlen(deviceNameTestStr)), 0); pthread_cond_signal(&cond); @@ -247,14 +247,14 @@ uint32_t test_generated_event_device_name_with_register_same_callback() static const char deviceScreenResolutionTestStr[] = "deviceScreenResolutionTestStr"; static void NotifyDeviceScreenResolutionChange(const void* userData, Device_ResolutionArray_t handle) { - EXPECT_EQ(Device_ResolutionArrayHandle_IsValid(handle), true); - if (Device_ResolutionArrayHandle_IsValid(handle) == true) { + EXPECT_EQ(Device_ResolutionArray_IsValid(handle), true); + if (Device_ResolutionArray_IsValid(handle) == true) { uint32_t size = Device_ResolutionArray_Size(handle); printf("Device ScreenResolutions changed for %d numbers\n", size); for (uint32_t i = 0; i < size; ++i) { printf("New reslution[%d] = %d\n", i, Device_ResolutionArray_Get(handle, i)); } - Device_ResolutionArrayHandle_Release(handle); + Device_ResolutionArray_Release(handle); } EXPECT_EQ(strncmp((const char*)userData, deviceScreenResolutionTestStr, strlen(deviceScreenResolutionTestStr)), 0); pthread_cond_signal(&cond); @@ -282,12 +282,12 @@ uint32_t test_generated_event_device_screenresolution() static const char accessibilityVoiceGuidanceTestStr[] = "AccessibilityVoiceGuidanceTestStr"; static void NotifyAccessibilityVoiceGuidanceChange(const void* userData, Accessibility_VoiceGuidanceSettings_t handle) { - EXPECT_EQ(Accessibility_VoiceGuidanceSettingsHandle_IsValid(handle), true); - if (Accessibility_VoiceGuidanceSettingsHandle_IsValid(handle) == true) { + EXPECT_EQ(Accessibility_VoiceGuidanceSettings_IsValid(handle), true); + if (Accessibility_VoiceGuidanceSettings_IsValid(handle) == true) { bool enabled = Accessibility_VoiceGuidanceSettings_Get_Enabled(handle); uint32_t speed = Accessibility_VoiceGuidanceSettings_Get_Speed(handle); printf("VoiceGuidanceSettings: Enabled : %d, Speed : %d\n", enabled, speed); - Accessibility_VoiceGuidanceSettingsHandle_Release(handle); + Accessibility_VoiceGuidanceSettings_Release(handle); } EXPECT_EQ(strncmp((const char*)userData, accessibilityVoiceGuidanceTestStr, strlen(accessibilityVoiceGuidanceTestStr)), 0); pthread_cond_signal(&cond);