macros.h (8f0ea33f2bbf3a6aa80235f0a02fa5f2780c2b17) macros.h (71a1ae7cebd3791d4d18ac9620a7a4ce8cf15819)
1/* Copyright (c) 2008 The NetBSD Foundation, Inc.
2 * All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 171 unchanged lines hidden (view full) ---

180 "%s != %s (%s != %s): " fmt, \
181 #expected, #actual, expected, actual, ##__VA_ARGS__)
182
183#define ATF_CHECK_STREQ_MSG(expected, actual, fmt, ...) \
184 ATF_CHECK_MSG(strcmp(expected, actual) == 0, \
185 "%s != %s (%s != %s): " fmt, \
186 #expected, #actual, expected, actual, ##__VA_ARGS__)
187
1/* Copyright (c) 2008 The NetBSD Foundation, Inc.
2 * All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 171 unchanged lines hidden (view full) ---

180 "%s != %s (%s != %s): " fmt, \
181 #expected, #actual, expected, actual, ##__VA_ARGS__)
182
183#define ATF_CHECK_STREQ_MSG(expected, actual, fmt, ...) \
184 ATF_CHECK_MSG(strcmp(expected, actual) == 0, \
185 "%s != %s (%s != %s): " fmt, \
186 #expected, #actual, expected, actual, ##__VA_ARGS__)
187
188#define ATF_REQUIRE_INTEQ(expected, actual) \
189 ATF_REQUIRE_MSG((expected) == (actual), "%s != %s (%jd != %jd)", \
190 #expected, #actual, (intmax_t)(expected), \
191 (intmax_t)(actual))
192
193#define ATF_CHECK_INTEQ(expected, actual) \
194 ATF_CHECK_MSG((expected) == (actual), "%s != %s (%jd != %jd)", #expected, \
195 #actual, (intmax_t)(expected), (intmax_t)(actual))
196
197#define ATF_REQUIRE_INTEQ_MSG(expected, actual, fmt, ...) \
198 ATF_REQUIRE_MSG((expected) == (actual), "%s != %s (%jd != %jd): " fmt, \
199 #expected, #actual, (intmax_t)(expected), \
200 (intmax_t)(actual), ##__VA_ARGS__)
201
202#define ATF_CHECK_INTEQ_MSG(expected, actual, fmt, ...) \
203 ATF_CHECK_MSG((expected) == (actual), "%s != %s (%jd != %jd): " fmt, \
204 #expected, #actual, (intmax_t)(expected), \
205 (intmax_t)(actual), ##__VA_ARGS__)
206
188#define ATF_REQUIRE_MATCH(regexp, string) \
189 ATF_REQUIRE_MSG(atf_utils_grep_string("%s", string, regexp), \
190 "'%s' not matched in '%s'", regexp, string);
191
192#define ATF_CHECK_MATCH(regexp, string) \
193 ATF_CHECK_MSG(atf_utils_grep_string("%s", string, regexp), \
194 "'%s' not matched in '%s'", regexp, string);
195

--- 17 unchanged lines hidden ---
207#define ATF_REQUIRE_MATCH(regexp, string) \
208 ATF_REQUIRE_MSG(atf_utils_grep_string("%s", string, regexp), \
209 "'%s' not matched in '%s'", regexp, string);
210
211#define ATF_CHECK_MATCH(regexp, string) \
212 ATF_CHECK_MSG(atf_utils_grep_string("%s", string, regexp), \
213 "'%s' not matched in '%s'", regexp, string);
214

--- 17 unchanged lines hidden ---