summaryrefslogtreecommitdiff
path: root/absl/container/internal/common_policy_traits_test.cc
diff options
context:
space:
mode:
authorGravatar Evan Brown <ezb@google.com>2022-10-03 10:51:40 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2022-10-03 10:52:25 -0700
commitf8e0ff7f33338c2874b75e45e4ea5abbfafb954c (patch)
tree343d800108e96f67e578ebc3f614055a2d997065 /absl/container/internal/common_policy_traits_test.cc
parentd277a48d4cd998a9d8937b99fe6ee28f7adb0484 (diff)
Use trivial relocation for transfers in swisstable and b-tree.
PiperOrigin-RevId: 478547898 Change-Id: Ie20cd0a49df042be912888ee238333a5f5fa0404
Diffstat (limited to 'absl/container/internal/common_policy_traits_test.cc')
-rw-r--r--absl/container/internal/common_policy_traits_test.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/absl/container/internal/common_policy_traits_test.cc b/absl/container/internal/common_policy_traits_test.cc
index 768d870e..5eaa4aae 100644
--- a/absl/container/internal/common_policy_traits_test.cc
+++ b/absl/container/internal/common_policy_traits_test.cc
@@ -27,7 +27,7 @@ namespace container_internal {
namespace {
using ::testing::MockFunction;
-using ::testing::Return;
+using ::testing::AnyNumber;
using ::testing::ReturnRef;
using Slot = int;
@@ -101,9 +101,10 @@ TEST_F(Test, element) {
TEST_F(Test, without_transfer) {
int b = 42;
- EXPECT_CALL(element, Call(&b)).WillOnce(::testing::ReturnRef(b));
- EXPECT_CALL(construct, Call(&alloc, &a, b));
- EXPECT_CALL(destroy, Call(&alloc, &b));
+ EXPECT_CALL(element, Call(&a)).Times(AnyNumber()).WillOnce(ReturnRef(a));
+ EXPECT_CALL(element, Call(&b)).WillOnce(ReturnRef(b));
+ EXPECT_CALL(construct, Call(&alloc, &a, b)).Times(AnyNumber());
+ EXPECT_CALL(destroy, Call(&alloc, &b)).Times(AnyNumber());
common_policy_traits<PolicyWithoutOptionalOps>::transfer(&alloc, &a, &b);
}