endif
test(
- 'rb_tree',
- executable(
- 'rb_tree_test',
- files('rb_tree_test.c'),
- include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
- dependencies : idep_mesautil,
- c_args : [c_msvc_compat_args],
- ),
- suite : ['util'],
- )
-
- test(
'roundeven',
executable(
'roundeven_test',
files_util_tests = files(
'bitset_test.cpp',
'blob_test.cpp',
+ 'rb_tree_test.cpp',
'register_allocate_test.cpp',
'tests/dag_test.cpp',
'tests/fast_idiv_by_const_test.cpp',
#include <stdint.h>
#include <stdlib.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** A red-black tree node
*
* This struct represents a node in the red-black tree. This struct should
*/
void rb_tree_validate(struct rb_tree *T);
+#ifdef __cplusplus
+} /* extern C */
+#endif
+
#endif /* RB_TREE_H */
#include "rb_tree.h"
#include <assert.h>
+#include <gtest/gtest.h>
#include <limits.h>
/* A list of 100 random numbers from 1 to 100. The number 30 is explicitly
}
}
-int
-main()
+TEST(RBTreeTest, InsertAndSearch)
{
struct rb_test_node nodes[ARRAY_SIZE(test_numbers)];
struct rb_tree tree;