master
h 54 lines 1.21 KB
Raw
1 /*++
2
3 Copyright (c) Microsoft. All rights reserved.
4
5 Module Name:
6
7 lxsstest.h
8
9 Abstract:
10
11 Common definitions for lxss tests.
12
13 --*/
14
15 #pragma once
16
17 #define STR2WSTR_INNER(str) L##str
18 #define STR2WSTR(str) STR2WSTR_INNER(str)
19
20 //
21 // Logging macros
22 //
23
24 #define LogError(str, ...) \
25 { \
26 WEX::Logging::Log::Error(WEX::Common::String().Format(STR2WSTR(str), __VA_ARGS__)); \
27 }
28
29 #define LogInfo(str, ...) \
30 { \
31 WEX::Logging::Log::Comment(WEX::Common::String().Format(STR2WSTR(str), __VA_ARGS__)); \
32 }
33
34 #define LogWarning(str, ...) \
35 { \
36 WEX::Logging::Log::Warning(WEX::Common::String().Format(STR2WSTR(str), __VA_ARGS__)); \
37 }
38
39 #define LogPass(str, ...) \
40 { \
41 WEX::Logging::Log::Result(WEX::Logging::TestResults::Passed, WEX::Common::String().Format(STR2WSTR(str), __VA_ARGS__)); \
42 }
43
44 #define LogSkipped(str, ...) \
45 { \
46 WEX::Logging::Log::Result(WEX::Logging::TestResults::Skipped, WEX::Common::String().Format(STR2WSTR(str), __VA_ARGS__)); \
47 }
48
49 //
50 // Helper macros
51 //
52
53 #define ALLOC(_size) HeapAlloc(GetProcessHeap(), 0, (_size))
54 #define FREE(_ptr) WI_VERIFY(HeapFree(GetProcessHeap(), 0, (_ptr)) != FALSE)