1 /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /*
3  *     Copyright 2010 Couchbase, Inc
4  *
5  *   Licensed under the Apache License, Version 2.0 (the "License");
6  *   you may not use this file except in compliance with the License.
7  *   You may obtain a copy of the License at
8  *
9  *       http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *   Unless required by applicable law or agreed to in writing, software
12  *   distributed under the License is distributed on an "AS IS" BASIS,
13  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *   See the License for the specific language governing permissions and
15  *   limitations under the License.
16  */
17 
18 #ifndef SRC_SUITE_STUBS_H_
19 #define SRC_SUITE_STUBS_H_ 1
20 
21 #include "config.h"
22 
23 #include <platform/cbassert.h>
24 
25 #include "ep_testsuite.h"
26 
27 bool teardown(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
28 void delay(int amt);
29 
30 void add(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
31 void append(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
32 void decr(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
33 void decrWithDefault(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
34 void prepend(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
35 void flush(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
36 void del(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
37 void get(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
38 void set(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
39 void setRetainCAS(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
40 void incr(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
41 void incrWithDefault(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
42 void getLock(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
43 void setUsingCAS(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
44 void deleteUsingCAS(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
45 void appendUsingCAS(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
46 void prependUsingCAS(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
47 
48 void checkValue(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1, const char* exp);
49 void assertNotExists(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
50 
51 #define assertHasError() cb_assert(hasError)
52 #define assertHasNoError() cb_assert(!hasError)
53 
54 extern int expiry;
55 extern int locktime;
56 extern bool hasError;
57 extern uint64_t cas;
58 extern struct test_harness testHarness;
59 
60 engine_test_t* get_tests_0(void);
61 engine_test_t* get_tests_1(void);
62 engine_test_t* get_tests_2(void);
63 engine_test_t* get_tests_3(void);
64 engine_test_t* get_tests_4(void);
65 engine_test_t* get_tests_5(void);
66 engine_test_t* get_tests_6(void);
67 engine_test_t* get_tests_7(void);
68 engine_test_t* get_tests_8(void);
69 engine_test_t* get_tests_9(void);
70 
71 #endif  /* SRC_SUITE_STUBS_H_ */
72