Skip to content

Commit 140b58b

Browse files
authored
Remove cruft related to FIRESTORE_STUB_BUILD. (#484)
* Remove cruft related to FIRESTORE_STUB_BUILD. * Fix typo. * Remove remaining traces.
1 parent c56e8a4 commit 140b58b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+31
-736
lines changed

firestore/integration_test_internal/src/collection_reference_test.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
#include "firestore/src/common/wrapper_assertions.h"
55
#if defined(__ANDROID__)
66
#include "firestore/src/android/collection_reference_android.h"
7-
#elif defined(FIRESTORE_STUB_BUILD)
8-
#include "firestore/src/stub/collection_reference_stub.h"
97
#endif // defined(__ANDROID__)
108

119
#include "gmock/gmock.h"
@@ -14,7 +12,7 @@
1412
namespace firebase {
1513
namespace firestore {
1614

17-
#if defined(__ANDROID__) || defined(FIRESTORE_STUB_BUILD)
15+
#if defined(__ANDROID__)
1816

1917
using CollectionReferenceTest = testing::Test;
2018

@@ -28,7 +26,7 @@ TEST_F(CollectionReferenceTest, Assignment) {
2826
CollectionReferenceInternal>();
2927
}
3028

31-
#endif // defined(__ANDROID__) || defined(FIRESTORE_STUB_BUILD)
29+
#endif // defined(__ANDROID__)
3230

3331
} // namespace firestore
3432
} // namespace firebase

firestore/integration_test_internal/src/document_change_test.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#if defined(__ANDROID__)
22
#include "firestore/src/android/document_change_android.h"
3-
#elif defined(FIRESTORE_STUB_BUILD)
4-
#include "firestore/src/stub/document_change_stub.h"
53
#endif // defined(__ANDROID__)
64

75
#include "firebase/firestore.h"
@@ -13,7 +11,7 @@
1311
namespace firebase {
1412
namespace firestore {
1513

16-
#if defined(__ANDROID__) || defined(FIRESTORE_STUB_BUILD)
14+
#if defined(__ANDROID__)
1715

1816
using DocumentChangeTest = FirestoreIntegrationTest;
1917

@@ -76,7 +74,7 @@ TEST_F(DocumentChangeTest, TestDocumentChanges) {
7674
EXPECT_EQ(changes[0].new_index(), 0);
7775
}
7876

79-
#endif // defined(__ANDROID__) || defined(FIRESTORE_STUB_BUILD)
77+
#endif // defined(__ANDROID__)
8078

8179
} // namespace firestore
8280
} // namespace firebase

firestore/integration_test_internal/src/document_reference_test.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99
#if defined(__ANDROID__)
1010
#include "firestore/src/android/converter_android.h"
1111
#include "firestore/src/android/document_reference_android.h"
12-
#elif defined(FIRESTORE_STUB_BUILD)
13-
#include "firestore/src/stub/document_reference_stub.h"
1412
#endif // defined(__ANDROID__)
1513

1614
namespace firebase {
1715
namespace firestore {
1816

19-
#if defined(__ANDROID__) || defined(FIRESTORE_STUB_BUILD)
17+
#if defined(__ANDROID__)
2018

2119
using DocumentReferenceTest = FirestoreIntegrationTest;
2220

@@ -30,7 +28,7 @@ TEST_F(DocumentReferenceTest, Assignment) {
3028
DocumentReferenceInternal>();
3129
}
3230

33-
#endif // defined(__ANDROID__) || defined(FIRESTORE_STUB_BUILD)
31+
#endif // defined(__ANDROID__)
3432

3533
#if defined(__ANDROID__)
3634

firestore/integration_test_internal/src/document_snapshot_test.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
#if defined(__ANDROID__)
55
#include "firestore/src/android/document_snapshot_android.h"
66
#include "firestore/src/common/wrapper_assertions.h"
7-
#elif defined(FIRESTORE_STUB_BUILD)
8-
#include "firestore/src/common/wrapper_assertions.h"
9-
#include "firestore/src/stub/document_snapshot_stub.h"
107
#endif // defined(__ANDROID__)
118

129
#include "gmock/gmock.h"
@@ -15,7 +12,7 @@
1512
namespace firebase {
1613
namespace firestore {
1714

18-
#if defined(__ANDROID__) || defined(FIRESTORE_STUB_BUILD)
15+
#if defined(__ANDROID__)
1916

2017
using DocumentSnapshotTest = testing::Test;
2118

firestore/integration_test_internal/src/field_value_test.cc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#if defined(__ANDROID__)
66
#include "firestore/src/android/field_value_android.h"
77
#include "firestore/src/common/wrapper_assertions.h"
8-
#elif defined(FIRESTORE_STUB_BUILD)
9-
#include "firestore/src/stub/field_value_stub.h"
108
#else
119
#include "firestore/src/main/field_value_main.h"
1210
#endif // defined(__ANDROID__)
@@ -39,7 +37,7 @@ TEST_F(FieldValueTest, TestFieldValueTypes) {
3937
FieldValue::ArrayRemove(std::vector<FieldValue>{FieldValue::Null()});
4038
}
4139

42-
#if defined(__ANDROID__) || defined(FIRESTORE_STUB_BUILD)
40+
#if defined(__ANDROID__)
4341

4442
TEST_F(FieldValueTest, Construction) {
4543
testutil::AssertWrapperConstructionContract<FieldValue>();
@@ -49,9 +47,7 @@ TEST_F(FieldValueTest, Assignment) {
4947
testutil::AssertWrapperAssignmentContract<FieldValue>();
5048
}
5149

52-
#endif // defined(__ANDROID__) || defined(FIRESTORE_STUB_BUILD)
53-
54-
#if !defined(FIRESTORE_STUB_BUILD)
50+
#endif // defined(__ANDROID__)
5551

5652
TEST_F(FieldValueTest, TestNullType) {
5753
FieldValue value = FieldValue::Null();
@@ -355,7 +351,5 @@ TEST_F(FieldValueTest, TestIncrementChoosesTheCorrectType) {
355351
// clang-format on
356352
}
357353

358-
#endif // !defined(FIRESTORE_STUB_BUILD)
359-
360354
} // namespace firestore
361355
} // namespace firebase

firestore/integration_test_internal/src/firestore_test.cc

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
#endif
88
#include <stdexcept>
99

10-
#if !defined(FIRESTORE_STUB_BUILD)
11-
#include "app/src/semaphore.h"
12-
#endif
13-
1410
#if defined(__ANDROID__)
1511
#include "android/firestore_integration_test_android.h"
1612
#include "firestore/src/android/exception_android.h"
@@ -93,24 +89,6 @@ TEST_F(FirestoreIntegrationTest, TestCanCreateCollectionAndDocumentReferences) {
9389
// If any of these assert, the test will fail.
9490
}
9591

96-
#if defined(FIRESTORE_STUB_BUILD)
97-
98-
TEST_F(FirestoreIntegrationTest, TestStubsReturnFailedFutures) {
99-
Firestore* db = TestFirestore();
100-
Future<void> future = db->EnableNetwork();
101-
Await(future);
102-
EXPECT_EQ(FutureStatus::kFutureStatusComplete, future.status());
103-
EXPECT_EQ(Error::kErrorFailedPrecondition, future.error());
104-
105-
future = db->Document("foo/bar").Set(
106-
MapFieldValue{{"foo", FieldValue::String("bar")}});
107-
Await(future);
108-
EXPECT_EQ(FutureStatus::kFutureStatusComplete, future.status());
109-
EXPECT_EQ(Error::kErrorFailedPrecondition, future.error());
110-
}
111-
112-
#else // defined(FIRESTORE_STUB_BUILD)
113-
11492
TEST_F(FirestoreIntegrationTest, TestCanReadNonExistentDocuments) {
11593
DocumentReference doc = Collection("rooms").Document();
11694

@@ -1565,7 +1543,5 @@ TEST_F(FirestoreAndroidIntegrationTest,
15651543
}
15661544
#endif // defined(__ANDROID__)
15671545

1568-
#endif // defined(FIRESTORE_STUB_BUILD)
1569-
15701546
} // namespace firestore
15711547
} // namespace firebase

firestore/integration_test_internal/src/includes_test.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,6 @@ TEST_F(IncludesTest, TestIncludingFirestoreHeaderIsSufficient) {
3838
#if defined(__ANDROID__)
3939
App* app =
4040
App::Create(app_framework::GetJniEnv(), app_framework::GetActivity());
41-
42-
#elif defined(FIRESTORE_STUB_BUILD)
43-
// Stubs don't load values from `GoogleService-Info.plist`/etc., so the app
44-
// has to be configured explicitly.
45-
AppOptions options;
46-
options.set_project_id("foo");
47-
options.set_app_id("foo");
48-
options.set_api_key("foo");
49-
App* app = App::Create(options);
50-
5141
#else
5242
App* app = App::Create();
5343
#endif // defined(__ANDROID__)

firestore/integration_test_internal/src/listener_registration_test.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#if defined(__ANDROID__)
66
#include "firestore/src/android/listener_registration_android.h"
77
#include "firestore/src/common/wrapper_assertions.h"
8-
#elif defined(FIRESTORE_STUB_BUILD)
9-
#include "firestore/src/stub/listener_registration_stub.h"
108
#endif // defined(__ANDROID__)
119

1210
#include "gmock/gmock.h"
@@ -29,9 +27,6 @@ class ListenerRegistrationTest : public FirestoreIntegrationTest {
2927
}
3028
};
3129

32-
// These tests don't work with stubs.
33-
#if !defined(FIRESTORE_STUB_BUILD)
34-
3530
TEST_F(ListenerRegistrationTest, TestCanBeRemoved) {
3631
CollectionReference collection = Collection();
3732
DocumentReference document = collection.Document();
@@ -120,8 +115,6 @@ TEST_F(ListenerRegistrationTest, TestCanBeRemovedIndependently) {
120115
EXPECT_EQ(3, listener_two.event_count());
121116
}
122117

123-
#endif // defined(FIRESTORE_STUB_BUILD)
124-
125118
#if defined(__ANDROID__)
126119
// TODO(b/136011600): the mechanism for creating internals doesn't work on iOS.
127120
// The most valuable test is making sure that a copy of a registration can be

firestore/integration_test_internal/src/query_network_test.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#include "util/event_accumulator.h"
77
#if defined(__ANDROID__)
88
#include "firestore/src/android/query_android.h"
9-
#elif defined(FIRESTORE_STUB_BUILD)
10-
#include "firestore/src/stub/query_stub.h"
119
#endif // defined(__ANDROID__)
1210

1311
#include "gmock/gmock.h"

firestore/integration_test_internal/src/query_snapshot_test.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
#include "firestore/src/common/wrapper_assertions.h"
55
#if defined(__ANDROID__)
66
#include "firestore/src/android/query_snapshot_android.h"
7-
#elif defined(FIRESTORE_STUB_BUILD)
8-
#include "firestore/src/stub/query_snapshot_stub.h"
97
#endif // defined(__ANDROID__)
108

119
#include "gmock/gmock.h"
@@ -14,7 +12,7 @@
1412
namespace firebase {
1513
namespace firestore {
1614

17-
#if defined(__ANDROID__) || defined(FIRESTORE_STUB_BUILD)
15+
#if defined(__ANDROID__)
1816

1917
using QuerySnapshotTest = testing::Test;
2018

@@ -28,7 +26,7 @@ TEST_F(QuerySnapshotTest, Assignment) {
2826
QuerySnapshotInternal>();
2927
}
3028

31-
#endif // defined(__ANDROID__) || defined(FIRESTORE_STUB_BUILD)
29+
#endif // defined(__ANDROID__)
3230

3331
} // namespace firestore
3432
} // namespace firebase

0 commit comments

Comments
 (0)