- Add _Check_return_opt and _Check_return_wat_ annotations
[WINE]
- Add ok_size_t(), ok_char() and ok_wstr() to test.h

svn path=/trunk/; revision=57341
This commit is contained in:
Timo Kreuzer 2012-09-19 20:36:05 +00:00
parent 0d0764b28d
commit 9c8421dafe
2 changed files with 24 additions and 0 deletions

View file

@ -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

View file

@ -646,12 +646,24 @@ int main( int argc, char **argv )
#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)
#define ok_ntstatus(status, expected) ok_hex(status, expected)