166eb94d0SMike Wiederhold/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
266eb94d0SMike Wiederhold/*
366eb94d0SMike Wiederhold *     Copyright 2010 Couchbase, Inc
466eb94d0SMike Wiederhold *
566eb94d0SMike Wiederhold *   Licensed under the Apache License, Version 2.0 (the "License");
666eb94d0SMike Wiederhold *   you may not use this file except in compliance with the License.
766eb94d0SMike Wiederhold *   You may obtain a copy of the License at
866eb94d0SMike Wiederhold *
966eb94d0SMike Wiederhold *       http://www.apache.org/licenses/LICENSE-2.0
1066eb94d0SMike Wiederhold *
1166eb94d0SMike Wiederhold *   Unless required by applicable law or agreed to in writing, software
1266eb94d0SMike Wiederhold *   distributed under the License is distributed on an "AS IS" BASIS,
1366eb94d0SMike Wiederhold *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1466eb94d0SMike Wiederhold *   See the License for the specific language governing permissions and
1566eb94d0SMike Wiederhold *   limitations under the License.
1666eb94d0SMike Wiederhold */
1766eb94d0SMike Wiederhold
188f48f64bSMike Wiederhold#ifndef SRC_SUITE_STUBS_H_
198f48f64bSMike Wiederhold#define SRC_SUITE_STUBS_H_ 1
20a5899de1SDustin Sallings
21244c0146SMike Wiederhold#include "config.h"
22244c0146SMike Wiederhold
23c649b2d9STrond Norbye#include <platform/cbassert.h>
24451bfa4bSDustin Sallings
25a5899de1SDustin Sallings#include "ep_testsuite.h"
26a5899de1SDustin Sallings
27a5899de1SDustin Sallingsbool teardown(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
28a5899de1SDustin Sallingsvoid delay(int amt);
29a5899de1SDustin Sallings
30a5899de1SDustin Sallingsvoid add(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
31a5899de1SDustin Sallingsvoid append(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
32a5899de1SDustin Sallingsvoid decr(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
33a5899de1SDustin Sallingsvoid decrWithDefault(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
34a5899de1SDustin Sallingsvoid prepend(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
35a5899de1SDustin Sallingsvoid flush(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
36a5899de1SDustin Sallingsvoid del(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
371d6f347cSDustin Sallingsvoid get(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
38a5899de1SDustin Sallingsvoid set(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
39e6712394SDustin Sallingsvoid setRetainCAS(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
40a5899de1SDustin Sallingsvoid incr(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
41a5899de1SDustin Sallingsvoid incrWithDefault(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
42f8c7c7eaSDustin Sallingsvoid getLock(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
43e6712394SDustin Sallingsvoid setUsingCAS(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
4427a41de2SDustin Sallingsvoid deleteUsingCAS(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
4523fcbda4SDustin Sallingsvoid appendUsingCAS(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
4623fcbda4SDustin Sallingsvoid prependUsingCAS(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
47a5899de1SDustin Sallings
48a5899de1SDustin Sallingsvoid checkValue(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1, const char* exp);
49a5899de1SDustin Sallingsvoid assertNotExists(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1);
50451bfa4bSDustin Sallings
51c649b2d9STrond Norbye#define assertHasError() cb_assert(hasError)
52c649b2d9STrond Norbye#define assertHasNoError() cb_assert(!hasError)
53a5899de1SDustin Sallings
54a5899de1SDustin Sallingsextern int expiry;
55f8c7c7eaSDustin Sallingsextern int locktime;
56451bfa4bSDustin Sallingsextern bool hasError;
57e6712394SDustin Sallingsextern uint64_t cas;
58a5899de1SDustin Sallingsextern struct test_harness testHarness;
59a5899de1SDustin Sallings
6046433b61SDustin Sallingsengine_test_t* get_tests_0(void);
6146433b61SDustin Sallingsengine_test_t* get_tests_1(void);
6246433b61SDustin Sallingsengine_test_t* get_tests_2(void);
6346433b61SDustin Sallingsengine_test_t* get_tests_3(void);
6446433b61SDustin Sallingsengine_test_t* get_tests_4(void);
6546433b61SDustin Sallingsengine_test_t* get_tests_5(void);
6646433b61SDustin Sallingsengine_test_t* get_tests_6(void);
6746433b61SDustin Sallingsengine_test_t* get_tests_7(void);
6846433b61SDustin Sallingsengine_test_t* get_tests_8(void);
6946433b61SDustin Sallingsengine_test_t* get_tests_9(void);
7046433b61SDustin Sallings
71dc4753dbSTrond Norbye#endif  /* SRC_SUITE_STUBS_H_ */
72