summaryrefslogtreecommitdiffstats
path: root/vespalib/src/tests
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@yahooinc.com>2022-05-25 13:20:52 +0000
committerHåvard Pettersen <havardpe@yahooinc.com>2022-05-25 13:21:39 +0000
commit5f47082852cf0c79a92abc46171cc2818db35d01 (patch)
tree7af850c91f4b797f01e9699441002167cf30a3e1 /vespalib/src/tests
parent2656098f025f9efbb91e0a06feb66d8d9a0f2997 (diff)
avoid undefined behavior in vespalib unit tests
Diffstat (limited to 'vespalib/src/tests')
-rw-r--r--vespalib/src/tests/btree/btree_store/btree_store_test.cpp4
-rw-r--r--vespalib/src/tests/btree/btreeaggregation_test.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/vespalib/src/tests/btree/btree_store/btree_store_test.cpp b/vespalib/src/tests/btree/btree_store/btree_store_test.cpp
index 974aafb392a..5e2aa89b59e 100644
--- a/vespalib/src/tests/btree/btree_store/btree_store_test.cpp
+++ b/vespalib/src/tests/btree/btree_store/btree_store_test.cpp
@@ -43,8 +43,8 @@ protected:
additions.emplace_back(i, 0);
}
_store.apply(root,
- &additions[0], &additions[0] + additions.size(),
- &removals[0], &removals[0] + removals.size());
+ additions.data(), additions.data() + additions.size(),
+ removals.data(), removals.data() + removals.size());
return root;
}
static std::vector<int> make_exp_sequence(int start_key, int end_key)
diff --git a/vespalib/src/tests/btree/btreeaggregation_test.cpp b/vespalib/src/tests/btree/btreeaggregation_test.cpp
index b1198e3828d..f4300499fcd 100644
--- a/vespalib/src/tests/btree/btreeaggregation_test.cpp
+++ b/vespalib/src/tests/btree/btreeaggregation_test.cpp
@@ -258,8 +258,8 @@ MyTreeForceApplyStore::remove(EntryRef &ref, const KeyType &key,
std::vector<KeyType> removals;
removals.push_back(key);
apply(ref,
- &additions[0], &additions[additions.size()],
- &removals[0], &removals[removals.size()],
+ additions.data(), additions.data() + additions.size(),
+ removals.data(), removals.data() + removals.size(),
comp);
return retVal;
}