blob: a2ef309c2774327d4b40ce490a9feea3d02baec8 (
plain) (
blame)
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
|
// 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>
#include <stdexcept>
void willThrow() {
throw std::runtime_error("This failed");
}
TEST("require that checks work") {
EXPECT_TRUE(true);
EXPECT_FALSE(false);
EXPECT_EQUAL(3, 3);
EXPECT_NOT_EQUAL(3, 4);
EXPECT_APPROX(3.0, 3.1, 0.2);
EXPECT_NOT_APPROX(3.0, 3.5, 0.2);
EXPECT_LESS(3, 4);
EXPECT_LESS_EQUAL(3, 3);
EXPECT_GREATER(4, 3);
EXPECT_GREATER_EQUAL(4, 4);
EXPECT_EXCEPTION(willThrow(), std::runtime_error, "fail");
}
TEST("this test will fail") {
EXPECT_EQUAL(3, 4);
}
TEST_MAIN() { TEST_RUN_ALL(); }
|