diff --git a/firestore/integration_test_internal/src/android/firestore_integration_test_android.cc b/firestore/integration_test_internal/src/android/firestore_integration_test_android.cc index 673e43d2de..6376c78b69 100644 --- a/firestore/integration_test_internal/src/android/firestore_integration_test_android.cc +++ b/firestore/integration_test_internal/src/android/firestore_integration_test_android.cc @@ -67,15 +67,13 @@ void FirestoreAndroidIntegrationTest::SetUp() { } void FirestoreAndroidIntegrationTest::TearDown() { - // Fail the test if there is a pending Java exception. Clear the pending - // exception as well so that it doesn't bleed into the next test. FailTestIfPendingException(); - - // Perform the tear-down steps of the superclass. FirestoreIntegrationTest::TearDown(); } void FirestoreAndroidIntegrationTest::FailTestIfPendingException() { + // Fail the test if there is a pending Java exception. Clear the pending + // exception as well so that it doesn't bleed into the next test. Local pending_exception = env().ClearExceptionOccurred(); if (!pending_exception) { return; @@ -86,7 +84,8 @@ void FirestoreAndroidIntegrationTest::FailTestIfPendingException() { return; } - // Fail the test since the test completed with a pending exception. + // Fail the test since the test completed with an unexpected pending + // exception. std::string pending_exception_as_string = pending_exception.ToString(env()); env().ExceptionClear(); FAIL() << "Test completed with a pending Java exception: " diff --git a/firestore/integration_test_internal/src/android/firestore_integration_test_android_test.cc b/firestore/integration_test_internal/src/android/firestore_integration_test_android_test.cc index 496cb78e86..5d52b277b6 100644 --- a/firestore/integration_test_internal/src/android/firestore_integration_test_android_test.cc +++ b/firestore/integration_test_internal/src/android/firestore_integration_test_android_test.cc @@ -63,7 +63,6 @@ TEST_F(FirestoreAndroidIntegrationTest, std::string debug_string = ToDebugString(object); EXPECT_EQ(debug_string, "Test Value"); - env().ExceptionClear(); } TEST_F(FirestoreAndroidIntegrationTest, @@ -75,7 +74,6 @@ TEST_F(FirestoreAndroidIntegrationTest, std::string debug_string = ToDebugString(null_reference); EXPECT_EQ(debug_string, "null"); - env().ExceptionClear(); } TEST_F(FirestoreAndroidIntegrationTest, JavaEqShouldReturnTrueForEqualObjects) { diff --git a/firestore/integration_test_internal/src/jni/task_test.cc b/firestore/integration_test_internal/src/jni/task_test.cc index f4dfd8ae76..fea8e53a32 100644 --- a/firestore/integration_test_internal/src/jni/task_test.cc +++ b/firestore/integration_test_internal/src/jni/task_test.cc @@ -78,7 +78,7 @@ TEST_F(TaskTest, GetResultShouldReturnTheResult) { Local actual_result = task.GetResult(env()); - ASSERT_THAT(actual_result, JavaEq(result)); + ASSERT_THAT(actual_result, RefersToSameJavaObjectAs(result)); } TEST_F(TaskTest, GetExceptionShouldReturnTheException) { @@ -87,7 +87,7 @@ TEST_F(TaskTest, GetExceptionShouldReturnTheException) { Local actual_exception = task.GetException(env()); - ASSERT_THAT(actual_exception, JavaEq(exception)); + ASSERT_THAT(actual_exception, RefersToSameJavaObjectAs(exception)); } // Tests for Task.IsComplete()