summaryrefslogtreecommitdiffstats
path: root/tests/rangequery_tests.cpp
blob: 49c73d38466401324010b35e4376e0275ac208c0 (plain)
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
/*
 * tests/rangequery_tests.cpp
 *
 * Unit tests for Range Queries across several different
 * shards
 *
 * Copyright (C) 2023 Douglas Rumbaugh <drumbaugh@psu.edu> 
 *                    Dong Xie <dongx@psu.edu>
 *
 * Distributed under the Modified BSD License.
 *
 */

#include "shard/ISAMTree.h"
#include "query/rangequery.h"
#include "include/testing.h"

#include <check.h>

using namespace de;

typedef ISAMTree<Rec> Shard;

#include "include/rangequery.h"

Suite *unit_testing()
{
    Suite *unit = suite_create("Range Count Query Testing");
    inject_rangequery_tests(unit);

    return unit;
}


int shard_unit_tests()
{
    int failed = 0;
    Suite *unit = unit_testing();
    SRunner *unit_shardner = srunner_create(unit);

    srunner_run_all(unit_shardner, CK_NORMAL);
    failed = srunner_ntests_failed(unit_shardner);
    srunner_free(unit_shardner);

    return failed;
}


int main() 
{
    int unit_failed = shard_unit_tests();

    return (unit_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}