Skip to content

Commit 837bd85

Browse files
committed
format off fixes, removed firestore clangformat file
1 parent f866933 commit 837bd85

File tree

153 files changed

+571
-1239
lines changed

Some content is hidden

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

153 files changed

+571
-1239
lines changed

app/src/locale.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,15 @@ std::string GetLocale() {
5959
// of the LANG or LC_CTYPE environment variables if set, or otherwise return a
6060
// default locale (empty in real life, or placeholder when running in a unit
6161
// test, as the test environment has no locale variables set).
62-
std::string output = std::locale().name() != "C" ? std::locale().name()
63-
: getenv("LANG") ? getenv("LANG")
64-
: getenv("LC_CTYPE") ? getenv("LC_CTYPE")
65-
: getenv("TEST_TMPDIR") ? "en_US"
66-
: "";
62+
// clang-format off
63+
std::string output = std::locale().name() != "C"
64+
? std::locale().name()
65+
: getenv("LANG")
66+
? getenv("LANG")
67+
: getenv("LC_CTYPE")
68+
? getenv("LC_CTYPE")
69+
: getenv("TEST_TMPDIR") ? "en_US" : "";
70+
// clang-format on
6771
// Some of the environment variables have a "." after the name to specify the
6872
// terminal encoding, e.g. "en_US.UTF-8", so we want to cut the string on the
6973
// ".".

app/tests/optional_test.cc

Lines changed: 60 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,12 @@ TEST_F(OptionalTest, CopyConstructor) {
164164
EXPECT_TRUE(another_copy_of_optional_int.has_value());
165165
EXPECT_EQ(another_copy_of_optional_int.value(), 9999);
166166

167-
SetupExpectCall().Construct(1).CopyAndMove(2, 1).Destruct(4);
167+
// clang-format off
168+
SetupExpectCall()
169+
.Construct(1)
170+
.CopyAndMove(2, 1)
171+
.Destruct(4);
172+
// clang-format on
168173

169174
Optional<SpecialFunctionsNotifierWrapper> optional_struct(
170175
SpecialFunctionsNotifierWrapper{});
@@ -187,7 +192,12 @@ TEST_F(OptionalTest, CopyAssignment) {
187192
EXPECT_TRUE(another_optional_int.has_value());
188193
EXPECT_EQ(another_optional_int.value(), 9999);
189194

190-
SetupExpectCall().Construct(2).CopyAndMove(1, 2).Destruct(4);
195+
// clang-format off
196+
SetupExpectCall()
197+
.Construct(2)
198+
.CopyAndMove(1, 2)
199+
.Destruct(4);
200+
// clang-format on
191201

192202
Optional<SpecialFunctionsNotifierWrapper> optional_struct(
193203
SpecialFunctionsNotifierWrapper{});
@@ -204,7 +214,12 @@ TEST_F(OptionalTest, CopyAssignmentSelf) {
204214
EXPECT_TRUE(optional_int.has_value());
205215
EXPECT_EQ(optional_int.value(), 9999);
206216

207-
SetupExpectCall().Construct(1).CopyAndMove(1, 1).Destruct(2);
217+
// clang-format off
218+
SetupExpectCall()
219+
.Construct(1)
220+
.CopyAndMove(1, 1)
221+
.Destruct(2);
222+
// clang-format on
208223

209224
Optional<SpecialFunctionsNotifierWrapper> optional_struct(
210225
SpecialFunctionsNotifierWrapper{});
@@ -223,7 +238,12 @@ TEST_F(OptionalTest, MoveConstructor) {
223238
EXPECT_TRUE(another_moved_optional_int.has_value());
224239
EXPECT_EQ(another_moved_optional_int.value(), 9999);
225240

226-
SetupExpectCall().Construct(1).CopyAndMove(0, 3).Destruct(4);
241+
// clang-format off
242+
SetupExpectCall()
243+
.Construct(1)
244+
.CopyAndMove(0, 3)
245+
.Destruct(4);
246+
// clang-format on
227247

228248
Optional<SpecialFunctionsNotifierWrapper> optional_struct(
229249
SpecialFunctionsNotifierWrapper{});
@@ -245,7 +265,12 @@ TEST_F(OptionalTest, MoveAssignment) {
245265
EXPECT_TRUE(another_optional_int.has_value());
246266
EXPECT_EQ(another_optional_int.value(), 9999);
247267

248-
SetupExpectCall().Construct(2).CopyAndMove(0, 3).Destruct(4);
268+
// clang-format off
269+
SetupExpectCall()
270+
.Construct(2)
271+
.CopyAndMove(0, 3)
272+
.Destruct(4);
273+
// clang-format on
249274

250275
Optional<SpecialFunctionsNotifierWrapper> optional_struct(
251276
SpecialFunctionsNotifierWrapper{});
@@ -278,7 +303,12 @@ TEST_F(OptionalTest, ValueConstructor) {
278303
EXPECT_TRUE(optional_int.has_value());
279304
EXPECT_EQ(optional_int.value(), 1337);
280305

281-
SetupExpectCall().Construct(1).CopyAndMove(1, 0).Destruct(2);
306+
// clang-format off
307+
SetupExpectCall()
308+
.Construct(1)
309+
.CopyAndMove(1, 0)
310+
.Destruct(2);
311+
// clang-format on
282312

283313
SpecialFunctionsNotifierWrapper value{};
284314
Optional<SpecialFunctionsNotifierWrapper> optional_struct(value);
@@ -299,7 +329,12 @@ TEST_F(OptionalTest, ValueCopyAssignmentToUnpopulatedOptional) {
299329
EXPECT_TRUE(optional_int.has_value());
300330
EXPECT_EQ(optional_int.value(), 9999);
301331

302-
SetupExpectCall().Construct(1).CopyAndMove(1, 0).Destruct(2);
332+
// clang-format off
333+
SetupExpectCall()
334+
.Construct(1)
335+
.CopyAndMove(1, 0)
336+
.Destruct(2);
337+
// clang-format on
303338

304339
Optional<SpecialFunctionsNotifierWrapper> optional_struct;
305340
SpecialFunctionsNotifierWrapper my_struct{};
@@ -313,7 +348,12 @@ TEST_F(OptionalTest, ValueCopyAssignmentToPopulatedOptional) {
313348
EXPECT_TRUE(optional_int.has_value());
314349
EXPECT_EQ(optional_int.value(), 9999);
315350

316-
SetupExpectCall().Construct(2).CopyAndMove(1, 1).Destruct(3);
351+
// clang-format off
352+
SetupExpectCall()
353+
.Construct(2)
354+
.CopyAndMove(1, 1)
355+
.Destruct(3);
356+
// clang-format on
317357

318358
Optional<SpecialFunctionsNotifierWrapper> optional_struct(
319359
SpecialFunctionsNotifierWrapper{});
@@ -323,7 +363,12 @@ TEST_F(OptionalTest, ValueCopyAssignmentToPopulatedOptional) {
323363
}
324364

325365
TEST_F(OptionalTest, ValueMoveAssignmentToUnpopulatedOptional) {
326-
SetupExpectCall().Construct(1).CopyAndMove(0, 1).Destruct(2);
366+
// clang-format off
367+
SetupExpectCall()
368+
.Construct(1)
369+
.CopyAndMove(0, 1)
370+
.Destruct(2);
371+
// clang-format on
327372

328373
Optional<SpecialFunctionsNotifierWrapper> optional_struct;
329374
SpecialFunctionsNotifierWrapper my_struct{};
@@ -332,7 +377,12 @@ TEST_F(OptionalTest, ValueMoveAssignmentToUnpopulatedOptional) {
332377
}
333378

334379
TEST_F(OptionalTest, ValueMoveAssignmentToPopulatedOptional) {
335-
SetupExpectCall().Construct(2).CopyAndMove(0, 2).Destruct(3);
380+
// clang-format off
381+
SetupExpectCall()
382+
.Construct(2)
383+
.CopyAndMove(0, 2)
384+
.Destruct(3);
385+
// clang-format on
336386

337387
Optional<SpecialFunctionsNotifierWrapper> optional_struct(
338388
SpecialFunctionsNotifierWrapper{});

firestore/.clang-format

Lines changed: 0 additions & 11 deletions
This file was deleted.

firestore/integration_test/src/integration_test.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,7 @@ class FirebaseFirestoreBasicTest : public FirebaseTest {
140140
firebase::App* FirebaseFirestoreBasicTest::shared_app_;
141141
firebase::auth::Auth* FirebaseFirestoreBasicTest::shared_auth_;
142142

143-
void FirebaseFirestoreBasicTest::SetUpTestSuite() {
144-
InitializeAppAndAuth();
145-
}
143+
void FirebaseFirestoreBasicTest::SetUpTestSuite() { InitializeAppAndAuth(); }
146144

147145
void FirebaseFirestoreBasicTest::InitializeAppAndAuth() {
148146
LogDebug("Initialize Firebase App.");
@@ -184,9 +182,7 @@ void FirebaseFirestoreBasicTest::InitializeAppAndAuth() {
184182
SignIn();
185183
}
186184

187-
void FirebaseFirestoreBasicTest::TearDownTestSuite() {
188-
TerminateAppAndAuth();
189-
}
185+
void FirebaseFirestoreBasicTest::TearDownTestSuite() { TerminateAppAndAuth(); }
190186

191187
void FirebaseFirestoreBasicTest::TerminateAppAndAuth() {
192188
if (shared_auth_) {

firestore/integration_test_internal/src/android/cancellation_token_source.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ Local<Object> CancellationTokenSource::GetToken(Env& env) {
3434
return env.Call(*this, kGetToken);
3535
}
3636

37-
void CancellationTokenSource::Cancel(Env& env) {
38-
env.Call(*this, kCancel);
39-
}
37+
void CancellationTokenSource::Cancel(Env& env) { env.Call(*this, kCancel); }
4038

4139
} // namespace firestore
4240
} // namespace firebase

firestore/integration_test_internal/src/android/firestore_integration_test_android.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ Constructor<Throwable> kExceptionConstructor("(Ljava/lang/String;)V");
4141
} // namespace
4242

4343
FirestoreAndroidIntegrationTest::FirestoreAndroidIntegrationTest()
44-
: loader_(app()) {
45-
}
44+
: loader_(app()) {}
4645

4746
void FirestoreAndroidIntegrationTest::SetUp() {
4847
FirestoreIntegrationTest::SetUp();

firestore/integration_test_internal/src/android/firestore_integration_test_android.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ void PrintTo(const Global<T>& object, std::ostream* os) {
4949
* jni::Local<jni::String> object2 = env.NewStringUtf("string");
5050
* EXPECT_THAT(object1, JavaEq(object2));
5151
*/
52-
MATCHER_P(JavaEq,
53-
object,
52+
MATCHER_P(JavaEq, object,
5453
std::string("compares ") + (negation ? "unequal" : "equal") +
5554
" using .equals() to a " + ToDebugString(object)) {
5655
jni::Env env;
@@ -67,9 +66,7 @@ class FirestoreAndroidIntegrationTest : public FirestoreIntegrationTest {
6766
void SetUp() override;
6867
void TearDown() noexcept(false) override;
6968

70-
jni::Loader& loader() {
71-
return loader_;
72-
}
69+
jni::Loader& loader() { return loader_; }
7370

7471
/** Creates and returns a new Java `Exception` object with a message. */
7572
jni::Local<jni::Throwable> CreateException(jni::Env& env,

firestore/integration_test_internal/src/android/promise_android_test.cc

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ namespace {
4141

4242
class PromiseTest : public FirestoreAndroidIntegrationTest {
4343
public:
44-
PromiseTest() : promises_(GetFirestoreInternal(TestFirestore())) {
45-
}
44+
PromiseTest() : promises_(GetFirestoreInternal(TestFirestore())) {}
4645

4746
void SetUp() override {
4847
FirestoreAndroidIntegrationTest::SetUp();
@@ -60,9 +59,7 @@ class PromiseTest : public FirestoreAndroidIntegrationTest {
6059
};
6160

6261
protected:
63-
PromiseFactory<AsyncFn>& promises() {
64-
return promises_;
65-
}
62+
PromiseFactory<AsyncFn>& promises() { return promises_; }
6663

6764
jni::Local<jni::Task> GetTask() {
6865
jni::Env env = GetEnv();
@@ -85,9 +82,7 @@ class PromiseTest : public FirestoreAndroidIntegrationTest {
8582
cancellation_token_source_.Cancel(env);
8683
}
8784

88-
static jni::Env GetEnv() {
89-
return jni::Env(app_framework::GetJniEnv());
90-
}
85+
static jni::Env GetEnv() { return jni::Env(app_framework::GetJniEnv()); }
9186

9287
private:
9388
PromiseFactory<AsyncFn> promises_;
@@ -106,12 +101,10 @@ class PromiseTest : public FirestoreAndroidIntegrationTest {
106101
// latter specialization provides access to the "result" specified to
107102
// `CompleteWith`.
108103
template <typename PublicType, typename InternalType>
109-
class TestCompletionBase : public Promise<PublicType,
110-
InternalType,
104+
class TestCompletionBase : public Promise<PublicType, InternalType,
111105
PromiseTest::AsyncFn>::Completion {
112106
public:
113-
void CompleteWith(Error error_code,
114-
const char* error_message,
107+
void CompleteWith(Error error_code, const char* error_message,
115108
PublicType* result) override {
116109
MutexLock lock(mutex_);
117110
FIREBASE_ASSERT(invocation_count_ == 0);
@@ -218,9 +211,7 @@ class TestVoidCompletion : public TestCompletionBase<void, void> {
218211
}
219212

220213
protected:
221-
void HandleResult(void* result) override {
222-
result_ = result;
223-
}
214+
void HandleResult(void* result) override { result_ = result; }
224215

225216
private:
226217
void* result_;

firestore/integration_test_internal/src/array_transform_test.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ class ArrayTransformTest : public FirestoreIntegrationTest {
2828
EXPECT_FALSE(snapshot.exists());
2929
}
3030

31-
void TearDown() override {
32-
registration_.Remove();
33-
}
31+
void TearDown() override { registration_.Remove(); }
3432

3533
void WriteInitialData(const MapFieldValue& data) {
3634
Await(document_.Set(data));
@@ -51,9 +49,7 @@ class ArrayTransformTest : public FirestoreIntegrationTest {
5149

5250
class ArrayTransformServerApplicationTest : public FirestoreIntegrationTest {
5351
protected:
54-
void SetUp() override {
55-
document_ = Document();
56-
}
52+
void SetUp() override { document_ = Document(); }
5753

5854
DocumentReference document_;
5955
};

firestore/integration_test_internal/src/field_value_test.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,18 +341,18 @@ TEST_F(FieldValueTest, TestIncrementChoosesTheCorrectType) {
341341

342342
// The statements below shouldn't compile (uncomment to check).
343343

344+
// clang-format off
344345
// Types that would lead to truncation:
345346
// EXPECT_TRUE(FieldValue::Increment(1UL).type() == Type::kIncrementInteger);
346347
// unsigned long long ullfoo = 1;
347-
// EXPECT_TRUE(FieldValue::Increment(ullfoo).type() ==
348-
// Type::kIncrementInteger); EXPECT_TRUE(FieldValue::Increment(1.0L).type() ==
349-
// Type::kIncrementDouble);
348+
// EXPECT_TRUE(FieldValue::Increment(ullfoo).type() == Type::kIncrementInteger);
349+
// EXPECT_TRUE(FieldValue::Increment(1.0L).type() == Type::kIncrementDouble);
350350

351351
// Inapplicable types:
352352
// EXPECT_TRUE(FieldValue::Increment(true).type() == Type::kIncrementInteger);
353353
// EXPECT_TRUE(FieldValue::Increment('a').type() == Type::kIncrementInteger);
354-
// EXPECT_TRUE(FieldValue::Increment("abc").type() ==
355-
// Type::kIncrementInteger);
354+
// EXPECT_TRUE(FieldValue::Increment("abc").type() == Type::kIncrementInteger);
355+
// clang-format on
356356
}
357357

358358
#endif // !defined(FIRESTORE_STUB_BUILD)

firestore/integration_test_internal/src/firestore_integration_test.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,7 @@ std::string FirestoreIntegrationTest::DescribeFailedFuture(
291291
std::to_string(future.error()) + "): " + future.error_message();
292292
}
293293

294-
bool ProcessEvents(int msec) {
295-
return app_framework::ProcessEvents(msec);
296-
}
294+
bool ProcessEvents(int msec) { return app_framework::ProcessEvents(msec); }
297295

298296
} // namespace firestore
299297
} // namespace firebase

0 commit comments

Comments
 (0)