From 242c8300eb95b4a7a2aef5cd77448c0e73753588 Mon Sep 17 00:00:00 2001 From: HaseenaSainul Date: Thu, 4 Apr 2024 03:37:44 -0400 Subject: [PATCH] CPPSDK: test rearrangment based on modules --- src/sdks/core/src/cpp/sdk/cpptest/Main.cpp | 498 +++++++++++-------- src/sdks/manage/src/cpp/sdk/cpptest/Main.cpp | 439 +++++++++++----- 2 files changed, 617 insertions(+), 320 deletions(-) diff --git a/src/sdks/core/src/cpp/sdk/cpptest/Main.cpp b/src/sdks/core/src/cpp/sdk/cpptest/Main.cpp index 2e8bbba9b..a07aa130f 100644 --- a/src/sdks/core/src/cpp/sdk/cpptest/Main.cpp +++ b/src/sdks/core/src/cpp/sdk/cpptest/Main.cpp @@ -4,25 +4,20 @@ void ShowMenu() { printf("Enter\n" - "\tI : Get Account Id\n" - "\tU : Get Account Uid\n" - "\tM : Get Device Model\n" - "\tS : Get Device Sku\n" - "\tA : Handle Advertising methods\n" - "\tN : Get/Subscribe/Unsubscribe Device Name\n" - "\tP : Get/Subscribe/Unsubscribe Device Audio Profiles\n" - "\tR : Get/Subscribe/Unsubscribe Device Screen Resolution\n" - "\tL : Handle Localization methods\n" - "\tC : Get/Subscribe/Unsubscribe Closed Caption Settings\n" - "\tK : Invoke keyboard methods email/password/standard\n" - "\tV : Handle Profile methods\n" - "\tT : Handle Authentication methods\n" - "\tB : Handle Capabilities Method\n" - "\tE : Handle Metrics methods\n" - "\tF : Handle Lifecycle methods\n" - "\tD : Handle SecondScreen methods\n" - "\tY : Handle Discovery methods\n" - "\tZ : Parameters Initialization\n" + "\tC : Accessibility\n" + "\tO : Account\n" + "\tA : Advertising\n" + "\tU : Authentication\n" + "\tB : Capabilities\n" + "\tD : Device\n" + "\tI : Discovery\n" + "\tK : Keyboard\n" + "\tF : Lifecycle\n" + "\tL : Localization\n" + "\tM : Metrics\n" + "\tP : Parameters\n" + "\tR : Profile\n" + "\tS : SecondScreen\n" "\tQ : Quit\n\n" ); } @@ -35,21 +30,27 @@ void ShowPropertyMenu(std::string& module, std::string& property) "\tQ : Quit\n", module.c_str(), property.c_str()); } -void ShowProfileMenu() +void ShowAccessibilityMenu() { printf("Options: \n" - "\tC : Verify ApproveContentRating\n" - "\tP : Verify ApprovePurchase\n" - "\tF : Get Flags\n" + "\tC : Get/Subscribe/Unsubscribe Closed Caption Settings\n" "\tQ : Quit\n"); } -void ShowLocalizationMenu() +void ShowAccountMenu() { printf("Options: \n" - "\tA: Get additionalInfo\n" - "\tL: Get LatLon\n" - "\tP: Get/Subscribe/Unsubscribe Preferred AudioLanguages\n" + "\tI : Get Account Id\n" + "\tU : Get Account Uid\n" + "\tQ : Quit\n"); +} + +void ShowAdvertisingMenu() +{ + printf("Options: \n" + "\tP : Get/Subscribe/Unsubscribe Advertising Policy\n" + "\tC : Build configuration object for Ad Framework initialization\n" + "\tD : Get the device advertising device attributes\n" "\tQ : Quit\n"); } @@ -75,12 +76,43 @@ void ShowCapabilitiesMenu() "\tQ : Quit\n"); } -void ShowAdvertisingMenu() +void ShowDeviceMenu() { printf("Options: \n" - "\tP : Get/Subscribe/Unsubscribe Advertising Policy\n" - "\tC : Build configuration object for Ad Framework initialization\n" - "\tD : Get the device advertising device attributes\n" + "\tM : Get Device Model\n" + "\tS : Get Device Sku\n" + "\tN : Get/Subscribe/Unsubscribe Device Name\n" + "\tP : Get/Subscribe/Unsubscribe Device Audio Profiles\n" + "\tR : Get/Subscribe/Unsubscribe Device Screen Resolution\n" + "\tQ : Quit\n"); +} + +void ShowDiscoveryMenu() +{ + printf("Options: \n" + "\tS : SignIn\n" + "\tO : SignOut\n" + "\tA : ContentAccess\n" + "\tC : ClearContentAccess\n" + "\tE : Entitlements\n" + "\tI : EntityInfo\n" + "\tP : Policy\n" + "\tU : PurchasedContent\n" + "\tN : WatchNext\n" + "\tL : Launch\n" + "\tB : Subscribe/Unsubscribe DiscoveryOnNavigateToLaunch\n" + "\tQ : Quit\n"); +} + +void ShowKeyboardMenu() +{ + printf("Enter\n" + "\tE : Invoke Email method\n" + "\tA : Abort Email method\n" + "\tP : Invoke Password method\n" + "\tC : Abort Password method\n" + "\tS : Invoke Standard method\n" + "\tK : Abort Standard method\n" "\tQ : Quit\n"); } @@ -93,6 +125,15 @@ void ShowLifecycleMenu() "\tQ : Quit\n"); } +void ShowLocalizationMenu() +{ + printf("Options: \n" + "\tA: Get additionalInfo\n" + "\tL: Get LatLon\n" + "\tP: Get/Subscribe/Unsubscribe Preferred AudioLanguages\n" + "\tQ : Quit\n"); +} + void ShowMetricsMenu() { printf("Options: \n" @@ -101,45 +142,28 @@ void ShowMetricsMenu() "\tQ : Quit\n"); } -void ShowSecondScreenMenu() +void ShowParametersMenu() { printf("Options: \n" - "\tD : Get Device Id\n" - "\tF : Get/Subscribe/Unsubscribe FriendlyName\n" - "\tP : Get Protocols\n" + "\tZ : Parameters Initialization\n" "\tQ : Quit\n"); } -void ShowDiscoveryMenu() +void ShowProfileMenu() { printf("Options: \n" - "\tS : SignIn\n" - "\tO : SignOut\n" - "\tA : ContentAccess\n" - "\tC : ClearContentAccess\n" - "\tE : Entitlements\n" - "\tI : EntityInfo\n" - "\tP : Policy\n" - "\tU : PurchasedContent\n" - "\tN : WatchNext\n" - "\tL : Launch\n" -#ifdef POLYMORPHICS_REDUCER_METHODS - "\tW : Watched\n" - "\tR : WatchedReduced\n" -#endif - "\tB : Subscribe/Unsubscribe DiscoveryOnNavigateToLaunch\n" + "\tC : Verify ApproveContentRating\n" + "\tP : Verify ApprovePurchase\n" + "\tF : Get Flags\n" "\tQ : Quit\n"); } -void ShowKeyboardMenu() +void ShowSecondScreenMenu() { - printf("Enter\n" - "\tE : Invoke Email method\n" - "\tA : Abort Email method\n" - "\tP : Invoke Password method\n" - "\tC : Abort Password method\n" - "\tS : Invoke Standard method\n" - "\tK : Abort Standard method\n" + printf("Options: \n" + "\tD : Get Device Id\n" + "\tF : Get/Subscribe/Unsubscribe FriendlyName\n" + "\tP : Get Protocols\n" "\tQ : Quit\n"); } @@ -203,7 +227,76 @@ void ShowEventMenu() } while (opt != 'Q'); \ } -void HandleAuthenticationMethod() +void HandleAccessibilityMethods() +{ + int opt; + do { + getchar(); + ShowAccessibilityMenu(); + printf("Enter option : "); + opt = toupper(getchar()); + switch (opt) { + case 'C': { + HandleProperty(Accessibility, ClosedCaptionsSettings) + break; + } + default: + break; + } + } while (opt != 'Q'); +} + +void HandleAccountMethods() +{ + int opt; + do { + getchar(); + ShowAccountMenu(); + printf("Enter option : "); + opt = toupper(getchar()); + switch (opt) { + case 'I': { + CoreSDKTest::GetAccountId(); // Error while running need to cross check + break; + } + case 'U' : { + CoreSDKTest::GetAccountUid(); // Error while running need to cross check + break; + } + default: + break; + } + } while (opt != 'Q'); +} + +void HandleAdvertisingMethods() +{ + int opt; + do { + getchar(); + ShowAdvertisingMenu(); + printf("Enter option : "); + opt = toupper(getchar()); + switch (opt) { + case 'P': { + HandleProperty(Advertising, Policy) + break; + } + case 'C': { + CoreSDKTest::BuildAdvertisingConfiguration(); // Error while testing need to check + break; + } + case 'D': { + CoreSDKTest::GetAdvertisingDeviceAttributes(); // Error while testing need to check + break; + } + default: + break; + } + } while (opt != 'Q'); +} + +void HandleAuthenticationMethods() { int opt; do { @@ -234,7 +327,7 @@ void HandleAuthenticationMethod() } while (opt != 'Q'); } -void HandleCapabilitiesMethod() +void HandleCapabilitiesMethods() { int opt; do { @@ -269,25 +362,33 @@ void HandleCapabilitiesMethod() } while (opt != 'Q'); } -void HandleProfileMethod() +void HandleDeviceMethods() { int opt; do { getchar(); - ShowProfileMenu(); + ShowDeviceMenu(); printf("Enter option : "); opt = toupper(getchar()); switch (opt) { - case 'C': { - CoreSDKTest::VerifyProfileApproveContentRating(); // Error while testing, need to cross check + case 'N': { + HandleProperty(Device, Name) + break; + } + case 'M': { + CoreSDKTest::GetDeviceModel(); + break; + } + case 'S': { + CoreSDKTest::GetDeviceSku(); break; } case 'P': { - CoreSDKTest::VerifyProfileApprovePurchase(); // Error while testing, need to cross check + HandleProperty(Device, Audio) break; } - case 'F': { - CoreSDKTest::GetProfileFlags(); + case 'R': { + HandleProperty(Device, ScreenResolution) break; } default: @@ -296,52 +397,95 @@ void HandleProfileMethod() } while (opt != 'Q'); } -void HandleLocalizationMethod() +void HandleDiscoveryMethods() { int opt; do { getchar(); - ShowLocalizationMenu(); + ShowDiscoveryMenu(); printf("Enter option : "); opt = toupper(getchar()); switch (opt) { + case 'S': { + CoreSDKTest::DiscoverySignIn(); + break; + } + case 'O': { + CoreSDKTest::DiscoverySignOut(); + break; + } case 'A': { - CoreSDKTest::GetLocalizationAdditionalInfo(); + CoreSDKTest::DiscoveryContentAccess(); break; } - case 'L': { - CoreSDKTest::GetLocalizationLatlon(); + case 'C': { + CoreSDKTest::DiscoveryClearContentAccess(); + break; + } + case 'E': { + CoreSDKTest::DiscoveryEntitlements(); + break; + } + case 'I': { + CoreSDKTest::DiscoveryEntityInfo(); break; } case 'P': { - HandleProperty(Localization, PreferredAudioLanguages) + CoreSDKTest::DiscoveryPolicy(); + break; + } + case 'U': { + CoreSDKTest::DiscoveryPurchasedContent(); break; } + case 'N': { + CoreSDKTest::DiscoveryWatchNext(); + break; + } + case 'L': { + CoreSDKTest::DiscoveryLaunch(); + break; + } + case 'B': { + HandleEventListener(Discovery, OnNavigateToLaunchNotification) + } default: break; } } while (opt != 'Q'); } -void HandleAdvertisingMethod() +void HandleKeyboardMethodsInvokation() { int opt; do { getchar(); - ShowAdvertisingMenu(); + ShowKeyboardMenu(); printf("Enter option : "); opt = toupper(getchar()); switch (opt) { + case 'E': { + CoreSDKTest::InvokeKeyboardEmail(); + break; + } + case 'A': { + CoreSDKTest::AbortKeyboardEmail(); + break; + } case 'P': { - HandleProperty(Advertising, Policy) + CoreSDKTest::InvokeKeyboardPassword(); break; } case 'C': { - CoreSDKTest::BuildAdvertisingConfiguration(); // Error while testing need to check + CoreSDKTest::AbortKeyboardPassword(); break; } - case 'D': { - CoreSDKTest::GetAdvertisingDeviceAttributes(); // Error while testing need to check + case 'S': { + CoreSDKTest::InvokeKeyboardStandard(); + break; + } + case 'K': { + CoreSDKTest::AbortKeyboardStandard(); break; } default: @@ -350,7 +494,7 @@ void HandleAdvertisingMethod() } while (opt != 'Q'); } -void HandleLifecycleMethod() +void HandleLifecycleMethods() { int opt; do { @@ -377,21 +521,25 @@ void HandleLifecycleMethod() } while (opt != 'Q'); } -void HandleMetricsMethod() +void HandleLocalizationMethods() { int opt; do { getchar(); - ShowMetricsMenu(); + ShowLocalizationMenu(); printf("Enter option : "); opt = toupper(getchar()); switch (opt) { - case 'S': { - CoreSDKTest::MetricsStartContent(); + case 'A': { + CoreSDKTest::GetLocalizationAdditionalInfo(); break; } - case 'T': { - CoreSDKTest::MetricsStopContent(); + case 'L': { + CoreSDKTest::GetLocalizationLatlon(); + break; + } + case 'P': { + HandleProperty(Localization, PreferredAudioLanguages) break; } default: @@ -400,25 +548,21 @@ void HandleMetricsMethod() } while (opt != 'Q'); } -void HandleSecondScreenMethod() +void HandleMetricsMethods() { int opt; do { getchar(); - ShowSecondScreenMenu(); + ShowMetricsMenu(); printf("Enter option : "); opt = toupper(getchar()); switch (opt) { - case 'D': { - CoreSDKTest::GetSecondScreenDevice(); - break; - } - case 'F': { - HandleProperty(SecondScreen, FriendlyName) + case 'S': { + CoreSDKTest::MetricsStartContent(); break; } - case 'P': { - CoreSDKTest::GetSecondScreenProtocols(); + case 'T': { + CoreSDKTest::MetricsStopContent(); break; } default: @@ -427,105 +571,71 @@ void HandleSecondScreenMethod() } while (opt != 'Q'); } -void HandleDiscoveryMethod() +void HandleParametersMethods() { int opt; do { getchar(); - ShowDiscoveryMenu(); + ShowParametersMenu(); printf("Enter option : "); opt = toupper(getchar()); switch (opt) { - case 'S': { - CoreSDKTest::DiscoverySignIn(); - break; - } - case 'O': { - CoreSDKTest::DiscoverySignOut(); + case 'Z': { + CoreSDKTest::ParametersInitialization(); break; } - case 'A': { - CoreSDKTest::DiscoveryContentAccess(); + default: break; } + } while (opt != 'Q'); +} + +void HandleProfileMethods() +{ + int opt; + do { + getchar(); + ShowProfileMenu(); + printf("Enter option : "); + opt = toupper(getchar()); + switch (opt) { case 'C': { - CoreSDKTest::DiscoveryClearContentAccess(); - break; - } - case 'E': { - CoreSDKTest::DiscoveryEntitlements(); - break; - } - case 'I': { - CoreSDKTest::DiscoveryEntityInfo(); + CoreSDKTest::VerifyProfileApproveContentRating(); // Error while testing, need to cross check break; } case 'P': { - CoreSDKTest::DiscoveryPolicy(); - break; - } - case 'U': { - CoreSDKTest::DiscoveryPurchasedContent(); - break; - } - case 'N': { - CoreSDKTest::DiscoveryWatchNext(); - break; - } - case 'L': { - CoreSDKTest::DiscoveryLaunch(); - break; - } -#ifdef POLYMORPHICS_REDUCER_METHODS - case 'W': { - CoreSDKTest::DiscoveryWatched(); + CoreSDKTest::VerifyProfileApprovePurchase(); // Error while testing, need to cross check break; } - case 'R': { - CoreSDKTest::DiscoveryWatchedReduced(); + case 'F': { + CoreSDKTest::GetProfileFlags(); break; } -#endif - case 'B': { - HandleEventListener(Discovery, OnNavigateToLaunchNotification) - } default: break; } } while (opt != 'Q'); } -void HandleKeyboardMethodsInvokation() +void HandleSecondScreenMethods() { int opt; do { getchar(); - ShowKeyboardMenu(); + ShowSecondScreenMenu(); printf("Enter option : "); opt = toupper(getchar()); switch (opt) { - case 'E': { - CoreSDKTest::InvokeKeyboardEmail(); + case 'D': { + CoreSDKTest::GetSecondScreenDevice(); break; } - case 'A': { - CoreSDKTest::AbortKeyboardEmail(); + case 'F': { + HandleProperty(SecondScreen, FriendlyName) break; } case 'P': { - CoreSDKTest::InvokeKeyboardPassword(); - break; - } - case 'C': { - CoreSDKTest::AbortKeyboardPassword(); - break; - } - case 'S': { - CoreSDKTest::InvokeKeyboardStandard(); - break; - } - case 'K': { - CoreSDKTest::AbortKeyboardStandard(); + CoreSDKTest::GetSecondScreenProtocols(); break; } default: @@ -562,80 +672,60 @@ int main (int argc, char* argv[]) printf("Enter option : "); option = toupper(getchar()); switch (option) { - case 'I' : { - CoreSDKTest::GetAccountId(); // Error while running need to cross check + case 'C': { + HandleAccessibilityMethods(); break; } - case 'U' : { - CoreSDKTest::GetAccountUid(); // Error while running need to cross check + case 'O' : { + HandleAccountMethods(); break; } case 'A' : { - HandleAdvertisingMethod(); - break; - } - case 'N': { - HandleProperty(Device, Name) - break; - } - case 'M': { - CoreSDKTest::GetDeviceModel(); + HandleAdvertisingMethods(); break; } - case 'S': { - CoreSDKTest::GetDeviceSku(); - break; - } - case 'P': { - HandleProperty(Device, Audio) + case 'U': { + HandleAuthenticationMethods(); break; } - case 'R': { - HandleProperty(Device, ScreenResolution) + case 'B': { + HandleCapabilitiesMethods(); break; } - case 'L': { - HandleLocalizationMethod(); + case 'D': { + HandleDeviceMethods(); break; } - case 'C': { - HandleProperty(Accessibility, ClosedCaptionsSettings) + case 'I': { + HandleDiscoveryMethods(); break; } case 'K': { HandleKeyboardMethodsInvokation(); break; } - case 'V': { - HandleProfileMethod(); - break; - } - case 'T': { - HandleAuthenticationMethod(); - break; - } - case 'B': { - HandleCapabilitiesMethod(); + case 'F': { + HandleLifecycleMethods(); break; } - case 'F': { - HandleLifecycleMethod(); + case 'L': { + HandleLocalizationMethods(); break; } - case 'E': { - HandleMetricsMethod(); + case 'M': { + HandleMetricsMethods(); break; } - case 'D': { - HandleSecondScreenMethod(); + case 'P': { + HandleParametersMethods(); break; } - case 'Y': { - HandleDiscoveryMethod(); + case 'R': { + HandleProfileMethods(); break; } - case 'Z': { - CoreSDKTest::ParametersInitialization(); + case 'S': { + HandleSecondScreenMethods(); break; } default: diff --git a/src/sdks/manage/src/cpp/sdk/cpptest/Main.cpp b/src/sdks/manage/src/cpp/sdk/cpptest/Main.cpp index 1a0b1df3b..48d59bf38 100644 --- a/src/sdks/manage/src/cpp/sdk/cpptest/Main.cpp +++ b/src/sdks/manage/src/cpp/sdk/cpptest/Main.cpp @@ -4,34 +4,81 @@ void ShowMenu() { printf("Options ---- >\n" - "\tA : Get/Set Advertising skipRestriction\n" - "\tT : Set Account Session\n" - "\tE : Get/Set/Subscribe/Unsubscribe AudioDescriptions Enabled\n" - "\tN : Get/Set/Subscribe/Unsubscribe Device Name\n" - "\tB : Get/Set/Subscribe/Unsubscribe ClosedCaption Background Opacity\n" - "\tF : Get/Set/Subscribe/Unsubscribe ClosedCaption Font Family\n" - "\tL : Get/Set/Subscribe/Unsubscribe Localization Preferred AudioLanguages\n" - "\tC : Get/Set/Subscribe/Unsubscribe Privacy Allow ACR Collection\n" - "\tS : Get Privacy Settings\n" - "\tI : Subscribe/Unsubscribe SignIn notification\n" - "\tO : Subscribe/Unsubscribe SignOut notification\n" - "\tR : Reset Advertising Identifier\n" - "\tK : Register for Keyboard Provider and check sequence\n" - "\tG : Register for Acknowledge Challenge Provider and check sequence\n" - "\tP : Register for Pin Challenge Provider and check sequence\n" - "\tD : Operate on Localization Additional Info\n" - "\tU : Grant/Deny/Clear permission on App\n" - "\tW : Scan Wifi on device\n" + "\tG : AcknowledgeChallenge Provider\n" + "\tO : Account\n" + "\tA : Advertising\n" + "\tE : AudioDescriptions\n" + "\tC : ClosedCaption\n" + "\tD : Device\n" + "\tI : Discovery\n" + "\tK : Keyboard Provider\n" + "\tL : Localization\n" + "\tP : PinChallenge Provider\n" + "\tV : Privacy\n" + "\tU : UserGrant\n" + "\tW : Wifi\n" "\tQ : Quit\n\n" ); } -void ShowWifiOperationsMenu() +void ShowAccountMenu() { printf("Options \n" - "\tS : Scan access points\n" - "\tC : Connect to selected access point \n" - "\tD : Disconnect from access point \n" + "\tS : Set Account Session\n" + "\tQ : Quit\n"); +} + +void ShowAdvertisingMenu() +{ + printf("Options \n" + "\tS : Get/Set Advertising skipRestriction\n" + "\tR : Reset Advertising Identifier\n" + "\tQ : Quit\n"); +} + +void ShowAudioDescriptionsMenu() +{ + printf("Options \n" + "\tE : Get/Set/Subscribe/Unsubscribe AudioDescriptions Enabled\n" + "\tQ : Quit\n"); +} + +void ShowClosedCaptionsMenu() +{ + printf("Options \n" + "\tB : Get/Set/Subscribe/Unsubscribe ClosedCaption Background Opacity\n" + "\tF : Get/Set/Subscribe/Unsubscribe ClosedCaption Font Family\n" + "\tQ : Quit\n"); +} + +void ShowDeviceMenu() +{ + printf("Options \n" + "\tN : Get/Set/Subscribe/Unsubscribe Device Name\n" + "\tQ : Quit\n"); +} + +void ShowDiscoveryMenu() +{ + printf("Options \n" + "\tI : Subscribe/Unsubscribe SignIn notification\n" + "\tO : Subscribe/Unsubscribe SignOut notification\n" + "\tQ : Quit\n"); +} + +void ShowLocalizationMenu() +{ + printf("Options \n" + "\tD : Operate on Localization Additional Info\n" + "\tP : Get/Set/Subscribe/Unsubscribe Localization Preferred AudioLanguages\n" + "\tQ : Quit\n"); +} + +void ShowPrivacyMenu() +{ + printf("Options \n" + "\tC : Get/Set/Subscribe/Unsubscribe Privacy Allow ACR Collection\n" + "\tS : Get Privacy Settings\n" "\tQ : Quit\n"); } @@ -47,6 +94,15 @@ void ShowUserGrantsMenu() "\tQ : Quit\n"); } +void ShowWifiOperationsMenu() +{ + printf("Options \n" + "\tS : Scan access points\n" + "\tC : Connect to selected access point \n" + "\tD : Disconnect from access point \n" + "\tQ : Quit\n"); +} + void ShowAdditionalInfoMenu() { printf("Options \n" @@ -89,64 +145,6 @@ void ShowEventMenu() "\tQ : Quit\n"); } -void HandleUserGrants() -{ - int opt; - do { - getchar(); - ShowUserGrantsMenu(); - printf("Enter option : "); - opt = toupper(getchar()); - switch (opt) { - case 'G': { - ManageSDKTest::GetUserGrantsPermission(); - break; - } - case 'R': { - ManageSDKTest::GrantUserGrantsPermission(); - break; - } - case 'D': { - ManageSDKTest::DenyUserGrantsPermission(); - break; - } - case 'C': { - ManageSDKTest::ClearUserGrantsPermission(); - break; - } - default: - break; - } - } while (opt != 'Q'); -} - -void HandleAdditionalInfo() -{ - int opt; - do { - getchar(); - ShowAdditionalInfoMenu(); - printf("Enter option : "); - opt = toupper(getchar()); - switch (opt) { - case 'G': { - ManageSDKTest::GetLocalizationAdditionalInfo(); - break; - } - case 'A': { - ManageSDKTest::AddLocalizationAdditionalInfo(); - break; - } - case 'R': { - ManageSDKTest::RemoveLocalizationAdditionalInfo(); - break; - } - default: - break; - } - } while (opt != 'Q'); -} - #define VALUE(string) #string #define TO_STRING(string) VALUE(string) @@ -198,7 +196,6 @@ void HandleAdditionalInfo() } while (opt != 'Q'); \ } - #define HandlePropertyWithEvent(Module, Property) \ { \ int opt; \ @@ -252,6 +249,236 @@ void HandleAdditionalInfo() } while (opt != 'Q'); \ } +void HandleAccountMethods() +{ + int opt; + do { + getchar(); + ShowAccountMenu(); + printf("Enter option : "); + opt = toupper(getchar()); + switch (opt) { + case 'S': { + ManageSDKTest::SetAccountSession(); + break; + } + default: + break; + } + } while (opt != 'Q'); +} + +void HandleAdvertisingMethods() +{ + int opt; + do { + getchar(); + ShowAdvertisingMenu(); + printf("Enter option : "); + opt = toupper(getchar()); + switch (opt) { + case 'S': { + HandleProperty(Advertising, SkipRestriction) + break; + } + case 'R': { + ManageSDKTest::ResetAdvertisingIdentifier(); + break; + } + default: + break; + } + } while (opt != 'Q'); +} + +void HandleAudioDescriptionsMethods() +{ + int opt; + do { + getchar(); + ShowAudioDescriptionsMenu(); + printf("Enter option : "); + opt = toupper(getchar()); + switch (opt) { + case 'A': { + HandlePropertyWithEvent(AudioDescriptions, Enabled) + break; + } + default: + break; + } + } while (opt != 'Q'); +} + +void HandleClosedCaptionsMethods() +{ + int opt; + do { + getchar(); + ShowClosedCaptionsMenu(); + printf("Enter option : "); + opt = toupper(getchar()); + switch (opt) { + case 'B': { + HandlePropertyWithEvent(ClosedCaptions, BackgroundOpacity) + break; + } + case 'F': { + HandlePropertyWithEvent(ClosedCaptions, FontFamily) + break; + } + default: + break; + } + } while (opt != 'Q'); +} + +void HandleDeviceMethods() +{ + int opt; + do { + getchar(); + ShowDeviceMenu(); + printf("Enter option : "); + opt = toupper(getchar()); + switch (opt) { + case 'N': { + HandlePropertyWithEvent(Device, Name) + break; + } + default: + break; + } + } while (opt != 'Q'); +} + +void HandleDiscoveryMethods() +{ + int opt; + do { + getchar(); + ShowDiscoveryMenu(); + printf("Enter option : "); + opt = toupper(getchar()); + switch (opt) { + case 'I': { + HandleEventListener(Discovery, SignInNotification) + break; + } + case 'O': { + HandleEventListener(Discovery, SignOutNotification) + break; + } + default: + break; + } + } while (opt != 'Q'); +} + +void HandleAdditionalInfo() +{ + int opt; + do { + getchar(); + ShowAdditionalInfoMenu(); + printf("Enter option : "); + opt = toupper(getchar()); + switch (opt) { + case 'G': { + ManageSDKTest::GetLocalizationAdditionalInfo(); + break; + } + case 'A': { + ManageSDKTest::AddLocalizationAdditionalInfo(); + break; + } + case 'R': { + ManageSDKTest::RemoveLocalizationAdditionalInfo(); + break; + } + default: + break; + } + } while (opt != 'Q'); +} + +void HandleLocalizationMethods() +{ + int opt; + do { + getchar(); + ShowLocalizationMenu(); + printf("Enter option : "); + opt = toupper(getchar()); + switch (opt) { + case 'D': { + HandleAdditionalInfo(); + break; + } + case 'P': { + HandlePropertyWithEvent(Localization, PreferredAudioLanguages) + break; + } + default: + break; + } + } while (opt != 'Q'); +} + +void HandlePrivacyMethods() +{ + int opt; + do { + getchar(); + ShowPrivacyMenu(); + printf("Enter option : "); + opt = toupper(getchar()); + switch (opt) { + case 'A': { + HandlePropertyWithEvent(Privacy, AllowACRCollection) + break; + } + case 'S': { + ManageSDKTest::GetPrivacySettings(); + break; + } + default: + break; + } + } while (opt != 'Q'); +} + +void HandleUserGrants() +{ + int opt; + do { + getchar(); + ShowUserGrantsMenu(); + printf("Enter option : "); + opt = toupper(getchar()); + switch (opt) { + case 'G': { + ManageSDKTest::GetUserGrantsPermission(); + break; + } + case 'R': { + ManageSDKTest::GrantUserGrantsPermission(); + break; + } + case 'D': { + ManageSDKTest::DenyUserGrantsPermission(); + break; + } + case 'C': { + ManageSDKTest::ClearUserGrantsPermission(); + break; + } + default: + break; + } + } while (opt != 'Q'); +} + void HandleWifiOperations() { int opt; @@ -307,52 +534,28 @@ int main (int argc, char* argv[]) printf("Enter option : "); option = toupper(getchar()); switch (option) { - case 'A': { - HandleProperty(Advertising, SkipRestriction) + case 'O': { + HandleAccountMethods(); break; } - case 'T': { - ManageSDKTest::SetAccountSession(); + case 'A': { + HandleAdvertisingMethods(); break; } case 'E': { - HandlePropertyWithEvent(AudioDescriptions, Enabled) - break; - } - case 'N': { - HandlePropertyWithEvent(Device, Name) - break; - } - case 'B': { - HandlePropertyWithEvent(ClosedCaptions, BackgroundOpacity) - break; - } - case 'F': { - HandlePropertyWithEvent(ClosedCaptions, FontFamily) - break; - } - case 'L': { - HandlePropertyWithEvent(Localization, PreferredAudioLanguages) + HandleAudioDescriptionsMethods(); break; } case 'C': { - HandlePropertyWithEvent(Privacy, AllowACRCollection) + HandleClosedCaptionsMethods(); break; } - case 'S': { - ManageSDKTest::GetPrivacySettings(); + case 'D': { + HandleDeviceMethods(); break; } case 'I': { - HandleEventListener(Discovery, SignInNotification) - break; - } - case 'O': { - HandleEventListener(Discovery, SignOutNotification) - break; - } - case 'R': { - ManageSDKTest::ResetAdvertisingIdentifier(); + HandleDiscoveryMethods(); break; } case 'K': { @@ -370,8 +573,12 @@ int main (int argc, char* argv[]) HandleProviderSequence(PinChallenge) break; } - case 'D': { - HandleAdditionalInfo(); + case 'L': { + HandleLocalizationMethods(); + break; + } + case 'V': { + HandlePrivacyMethods(); break; } case 'U': {