summaryrefslogtreecommitdiffstats
path: root/test/abts.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/abts.h')
-rw-r--r--test/abts.h45
1 files changed, 43 insertions, 2 deletions
diff --git a/test/abts.h b/test/abts.h
index ed1c092..dffb0c5 100644
--- a/test/abts.h
+++ b/test/abts.h
@@ -42,6 +42,7 @@ struct sub_suite {
char *name;
int num_test;
int failed;
+ int skipped;
int not_run;
int not_impl;
struct sub_suite *next;
@@ -56,6 +57,7 @@ typedef struct abts_suite abts_suite;
struct abts_case {
int failed;
+ int skipped;
sub_suite *suite;
};
typedef struct abts_case abts_case;
@@ -70,6 +72,28 @@ void abts_log_message(const char *fmt, ...);
void abts_int_equal(abts_case *tc, const int expected, const int actual, int lineno);
void abts_int_nequal(abts_case *tc, const int expected, const int actual, int lineno);
+void abts_uint_equal(abts_case *tc, const unsigned int expected,
+ const unsigned int actual, int lineno);
+void abts_uint_nequal(abts_case *tc, const unsigned int expected,
+ const unsigned int actual, int lineno);
+void abts_long_equal(abts_case *tc, const long expected,
+ const long actual, int lineno);
+void abts_long_nequal(abts_case *tc, const long expected,
+ const long actual, int lineno);
+void abts_ulong_equal(abts_case *tc, const unsigned long expected,
+ const unsigned long actual, int lineno);
+void abts_ulong_nequal(abts_case *tc, const unsigned long expected,
+ const unsigned long actual, int lineno);
+void abts_llong_equal(abts_case *tc, const long long expected,
+ const long long actual, int lineno);
+void abts_llong_nequal(abts_case *tc, const long long expected,
+ const long long actual, int lineno);
+void abts_ullong_equal(abts_case *tc, const unsigned long long expected,
+ const unsigned long long actual, int lineno);
+void abts_ullong_nequal(abts_case *tc, const unsigned long long expected,
+ const unsigned long long actual, int lineno);
+void abts_size_equal(abts_case *tc, size_t expected, size_t actual, int lineno);
+void abts_size_nequal(abts_case *tc, size_t expected, size_t actual, int lineno);
void abts_str_equal(abts_case *tc, const char *expected, const char *actual, int lineno);
void abts_str_nequal(abts_case *tc, const char *expected, const char *actual,
size_t n, int lineno);
@@ -77,13 +101,25 @@ void abts_ptr_notnull(abts_case *tc, const void *ptr, int lineno);
void abts_ptr_equal(abts_case *tc, const void *expected, const void *actual, int lineno);
void abts_true(abts_case *tc, int condition, int lineno);
void abts_fail(abts_case *tc, const char *message, int lineno);
+void abts_skip(abts_case *tc, const char *message, int lineno);
void abts_not_impl(abts_case *tc, const char *message, int lineno);
void abts_assert(abts_case *tc, const char *message, int condition, int lineno);
-void abts_size_equal(abts_case *tc, size_t expected, size_t actual, int lineno);
/* Convenience macros. Ryan hates these! */
#define ABTS_INT_EQUAL(a, b, c) abts_int_equal(a, b, c, __LINE__)
#define ABTS_INT_NEQUAL(a, b, c) abts_int_nequal(a, b, c, __LINE__)
+#define ABTS_UINT_EQUAL(a, b, c) abts_uint_equal(a, b, c, __LINE__)
+#define ABTS_UINT_NEQUAL(a, b, c) abts_uint_nequal(a, b, c, __LINE__)
+#define ABTS_LONG_EQUAL(a, b, c) abts_long_equal(a, b, c, __LINE__)
+#define ABTS_LONG_NEQUAL(a, b, c) abts_long_nequal(a, b, c, __LINE__)
+#define ABTS_ULONG_EQUAL(a, b, c) abts_ulong_equal(a, b, c, __LINE__)
+#define ABTS_ULONG_NEQUAL(a, b, c) abts_ulong_nequal(a, b, c, __LINE__)
+#define ABTS_LLONG_EQUAL(a, b, c) abts_llong_equal(a, b, c, __LINE__)
+#define ABTS_LLONG_NEQUAL(a, b, c) abts_llong_nequal(a, b, c, __LINE__)
+#define ABTS_ULLONG_EQUAL(a, b, c) abts_ullong_equal(a, b, c, __LINE__)
+#define ABTS_ULLONG_NEQUAL(a, b, c) abts_ullong_nequal(a, b, c, __LINE__)
+#define ABTS_SIZE_EQUAL(a, b, c) abts_size_equal(a, b, c, __LINE__)
+#define ABTS_SIZE_NEQUAL(a, b, c) abts_size_nequal(a, b, c, __LINE__)
#define ABTS_STR_EQUAL(a, b, c) abts_str_equal(a, b, c, __LINE__)
#define ABTS_STR_NEQUAL(a, b, c, d) abts_str_nequal(a, b, c, d, __LINE__)
#define ABTS_PTR_NOTNULL(a, b) abts_ptr_notnull(a, b, __LINE__)
@@ -93,8 +129,13 @@ void abts_size_equal(abts_case *tc, size_t expected, size_t actual, int lineno);
#define ABTS_NOT_IMPL(a, b) abts_not_impl(a, b, __LINE__);
#define ABTS_ASSERT(a, b, c) abts_assert(a, b, c, __LINE__);
-#define ABTS_SIZE_EQUAL(a, b, c) abts_size_equal(a, b, c, __LINE__)
+/* When skipping tests, make a reference to the test data parameter
+ to avoid unused variable warnings. */
+#define ABTS_SKIP(tc, data, msg) do { \
+ ((void)(data)); \
+ abts_skip((tc), (msg), __LINE__); \
+ } while (0)
abts_suite *run_tests(abts_suite *suite);
abts_suite *run_tests1(abts_suite *suite);