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

Side by Side Diff: tests/test_runner.h

Issue 8596009: Add test for patching a system call instruction (Closed) Base URL: https://seccompsandbox.googlecode.com/svn/trunk
Patch Set: Add comment Created 9 years, 1 month 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 | Annotate | Revision Log
« tests/test_patching.cc ('K') | « tests/test_patching_input.S ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium 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 TEST_RUNNER_H__ 5 #ifndef TEST_RUNNER_H__
6 #define TEST_RUNNER_H__ 6 #define TEST_RUNNER_H__
7 7
8 #include <errno.h>
9 #include <stdio.h>
10
8 11
9 void intend_exit_status(int val, bool is_signal); 12 void intend_exit_status(int val, bool is_signal);
10 void add_test_case(const char *test_name, void (*test_func)()); 13 void add_test_case(const char *test_name, void (*test_func)());
11 14
12 15
13 #define TEST(name) \ 16 #define TEST(name) \
14 void name(); \ 17 void name(); \
15 static void __attribute__((constructor)) add_##name() { \ 18 static void __attribute__((constructor)) add_##name() { \
16 add_test_case(#name, name); \ 19 add_test_case(#name, name); \
17 } \ 20 } \
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr, \ 86 __FILE__, __LINE__, __PRETTY_FUNCTION__, #expr, \
84 strerror_r(exp_errno, errmsg1, sizeof(errmsg1)), \ 87 strerror_r(exp_errno, errmsg1, sizeof(errmsg1)), \
85 strerror_r(errno, errmsg2, sizeof(errmsg2))); \ 88 strerror_r(errno, errmsg2, sizeof(errmsg2))); \
86 _exit(1); \ 89 _exit(1); \
87 } \ 90 } \
88 check_res; \ 91 check_res; \
89 }) 92 })
90 93
91 94
92 #endif 95 #endif
OLDNEW
« tests/test_patching.cc ('K') | « tests/test_patching_input.S ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698