Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: tests/cgptlib_test.h

Issue 2809037: Make vboot_reference build in MSVC command line environment. (Closed) Base URL: ssh://git@chromiumos-git/vboot_reference.git
Patch Set: Integrated trunk changes. Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « msc/nmakefile ('k') | tests/cgptlib_test.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 #ifndef VBOOT_REFERENCE_CGPTLIB_TEST_H_ 5 #ifndef VBOOT_REFERENCE_CGPTLIB_TEST_H_
6 #define VBOOT_REFERENCE_CGPTLIB_TEST_H_ 6 #define VBOOT_REFERENCE_CGPTLIB_TEST_H_
7 7
8 #include <stdio.h> 8 #include <stdio.h>
9 #include "sysincludes.h"
9 10
10 enum { 11 enum {
11 TEST_FAIL = -1, 12 TEST_FAIL = -1,
12 TEST_OK = 0, 13 TEST_OK = 0,
13 }; 14 };
14 15
15 #define TEST_CASE(func) #func, func 16 #define TEST_CASE(func) #func, func
16 typedef int (*test_func)(void); 17 typedef int (*test_func)();
17 18
18 #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) 19 #define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
19 20
20 /* ANSI Color coding sequences. */ 21 /* disable MSVC warning on const logical expression (as in } while(0);) */
21 #define COL_GREEN "\e[1;32m" 22 __pragma(warning (disable: 4127))
22 #define COL_RED "\e[0;31m"
23 #define COL_STOP "\e[m"
24 23
25 #define EXPECT(expr) \ 24 #define EXPECT(expr) \
26 do { \ 25 do { \
27 if (!(expr)) { \ 26 if (!(expr)) { \
28 printf(COL_RED " fail " COL_STOP "in expression %s in %s() line %d\n",\ 27 printf(COL_RED " fail " COL_STOP "in expression %s in %s() line %d\n",\
29 #expr, __FUNCTION__, __LINE__); \ 28 #expr, __FUNCTION__, __LINE__); \
30 return TEST_FAIL; \ 29 return TEST_FAIL; \
31 } \ 30 } \
32 } while (0) 31 } while (0)
33 32
34 #endif /* VBOOT_REFERENCE_CGPTLIB_TEST_H_ */ 33 #endif /* VBOOT_REFERENCE_CGPTLIB_TEST_H_ */
OLDNEW
« no previous file with comments | « msc/nmakefile ('k') | tests/cgptlib_test.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698