Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<Throwable> pending_exception = env().ClearExceptionOccurred();
if (!pending_exception) {
return;
Expand All @@ -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: "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ TEST_F(FirestoreAndroidIntegrationTest,
std::string debug_string = ToDebugString(object);

EXPECT_EQ(debug_string, "Test Value");
env().ExceptionClear();
}

TEST_F(FirestoreAndroidIntegrationTest,
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions firestore/integration_test_internal/src/jni/task_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ TEST_F(TaskTest, GetResultShouldReturnTheResult) {

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

ASSERT_THAT(actual_result, JavaEq(result));
ASSERT_THAT(actual_result, RefersToSameJavaObjectAs(result));
}

TEST_F(TaskTest, GetExceptionShouldReturnTheException) {
Expand All @@ -87,7 +87,7 @@ TEST_F(TaskTest, GetExceptionShouldReturnTheException) {

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

ASSERT_THAT(actual_exception, JavaEq(exception));
ASSERT_THAT(actual_exception, RefersToSameJavaObjectAs(exception));
}

// Tests for Task.IsComplete()
Expand Down