From ffdcff5c24e7a7e8be340c6cae44a50627192a0d Mon Sep 17 00:00:00 2001 From: nnaveen979 Date: Thu, 31 Jul 2025 12:32:45 +0530 Subject: [PATCH 01/10] test: contract test descripencies are resolved for testtrack and usersettings --- .../contracts/thunder_text_track_pacts.rs | 40 ++++----- .../contracts/thunder_user_settings_pacts.rs | 88 +++++++++---------- 2 files changed, 64 insertions(+), 64 deletions(-) diff --git a/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs b/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs index 3ac3793fc..4953d0ea3 100644 --- a/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs +++ b/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs @@ -105,7 +105,7 @@ async fn test_text_track_set_font_family() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 2)", - "result": "matching(type, 'SUCCESS')" + "result": null }] })) .await; @@ -200,7 +200,7 @@ async fn test_text_track_set_font_size() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 4)", - "result": "matching(type, 'SUCCESS')" + "result": null }] })) .await; @@ -295,7 +295,7 @@ async fn test_text_track_set_font_color() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 6)", - "result": "matching(type, 'SUCCESS')" + "result": null }] })) .await; @@ -390,7 +390,7 @@ async fn test_text_track_set_font_edge() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 8)", - "result": "matching(type, 'SUCCESS')" + "result": null }] })) .await; @@ -487,7 +487,7 @@ async fn test_text_track_set_font_edge_color() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 10)", - "result": "matching(type, 'SUCCESS')" + "result": null }] })) .await; @@ -534,7 +534,7 @@ async fn test_text_track_get_font_opacity() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 11)", - "result": "matching(type, '0.8')" + "result": "matching(integer, -1)" }] })).await; i.test_name("get_font_opacity"); @@ -574,7 +574,7 @@ async fn test_text_track_set_font_opacity() { "id": "matching(integer, 12)", "method": "org.rdk.TextTrack.setFontOpacity", "params": { - "fontOpacity": "matching(type, '0.9')" + "fontOpacity": "matching(integer, 1)" } }, "requestMetadata": { @@ -583,7 +583,7 @@ async fn test_text_track_set_font_opacity() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 12)", - "result": "matching(type, 'SUCCESS')" + "result": null }] })) .await; @@ -606,7 +606,7 @@ async fn test_text_track_set_font_opacity() { "id": 12, "method": "org.rdk.TextTrack.setFontOpacity", "params": { - "fontOpacity": "0.9" + "fontOpacity": 1 } }) ) @@ -629,7 +629,7 @@ async fn test_text_track_get_background_color() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 13)", - "result": "matching(type, '#000000')" + "result": "matching(type, '#000000ff')" }] })).await; i.test_name("get_background_color"); @@ -680,7 +680,7 @@ async fn test_text_track_set_background_color() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 14)", - "result": "matching(type, 'SUCCESS')" + "result": null }] })) .await; @@ -727,7 +727,7 @@ async fn test_text_track_get_background_opacity() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 15)", - "result": "matching(type, '0.7')" + "result": "matching(integer, -1)" }] })).await; i.test_name("get_background_opacity"); @@ -769,7 +769,7 @@ async fn test_text_track_set_background_opacity() { "id": "matching(integer, 16)", "method": "org.rdk.TextTrack.setBackgroundOpacity", "params": { - "backgroundOpacity": "matching(type, '0.85')" + "backgroundOpacity": "matching(type, 1)" } }, "requestMetadata": { @@ -778,7 +778,7 @@ async fn test_text_track_set_background_opacity() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 16)", - "result": "matching(type, 'SUCCESS')" + "result": null }] })) .await; @@ -802,7 +802,7 @@ async fn test_text_track_set_background_opacity() { "id": 16, "method": "org.rdk.TextTrack.setBackgroundOpacity", "params": { - "backgroundOpacity": "0.85" + "backgroundOpacity": 1 } }) ) @@ -874,7 +874,7 @@ async fn test_text_track_set_window_color() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 18)", - "result": "matching(type, 'SUCCESS')" + "result": null }] })) .await; @@ -920,7 +920,7 @@ async fn test_text_track_get_window_opacity() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 19)", - "result": "matching(type, '0.6')" + "result": "matching(integer, -1)" }] })).await; i.test_name("get_window_opacity"); @@ -962,7 +962,7 @@ async fn test_text_track_set_window_opacity() { "id": "matching(integer, 20)", "method": "org.rdk.TextTrack.setWindowOpacity", "params": { - "windowOpacity": "matching(type, '0.75')" + "windowOpacity": "matching(integer, 1)" } }, "requestMetadata": { @@ -971,7 +971,7 @@ async fn test_text_track_set_window_opacity() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 20)", - "result": "matching(type, 'SUCCESS')" + "result": null }] })) .await; @@ -995,7 +995,7 @@ async fn test_text_track_set_window_opacity() { "id": 20, "method": "org.rdk.TextTrack.setWindowOpacity", "params": { - "windowOpacity": "0.75" + "windowOpacity": 1 } }) ) diff --git a/device/thunder_ripple_sdk/src/tests/contracts/thunder_user_settings_pacts.rs b/device/thunder_ripple_sdk/src/tests/contracts/thunder_user_settings_pacts.rs index 41fecbf59..399a3cc3d 100644 --- a/device/thunder_ripple_sdk/src/tests/contracts/thunder_user_settings_pacts.rs +++ b/device/thunder_ripple_sdk/src/tests/contracts/thunder_user_settings_pacts.rs @@ -95,10 +95,10 @@ async fn test_device_set_presentation_language() { "pact:content-type": "application/json", "request": { "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", + "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setPresentationLanguage", "params": { - "language": "matching(type, 'en-US')" + "presentationLanguage": "matching(type, 'en-US')" } }, "requestMetadata": { @@ -106,8 +106,8 @@ async fn test_device_set_presentation_language() { }, "response": [{ "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", - "result": "matching(type, 'success')" + "id": "matching(integer, 42)", + "result": null }] })) .await; @@ -128,10 +128,10 @@ async fn test_device_set_presentation_language() { .to_string(), json!({ "jsonrpc": "2.0", - "id": 0, + "id": 42, "method": "org.rdk.UserSettings.setPresentationLanguage", "params": { - "language": "en-US" + "presentationLanguage": "en-US" } }) ) @@ -200,7 +200,7 @@ async fn test_device_set_preferred_audio_languages() { "pact:content-type": "application/json", "request": { "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", + "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setPreferredAudioLanguages", "params": { "languages": "matching(type, 'eng')" @@ -211,8 +211,8 @@ async fn test_device_set_preferred_audio_languages() { }, "response": [{ "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", - "result": "matching(type, 'success')" + "id": "matching(integer, 42)", + "result": null }] })) .await; @@ -233,7 +233,7 @@ async fn test_device_set_preferred_audio_languages() { .to_string(), json!({ "jsonrpc": "2.0", - "id": 0, + "id": 42, "method": "org.rdk.UserSettings.setPreferredAudioLanguages", "params": { "languages": "eng" @@ -256,7 +256,7 @@ async fn test_device_set_voice_guidance() { "pact:content-type": "application/json", "request": { "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", + "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setVoiceGuidance", "params": { "enabled": "matching(type, true)" @@ -267,8 +267,8 @@ async fn test_device_set_voice_guidance() { }, "response": [{ "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", - "result": "matching(type, 'success')" + "id": "matching(integer, 42)", + "result": null }] })) .await; @@ -289,7 +289,7 @@ async fn test_device_set_voice_guidance() { .to_string(), json!({ "jsonrpc": "2.0", - "id": 0, + "id": 42, "method": "org.rdk.UserSettings.setVoiceGuidance", "params": { "enabled": true @@ -312,7 +312,7 @@ async fn test_device_get_voice_guidance_rate() { "pact:content-type": "application/json", "request": { "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", + "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.getVoiceGuidanceRate" }, "requestMetadata": { @@ -320,8 +320,8 @@ async fn test_device_get_voice_guidance_rate() { }, "response": [{ "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", - "result": "matching(type, '0.1')" + "id": "matching(integer, 42)", + "result": "matching(type, 0.1)" }] })) .await; @@ -342,7 +342,7 @@ async fn test_device_get_voice_guidance_rate() { .to_string(), json!({ "jsonrpc": "2.0", - "id": 0, + "id": 42, "method": "org.rdk.UserSettings.getVoiceGuidanceRate" }) ) @@ -362,10 +362,10 @@ async fn test_device_set_voice_guidance_rate() { "pact:content-type": "application/json", "request": { "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", + "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setVoiceGuidanceRate", "params": { - "rate": "matching(type, '0.1')" + "rate": "matching(type, 0.1)" } }, "requestMetadata": { @@ -373,8 +373,8 @@ async fn test_device_set_voice_guidance_rate() { }, "response": [{ "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", - "result": "matching(type, 'success')" + "id": "matching(integer, 42)", + "result": null }] })) .await; @@ -395,10 +395,10 @@ async fn test_device_set_voice_guidance_rate() { .to_string(), json!({ "jsonrpc": "2.0", - "id": 0, + "id": 42, "method": "org.rdk.UserSettings.setVoiceGuidanceRate", "params": { - "rate": "0.1" + "rate": 0.1 } }) ) @@ -468,7 +468,7 @@ async fn test_device_set_audio_description() { "pact:content-type": "application/json", "request": { "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", + "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setAudioDescription", "params": { "enabled": "matching(type, true)" @@ -479,8 +479,8 @@ async fn test_device_set_audio_description() { }, "response": [{ "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", - "result": "matching(type, 'success')" + "id": "matching(integer, 42)", + "result": null }] })) .await; @@ -501,7 +501,7 @@ async fn test_device_set_audio_description() { .to_string(), json!({ "jsonrpc": "2.0", - "id": 0, + "id": 42, "method": "org.rdk.UserSettings.setAudioDescription", "params": { "enabled": true @@ -623,7 +623,7 @@ async fn test_device_set_captions() { "pact:content-type": "application/json", "request": { "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", + "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setCaptions", "params": { "enabled": "matching(type, true)" @@ -634,8 +634,8 @@ async fn test_device_set_captions() { }, "response": [{ "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", - "result": "matching(type, 'success')" + "id": "matching(integer, 42)", + "result": null }] })) .await; @@ -656,7 +656,7 @@ async fn test_device_set_captions() { .to_string(), json!({ "jsonrpc": "2.0", - "id": 0, + "id": 42, "method": "org.rdk.UserSettings.setCaptions", "params": { "enabled": true @@ -729,7 +729,7 @@ async fn test_device_set_preferred_captions_languages() { "pact:content-type": "application/json", "request": { "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", + "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setPreferredCaptionsLanguages", "params": { "languages": "matching(type, 'eng')" @@ -740,8 +740,8 @@ async fn test_device_set_preferred_captions_languages() { }, "response": [{ "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", - "result": "matching(type, 'success')" + "id": "matching(integer, 42)", + "result": null }] })) .await; @@ -762,7 +762,7 @@ async fn test_device_set_preferred_captions_languages() { .to_string(), json!({ "jsonrpc": "2.0", - "id": 0, + "id": 42, "method": "org.rdk.UserSettings.setPreferredCaptionsLanguages", "params": { "languages": "eng" @@ -785,7 +785,7 @@ async fn test_device_get_voice_guidance_hints() { "pact:content-type": "application/json", "request": { "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", + "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.getVoiceGuidanceHints" }, "requestMetadata": { @@ -793,8 +793,8 @@ async fn test_device_get_voice_guidance_hints() { }, "response": [{ "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", - "result": "matching(type, 'enabled')" + "id": "matching(integer, 42)", + "result": "matching(type, true)" }] })) .await; @@ -815,7 +815,7 @@ async fn test_device_get_voice_guidance_hints() { .to_string(), json!({ "jsonrpc": "2.0", - "id": 0, + "id": 42, "method": "org.rdk.UserSettings.getVoiceGuidanceHints" }) ) @@ -835,7 +835,7 @@ async fn test_device_set_voice_guidance_hints() { "pact:content-type": "application/json", "request": { "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", + "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setVoiceGuidanceHints", "params": { "hints": "matching(type, 'enabled')" @@ -846,8 +846,8 @@ async fn test_device_set_voice_guidance_hints() { }, "response": [{ "jsonrpc": "matching(type, '2.0')", - "id": "matching(integer, 0)", - "result": "matching(type, 'success')" + "id": "matching(integer, 42)", + "result": null }] })) .await; @@ -868,7 +868,7 @@ async fn test_device_set_voice_guidance_hints() { .to_string(), json!({ "jsonrpc": "2.0", - "id": 0, + "id": 42, "method": "org.rdk.UserSettings.setVoiceGuidanceHints", "params": { "hints": "enabled" From 4a967de54981cd210be543878868580d6e545d93 Mon Sep 17 00:00:00 2001 From: nnaveen979 Date: Thu, 31 Jul 2025 14:31:48 +0530 Subject: [PATCH 02/10] chore: changed the backgroundOpacity type in contract test --- .../src/tests/contracts/thunder_text_track_pacts.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs b/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs index 4953d0ea3..bba5eb202 100644 --- a/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs +++ b/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs @@ -769,7 +769,7 @@ async fn test_text_track_set_background_opacity() { "id": "matching(integer, 16)", "method": "org.rdk.TextTrack.setBackgroundOpacity", "params": { - "backgroundOpacity": "matching(type, 1)" + "backgroundOpacity": "matching(integer, 1)" } }, "requestMetadata": { From cac1d602c09f0d2d6ebd8f4b32072d1281396a02 Mon Sep 17 00:00:00 2001 From: nnaveen979 Date: Fri, 1 Aug 2025 16:35:19 +0530 Subject: [PATCH 03/10] fix: review comments fixed for contract tests of text_track, user_settings plugins --- .../contracts/thunder_text_track_pacts.rs | 32 +++++++++++++++---- .../contracts/thunder_user_settings_pacts.rs | 24 ++++++++++---- 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs b/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs index bba5eb202..3f038d969 100644 --- a/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs +++ b/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs @@ -523,6 +523,9 @@ async fn test_text_track_set_font_edge_color() { async fn test_text_track_get_font_opacity() { let mut pact_builder_async = get_pact_builder_async_obj().await; + // Use the same integer value as set in the setter test + let expected_value = 90; + pact_builder_async .synchronous_message_interaction("A request to get the font opacity", |mut i| async move { i.contents_from(json!({ @@ -534,7 +537,7 @@ async fn test_text_track_get_font_opacity() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 11)", - "result": "matching(integer, -1)" + "result": expected_value }] })).await; i.test_name("get_font_opacity"); @@ -565,6 +568,9 @@ async fn test_text_track_get_font_opacity() { async fn test_text_track_set_font_opacity() { let mut pact_builder_async = get_pact_builder_async_obj().await; + // Set a valid integer value for fontOpacity + let set_value = 90; + pact_builder_async .synchronous_message_interaction("A request to set the font opacity", |mut i| async move { i.contents_from(json!({ @@ -574,7 +580,7 @@ async fn test_text_track_set_font_opacity() { "id": "matching(integer, 12)", "method": "org.rdk.TextTrack.setFontOpacity", "params": { - "fontOpacity": "matching(integer, 1)" + "fontOpacity": "matching(integer, 90)" } }, "requestMetadata": { @@ -606,7 +612,7 @@ async fn test_text_track_set_font_opacity() { "id": 12, "method": "org.rdk.TextTrack.setFontOpacity", "params": { - "fontOpacity": 1 + "fontOpacity": set_value } }) ) @@ -716,6 +722,9 @@ async fn test_text_track_set_background_color() { async fn test_text_track_get_background_opacity() { let mut pact_builder_async = get_pact_builder_async_obj().await; + // Use the same integer value as set in the setter test + let expected_value = 1; + pact_builder_async .synchronous_message_interaction("A request to get the background opacity", |mut i| async move { i.contents_from(json!({ @@ -727,7 +736,7 @@ async fn test_text_track_get_background_opacity() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 15)", - "result": "matching(integer, -1)" + "result": expected_value }] })).await; i.test_name("get_background_opacity"); @@ -758,6 +767,9 @@ async fn test_text_track_get_background_opacity() { async fn test_text_track_set_background_opacity() { let mut pact_builder_async = get_pact_builder_async_obj().await; + // Set a valid integer value for backgroundOpacity + let set_value = 1; + pact_builder_async .synchronous_message_interaction( "A request to set the background opacity", @@ -802,7 +814,7 @@ async fn test_text_track_set_background_opacity() { "id": 16, "method": "org.rdk.TextTrack.setBackgroundOpacity", "params": { - "backgroundOpacity": 1 + "backgroundOpacity": set_value } }) ) @@ -909,6 +921,9 @@ async fn test_text_track_set_window_color() { async fn test_text_track_get_window_opacity() { let mut pact_builder_async = get_pact_builder_async_obj().await; + // Use the same integer value as set in the setter test + let expected_value = 1; + pact_builder_async .synchronous_message_interaction("A request to get the window opacity", |mut i| async move { i.contents_from(json!({ @@ -920,7 +935,7 @@ async fn test_text_track_get_window_opacity() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 19)", - "result": "matching(integer, -1)" + "result": expected_value }] })).await; i.test_name("get_window_opacity"); @@ -951,6 +966,9 @@ async fn test_text_track_get_window_opacity() { async fn test_text_track_set_window_opacity() { let mut pact_builder_async = get_pact_builder_async_obj().await; + // Set a valid integer value for windowOpacity + let set_value = 1; + pact_builder_async .synchronous_message_interaction( "A request to set the window opacity", @@ -995,7 +1013,7 @@ async fn test_text_track_set_window_opacity() { "id": 20, "method": "org.rdk.TextTrack.setWindowOpacity", "params": { - "windowOpacity": 1 + "windowOpacity": set_value } }) ) diff --git a/device/thunder_ripple_sdk/src/tests/contracts/thunder_user_settings_pacts.rs b/device/thunder_ripple_sdk/src/tests/contracts/thunder_user_settings_pacts.rs index 399a3cc3d..f57f2f39c 100644 --- a/device/thunder_ripple_sdk/src/tests/contracts/thunder_user_settings_pacts.rs +++ b/device/thunder_ripple_sdk/src/tests/contracts/thunder_user_settings_pacts.rs @@ -304,6 +304,9 @@ async fn test_device_set_voice_guidance() { async fn test_device_get_voice_guidance_rate() { let mut pact_builder_async = get_pact_builder_async_obj().await; + // Use the same value as set in the setter + let rate_value = 0.1; + pact_builder_async .synchronous_message_interaction( "A request to get the voice guidance rate", @@ -321,7 +324,7 @@ async fn test_device_get_voice_guidance_rate() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 42)", - "result": "matching(type, 0.1)" + "result": rate_value }] })) .await; @@ -354,6 +357,9 @@ async fn test_device_get_voice_guidance_rate() { async fn test_device_set_voice_guidance_rate() { let mut pact_builder_async = get_pact_builder_async_obj().await; + // Set a valid value for rate + let rate_value = 0.1; + pact_builder_async .synchronous_message_interaction( "A request to set the voice guidance rate", @@ -365,7 +371,7 @@ async fn test_device_set_voice_guidance_rate() { "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setVoiceGuidanceRate", "params": { - "rate": "matching(type, 0.1)" + "rate": rate_value } }, "requestMetadata": { @@ -398,7 +404,7 @@ async fn test_device_set_voice_guidance_rate() { "id": 42, "method": "org.rdk.UserSettings.setVoiceGuidanceRate", "params": { - "rate": 0.1 + "rate": rate_value } }) ) @@ -777,6 +783,9 @@ async fn test_device_set_preferred_captions_languages() { async fn test_device_get_voice_guidance_hints() { let mut pact_builder_async = get_pact_builder_async_obj().await; + // Use the same value as set in the setter + let hints_value = "enabled"; + pact_builder_async .synchronous_message_interaction( "A request to get the voice guidance hints", @@ -794,7 +803,7 @@ async fn test_device_get_voice_guidance_hints() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 42)", - "result": "matching(type, true)" + "result": hints_value }] })) .await; @@ -827,6 +836,9 @@ async fn test_device_get_voice_guidance_hints() { async fn test_device_set_voice_guidance_hints() { let mut pact_builder_async = get_pact_builder_async_obj().await; + // Set a valid value for hints + let hints_value = "enabled"; + pact_builder_async .synchronous_message_interaction( "A request to set the voice guidance hints", @@ -838,7 +850,7 @@ async fn test_device_set_voice_guidance_hints() { "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setVoiceGuidanceHints", "params": { - "hints": "matching(type, 'enabled')" + "hints": hints_value } }, "requestMetadata": { @@ -871,7 +883,7 @@ async fn test_device_set_voice_guidance_hints() { "id": 42, "method": "org.rdk.UserSettings.setVoiceGuidanceHints", "params": { - "hints": "enabled" + "hints": hints_value } }) ) From 8c25e8f0e5792dcb8ab2d32e38ee3f37c3894bdb Mon Sep 17 00:00:00 2001 From: nnaveen979 Date: Fri, 1 Aug 2025 20:42:10 +0530 Subject: [PATCH 04/10] fix: contract test fix --- .../src/tests/contracts/thunder_device_info_pacts.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/device/thunder_ripple_sdk/src/tests/contracts/thunder_device_info_pacts.rs b/device/thunder_ripple_sdk/src/tests/contracts/thunder_device_info_pacts.rs index ebe1378e2..e95f5cb0f 100644 --- a/device/thunder_ripple_sdk/src/tests/contracts/thunder_device_info_pacts.rs +++ b/device/thunder_ripple_sdk/src/tests/contracts/thunder_device_info_pacts.rs @@ -109,8 +109,8 @@ async fn test_device_get_model() { result.insert( "stbTimestamp".into(), ContractMatcher::MatchRegex( - "^\\w{3} \\d{1,2} \\w{3} (?:\\d{2})?\\d{2} \\d{2}:\\d{2}:\\d{2} UTC$".into(), - "Wed 01 Jan 2024 02:45:28 UTC".into(), + "^\\w{3} \\d{1,2} \\w{3} (?:\\d{2})?\\d{2} \\d{2}:\\d{2}:\\d{2} [A-Z ]*UTC$".into(), + "Thu 09 Jan 2020 04:04:24 AP UTC".into(), ), ); result.insert("success".into(), ContractMatcher::MatchBool(true)); @@ -137,7 +137,7 @@ async fn test_device_get_model() { .to_string(), json!({ "jsonrpc": "2.0", - "id": 0, + "id": 42, "method": "org.rdk.System.1.getSystemVersions" }) ) From e901fc4fee90739e6e516702aa9bb5bae4cd2fc3 Mon Sep 17 00:00:00 2001 From: nnaveen979 Date: Tue, 5 Aug 2025 20:26:33 +0530 Subject: [PATCH 05/10] chore: dummy commit --- .../src/tests/contracts/thunder_device_info_pacts.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/device/thunder_ripple_sdk/src/tests/contracts/thunder_device_info_pacts.rs b/device/thunder_ripple_sdk/src/tests/contracts/thunder_device_info_pacts.rs index e95f5cb0f..2f8ccc88b 100644 --- a/device/thunder_ripple_sdk/src/tests/contracts/thunder_device_info_pacts.rs +++ b/device/thunder_ripple_sdk/src/tests/contracts/thunder_device_info_pacts.rs @@ -95,10 +95,12 @@ async fn test_device_get_model() { let mut pact_builder_async = get_pact_builder_async_obj().await; let mut result = HashMap::new(); + result.insert( "stbVersion".into(), ContractMatcher::MatchType("AX061AEI_VBN_1911_sprint_20200109040424sdy".into()), ); + result.insert( "receiverVersion".into(), ContractMatcher::MatchRegex( @@ -106,6 +108,7 @@ async fn test_device_get_model() { "3.14.0.0".into(), ), ); + result.insert( "stbTimestamp".into(), ContractMatcher::MatchRegex( From 40b9481df752fc145975b16588c12efbedd22150 Mon Sep 17 00:00:00 2001 From: nnaveen979 Date: Thu, 7 Aug 2025 15:38:02 +0530 Subject: [PATCH 06/10] test: contract tests modified for the usersettings plugin --- .../contracts/thunder_user_settings_pacts.rs | 52 +++++++------------ 1 file changed, 20 insertions(+), 32 deletions(-) diff --git a/device/thunder_ripple_sdk/src/tests/contracts/thunder_user_settings_pacts.rs b/device/thunder_ripple_sdk/src/tests/contracts/thunder_user_settings_pacts.rs index f57f2f39c..faed8138b 100644 --- a/device/thunder_ripple_sdk/src/tests/contracts/thunder_user_settings_pacts.rs +++ b/device/thunder_ripple_sdk/src/tests/contracts/thunder_user_settings_pacts.rs @@ -57,7 +57,7 @@ async fn test_device_get_presentation_language() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 0)", - "result": "matching(type, 'en-US')" + "result": "matching(regex, '^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-[a-zA-Z]{2}|[0-9]{3})?(-[a-zA-Z0-9]+)*$', 'en-Latn-US')" }] })).await; i.test_name("get_presentation_language"); @@ -98,7 +98,7 @@ async fn test_device_set_presentation_language() { "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setPresentationLanguage", "params": { - "presentationLanguage": "matching(type, 'en-US')" + "presentationLanguage": "matching(regex, '^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-[a-zA-Z]{2}|[0-9]{3})?(-[a-zA-Z0-9]+)*$', 'en-Latn-US')" } }, "requestMetadata": { @@ -159,7 +159,7 @@ async fn test_device_get_preferred_audio_languages() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 0)", - "result": "matching(type, 'eng')" + "result": "matching(regex, '^[a-z]{3}(,[a-z]{3})*$', 'eng,spa,fre')" }] })) .await; @@ -203,7 +203,7 @@ async fn test_device_set_preferred_audio_languages() { "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setPreferredAudioLanguages", "params": { - "languages": "matching(type, 'eng')" + "preferredLanguages": "matching(regex, '^[a-z]{3}(,[a-z]{3})*$', 'eng,spa,fre')" } }, "requestMetadata": { @@ -236,7 +236,7 @@ async fn test_device_set_preferred_audio_languages() { "id": 42, "method": "org.rdk.UserSettings.setPreferredAudioLanguages", "params": { - "languages": "eng" + "preferredLanguages": "eng" } }) ) @@ -259,7 +259,7 @@ async fn test_device_set_voice_guidance() { "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setVoiceGuidance", "params": { - "enabled": "matching(type, true)" + "enabled": "matching(boolean, true)" } }, "requestMetadata": { @@ -304,9 +304,6 @@ async fn test_device_set_voice_guidance() { async fn test_device_get_voice_guidance_rate() { let mut pact_builder_async = get_pact_builder_async_obj().await; - // Use the same value as set in the setter - let rate_value = 0.1; - pact_builder_async .synchronous_message_interaction( "A request to get the voice guidance rate", @@ -324,7 +321,7 @@ async fn test_device_get_voice_guidance_rate() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 42)", - "result": rate_value + "result": "matching(type, 0.1)" }] })) .await; @@ -357,9 +354,6 @@ async fn test_device_get_voice_guidance_rate() { async fn test_device_set_voice_guidance_rate() { let mut pact_builder_async = get_pact_builder_async_obj().await; - // Set a valid value for rate - let rate_value = 0.1; - pact_builder_async .synchronous_message_interaction( "A request to set the voice guidance rate", @@ -371,7 +365,7 @@ async fn test_device_set_voice_guidance_rate() { "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setVoiceGuidanceRate", "params": { - "rate": rate_value + "rate": "matching(type, 0.1)" } }, "requestMetadata": { @@ -404,7 +398,7 @@ async fn test_device_set_voice_guidance_rate() { "id": 42, "method": "org.rdk.UserSettings.setVoiceGuidanceRate", "params": { - "rate": rate_value + "rate": 0.1 } }) ) @@ -433,7 +427,7 @@ async fn test_device_get_audio_description() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 0)", - "result": "matching(type, true)" + "result": "matching(boolean, true)" }] })) .await; @@ -477,7 +471,7 @@ async fn test_device_set_audio_description() { "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setAudioDescription", "params": { - "enabled": "matching(type, true)" + "enabled": "matching(boolean, true)" } }, "requestMetadata": { @@ -588,7 +582,7 @@ async fn test_device_get_captions() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 0)", - "result": "matching(type, true)" + "result": "matching(boolean, true)" }] })) .await; @@ -632,7 +626,7 @@ async fn test_device_set_captions() { "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setCaptions", "params": { - "enabled": "matching(type, true)" + "enabled": "matching(boolean, true)" } }, "requestMetadata": { @@ -694,7 +688,7 @@ async fn test_device_get_preferred_captions_languages() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 0)", - "result": "matching(type, 'eng')" + "result": "matching(regex, '^[a-z]{3}(,[a-z]{3})*$', 'eng,spa,fre')" }] })) .await; @@ -738,7 +732,7 @@ async fn test_device_set_preferred_captions_languages() { "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setPreferredCaptionsLanguages", "params": { - "languages": "matching(type, 'eng')" + "preferredLanguages": "matching(regex, '^[a-z]{3}(,[a-z]{3})*$', 'eng,spa,fre')" } }, "requestMetadata": { @@ -771,7 +765,7 @@ async fn test_device_set_preferred_captions_languages() { "id": 42, "method": "org.rdk.UserSettings.setPreferredCaptionsLanguages", "params": { - "languages": "eng" + "preferredLanguages": "eng" } }) ) @@ -783,9 +777,6 @@ async fn test_device_set_preferred_captions_languages() { async fn test_device_get_voice_guidance_hints() { let mut pact_builder_async = get_pact_builder_async_obj().await; - // Use the same value as set in the setter - let hints_value = "enabled"; - pact_builder_async .synchronous_message_interaction( "A request to get the voice guidance hints", @@ -803,7 +794,7 @@ async fn test_device_get_voice_guidance_hints() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 42)", - "result": hints_value + "result": "matching(boolean, true)" }] })) .await; @@ -836,9 +827,6 @@ async fn test_device_get_voice_guidance_hints() { async fn test_device_set_voice_guidance_hints() { let mut pact_builder_async = get_pact_builder_async_obj().await; - // Set a valid value for hints - let hints_value = "enabled"; - pact_builder_async .synchronous_message_interaction( "A request to set the voice guidance hints", @@ -850,7 +838,7 @@ async fn test_device_set_voice_guidance_hints() { "id": "matching(integer, 42)", "method": "org.rdk.UserSettings.setVoiceGuidanceHints", "params": { - "hints": hints_value + "hints": "matching(boolean, true)" } }, "requestMetadata": { @@ -883,7 +871,7 @@ async fn test_device_set_voice_guidance_hints() { "id": 42, "method": "org.rdk.UserSettings.setVoiceGuidanceHints", "params": { - "hints": hints_value + "hints": true } }) ) @@ -912,7 +900,7 @@ async fn test_device_get_voice_guidance() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 0)", - "result": "matching(type, true)" + "result": "matching(boolean, true)" }] })) .await; From 00860cda005ff8c150271604919b7f5a89d9d7bf Mon Sep 17 00:00:00 2001 From: nnaveen979 Date: Thu, 7 Aug 2025 22:31:43 +0530 Subject: [PATCH 07/10] test: text track contract tests modified --- .../contracts/thunder_text_track_pacts.rs | 55 +++++++------------ 1 file changed, 20 insertions(+), 35 deletions(-) diff --git a/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs b/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs index 3f038d969..36ff353d8 100644 --- a/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs +++ b/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs @@ -96,7 +96,7 @@ async fn test_text_track_set_font_family() { "id": "matching(integer, 2)", "method": "org.rdk.TextTrack.setFontFamily", "params": { - "fontFamily": "matching(type, 'Verdana')" + "fontFamily": "matching(regex, '^(MONOSPACED_SERIF|PROPORTIONAL_SERIF|MONOSPACE_SANS_SERIF|PROPORTIONAL_SANS_SERIF|CASUAL|CURSIVE|SMALL_CAPITAL|CONTENT_DEFAULT)$', 'MONOSPACED_SERIF')" } }, "requestMetadata": { @@ -128,7 +128,7 @@ async fn test_text_track_set_font_family() { "id": 2, "method": "org.rdk.TextTrack.setFontFamily", "params": { - "fontFamily": "Verdana" + "fontFamily": "MONOSPACED_SERIF" } }) ) @@ -191,7 +191,7 @@ async fn test_text_track_set_font_size() { "id": "matching(integer, 4)", "method": "org.rdk.TextTrack.setFontSize", "params": { - "fontSize": "matching(type, '18px')" + "fontSize": "matching(regex, '^(-1|0|1|2|3)$', 1)" } }, "requestMetadata": { @@ -223,7 +223,7 @@ async fn test_text_track_set_font_size() { "id": 4, "method": "org.rdk.TextTrack.setFontSize", "params": { - "fontSize": "18px" + "fontSize": 1 } }) ) @@ -286,7 +286,7 @@ async fn test_text_track_set_font_color() { "id": "matching(integer, 6)", "method": "org.rdk.TextTrack.setFontColor", "params": { - "fontColor": "matching(type, '#FF0000')" + "fontColor": "matching(regex, \"^$|^#[0-9A-Fa-f]{6}$\", \"#FF0000\")" } }, "requestMetadata": { @@ -381,7 +381,7 @@ async fn test_text_track_set_font_edge() { "id": "matching(integer, 8)", "method": "org.rdk.TextTrack.setFontEdge", "params": { - "fontEdge": "matching(type, 'raised')" + "fontEdge": "matching(regex, '^(none|raised|depressed|uniform|drop_shadow_left|drop_shadow_right|content_default)$', 'raised')" } }, "requestMetadata": { @@ -478,7 +478,7 @@ async fn test_text_track_set_font_edge_color() { "id": "matching(integer, 10)", "method": "org.rdk.TextTrack.setFontEdgeColor", "params": { - "fontEdgeColor": "matching(type, '#FF00FF')" + "fontEdgeColor": "matching(regex, \"^$|^#[0-9A-Fa-f]{6}$\", \"#FFFFFF\")" } }, "requestMetadata": { @@ -511,7 +511,7 @@ async fn test_text_track_set_font_edge_color() { "id": 10, "method": "org.rdk.TextTrack.setFontEdgeColor", "params": { - "fontEdgeColor": "#FF00FF" + "fontEdgeColor": "#FFFFFF" } }) ) @@ -523,9 +523,6 @@ async fn test_text_track_set_font_edge_color() { async fn test_text_track_get_font_opacity() { let mut pact_builder_async = get_pact_builder_async_obj().await; - // Use the same integer value as set in the setter test - let expected_value = 90; - pact_builder_async .synchronous_message_interaction("A request to get the font opacity", |mut i| async move { i.contents_from(json!({ @@ -537,7 +534,7 @@ async fn test_text_track_get_font_opacity() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 11)", - "result": expected_value + "result": "matching(regex, '^(-1|[0-9]{1,2}|100)$', 90)" }] })).await; i.test_name("get_font_opacity"); @@ -580,7 +577,7 @@ async fn test_text_track_set_font_opacity() { "id": "matching(integer, 12)", "method": "org.rdk.TextTrack.setFontOpacity", "params": { - "fontOpacity": "matching(integer, 90)" + "fontOpacity": "matching(regex, '^(-1|[0-9]{1,2}|100)$', 1)" } }, "requestMetadata": { @@ -612,7 +609,7 @@ async fn test_text_track_set_font_opacity() { "id": 12, "method": "org.rdk.TextTrack.setFontOpacity", "params": { - "fontOpacity": set_value + "fontOpacity": 1 } }) ) @@ -635,7 +632,7 @@ async fn test_text_track_get_background_color() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 13)", - "result": "matching(type, '#000000ff')" + "result": "matching(regex, \"^$|^#[0-9A-Fa-f]{6}$\", \"#FFFFFF\")" }] })).await; i.test_name("get_background_color"); @@ -677,7 +674,7 @@ async fn test_text_track_set_background_color() { "id": "matching(integer, 14)", "method": "org.rdk.TextTrack.setBackgroundColor", "params": { - "backgroundColor": "matching(type, '#FFFFFF')" + "backgroundColor": "matching(regex, \"^$|^#[0-9A-Fa-f]{6}$\", \"#FFFFFF\")" } }, "requestMetadata": { @@ -722,9 +719,6 @@ async fn test_text_track_set_background_color() { async fn test_text_track_get_background_opacity() { let mut pact_builder_async = get_pact_builder_async_obj().await; - // Use the same integer value as set in the setter test - let expected_value = 1; - pact_builder_async .synchronous_message_interaction("A request to get the background opacity", |mut i| async move { i.contents_from(json!({ @@ -736,7 +730,7 @@ async fn test_text_track_get_background_opacity() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 15)", - "result": expected_value + "result": "matching(regex, '^(-1|[0-9]{1,2}|100)$', 1)" }] })).await; i.test_name("get_background_opacity"); @@ -767,9 +761,6 @@ async fn test_text_track_get_background_opacity() { async fn test_text_track_set_background_opacity() { let mut pact_builder_async = get_pact_builder_async_obj().await; - // Set a valid integer value for backgroundOpacity - let set_value = 1; - pact_builder_async .synchronous_message_interaction( "A request to set the background opacity", @@ -781,7 +772,7 @@ async fn test_text_track_set_background_opacity() { "id": "matching(integer, 16)", "method": "org.rdk.TextTrack.setBackgroundOpacity", "params": { - "backgroundOpacity": "matching(integer, 1)" + "backgroundOpacity": "matching(regex, '^(-1|[0-9]{1,2}|100)$', 1)" } }, "requestMetadata": { @@ -814,7 +805,7 @@ async fn test_text_track_set_background_opacity() { "id": 16, "method": "org.rdk.TextTrack.setBackgroundOpacity", "params": { - "backgroundOpacity": set_value + "backgroundOpacity": 1 } }) ) @@ -837,7 +828,7 @@ async fn test_text_track_get_window_color() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 17)", - "result": "matching(type, '#CCCCCC')" + "result": "matching(regex, \"^$|^#[0-9A-Fa-f]{6}$\", \"#FFFFFF\")" }] })).await; i.test_name("get_window_color"); @@ -921,9 +912,6 @@ async fn test_text_track_set_window_color() { async fn test_text_track_get_window_opacity() { let mut pact_builder_async = get_pact_builder_async_obj().await; - // Use the same integer value as set in the setter test - let expected_value = 1; - pact_builder_async .synchronous_message_interaction("A request to get the window opacity", |mut i| async move { i.contents_from(json!({ @@ -935,7 +923,7 @@ async fn test_text_track_get_window_opacity() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 19)", - "result": expected_value + "result": "matching(regex, '^(-1|[0-9]{1,2}|100)$', 1)" }] })).await; i.test_name("get_window_opacity"); @@ -966,9 +954,6 @@ async fn test_text_track_get_window_opacity() { async fn test_text_track_set_window_opacity() { let mut pact_builder_async = get_pact_builder_async_obj().await; - // Set a valid integer value for windowOpacity - let set_value = 1; - pact_builder_async .synchronous_message_interaction( "A request to set the window opacity", @@ -980,7 +965,7 @@ async fn test_text_track_set_window_opacity() { "id": "matching(integer, 20)", "method": "org.rdk.TextTrack.setWindowOpacity", "params": { - "windowOpacity": "matching(integer, 1)" + "windowOpacity": "matching(regex, '^(-1|[0-9]{1,2}|100)$', 1)" } }, "requestMetadata": { @@ -1013,7 +998,7 @@ async fn test_text_track_set_window_opacity() { "id": 20, "method": "org.rdk.TextTrack.setWindowOpacity", "params": { - "windowOpacity": set_value + "windowOpacity": 1 } }) ) From 1f37a359c56a610d3f4cd5ef6b5821aa320e769d Mon Sep 17 00:00:00 2001 From: nnaveen979 Date: Thu, 7 Aug 2025 22:34:52 +0530 Subject: [PATCH 08/10] chore: clippy error fixed --- .../src/tests/contracts/thunder_text_track_pacts.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs b/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs index 36ff353d8..3dc138771 100644 --- a/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs +++ b/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs @@ -565,9 +565,6 @@ async fn test_text_track_get_font_opacity() { async fn test_text_track_set_font_opacity() { let mut pact_builder_async = get_pact_builder_async_obj().await; - // Set a valid integer value for fontOpacity - let set_value = 90; - pact_builder_async .synchronous_message_interaction("A request to set the font opacity", |mut i| async move { i.contents_from(json!({ From 25e065cf4faf6d683f0a942e776c6ce6cc00cd94 Mon Sep 17 00:00:00 2001 From: nnaveen979 Date: Fri, 8 Aug 2025 11:57:25 +0530 Subject: [PATCH 09/10] test: fixed contract test failures --- .../contracts/thunder_text_track_pacts.rs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs b/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs index 3dc138771..7ca7961ae 100644 --- a/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs +++ b/device/thunder_ripple_sdk/src/tests/contracts/thunder_text_track_pacts.rs @@ -191,7 +191,7 @@ async fn test_text_track_set_font_size() { "id": "matching(integer, 4)", "method": "org.rdk.TextTrack.setFontSize", "params": { - "fontSize": "matching(regex, '^(-1|0|1|2|3)$', 1)" + "fontSize": "matching(regex, '^(-1|0|1|2|3)$', '1')" } }, "requestMetadata": { @@ -286,7 +286,7 @@ async fn test_text_track_set_font_color() { "id": "matching(integer, 6)", "method": "org.rdk.TextTrack.setFontColor", "params": { - "fontColor": "matching(regex, \"^$|^#[0-9A-Fa-f]{6}$\", \"#FF0000\")" + "fontColor": "matching(regex, '^$|^#[0-9A-Fa-f]{6}$', '\"#FF0000\"')" } }, "requestMetadata": { @@ -478,7 +478,7 @@ async fn test_text_track_set_font_edge_color() { "id": "matching(integer, 10)", "method": "org.rdk.TextTrack.setFontEdgeColor", "params": { - "fontEdgeColor": "matching(regex, \"^$|^#[0-9A-Fa-f]{6}$\", \"#FFFFFF\")" + "fontEdgeColor": "matching(regex, '^$|^#[0-9A-Fa-f]{6}$', '\"#FFFFFF\"')" } }, "requestMetadata": { @@ -534,7 +534,7 @@ async fn test_text_track_get_font_opacity() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 11)", - "result": "matching(regex, '^(-1|[0-9]{1,2}|100)$', 90)" + "result": "matching(regex, '^(-1|[0-9]{1,2}|100)$', '90')" }] })).await; i.test_name("get_font_opacity"); @@ -574,7 +574,7 @@ async fn test_text_track_set_font_opacity() { "id": "matching(integer, 12)", "method": "org.rdk.TextTrack.setFontOpacity", "params": { - "fontOpacity": "matching(regex, '^(-1|[0-9]{1,2}|100)$', 1)" + "fontOpacity": "matching(regex, '^(-1|[0-9]{1,2}|100)$', '1')" } }, "requestMetadata": { @@ -629,7 +629,7 @@ async fn test_text_track_get_background_color() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 13)", - "result": "matching(regex, \"^$|^#[0-9A-Fa-f]{6}$\", \"#FFFFFF\")" + "result": "matching(regex, '\"^$|^#[0-9A-Fa-f]{6}$\"', '\"#FFFFFF\"')" }] })).await; i.test_name("get_background_color"); @@ -671,7 +671,7 @@ async fn test_text_track_set_background_color() { "id": "matching(integer, 14)", "method": "org.rdk.TextTrack.setBackgroundColor", "params": { - "backgroundColor": "matching(regex, \"^$|^#[0-9A-Fa-f]{6}$\", \"#FFFFFF\")" + "backgroundColor": "matching(regex, '^$|^#[0-9A-Fa-f]{6}$', '\"#FFFFFF\"')" } }, "requestMetadata": { @@ -727,7 +727,7 @@ async fn test_text_track_get_background_opacity() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 15)", - "result": "matching(regex, '^(-1|[0-9]{1,2}|100)$', 1)" + "result": "matching(regex, '^(-1|[0-9]{1,2}|100)$', '1')" }] })).await; i.test_name("get_background_opacity"); @@ -769,7 +769,7 @@ async fn test_text_track_set_background_opacity() { "id": "matching(integer, 16)", "method": "org.rdk.TextTrack.setBackgroundOpacity", "params": { - "backgroundOpacity": "matching(regex, '^(-1|[0-9]{1,2}|100)$', 1)" + "backgroundOpacity": "matching(regex, '^(-1|[0-9]{1,2}|100)$', '1')" } }, "requestMetadata": { @@ -825,7 +825,7 @@ async fn test_text_track_get_window_color() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 17)", - "result": "matching(regex, \"^$|^#[0-9A-Fa-f]{6}$\", \"#FFFFFF\")" + "result": "matching(regex, '^$|^#[0-9A-Fa-f]{6}$', '\"#FFFFFF\"')" }] })).await; i.test_name("get_window_color"); @@ -920,7 +920,7 @@ async fn test_text_track_get_window_opacity() { "response": [{ "jsonrpc": "matching(type, '2.0')", "id": "matching(integer, 19)", - "result": "matching(regex, '^(-1|[0-9]{1,2}|100)$', 1)" + "result": "matching(regex, '^(-1|[0-9]{1,2}|100)$', '1')" }] })).await; i.test_name("get_window_opacity"); @@ -962,7 +962,7 @@ async fn test_text_track_set_window_opacity() { "id": "matching(integer, 20)", "method": "org.rdk.TextTrack.setWindowOpacity", "params": { - "windowOpacity": "matching(regex, '^(-1|[0-9]{1,2}|100)$', 1)" + "windowOpacity": "matching(regex, '^(-1|[0-9]{1,2}|100)$', '1')" } }, "requestMetadata": { From 5288734c1b1c23ad745fc882b95eed081fc3e037 Mon Sep 17 00:00:00 2001 From: nnaveen979 Date: Fri, 8 Aug 2025 19:50:44 +0530 Subject: [PATCH 10/10] test: contract test get_device_model modified --- .../src/tests/contracts/thunder_device_info_pacts.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/device/thunder_ripple_sdk/src/tests/contracts/thunder_device_info_pacts.rs b/device/thunder_ripple_sdk/src/tests/contracts/thunder_device_info_pacts.rs index 2f8ccc88b..c86815340 100644 --- a/device/thunder_ripple_sdk/src/tests/contracts/thunder_device_info_pacts.rs +++ b/device/thunder_ripple_sdk/src/tests/contracts/thunder_device_info_pacts.rs @@ -98,21 +98,21 @@ async fn test_device_get_model() { result.insert( "stbVersion".into(), - ContractMatcher::MatchType("AX061AEI_VBN_1911_sprint_20200109040424sdy".into()), + ContractMatcher::MatchRegex( + r"^[A-Z0-9]+_VBN_[A-Za-z0-9]+_sprint_\d{14}sdy(_[A-Z0-9_]+)*$".into(), + "AX061AEI_VBN_1911_sprint_20200109040424sdy".into(), + ), ); result.insert( "receiverVersion".into(), - ContractMatcher::MatchRegex( - r"^[0-9]\d*.[0-9]\d*.[0-9]\d*.[0-9]\d*$".into(), - "3.14.0.0".into(), - ), + ContractMatcher::MatchRegex(r"^\d+\.\d+\.\d+\.\d+$".into(), "3.14.0.0".into()), ); result.insert( "stbTimestamp".into(), ContractMatcher::MatchRegex( - "^\\w{3} \\d{1,2} \\w{3} (?:\\d{2})?\\d{2} \\d{2}:\\d{2}:\\d{2} [A-Z ]*UTC$".into(), + r"^\w{3} \d{2} \w{3} \d{4} \d{2}:\d{2}:\d{2} [A-Z ]*UTC$".into(), "Thu 09 Jan 2020 04:04:24 AP UTC".into(), ), );