All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
test_common.h
Go to the documentation of this file.
1 #pragma once
2 #include <stdlib.h>
3 #include <stdbool.h>
4 #include <stdint.h>
5 #include <stdio.h>
6 #include <stdarg.h>
7 
8 #include <aerospike/as_integer.h>
9 #include <aerospike/as_list.h>
10 #include <aerospike/as_map.h>
11 #include <aerospike/as_string.h>
12 #include <aerospike/as_val.h>
13 
14 #include "test.h"
15 
16 /******************************************************************************
17  * atf_x_equals
18  *****************************************************************************/
19 
20 bool atf_val_equals(atf_test_result * test_result, as_val * actual, as_val * expected);
21 bool atf_integer_equals(atf_test_result * test_result, as_integer * actual, as_integer * expected);
22 bool atf_string_equals(atf_test_result * test_result, as_string * actual, as_string * expected);
23 bool atf_list_equals(atf_test_result * test_result, as_list * actual, as_list * expected);
24 bool atf_map_equals(atf_test_result * test_result, as_map * actual, as_map * expected);
25 
26 #define assert_val_eq(ACTUAL, EXPECTED) \
27  if ( atf_val_equals(__result__, (as_val *) ACTUAL, (as_val *) EXPECTED) == false ) {\
28  atf_assert(__result__, #ACTUAL" == "#EXPECTED, __FILE__, __LINE__);\
29  }