1 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 #ifndef TESTSUITE_H
3 #define TESTSUITE_H 1
4 
5 #include "disable_optimize.h"
6 
7 #include <memcached/engine.h>
8 #include <memcached/engine_testapp.h>
9 #include <platform/cbassert.h>
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 MEMCACHED_PUBLIC_API
16 engine_test_t* get_tests(void);
17 
18 MEMCACHED_PUBLIC_API
19 bool setup_suite(struct test_harness *th);
20 
21 
22 bool test_setup(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
23 bool teardown(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
24 void delay(int amt);
25 void add(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
26 void append(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
27 void decr(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
28 void decrWithDefault(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
29 void prepend(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
30 void flush(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
31 void del(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
32 void set(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
33 void incr(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
34 void incrWithDefault(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
35 
36 void checkValue(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1, const char* exp);
37 void assertNotExists(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
38 
39 #define assertHasError() cb_assert(hasError)
40 #define assertHasNoError() cb_assert(!hasError)
41 
42 extern int expiry;
43 extern bool hasError;
44 extern struct test_harness testHarness;
45 
46 engine_test_t* get_tests_0(void);
47 engine_test_t* get_tests_1(void);
48 engine_test_t* get_tests_2(void);
49 engine_test_t* get_tests_3(void);
50 engine_test_t* get_tests_4(void);
51 engine_test_t* get_tests_5(void);
52 engine_test_t* get_tests_6(void);
53 engine_test_t* get_tests_7(void);
54 engine_test_t* get_tests_8(void);
55 engine_test_t* get_tests_9(void);
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
61 #endif /* SUITE_STUBS_H */
62