shell32: implements shell link's GetCurFile (with tests, fixes bug #21297) [try5]

Alexandre Julliard julliard at winehq.org
Thu Feb 25 07:01:59 CST 2010


Mikołaj Zalewski <mikolaj at zalewski.pl> writes:

> @@ -33,6 +33,30 @@
>  
>  #include "shell32_test.h"
>  
> +#define expect_eq_x(expected, actual) \
> +    do { \
> +      int value = (actual); \
> +      ok((expected) == value, "Expected " #actual " to be 0x%x (" #expected ") is 0x%x\n", \
> +          (expected), value); \
> +    } while (0)
> +#define expect_eq_p(expected, actual) \
> +    do { \
> +      void *value = (actual); \
> +      ok((expected) == value, "Expected " #actual " to be %p (" #expected ") is %p\n", \
> +          (expected), value); \
> +    } while (0)
> +#define expect_eq_ws(expected, actual) \
> +    do { \
> +      LPCWSTR value = (actual); \
> +      ok(winetest_strcmpW((expected), value) == 0, "Expected " #actual " to be %s (" #expected ") is %s\n", \
> +          wine_dbgstr_w(expected), wine_dbgstr_w(value)); \
> +    } while (0)
> +#define expect_true(actual) \
> +    do { \
> +      BOOL value = (actual); \
> +      ok(value, "Expected " #actual " to be true, but it isn't\n"); \
> +    } while (0)
> +

That's quite ugly. It doesn't save much code since it's basically a
single ok() statement each time, and it makes it harder to fix a test
when we find out that it can expect two different values, or that it
needs a different printf format. Please avoid that sort of thing.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list