summaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2021-03-19 12:47:48 +0000
committerArne Juul <arnej@verizonmedia.com>2021-03-19 12:47:48 +0000
commit9b17d36bd4f9c2f468fb36635833ea85298cbb0a (patch)
treec1fb7f476ab1912c50feda1fb8f2d60b80a8827a /eval
parente0d0fd0945fb5f09ac6d87981683596473a30962 (diff)
tighten tests
Diffstat (limited to 'eval')
-rw-r--r--eval/src/tests/instruction/mixed_simple_join_function/mixed_simple_join_function_test.cpp17
-rw-r--r--eval/src/vespa/eval/instruction/mixed_simple_join_function.cpp2
2 files changed, 13 insertions, 6 deletions
diff --git a/eval/src/tests/instruction/mixed_simple_join_function/mixed_simple_join_function_test.cpp b/eval/src/tests/instruction/mixed_simple_join_function/mixed_simple_join_function_test.cpp
index b5f2402a77c..5447dab6704 100644
--- a/eval/src/tests/instruction/mixed_simple_join_function/mixed_simple_join_function_test.cpp
+++ b/eval/src/tests/instruction/mixed_simple_join_function/mixed_simple_join_function_test.cpp
@@ -48,7 +48,7 @@ struct FunInfo {
std::optional<Primary> primary;
bool l_mut;
bool r_mut;
- bool require_inplace;
+ std::optional<bool> inplace;
void verify(const EvalFixture &fixture, const LookFor &fun) const {
EXPECT_TRUE(fun.result_is_mutable());
EXPECT_EQUAL(fun.overlap(), overlap);
@@ -64,14 +64,21 @@ struct FunInfo {
EXPECT_TRUE(r_mut);
}
}
- if (require_inplace) {
- EXPECT_TRUE(fun.inplace());
+ if (inplace.has_value()) {
+ EXPECT_EQUAL(fun.inplace(), inplace.value());
}
if (fun.inplace()) {
EXPECT_TRUE(fun.primary_is_mutable());
size_t idx = (fun.primary() == Primary::LHS) ? 0 : 1;
EXPECT_EQUAL(fixture.result_value().cells().data,
fixture.param_value(idx).cells().data);
+ EXPECT_NOT_EQUAL(fixture.result_value().cells().data,
+ fixture.param_value(1-idx).cells().data);
+ } else {
+ EXPECT_NOT_EQUAL(fixture.result_value().cells().data,
+ fixture.param_value(0).cells().data);
+ EXPECT_NOT_EQUAL(fixture.result_value().cells().data,
+ fixture.param_value(1).cells().data);
}
}
};
@@ -90,7 +97,7 @@ void verify_optimized(const vespalib::string &expr, Primary primary, Overlap ove
{
TEST_STATE(expr.c_str());
CellTypeSpace all_types(CellTypeUtils::list_types(), 2);
- FunInfo details{overlap, factor, primary, l_mut, r_mut, false};
+ FunInfo details{overlap, factor, primary, l_mut, r_mut, std::nullopt};
EvalFixture::verify<FunInfo>(expr, {details}, all_types);
}
@@ -99,7 +106,7 @@ void verify_optimized(const vespalib::string &expr, Overlap overlap, size_t fact
{
TEST_STATE(expr.c_str());
CellTypeSpace all_types(CellTypeUtils::list_types(), 2);
- FunInfo details{overlap, factor, std::nullopt, l_mut, r_mut, false};
+ FunInfo details{overlap, factor, std::nullopt, l_mut, r_mut, std::nullopt};
EvalFixture::verify<FunInfo>(expr, {details}, all_types);
}
diff --git a/eval/src/vespa/eval/instruction/mixed_simple_join_function.cpp b/eval/src/vespa/eval/instruction/mixed_simple_join_function.cpp
index 69e01469bfa..70134196d1e 100644
--- a/eval/src/vespa/eval/instruction/mixed_simple_join_function.cpp
+++ b/eval/src/vespa/eval/instruction/mixed_simple_join_function.cpp
@@ -193,7 +193,7 @@ bool
MixedSimpleJoinFunction::inplace() const
{
return primary_is_mutable() &&
- (result_type() == primary_child().result_type());
+ (result_type().cell_type() == primary_child().result_type().cell_type());
}
size_t