forked from vmware/splinterdb
-
Notifications
You must be signed in to change notification settings - Fork 2
/
test_common.h
60 lines (50 loc) · 1.63 KB
/
test_common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright 2022 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0
/*
* -----------------------------------------------------------------------------
* test_common.h --
*
* Header file with shared prototypes and definitions for functions defined
* in test_common.c, that are shared between functional/ and unit/ test sources.
* -----------------------------------------------------------------------------
*/
#ifndef __TEST_COMMON_H__
#define __TEST_COMMON_H__
#include "trunk.h"
#include "functional/test.h"
typedef struct stats_lookup {
uint64 num_found;
uint64 num_not_found;
uint64 latency_max;
} stats_lookup;
typedef struct {
bool expected_found;
bool stats_only; // update statistic only
stats_lookup *stats;
} verify_tuple_arg;
/*
* Tuple verification routine.
*/
void
verify_tuple(trunk_handle *spl,
test_message_generator *gen,
uint64 lookup_num,
char *key,
message data,
bool expected_found);
void
test_wait_for_inflight(trunk_handle *spl,
test_async_lookup *async_lookup,
verify_tuple_arg *vtarg);
void
verify_tuple_callback(trunk_handle *spl, test_async_ctxt *ctxt, void *arg);
test_async_ctxt *
test_async_ctxt_get(trunk_handle *spl,
test_async_lookup *async_lookup,
verify_tuple_arg *vtarg);
static inline bool
test_show_verbose_progress(test_exec_config *test_exec_cfg)
{
return (test_exec_cfg->verbose_progress);
}
#endif /* __TEST_COMMON_H__ */