Skip to content

Commit

Permalink
Make global_object_test slightly stricter.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 528527391
  • Loading branch information
jwhpryor authored and copybara-github committed May 1, 2023
1 parent 2a7f261 commit 4fb5fb1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions implementation/global_object_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ TEST_F(JniTest, GlobalObject_CallsNewAndDeleteOnNewObject) {

GlobalObject<kClass> global_object{};

EXPECT_NE(jobject{global_object}, nullptr);
EXPECT_EQ(jobject{global_object}, AsGlobal(Fake<jobject>()));
}

TEST_F(JniTest, GlobalObject_ConstructsFromNonStandardConstructor) {
Expand Down Expand Up @@ -116,9 +116,11 @@ TEST_F(JniTest, GlobalObject_CallsDeleteOnceAfterAMoveConstruction) {
static constexpr Class kClass{
"com/google/CallsDeleteOnceAfterAMoveConstruction"};
GlobalObject<kClass> global_object_1{AdoptGlobal{}, Fake<jobject>()};
EXPECT_NE(jobject{global_object_1}, nullptr);
EXPECT_EQ(jobject{global_object_1}, Fake<jobject>());
GlobalObject<kClass> 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<jobject>());
}

TEST_F(JniTest, GlobalObject_FunctionsProperlyInSTLContainer) {
Expand Down

0 comments on commit 4fb5fb1

Please sign in to comment.