aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/tests/tutorial/fixtures/fixtures_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'vespalib/src/tests/tutorial/fixtures/fixtures_test.cpp')
-rw-r--r--vespalib/src/tests/tutorial/fixtures/fixtures_test.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/vespalib/src/tests/tutorial/fixtures/fixtures_test.cpp b/vespalib/src/tests/tutorial/fixtures/fixtures_test.cpp
new file mode 100644
index 00000000000..54b88b8ef67
--- /dev/null
+++ b/vespalib/src/tests/tutorial/fixtures/fixtures_test.cpp
@@ -0,0 +1,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(); }