From 4fb5fb169968a583db16ccb35ba29cad84774a3a Mon Sep 17 00:00:00 2001 From: Jamieson Pryor Date: Mon, 1 May 2023 11:31:21 -0700 Subject: [PATCH] Make global_object_test slightly stricter. PiperOrigin-RevId: 528527391 --- implementation/global_object_test.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/implementation/global_object_test.cc b/implementation/global_object_test.cc index 38c72d63..dcff448f 100644 --- a/implementation/global_object_test.cc +++ b/implementation/global_object_test.cc @@ -49,7 +49,7 @@ TEST_F(JniTest, GlobalObject_CallsNewAndDeleteOnNewObject) { GlobalObject global_object{}; - EXPECT_NE(jobject{global_object}, nullptr); + EXPECT_EQ(jobject{global_object}, AsGlobal(Fake())); } TEST_F(JniTest, GlobalObject_ConstructsFromNonStandardConstructor) { @@ -116,9 +116,11 @@ TEST_F(JniTest, GlobalObject_CallsDeleteOnceAfterAMoveConstruction) { static constexpr Class kClass{ "com/google/CallsDeleteOnceAfterAMoveConstruction"}; GlobalObject global_object_1{AdoptGlobal{}, Fake()}; - EXPECT_NE(jobject{global_object_1}, nullptr); + EXPECT_EQ(jobject{global_object_1}, Fake()); GlobalObject global_object_2{std::move(global_object_1)}; - EXPECT_NE(jobject{global_object_2}, nullptr); + + EXPECT_EQ(jobject{global_object_1}, nullptr); // NOLINT + EXPECT_EQ(jobject{global_object_2}, Fake()); } TEST_F(JniTest, GlobalObject_FunctionsProperlyInSTLContainer) {