Skip to content

Commit 902f18a

Browse files
committed
Undo changes that are covered in #1359
1 parent e7477af commit 902f18a

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

firestore/integration_test_internal/src/android/firestore_integration_test_android.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,15 @@ void FirestoreAndroidIntegrationTest::SetUp() {
6767
}
6868

6969
void FirestoreAndroidIntegrationTest::TearDown() {
70+
// Fail the test if there is a pending Java exception. Clear the pending
71+
// exception as well so that it doesn't bleed into the next test.
7072
FailTestIfPendingException();
73+
74+
// Perform the tear-down steps of the superclass.
7175
FirestoreIntegrationTest::TearDown();
7276
}
7377

7478
void FirestoreAndroidIntegrationTest::FailTestIfPendingException() {
75-
// Fail the test if there is a pending Java exception. Clear the pending
76-
// exception as well so that it doesn't bleed into the next test.
7779
Local<Throwable> pending_exception = env().ClearExceptionOccurred();
7880
if (!pending_exception) {
7981
return;
@@ -84,8 +86,7 @@ void FirestoreAndroidIntegrationTest::FailTestIfPendingException() {
8486
return;
8587
}
8688

87-
// Fail the test since the test completed with an unexpected pending
88-
// exception.
89+
// Fail the test since the test completed with a pending exception.
8990
std::string pending_exception_as_string = pending_exception.ToString(env());
9091
env().ExceptionClear();
9192
FAIL() << "Test completed with a pending Java exception: "

firestore/integration_test_internal/src/android/firestore_integration_test_android_test.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ TEST_F(FirestoreAndroidIntegrationTest,
6363
std::string debug_string = ToDebugString(object);
6464

6565
EXPECT_EQ(debug_string, "Test Value");
66+
env().ExceptionClear();
6667
}
6768

6869
TEST_F(FirestoreAndroidIntegrationTest,
@@ -74,6 +75,7 @@ TEST_F(FirestoreAndroidIntegrationTest,
7475
std::string debug_string = ToDebugString(null_reference);
7576

7677
EXPECT_EQ(debug_string, "null");
78+
env().ExceptionClear();
7779
}
7880

7981
TEST_F(FirestoreAndroidIntegrationTest, JavaEqShouldReturnTrueForEqualObjects) {

firestore/integration_test_internal/src/jni/task_test.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ TEST_F(TaskTest, GetResultShouldReturnTheResult) {
7878

7979
Local<Object> actual_result = task.GetResult(env());
8080

81-
ASSERT_THAT(actual_result, RefersToSameJavaObjectAs(result));
81+
ASSERT_THAT(actual_result, JavaEq(result));
8282
}
8383

8484
TEST_F(TaskTest, GetExceptionShouldReturnTheException) {
@@ -87,7 +87,7 @@ TEST_F(TaskTest, GetExceptionShouldReturnTheException) {
8787

8888
Local<Throwable> actual_exception = task.GetException(env());
8989

90-
ASSERT_THAT(actual_exception, RefersToSameJavaObjectAs(exception));
90+
ASSERT_THAT(actual_exception, JavaEq(exception));
9191
}
9292

9393
// Tests for Task.IsComplete()

0 commit comments

Comments
 (0)