aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/tests/tutorial/fixtures/fixtures_test.cpp
blob: 588384606d34d750bd2a63a44b1d8886c6f597a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/test_kit.h>

struct Fixture {
    int value;
    Fixture() : value(5) {}
};

TEST_F("basic fixture", Fixture) {
    EXPECT_EQUAL(5, f1.value);
}

TEST_FFF("fancy fixtures", size_t(10), int(5), std::vector<int>(f1, f2)) {
    EXPECT_EQUAL(10u, f1);
    EXPECT_EQUAL(5, f2);
    ASSERT_EQUAL(10u, f3.size());
    EXPECT_EQUAL(5, f3[7]);
}

TEST_MAIN() { TEST_RUN_ALL(); }