summaryrefslogtreecommitdiffstats
path: root/vespalib/src/tests/tutorial/fixtures/fixtures_test.cpp
blob: 54b88b8ef67b76d5c7859ee5f76e8710aa43e3d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright 2016 Yahoo Inc. 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(); }