diff options
author | Abseil Team <absl-team@google.com> | 2020-06-11 09:56:29 -0700 |
---|---|---|
committer | vslashg <gfalcon@google.com> | 2020-06-12 17:24:49 -0400 |
commit | 2c92bdc7c2f8e65198af61a0611d90a55312ee82 (patch) | |
tree | 8b0fe283dd1594d6bd8f4d039417047807985f97 /absl/base/invoke_test.cc | |
parent | e7ebf9803746b9a115d96164bdf5e915be8f223b (diff) | |
download | abseil-2c92bdc7c2f8e65198af61a0611d90a55312ee82.tar.gz abseil-2c92bdc7c2f8e65198af61a0611d90a55312ee82.tar.bz2 abseil-2c92bdc7c2f8e65198af61a0611d90a55312ee82.zip |
Export of internal Abseil changes
--
e21e960918678629abf89ad1b694b7d4a456b434 by Greg Falcon <gfalcon@google.com>:
Roll back invoke() change due to large increases in compiler memory usage.
PiperOrigin-RevId: 315919455
--
f95872e1e1d7afdefbac94f42ea228d42d80eb6e by Greg Falcon <gfalcon@google.com>:
Rollback of invoke() changes due to compiler memory usage growth
PiperOrigin-RevId: 315911585
--
6c6c6ba6892016a2ce4703042800254fb9b15727 by Laramie Leavitt <lar@google.com>:
Move some of the common mocking code into MockHelpers.
Use MockHelpers to do mock signature detection and improve the dispatch mechansim.
PiperOrigin-RevId: 315825988
--
5e9380367d280c7fa6dbd4d0f48c31ade7f1d419 by Greg Falcon <gfalcon@google.com>:
Rename the internal implementation details Invoke and InvokeT to `invoke` and `invoke_result_t`, since these are re-implementations of C++17 library entites of the same names.
PiperOrigin-RevId: 315790467
GitOrigin-RevId: e21e960918678629abf89ad1b694b7d4a456b434
Change-Id: Ia75011f94cb033c1c9a4cb64cf14d283b91426ac
Diffstat (limited to 'absl/base/invoke_test.cc')
-rw-r--r-- | absl/base/invoke_test.cc | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/absl/base/invoke_test.cc b/absl/base/invoke_test.cc index 994d36b9..6aa613c9 100644 --- a/absl/base/invoke_test.cc +++ b/absl/base/invoke_test.cc @@ -158,56 +158,31 @@ TEST(InvokeTest, MemberFunction) { std::unique_ptr<const Class> cp(new Class); std::unique_ptr<volatile Class> vp(new Class); - Class c; - std::reference_wrapper<Class> ref(c); - std::reference_wrapper<const Class> ref_const(c); - const std::reference_wrapper<Class> const_ref(c); - std::reference_wrapper<volatile Class> ref_volatile(c); - EXPECT_EQ(1, Invoke(&Class::Method, p, 3, 2)); EXPECT_EQ(1, Invoke(&Class::Method, p.get(), 3, 2)); EXPECT_EQ(1, Invoke(&Class::Method, *p, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::Method, ref, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::Method, const_ref, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::Method, std::move(ref), 3, 2)); EXPECT_EQ(1, Invoke(&Class::RefMethod, p, 3, 2)); EXPECT_EQ(1, Invoke(&Class::RefMethod, p.get(), 3, 2)); EXPECT_EQ(1, Invoke(&Class::RefMethod, *p, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::RefMethod, ref, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::RefMethod, const_ref, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::RefMethod, std::move(ref), 3, 2)); EXPECT_EQ(1, Invoke(&Class::RefRefMethod, std::move(*p), 3, 2)); // NOLINT EXPECT_EQ(1, Invoke(&Class::NoExceptMethod, p, 3, 2)); EXPECT_EQ(1, Invoke(&Class::NoExceptMethod, p.get(), 3, 2)); EXPECT_EQ(1, Invoke(&Class::NoExceptMethod, *p, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::NoExceptMethod, ref, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::NoExceptMethod, const_ref, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::NoExceptMethod, std::move(ref), 3, 2)); EXPECT_EQ(1, Invoke(&Class::ConstMethod, p, 3, 2)); EXPECT_EQ(1, Invoke(&Class::ConstMethod, p.get(), 3, 2)); EXPECT_EQ(1, Invoke(&Class::ConstMethod, *p, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::ConstMethod, ref, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::ConstMethod, const_ref, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::ConstMethod, std::move(ref), 3, 2)); EXPECT_EQ(1, Invoke(&Class::ConstMethod, cp, 3, 2)); EXPECT_EQ(1, Invoke(&Class::ConstMethod, cp.get(), 3, 2)); EXPECT_EQ(1, Invoke(&Class::ConstMethod, *cp, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::ConstMethod, ref_const, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::ConstMethod, std::move(ref_const), 3, 2)); EXPECT_EQ(1, Invoke(&Class::VolatileMethod, p, 3, 2)); EXPECT_EQ(1, Invoke(&Class::VolatileMethod, p.get(), 3, 2)); EXPECT_EQ(1, Invoke(&Class::VolatileMethod, *p, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::VolatileMethod, ref, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::VolatileMethod, const_ref, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::VolatileMethod, std::move(ref), 3, 2)); EXPECT_EQ(1, Invoke(&Class::VolatileMethod, vp, 3, 2)); EXPECT_EQ(1, Invoke(&Class::VolatileMethod, vp.get(), 3, 2)); EXPECT_EQ(1, Invoke(&Class::VolatileMethod, *vp, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::VolatileMethod, ref_volatile, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::VolatileMethod, std::move(ref_volatile), 3, 2)); EXPECT_EQ(1, Invoke(&Class::Method, make_unique<Class>(), 3, 2)); EXPECT_EQ(1, Invoke(&Class::ConstMethod, make_unique<Class>(), 3, 2)); @@ -217,15 +192,8 @@ TEST(InvokeTest, MemberFunction) { TEST(InvokeTest, DataMember) { std::unique_ptr<Class> p(new Class{42}); std::unique_ptr<const Class> cp(new Class{42}); - Class c{42}; - std::reference_wrapper<Class> ref(c); - std::reference_wrapper<const Class> ref_const(c); - const std::reference_wrapper<Class> const_ref(c); EXPECT_EQ(42, Invoke(&Class::member, p)); EXPECT_EQ(42, Invoke(&Class::member, *p)); - EXPECT_EQ(42, Invoke(&Class::member, ref)); - EXPECT_EQ(42, Invoke(&Class::member, const_ref)); - EXPECT_EQ(42, Invoke(&Class::member, std::move(ref))); EXPECT_EQ(42, Invoke(&Class::member, p.get())); Invoke(&Class::member, p) = 42; @@ -233,8 +201,6 @@ TEST(InvokeTest, DataMember) { EXPECT_EQ(42, Invoke(&Class::member, cp)); EXPECT_EQ(42, Invoke(&Class::member, *cp)); - EXPECT_EQ(42, Invoke(&Class::member, ref_const)); - EXPECT_EQ(42, Invoke(&Class::member, std::move(ref_const))); EXPECT_EQ(42, Invoke(&Class::member, cp.get())); } |