diff options
author | Håvard Pettersen <havardpe@oath.com> | 2021-03-24 10:26:22 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2021-03-24 10:31:48 +0000 |
commit | 82813c7fedb533a845bed73799588191435a4de9 (patch) | |
tree | 91dbca3eed600c4d434b801a2f9281c9ddc77a71 /eval | |
parent | 1a283e58b9e780bd99c72d838e4961f61a7da68f (diff) |
use REQUIRE for sanity checks
Diffstat (limited to 'eval')
-rw-r--r-- | eval/src/vespa/eval/eval/test/tensor_conformance.cpp | 5 | ||||
-rw-r--r-- | eval/src/vespa/eval/eval/test/test_io.cpp | 16 |
2 files changed, 11 insertions, 10 deletions
diff --git a/eval/src/vespa/eval/eval/test/tensor_conformance.cpp b/eval/src/vespa/eval/eval/test/tensor_conformance.cpp index 17ad75ae455..30933c78325 100644 --- a/eval/src/vespa/eval/eval/test/tensor_conformance.cpp +++ b/eval/src/vespa/eval/eval/test/tensor_conformance.cpp @@ -9,6 +9,7 @@ #include <vespa/eval/eval/simple_value.h> #include <vespa/eval/eval/value_type_spec.h> #include <vespa/vespalib/testkit/test_kit.h> +#include <vespa/vespalib/util/require.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/objects/nbostream.h> #include <vespa/vespalib/data/slime/slime.h> @@ -47,7 +48,7 @@ TensorSpec eval(const ValueBuilderFactory &factory, const vespalib::string &expr } NodeTypes types(*fun, param_types); const auto &expect_type = types.get_type(fun->root()); - ASSERT_FALSE(expect_type.is_error()); + REQUIRE(!expect_type.is_error()); InterpretedFunction ifun(factory, *fun, types); InterpretedFunction::Context ctx(ifun); const Value &result = ifun.eval(ctx, SimpleObjectParams{param_refs}); @@ -451,7 +452,7 @@ struct TestContext { {x({"a","b","c"}),y(5)}, float_cells({y(5),z({"i","j","k","l"})}), float_cells({x({"a","b","c"}),y(5)}), float_cells({y(5),z({"i","j","k","l"})}) }; - ASSERT_TRUE((layouts.size() % 2) == 0); + REQUIRE((layouts.size() % 2) == 0); for (size_t i = 0; i < layouts.size(); i += 2) { TensorSpec lhs_input = spec(layouts[i], seq); TensorSpec rhs_input = spec(layouts[i + 1], seq); diff --git a/eval/src/vespa/eval/eval/test/test_io.cpp b/eval/src/vespa/eval/eval/test/test_io.cpp index 4ecfb788f28..b53ee864cbe 100644 --- a/eval/src/vespa/eval/eval/test/test_io.cpp +++ b/eval/src/vespa/eval/eval/test/test_io.cpp @@ -1,7 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "test_io.h" -#include <vespa/vespalib/testkit/test_kit.h> +#include <vespa/vespalib/util/require.h> #include <vespa/vespalib/data/slime/slime.h> #include <vespa/vespalib/data/slime/json_format.h> #include <vespa/vespalib/util/size_literals.h> @@ -75,8 +75,8 @@ void TestWriter::maybe_write_test() { if (_test.get().type().getId() != slime::NIX::ID) { - ASSERT_GREATER(_test.get().fields(), 0u); - ASSERT_FALSE(_test[num_tests_str].valid()); + REQUIRE(_test.get().fields() > 0u); + REQUIRE(!_test[num_tests_str].valid()); write_compact(_test, _out); ++_num_tests; } @@ -116,21 +116,21 @@ void for_each_test(Input &in, if (JsonFormat::decode(in, slime)) { bool is_summary = slime[num_tests_str].valid(); bool is_test = (!is_summary && (slime.get().fields() > 0)); - ASSERT_TRUE(is_test != is_summary); + REQUIRE(is_test != is_summary); if (is_test) { ++num_tests; - ASSERT_TRUE(!got_summary); + REQUIRE(!got_summary); handle_test(slime); } else { got_summary = true; - ASSERT_EQUAL(slime[num_tests_str].asLong(), int64_t(num_tests)); + REQUIRE_EQ(slime[num_tests_str].asLong(), int64_t(num_tests)); handle_summary(slime); } } else { - ASSERT_EQUAL(in.obtain().size, 0u); + REQUIRE_EQ(in.obtain().size, 0u); } } - ASSERT_TRUE(got_summary); + REQUIRE(got_summary); } //----------------------------------------------------------------------------- |