Skip to content

Commit

Permalink
Native test update based on interface return type change from uint32_…
Browse files Browse the repository at this point in the history
…t to int32_t
  • Loading branch information
HaseenaSainul committed Aug 11, 2023
1 parent 1ffc6cc commit a235339
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 46 deletions.
16 changes: 8 additions & 8 deletions src/sdks/core/src/cpp/sdk/ctest/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void ShowEventMenu()
opt = toupper(getchar()); \
switch (opt) { \
case 'R': { \
uint32_t result = Module##_Register_On##eventFuncName((const void*)Callback, eventTestStr); \
int32_t result = Module##_Register_On##eventFuncName((const void*)Callback, eventTestStr); \
if (result != FireboltSDKErrorNone) { \
printf("Register event %s is failed, status = %d \n", eventName, result); \
} else { \
Expand All @@ -55,7 +55,7 @@ void ShowEventMenu()
break; \
} \
case 'U': { \
uint32_t result = Module##_Unregister_On##eventFuncName((const void*)Callback); \
int32_t result = Module##_Unregister_On##eventFuncName((const void*)Callback); \
if (result != FireboltSDKErrorNone) { \
printf("Unregister event %s is failed, status = %d \n", eventName, result); \
} else { \
Expand Down Expand Up @@ -181,7 +181,7 @@ int main (int argc, char* argv[])
case 'I': {
//Lets get the Device ID
Firebolt_String_t handle;
uint32_t result = Device_GetId(&handle);
int32_t result = Device_GetId(&handle);
if (result == FireboltSDKErrorNone) {
printf("Device: Id:%s\n\n", Firebolt_String(handle));
Firebolt_String_Release(handle);
Expand All @@ -193,7 +193,7 @@ int main (int argc, char* argv[])
}
case 'C': {
Accessibility_ClosedCaptionsSettings_t handle;
uint32_t result = Accessibility_GetClosedCaptionsSettings(&handle);
int32_t result = Accessibility_GetClosedCaptionsSettings(&handle);

if (result == FireboltSDKErrorNone) {
if (Accessibility_ClosedCaptionsSettings_IsValid(handle) == true) {
Expand Down Expand Up @@ -236,7 +236,7 @@ int main (int argc, char* argv[])
}
case 'G': {
Accessibility_VoiceGuidanceSettings_t handle;
uint32_t result = Accessibility_GetVoiceGuidanceSettings(&handle);
int32_t result = Accessibility_GetVoiceGuidanceSettings(&handle);

if (result == FireboltSDKErrorNone) {
if (Accessibility_VoiceGuidanceSettings_IsValid(handle) == true) {
Expand All @@ -254,7 +254,7 @@ int main (int argc, char* argv[])
}
case 'P': {
Advertising_AdPolicy_t handle;
uint32_t result = Advertising_GetPolicy(&handle);
int32_t result = Advertising_GetPolicy(&handle);
if (result == FireboltSDKErrorNone) {
if (Advertising_AdPolicy_IsValid(handle) == true) {
printf("AdPolicy: ");
Expand All @@ -273,7 +273,7 @@ int main (int argc, char* argv[])
}
case 'U': {
Firebolt_String_t handle;
uint32_t result = Account_GetUid(&handle);
int32_t result = Account_GetUid(&handle);
if (result == FireboltSDKErrorNone) {
printf("Account: Uid:%s\n\n", Firebolt_String(handle));
Firebolt_String_Release(handle);
Expand Down Expand Up @@ -427,7 +427,7 @@ int main (int argc, char* argv[])
Entertainment_EntityInfo_Release(entityInfo);

//All Set, Call the Push
uint32_t result = Discovery_PushEntityInfo(entityInfoResult);
int32_t result = Discovery_PushEntityInfo(entityInfoResult);
if (result == FireboltSDKErrorNone) {
printf("\nSuccessfully Pushed entityInfo\n");

Expand Down
4 changes: 2 additions & 2 deletions src/sdks/core/src/cpp/sdk/test/CoreSDKCTests.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
extern "C" {
#endif

uint32_t test_firebolt_core_main();
uint32_t test_properties_get_policy();
int32_t test_firebolt_core_main();
int32_t test_properties_get_policy();

#ifdef __cplusplus
}
Expand Down
40 changes: 20 additions & 20 deletions src/sdks/core/src/cpp/sdk/test/CoreSDKTestGeneratedCode.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
extern "C" {
#endif

uint32_t test_generated_properties_get_device_id()
int32_t test_generated_properties_get_device_id()
{
Firebolt_String_t handle;
uint32_t result = Device_GetId(&handle);
int32_t result = Device_GetId(&handle);

if (result == FireboltSDKErrorNone) {
printf("\nDevice: Id:%s\n", Firebolt_String(handle));
Expand All @@ -45,10 +45,10 @@ uint32_t test_generated_properties_get_device_id()
return result;
}
#if 0
uint32_t test_generated_properties_get_device_version()
int32_t test_generated_properties_get_device_version()
{
Device_Versions_t handle;
uint32_t result = Device_GetVersion(&handle);
int32_t result = Device_GetVersion(&handle);

if (result == FireboltSDKErrorNone) {
if (Device_Versions_IsValid(handle)) {
Expand Down Expand Up @@ -84,10 +84,10 @@ uint32_t test_generated_properties_get_device_version()
return result;
}
#endif
uint32_t test_generated_properties_get_accessibility_closedcaption()
int32_t test_generated_properties_get_accessibility_closedcaption()
{
Accessibility_ClosedCaptionsSettings_t handle;
uint32_t result = Accessibility_GetClosedCaptionsSettings(&handle);
int32_t result = Accessibility_GetClosedCaptionsSettings(&handle);

if (result == FireboltSDKErrorNone) {
if (Accessibility_ClosedCaptionsSettings_IsValid(handle) == true) {
Expand Down Expand Up @@ -128,10 +128,10 @@ uint32_t test_generated_properties_get_accessibility_closedcaption()
EXPECT_EQ(result, FireboltSDKErrorNone);
return result;
}
uint32_t test_generated_properties_get_accessibility_voiceguidancesettings()
int32_t test_generated_properties_get_accessibility_voiceguidancesettings()
{
Accessibility_VoiceGuidanceSettings_t handle;
uint32_t result = Accessibility_GetVoiceGuidanceSettings(&handle);
int32_t result = Accessibility_GetVoiceGuidanceSettings(&handle);

if (result == FireboltSDKErrorNone) {
if (Accessibility_VoiceGuidanceSettings_IsValid(handle) == true) {
Expand Down Expand Up @@ -169,10 +169,10 @@ const char* get_skiprestriction_enum_string(Advertising_SkipRestriction skipRest
return strSkipRestriction;
}

uint32_t test_generated_properties_get_advertising_policy()
int32_t test_generated_properties_get_advertising_policy()
{
Advertising_AdPolicy_t handle;
uint32_t result = Advertising_GetPolicy(&handle);
int32_t result = Advertising_GetPolicy(&handle);
if (result == FireboltSDKErrorNone) {
if (Advertising_AdPolicy_IsValid(handle) == true) {
printf("AdPolicy: ");
Expand Down Expand Up @@ -205,9 +205,9 @@ static void NotifyDeviceNameChange(const void* userData, Firebolt_String_t handl
EXPECT_EQ(strncmp((const char*)userData, deviceNameTestStr, strlen(deviceNameTestStr)), 0);
pthread_cond_signal(&cond);
}
uint32_t test_generated_event_device_name()
int32_t test_generated_event_device_name()
{
uint32_t result = Device_Register_OnNameChanged((const void*)&NotifyDeviceNameChange, deviceNameTestStr);
int32_t result = Device_Register_OnNameChanged((const void*)&NotifyDeviceNameChange, deviceNameTestStr);
EXPECT_EQ(result, FireboltSDKErrorNone);
if (result != FireboltSDKErrorNone) {
printf("Set event device.name status = %d \n", result);
Expand All @@ -225,9 +225,9 @@ uint32_t test_generated_event_device_name()
return result;
}

uint32_t test_generated_event_device_name_with_register_same_callback()
int32_t test_generated_event_device_name_with_register_same_callback()
{
uint32_t result = Device_Register_OnNameChanged((const void*)NotifyDeviceNameChange, deviceNameTestStr);
int32_t result = Device_Register_OnNameChanged((const void*)NotifyDeviceNameChange, deviceNameTestStr);
EXPECT_EQ(result, FireboltSDKErrorNone);
if (result != FireboltSDKErrorNone) {
printf("Set event device.name status = %d \n", result);
Expand Down Expand Up @@ -259,9 +259,9 @@ static void NotifyDeviceScreenResolutionChange(const void* userData, Device_Reso
EXPECT_EQ(strncmp((const char*)userData, deviceScreenResolutionTestStr, strlen(deviceScreenResolutionTestStr)), 0);
pthread_cond_signal(&cond);
}
uint32_t test_generated_event_device_screenresolution()
int32_t test_generated_event_device_screenresolution()
{
uint32_t result = Device_Register_OnScreenResolutionChanged((const void*)NotifyDeviceScreenResolutionChange, deviceScreenResolutionTestStr);
int32_t result = Device_Register_OnScreenResolutionChanged((const void*)NotifyDeviceScreenResolutionChange, deviceScreenResolutionTestStr);
EXPECT_EQ(result, FireboltSDKErrorNone);
if (result != FireboltSDKErrorNone) {
printf("Set event device.screenresolution status = %d \n", result);
Expand Down Expand Up @@ -292,9 +292,9 @@ static void NotifyAccessibilityVoiceGuidanceChange(const void* userData, Accessi
EXPECT_EQ(strncmp((const char*)userData, accessibilityVoiceGuidanceTestStr, strlen(accessibilityVoiceGuidanceTestStr)), 0);
pthread_cond_signal(&cond);
}
uint32_t test_generated_event_accessibility_voice_guidance_settings()
int32_t test_generated_event_accessibility_voice_guidance_settings()
{
uint32_t result = Accessibility_Register_OnVoiceGuidanceSettingsChanged((const void*)NotifyAccessibilityVoiceGuidanceChange, accessibilityVoiceGuidanceTestStr);
int32_t result = Accessibility_Register_OnVoiceGuidanceSettingsChanged((const void*)NotifyAccessibilityVoiceGuidanceChange, accessibilityVoiceGuidanceTestStr);
EXPECT_EQ(result, FireboltSDKErrorNone);
if (result != FireboltSDKErrorNone) {
printf("Set event device.name status = %d \n", result);
Expand All @@ -312,9 +312,9 @@ uint32_t test_generated_event_accessibility_voice_guidance_settings()
return result;
}
#if 0
uint32_t test_generated_calls_metrics_lifecycle_ready()
int32_t test_generated_calls_metrics_lifecycle_ready()
{
uint32_t result = Lifecycle_Ready();
int32_t result = Lifecycle_Ready();
if (result != FireboltSDKErrorNone) {
printf("Lifecycle.ready call status = %d \n", result);
} else {
Expand Down
20 changes: 10 additions & 10 deletions src/sdks/core/src/cpp/sdk/test/CoreSDKTestGeneratedCode.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
extern "C" {
#endif

//uint32_t test_generated_properties_get_device_version();
uint32_t test_generated_properties_get_device_id();
uint32_t test_generated_properties_get_accessibility_closedcaption();
uint32_t test_generated_properties_get_accessibility_voiceguidancesettings();
uint32_t test_generated_properties_get_advertising_policy();
uint32_t test_generated_event_device_name();
uint32_t test_generated_event_device_name_with_register_same_callback();
uint32_t test_generated_event_device_screenresolution();
uint32_t test_generated_event_accessibility_voice_guidance_settings();
//uint32_t test_generated_calls_metrics_lifecycle_ready();
//int32_t test_generated_properties_get_device_version();
int32_t test_generated_properties_get_device_id();
int32_t test_generated_properties_get_accessibility_closedcaption();
int32_t test_generated_properties_get_accessibility_voiceguidancesettings();
int32_t test_generated_properties_get_advertising_policy();
int32_t test_generated_event_device_name();
int32_t test_generated_event_device_name_with_register_same_callback();
int32_t test_generated_event_device_screenresolution();
int32_t test_generated_event_accessibility_voice_guidance_settings();
//int32_t test_generated_calls_metrics_lifecycle_ready();

#ifdef __cplusplus
}
Expand Down
10 changes: 5 additions & 5 deletions src/sdks/core/src/cpp/sdk/test/CoreSDKTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ namespace FireboltSDK {
std::forward_as_tuple(&GetDiscoveryPolicy));
}

/* static */ uint32_t CoreTests::GetDiscoveryPolicy()
/* static */ int32_t CoreTests::GetDiscoveryPolicy()
{
const string method = _T("discovery.policy");
WPEFramework::Core::ProxyType<Policy> response;
uint32_t status = FireboltSDK::Properties::Get(method, response);
int32_t status = FireboltSDK::Properties::Get(method, response);

EXPECT_EQ(status, FireboltSDKErrorNone);
if (status == FireboltSDKErrorNone) {
Expand All @@ -54,16 +54,16 @@ namespace FireboltSDK {
extern "C" {
#endif

uint32_t test_firebolt_core_main()
int32_t test_firebolt_core_main()
{
return FireboltSDK::Tests::Main<FireboltSDK::CoreTests>();
}

uint32_t test_properties_get_policy()
int32_t test_properties_get_policy()
{
const string method = _T("discovery.policy");
WPEFramework::Core::ProxyType<FireboltSDK::Policy> response;
uint32_t status = FireboltSDK::Properties::Get(method, response);
int32_t status = FireboltSDK::Properties::Get(method, response);

EXPECT_EQ(status, FireboltSDKErrorNone);
if (status == FireboltSDKErrorNone) {
Expand Down
2 changes: 1 addition & 1 deletion src/sdks/core/src/cpp/sdk/test/CoreSDKTests.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ namespace FireboltSDK {
CoreTests();
~CoreTests() override = default;

static uint32_t GetDiscoveryPolicy();
static int32_t GetDiscoveryPolicy();
};
}

0 comments on commit a235339

Please sign in to comment.