Author: tkreuzer
Date: Wed Sep 19 20:36:05 2012
New Revision: 57341
URL:
http://svn.reactos.org/svn/reactos?rev=57341&view=rev
Log:
[PSDK]
- Add _Check_return_opt and _Check_return_wat_ annotations
[WINE]
- Add ok_size_t(), ok_char() and ok_wstr() to test.h
Modified:
trunk/reactos/include/psdk/specstrings.h
trunk/reactos/include/reactos/wine/test.h
Modified: trunk/reactos/include/psdk/specstrings.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/specstrings.h…
==============================================================================
--- trunk/reactos/include/psdk/specstrings.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/specstrings.h [iso-8859-1] Wed Sep 19 20:36:05 2012
@@ -60,3 +60,15 @@
#define __analysis_noreturn
#endif
+
+#if defined(_PREFAST_) && defined(_PFT_SHOULD_CHECK_RETURN)
+#define _Check_return_opt_ _Check_return_
+#else
+#define _Check_return_opt_
+#endif
+
+#if defined(_PREFAST_) && defined(_PFT_SHOULD_CHECK_RETURN_WAT)
+#define _Check_return_wat_ _Check_return_
+#else
+#define _Check_return_wat_
+#endif
Modified: trunk/reactos/include/reactos/wine/test.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/wine/test.…
==============================================================================
--- trunk/reactos/include/reactos/wine/test.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/wine/test.h [iso-8859-1] Wed Sep 19 20:36:05 2012
@@ -646,11 +646,23 @@
#expression, (void*)(result), _value); \
} while (0)
+#define ok_size_t(expression, result) \
+ do { \
+ size_t _value = (expression); \
+ ok(_value == (result), "Wrong value for '%s', expected: "
#result " (%p), got: %p\n", \
+ #expression, (size_t)(result), _value); \
+ } while (0)
+
+#define ok_char(expression, result) ok_hex(expression, result)
+
#define ok_err(error) \
ok(GetLastError() == (error), "Wrong last error. Expected " #error ",
got %d\n", (int)GetLastError())
#define ok_str(x, y) \
ok(strcmp(x, y) == 0, "Wrong string. Expected '%s', got
'%s'\n", y, x)
+
+#define ok_wstr(x, y) \
+ ok(wcscmp(x, y) == 0, "Wrong string. Expected '%S', got
'%S'\n", y, x)
#define ok_long(expression, result) ok_hex(expression, result)
#define ok_int(expression, result) ok_dec(expression, result)