As Wine currently does not have a way to set captions, returning the default value should suffice for most applications.
It looks like Windows does not do error checking for the *value parameter.
For the computed properties, they return E_INVALIDARG when all the captions are set as Default. But they return S_OK if any of the caption settings have been modified, regardless of whether a valid *value parameter is passed.
I expected it to at least return the computed values for the default properties but this does not appear to be the case. I guess there's no reason to keep the checks for each member of the computed color struct? Perhaps keep the checks for E_INVALIDARG and S_OK? I haven't come across an application that uses the functions so I didn't implement them.
For the rest of the properties, the if (0) test was added just to show that it crashes with a NULL value. Also, if the wrong type is passed, the function does not crash on Windows and the value remains unchanged, but it returns S_OK.
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/tests/captions.c | 163 ++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+)
diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index b1e1f4fd334..eba51f9d883 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -26,7 +26,10 @@ #include "roapi.h"
#define WIDL_using_Windows_Foundation +#define WIDL_using_Windows_Foundation_Collections #include "windows.foundation.h" +#define WIDL_using_Windows_UI +#include "windows.ui.h" #define WIDL_using_Windows_Media_ClosedCaptioning #include "windows.media.closedcaptioning.h"
@@ -55,6 +58,13 @@ static void test_CaptionStatics(void) HSTRING str; HRESULT hr; LONG ref; + /* Properties */ + ClosedCaptionColor color; + ClosedCaptionOpacity opacity; + ClosedCaptionSize size; + ClosedCaptionStyle style; + ClosedCaptionEdgeEffect effect; + Color computed_color;
hr = WindowsCreateString( caption_properties_name, wcslen( caption_properties_name ), &str ); ok( hr == S_OK, "got hr %#lx.\n", hr ); @@ -75,6 +85,159 @@ static void test_CaptionStatics(void) hr = IActivationFactory_QueryInterface( factory, &IID_IClosedCaptionPropertiesStatics, (void **)&caption_statics ); ok( hr == S_OK, "got hr %#lx.\n", hr );
+ if (0) /* Crash on Windows */ + { + hr = IClosedCaptionPropertiesStatics_get_FontColor( caption_statics, NULL ); + todo_wine ok( hr == S_OK, "get_FontColor returned %#lx\n", hr ); + } + color = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_FontColor( caption_statics, &color ); + todo_wine ok( hr == S_OK, "get_FontColor returned %#lx\n", hr ); + todo_wine ok( color == ClosedCaptionColor_Default, "expected default font color, got %d\n", color ); + + if (FAILED(hr = IClosedCaptionPropertiesStatics_get_ComputedFontColor( caption_statics, &computed_color ))) + { + todo_wine ok( hr == E_INVALIDARG, "get_ComputedFontColor returned %#lx\n", hr ); + hr = IClosedCaptionPropertiesStatics_get_ComputedFontColor( caption_statics, NULL ); + todo_wine ok( hr == E_INVALIDARG, "get_ComputedFontColor returned %#lx\n", hr ); + } + else + { + todo_wine + { + ok( hr == S_OK, "get_ComputedFontColor returned %#lx\n", hr ); + ok( computed_color.A == 255, "expected default alpha font computed color, got %d\n", computed_color.A ); + ok( computed_color.R == 255, "expected default red font computed color, got %d\n", computed_color.R ); + ok( computed_color.G == 255, "expected default green font computed color, got %d\n", computed_color.G ); + ok( computed_color.B == 255, "expected default blue font computed color, got %d\n", computed_color.B ); + } + + hr = IClosedCaptionPropertiesStatics_get_ComputedFontColor( caption_statics, NULL ); + todo_wine ok( hr == S_OK, "get_ComputedFontColor returned %#lx\n", hr ); + } + + if (0) /* Crash on Windows */ + { + hr = IClosedCaptionPropertiesStatics_get_FontOpacity( caption_statics, NULL ); + todo_wine ok( hr == S_OK, "get_FontOpacity returned %#lx\n", hr ); + } + opacity = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_FontOpacity( caption_statics, &opacity ); + todo_wine ok( hr == S_OK, "get_FontOpacity returned %#lx\n", hr ); + todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default font opacity, got %d\n", opacity ); + + if (0) /* Crash on Windows */ + { + hr = IClosedCaptionPropertiesStatics_get_FontSize( caption_statics, NULL ); + todo_wine ok( hr == S_OK, "get_FontSize returned %#lx\n", hr ); + } + size = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_FontSize( caption_statics, &size ); + todo_wine ok( hr == S_OK, "get_FontSize returned %#lx\n", hr ); + todo_wine ok( size == ClosedCaptionSize_Default, "expected default font size, got %d\n", size ); + + if (0) /* Crash on Windows */ + { + hr = IClosedCaptionPropertiesStatics_get_FontStyle( caption_statics, NULL ); + todo_wine ok( hr == S_OK, "get_FontStyle returned %#lx\n", hr ); + } + style = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_FontStyle( caption_statics, &style ); + todo_wine ok( hr == S_OK, "get_FontStyle returned %#lx\n", hr ); + todo_wine ok( style == ClosedCaptionStyle_Default, "expected default font style, got %d\n", style ); + + if (0) /* Crash on Windows */ + { + hr = IClosedCaptionPropertiesStatics_get_FontEffect( caption_statics, NULL ); + todo_wine ok( hr == S_OK, "get_FontEffect returned %#lx\n", hr ); + } + effect = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_FontEffect( caption_statics, &effect ); + todo_wine ok( hr == S_OK, "get_FontEffect returned %#lx\n", hr ); + todo_wine ok( effect == ClosedCaptionEdgeEffect_Default, "expected default font effect, got %d\n", effect ); + + if (0) /* Crash on Windows */ + { + hr = IClosedCaptionPropertiesStatics_get_BackgroundColor( caption_statics, NULL ); + todo_wine ok( hr == S_OK, "get_BackgroundColor returned %#lx\n", hr ); + } + color = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_BackgroundColor( caption_statics, &color ); + todo_wine ok( hr == S_OK, "get_BackgroundColor returned %#lx\n", hr ); + todo_wine ok( color == ClosedCaptionColor_Default, "expected default background color, got %d\n", color ); + + if (FAILED(hr = IClosedCaptionPropertiesStatics_get_ComputedBackgroundColor( caption_statics, &computed_color ))) + { + todo_wine ok( hr == E_INVALIDARG, "get_ComputedBackgroundColor returned %#lx\n", hr ); + hr = IClosedCaptionPropertiesStatics_get_ComputedBackgroundColor( caption_statics, NULL ); + todo_wine ok( hr == E_INVALIDARG, "get_ComputedBackgroundColor returned %#lx\n", hr ); + } + else + { + todo_wine + { + ok( hr == S_OK, "get_ComputedBackgroundColor returned %#lx\n", hr ); + ok( computed_color.A == 255, "expected default alpha background computed color, got %d\n", computed_color.A ); + ok( computed_color.R == 0, "expected default red background computed color, got %d\n", computed_color.R ); + ok( computed_color.G == 0, "expected default green background computed color, got %d\n", computed_color.G ); + ok( computed_color.B == 0, "expected default blue background computed color, got %d\n", computed_color.B ); + } + + hr = IClosedCaptionPropertiesStatics_get_ComputedBackgroundColor( caption_statics, NULL ); + todo_wine ok( hr == S_OK, "get_ComputedBackgroundColor returned %#lx\n", hr ); + } + + if (0) /* Crash on Windows */ + { + hr = IClosedCaptionPropertiesStatics_get_BackgroundOpacity( caption_statics, NULL ); + todo_wine ok( hr == S_OK, "get_BackgroundOpacity returned %#lx\n", hr ); + } + opacity = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_BackgroundOpacity( caption_statics, &opacity ); + todo_wine ok( hr == S_OK, "get_BackgroundOpacity returned %#lx\n", hr ); + todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default background opacity, got %d\n", opacity ); + + if (0) /* Crash on Windows */ + { + hr = IClosedCaptionPropertiesStatics_get_RegionColor( caption_statics, NULL ); + todo_wine ok( hr == S_OK, "get_RegionColor returned %#lx\n", hr ); + } + color = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_RegionColor( caption_statics, &color ); + todo_wine ok( hr == S_OK, "get_RegionColor returned %#lx\n", hr ); + todo_wine ok( color == ClosedCaptionColor_Default, "expected default region color, got %d\n", color ); + + if (FAILED(hr = IClosedCaptionPropertiesStatics_get_ComputedRegionColor( caption_statics, &computed_color ))) + { + todo_wine ok( hr == E_INVALIDARG, "get_ComputedRegionColor returned %#lx\n", hr ); + hr = IClosedCaptionPropertiesStatics_get_ComputedRegionColor( caption_statics, NULL ); + todo_wine ok( hr == E_INVALIDARG, "get_ComputedRegionColor returned %#lx\n", hr ); + } + else + { + todo_wine + { + ok( hr == S_OK, "get_ComputedRegionColor returned %#lx\n", hr ); + ok( computed_color.A == 255, "expected default alpha region computed color, got %d\n", computed_color.A ); + ok( computed_color.R == 0, "expected default red region computed color, got %d\n", computed_color.R ); + ok( computed_color.G == 0, "expected default green region computed color, got %d\n", computed_color.G ); + ok( computed_color.B == 0, "expected default blue region computed color, got %d\n", computed_color.B ); + } + + hr = IClosedCaptionPropertiesStatics_get_ComputedRegionColor( caption_statics, NULL ); + todo_wine ok( hr == S_OK, "get_ComputedRegionColor returned %#lx\n", hr ); + } + + if (0) /* Crash on Windows */ + { + hr = IClosedCaptionPropertiesStatics_get_RegionOpacity( caption_statics, NULL ); + todo_wine ok( hr == S_OK, "get_RegionOpacity returned %#lx\n", hr ); + } + opacity = 0xdeadbeef; + hr = IClosedCaptionPropertiesStatics_get_RegionOpacity( caption_statics, &opacity ); + todo_wine ok( hr == S_OK, "get_RegionOpacity returned %#lx\n", hr ); + todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default region opacity, got %d\n", opacity ); + ref = IClosedCaptionPropertiesStatics_Release( caption_statics ); ok( ref == 2, "got ref %ld.\n", ref ); ref = IActivationFactory_Release( factory );
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index 2e68948209e..41f14944ec0 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -128,8 +128,10 @@ DEFINE_IINSPECTABLE( captions, IClosedCaptionPropertiesStatics, struct captions_
static HRESULT WINAPI captions_get_FontColor( IClosedCaptionPropertiesStatics *iface, ClosedCaptionColor *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionColor_Default; + return S_OK; }
static HRESULT WINAPI captions_get_ComputedFontColor( IClosedCaptionPropertiesStatics *iface, Color *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index eba51f9d883..ac6c530dfdf 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -88,12 +88,12 @@ static void test_CaptionStatics(void) if (0) /* Crash on Windows */ { hr = IClosedCaptionPropertiesStatics_get_FontColor( caption_statics, NULL ); - todo_wine ok( hr == S_OK, "get_FontColor returned %#lx\n", hr ); + ok( hr == S_OK, "get_FontColor returned %#lx\n", hr ); } color = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontColor( caption_statics, &color ); - todo_wine ok( hr == S_OK, "get_FontColor returned %#lx\n", hr ); - todo_wine ok( color == ClosedCaptionColor_Default, "expected default font color, got %d\n", color ); + ok( hr == S_OK, "get_FontColor returned %#lx\n", hr ); + ok( color == ClosedCaptionColor_Default, "expected default font color, got %d\n", color );
if (FAILED(hr = IClosedCaptionPropertiesStatics_get_ComputedFontColor( caption_statics, &computed_color ))) {
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index 41f14944ec0..43a421f0fa8 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -142,8 +142,10 @@ static HRESULT WINAPI captions_get_ComputedFontColor( IClosedCaptionPropertiesSt
static HRESULT WINAPI captions_get_FontOpacity( IClosedCaptionPropertiesStatics *iface, ClosedCaptionOpacity *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionOpacity_Default; + return S_OK; }
static HRESULT WINAPI captions_get_FontSize( IClosedCaptionPropertiesStatics *iface, ClosedCaptionSize *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index ac6c530dfdf..f484d4a7015 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -119,12 +119,12 @@ static void test_CaptionStatics(void) if (0) /* Crash on Windows */ { hr = IClosedCaptionPropertiesStatics_get_FontOpacity( caption_statics, NULL ); - todo_wine ok( hr == S_OK, "get_FontOpacity returned %#lx\n", hr ); + ok( hr == S_OK, "get_FontOpacity returned %#lx\n", hr ); } opacity = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontOpacity( caption_statics, &opacity ); - todo_wine ok( hr == S_OK, "get_FontOpacity returned %#lx\n", hr ); - todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default font opacity, got %d\n", opacity ); + ok( hr == S_OK, "get_FontOpacity returned %#lx\n", hr ); + ok( opacity == ClosedCaptionOpacity_Default, "expected default font opacity, got %d\n", opacity );
if (0) /* Crash on Windows */ {
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index 43a421f0fa8..f9bd9505ea5 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -150,8 +150,10 @@ static HRESULT WINAPI captions_get_FontOpacity( IClosedCaptionPropertiesStatics
static HRESULT WINAPI captions_get_FontSize( IClosedCaptionPropertiesStatics *iface, ClosedCaptionSize *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionSize_Default; + return S_OK; }
static HRESULT WINAPI captions_get_FontStyle( IClosedCaptionPropertiesStatics *iface, ClosedCaptionStyle *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index f484d4a7015..bfc7fadfa2b 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -129,12 +129,12 @@ static void test_CaptionStatics(void) if (0) /* Crash on Windows */ { hr = IClosedCaptionPropertiesStatics_get_FontSize( caption_statics, NULL ); - todo_wine ok( hr == S_OK, "get_FontSize returned %#lx\n", hr ); + ok( hr == S_OK, "get_FontSize returned %#lx\n", hr ); } size = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontSize( caption_statics, &size ); - todo_wine ok( hr == S_OK, "get_FontSize returned %#lx\n", hr ); - todo_wine ok( size == ClosedCaptionSize_Default, "expected default font size, got %d\n", size ); + ok( hr == S_OK, "get_FontSize returned %#lx\n", hr ); + ok( size == ClosedCaptionSize_Default, "expected default font size, got %d\n", size );
if (0) /* Crash on Windows */ {
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index f9bd9505ea5..40f5fbb9800 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -158,8 +158,10 @@ static HRESULT WINAPI captions_get_FontSize( IClosedCaptionPropertiesStatics *if
static HRESULT WINAPI captions_get_FontStyle( IClosedCaptionPropertiesStatics *iface, ClosedCaptionStyle *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionStyle_Default; + return S_OK; }
static HRESULT WINAPI captions_get_FontEffect( IClosedCaptionPropertiesStatics *iface, ClosedCaptionEdgeEffect *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index bfc7fadfa2b..d8158280c99 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -139,12 +139,12 @@ static void test_CaptionStatics(void) if (0) /* Crash on Windows */ { hr = IClosedCaptionPropertiesStatics_get_FontStyle( caption_statics, NULL ); - todo_wine ok( hr == S_OK, "get_FontStyle returned %#lx\n", hr ); + ok( hr == S_OK, "get_FontStyle returned %#lx\n", hr ); } style = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontStyle( caption_statics, &style ); - todo_wine ok( hr == S_OK, "get_FontStyle returned %#lx\n", hr ); - todo_wine ok( style == ClosedCaptionStyle_Default, "expected default font style, got %d\n", style ); + ok( hr == S_OK, "get_FontStyle returned %#lx\n", hr ); + ok( style == ClosedCaptionStyle_Default, "expected default font style, got %d\n", style );
if (0) /* Crash on Windows */ {
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index 40f5fbb9800..d3954eb1b4f 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -166,8 +166,10 @@ static HRESULT WINAPI captions_get_FontStyle( IClosedCaptionPropertiesStatics *i
static HRESULT WINAPI captions_get_FontEffect( IClosedCaptionPropertiesStatics *iface, ClosedCaptionEdgeEffect *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionEdgeEffect_Default; + return S_OK; }
static HRESULT WINAPI captions_get_BackgroundColor( IClosedCaptionPropertiesStatics *iface, ClosedCaptionColor *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index d8158280c99..fc02525c1e6 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -149,12 +149,12 @@ static void test_CaptionStatics(void) if (0) /* Crash on Windows */ { hr = IClosedCaptionPropertiesStatics_get_FontEffect( caption_statics, NULL ); - todo_wine ok( hr == S_OK, "get_FontEffect returned %#lx\n", hr ); + ok( hr == S_OK, "get_FontEffect returned %#lx\n", hr ); } effect = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_FontEffect( caption_statics, &effect ); - todo_wine ok( hr == S_OK, "get_FontEffect returned %#lx\n", hr ); - todo_wine ok( effect == ClosedCaptionEdgeEffect_Default, "expected default font effect, got %d\n", effect ); + ok( hr == S_OK, "get_FontEffect returned %#lx\n", hr ); + ok( effect == ClosedCaptionEdgeEffect_Default, "expected default font effect, got %d\n", effect );
if (0) /* Crash on Windows */ {
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index d3954eb1b4f..b18c2dce820 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -174,8 +174,10 @@ static HRESULT WINAPI captions_get_FontEffect( IClosedCaptionPropertiesStatics *
static HRESULT WINAPI captions_get_BackgroundColor( IClosedCaptionPropertiesStatics *iface, ClosedCaptionColor *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionColor_Default; + return S_OK; }
static HRESULT WINAPI captions_get_ComputedBackgroundColor( IClosedCaptionPropertiesStatics *iface, Color *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index fc02525c1e6..805233937da 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -159,12 +159,12 @@ static void test_CaptionStatics(void) if (0) /* Crash on Windows */ { hr = IClosedCaptionPropertiesStatics_get_BackgroundColor( caption_statics, NULL ); - todo_wine ok( hr == S_OK, "get_BackgroundColor returned %#lx\n", hr ); + ok( hr == S_OK, "get_BackgroundColor returned %#lx\n", hr ); } color = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_BackgroundColor( caption_statics, &color ); - todo_wine ok( hr == S_OK, "get_BackgroundColor returned %#lx\n", hr ); - todo_wine ok( color == ClosedCaptionColor_Default, "expected default background color, got %d\n", color ); + ok( hr == S_OK, "get_BackgroundColor returned %#lx\n", hr ); + ok( color == ClosedCaptionColor_Default, "expected default background color, got %d\n", color );
if (FAILED(hr = IClosedCaptionPropertiesStatics_get_ComputedBackgroundColor( caption_statics, &computed_color ))) {
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index b18c2dce820..13a88da34ff 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -188,8 +188,10 @@ static HRESULT WINAPI captions_get_ComputedBackgroundColor( IClosedCaptionProper
static HRESULT WINAPI captions_get_BackgroundOpacity( IClosedCaptionPropertiesStatics *iface, ClosedCaptionOpacity *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionOpacity_Default; + return S_OK; }
static HRESULT WINAPI captions_get_RegionColor( IClosedCaptionPropertiesStatics *iface, ClosedCaptionColor *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index 805233937da..6af35cb6b2a 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -190,12 +190,12 @@ static void test_CaptionStatics(void) if (0) /* Crash on Windows */ { hr = IClosedCaptionPropertiesStatics_get_BackgroundOpacity( caption_statics, NULL ); - todo_wine ok( hr == S_OK, "get_BackgroundOpacity returned %#lx\n", hr ); + ok( hr == S_OK, "get_BackgroundOpacity returned %#lx\n", hr ); } opacity = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_BackgroundOpacity( caption_statics, &opacity ); - todo_wine ok( hr == S_OK, "get_BackgroundOpacity returned %#lx\n", hr ); - todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default background opacity, got %d\n", opacity ); + ok( hr == S_OK, "get_BackgroundOpacity returned %#lx\n", hr ); + ok( opacity == ClosedCaptionOpacity_Default, "expected default background opacity, got %d\n", opacity );
if (0) /* Crash on Windows */ {
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index 13a88da34ff..a3a27abc823 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -196,8 +196,10 @@ static HRESULT WINAPI captions_get_BackgroundOpacity( IClosedCaptionPropertiesSt
static HRESULT WINAPI captions_get_RegionColor( IClosedCaptionPropertiesStatics *iface, ClosedCaptionColor *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionColor_Default; + return S_OK; }
static HRESULT WINAPI captions_get_ComputedRegionColor( IClosedCaptionPropertiesStatics *iface, Color *value ) diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index 6af35cb6b2a..2a28f77fa18 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -200,12 +200,12 @@ static void test_CaptionStatics(void) if (0) /* Crash on Windows */ { hr = IClosedCaptionPropertiesStatics_get_RegionColor( caption_statics, NULL ); - todo_wine ok( hr == S_OK, "get_RegionColor returned %#lx\n", hr ); + ok( hr == S_OK, "get_RegionColor returned %#lx\n", hr ); } color = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_RegionColor( caption_statics, &color ); - todo_wine ok( hr == S_OK, "get_RegionColor returned %#lx\n", hr ); - todo_wine ok( color == ClosedCaptionColor_Default, "expected default region color, got %d\n", color ); + ok( hr == S_OK, "get_RegionColor returned %#lx\n", hr ); + ok( color == ClosedCaptionColor_Default, "expected default region color, got %d\n", color );
if (FAILED(hr = IClosedCaptionPropertiesStatics_get_ComputedRegionColor( caption_statics, &computed_color ))) {
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/windows.media/captions.c | 6 ++++-- dlls/windows.media/tests/captions.c | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/windows.media/captions.c b/dlls/windows.media/captions.c index a3a27abc823..b7e07710603 100644 --- a/dlls/windows.media/captions.c +++ b/dlls/windows.media/captions.c @@ -210,8 +210,10 @@ static HRESULT WINAPI captions_get_ComputedRegionColor( IClosedCaptionProperties
static HRESULT WINAPI captions_get_RegionOpacity( IClosedCaptionPropertiesStatics *iface, ClosedCaptionOpacity *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + FIXME( "iface %p, value %p semi-stub.\n", iface, value ); + + *value = ClosedCaptionOpacity_Default; + return S_OK; }
static const struct IClosedCaptionPropertiesStaticsVtbl captions_statics_vtbl = diff --git a/dlls/windows.media/tests/captions.c b/dlls/windows.media/tests/captions.c index 2a28f77fa18..cc06ca04c1b 100644 --- a/dlls/windows.media/tests/captions.c +++ b/dlls/windows.media/tests/captions.c @@ -231,12 +231,12 @@ static void test_CaptionStatics(void) if (0) /* Crash on Windows */ { hr = IClosedCaptionPropertiesStatics_get_RegionOpacity( caption_statics, NULL ); - todo_wine ok( hr == S_OK, "get_RegionOpacity returned %#lx\n", hr ); + ok( hr == S_OK, "get_RegionOpacity returned %#lx\n", hr ); } opacity = 0xdeadbeef; hr = IClosedCaptionPropertiesStatics_get_RegionOpacity( caption_statics, &opacity ); - todo_wine ok( hr == S_OK, "get_RegionOpacity returned %#lx\n", hr ); - todo_wine ok( opacity == ClosedCaptionOpacity_Default, "expected default region opacity, got %d\n", opacity ); + ok( hr == S_OK, "get_RegionOpacity returned %#lx\n", hr ); + ok( opacity == ClosedCaptionOpacity_Default, "expected default region opacity, got %d\n", opacity );
ref = IClosedCaptionPropertiesStatics_Release( caption_statics ); ok( ref == 2, "got ref %ld.\n", ref );
Rémi Bernon (@rbernon) commented about dlls/windows.media/tests/captions.c:
hr = IActivationFactory_QueryInterface( factory, &IID_IClosedCaptionPropertiesStatics, (void **)&caption_statics ); ok( hr == S_OK, "got hr %#lx.\n", hr );
- if (0) /* Crash on Windows */
- {
hr = IClosedCaptionPropertiesStatics_get_FontColor( caption_statics, NULL );
todo_wine ok( hr == S_OK, "get_FontColor returned %#lx\n", hr );
- }
If you've tested that the pointers aren't validated on Windows I think you can just omit the tests.
Sometimes it is an important information and we have such tests, but most of the time it isn't.
Same for all the other functions below.
Rémi Bernon (@rbernon) commented about dlls/windows.media/tests/captions.c:
todo_wine ok( hr == E_INVALIDARG, "get_ComputedFontColor returned %#lx\n", hr );
- }
- else
- {
todo_wine
{
ok( hr == S_OK, "get_ComputedFontColor returned %#lx\n", hr );
ok( computed_color.A == 255, "expected default alpha font computed color, got %d\n", computed_color.A );
ok( computed_color.R == 255, "expected default red font computed color, got %d\n", computed_color.R );
ok( computed_color.G == 255, "expected default green font computed color, got %d\n", computed_color.G );
ok( computed_color.B == 255, "expected default blue font computed color, got %d\n", computed_color.B );
}
hr = IClosedCaptionPropertiesStatics_get_ComputedFontColor( caption_statics, NULL );
todo_wine ok( hr == S_OK, "get_ComputedFontColor returned %#lx\n", hr );
- }
It's hard to tell which of these branches is the expected behavior.