@@ -102,13 +102,15 @@ class FirebaseAuthTest : public FirebaseTest {
102
102
void DeleteUser ();
103
103
104
104
// Passthrough method to the base class's WaitForCompletion.
105
- bool WaitForCompletion (firebase::Future<std::string> future, const char * fn,
105
+ bool WaitForCompletion (firebase::Future<std::string> future,
106
+ const char * fn,
106
107
int expected_error = firebase::auth::kAuthErrorNone ) {
107
108
return FirebaseTest::WaitForCompletion (future, fn, expected_error);
108
109
}
109
110
110
111
// Passthrough method to the base class's WaitForCompletion.
111
- bool WaitForCompletion (firebase::Future<void > future, const char * fn,
112
+ bool WaitForCompletion (firebase::Future<void > future,
113
+ const char * fn,
112
114
int expected_error = firebase::auth::kAuthErrorNone ) {
113
115
return FirebaseTest::WaitForCompletion (future, fn, expected_error);
114
116
}
@@ -125,7 +127,8 @@ class FirebaseAuthTest : public FirebaseTest {
125
127
// Custom WaitForCompletion that checks if User and Provider ID matches
126
128
// afterwards.
127
129
bool WaitForCompletion (firebase::Future<firebase::auth::SignInResult> future,
128
- const char * fn, const std::string& provider_id);
130
+ const char * fn,
131
+ const std::string& provider_id);
129
132
130
133
bool initialized_;
131
134
firebase::auth::Auth* auth_;
@@ -198,7 +201,8 @@ void FirebaseAuthTest::Terminate() {
198
201
}
199
202
200
203
bool FirebaseAuthTest::WaitForCompletion (
201
- firebase::Future<firebase::auth::User*> future, const char * fn,
204
+ firebase::Future<firebase::auth::User*> future,
205
+ const char * fn,
202
206
int expected_error) {
203
207
bool succeeded = FirebaseTest::WaitForCompletion (future, fn, expected_error);
204
208
@@ -216,7 +220,8 @@ bool FirebaseAuthTest::WaitForCompletion(
216
220
}
217
221
218
222
bool FirebaseAuthTest::WaitForCompletion (
219
- firebase::Future<firebase::auth::SignInResult> future, const char * fn,
223
+ firebase::Future<firebase::auth::SignInResult> future,
224
+ const char * fn,
220
225
int expected_error) {
221
226
bool succeeded = FirebaseTest::WaitForCompletion (future, fn, expected_error);
222
227
@@ -235,7 +240,8 @@ bool FirebaseAuthTest::WaitForCompletion(
235
240
}
236
241
237
242
bool FirebaseAuthTest::WaitForCompletion (
238
- firebase::Future<firebase::auth::SignInResult> future, const char * fn,
243
+ firebase::Future<firebase::auth::SignInResult> future,
244
+ const char * fn,
239
245
const std::string& provider_id) {
240
246
bool succeeded = FirebaseTest::WaitForCompletion (future, fn);
241
247
if (succeeded) {
@@ -320,7 +326,9 @@ class TestAuthStateListener : public firebase::auth::AuthStateListener {
320
326
auth_states_.push_back (provider);
321
327
}
322
328
}
323
- const std::vector<std::string>& auth_states () { return auth_states_; }
329
+ const std::vector<std::string>& auth_states () {
330
+ return auth_states_;
331
+ }
324
332
325
333
private:
326
334
std::vector<std::string> auth_states_;
@@ -350,7 +358,9 @@ class TestIdTokenListener : public firebase::auth::IdTokenListener {
350
358
}
351
359
}
352
360
353
- const std::vector<std::string>& token_states () { return token_states_; }
361
+ const std::vector<std::string>& token_states () {
362
+ return token_states_;
363
+ }
354
364
355
365
private:
356
366
std::vector<std::string> token_states_;
@@ -395,7 +405,8 @@ TEST_F(FirebaseAuthTest, TestTokensAndAuthStateListeners) {
395
405
396
406
static std::string GenerateEmailAddress () {
397
407
char time_string[22 ];
398
- snprintf (time_string, 22 , " %d" , app_framework::GetCurrentTimeInMicroseconds ());
408
+ snprintf (time_string, 22 , " %d" ,
409
+ app_framework::GetCurrentTimeInMicroseconds ());
399
410
std::string email = " random_user_" ;
400
411
email.append (time_string);
401
412
email.append (" @gmail.com" );
@@ -718,7 +729,7 @@ TEST_F(FirebaseAuthTest, TestWithCustomEmailAndPassword) {
718
729
EXPECT_NE (auth_->current_user (), nullptr );
719
730
}
720
731
721
- #if ! defined(__linux__)
732
+ #if !defined(__linux__)
722
733
// Test is disabled on linux due to the need to unlock the keystore.
723
734
TEST_F (FirebaseAuthTest, TestAuthPersistenceWithAnonymousSignin) {
724
735
WaitForCompletion (auth_->SignInAnonymously (), " SignInAnonymously" );
@@ -734,7 +745,7 @@ TEST_F(FirebaseAuthTest, TestAuthPersistenceWithAnonymousSignin) {
734
745
}
735
746
#endif // ! defined(__linux__)
736
747
737
- #if ! defined(__linux__)
748
+ #if !defined(__linux__)
738
749
// Test is disabled on linux due to the need to unlock the keychain.
739
750
TEST_F (FirebaseAuthTest, TestAuthPersistenceWithEmailSignin) {
740
751
std::string email = GenerateEmailAddress ();
@@ -775,14 +786,14 @@ TEST_F(FirebaseAuthTest, TestAuthPersistenceWithEmailSignin) {
775
786
}
776
787
#endif // ! defined(__linux__)
777
788
778
-
779
789
class PhoneListener : public firebase ::auth::PhoneAuthProvider::Listener {
780
790
public:
781
791
PhoneListener ()
782
792
: on_verification_complete_count_(0 ),
783
793
on_verification_failed_count_ (0 ),
784
794
on_code_sent_count_(0 ),
785
- on_code_auto_retrieval_time_out_count_(0 ) {}
795
+ on_code_auto_retrieval_time_out_count_(0 ) {
796
+ }
786
797
787
798
void OnVerificationCompleted (firebase::auth::Credential credential) override {
788
799
LogDebug (" PhoneListener: successful automatic verification." );
@@ -812,7 +823,9 @@ class PhoneListener : public firebase::auth::PhoneAuthProvider::Listener {
812
823
on_code_auto_retrieval_time_out_count_++;
813
824
}
814
825
815
- const std::string& verification_id () const { return verification_id_; }
826
+ const std::string& verification_id () const {
827
+ return verification_id_;
828
+ }
816
829
const firebase::auth::PhoneAuthProvider::ForceResendingToken&
817
830
force_resending_token () const {
818
831
return force_resending_token_;
@@ -823,7 +836,9 @@ class PhoneListener : public firebase::auth::PhoneAuthProvider::Listener {
823
836
int on_verification_failed_count () const {
824
837
return on_verification_failed_count_;
825
838
}
826
- int on_code_sent_count () const { return on_code_sent_count_; }
839
+ int on_code_sent_count () const {
840
+ return on_code_sent_count_;
841
+ }
827
842
int on_code_auto_retrieval_time_out_count () const {
828
843
return on_code_auto_retrieval_time_out_count_;
829
844
}
@@ -840,7 +855,9 @@ class PhoneListener : public firebase::auth::PhoneAuthProvider::Listener {
840
855
on_code_auto_retrieval_time_out_count () == 0 ;
841
856
}
842
857
843
- firebase::auth::Credential credential () { return credential_; }
858
+ firebase::auth::Credential credential () {
859
+ return credential_;
860
+ }
844
861
845
862
private:
846
863
std::string verification_id_;
@@ -867,7 +884,8 @@ TEST_F(FirebaseAuthTest, TestPhoneAuth) {
867
884
LogDebug (" Calling VerifyPhoneNumber." );
868
885
// Randomly choose one of the phone numbers to avoid collisions.
869
886
const int random_phone_number =
870
- app_framework::GetCurrentTimeInMicroseconds () % kPhoneAuthTestNumPhoneNumbers ;
887
+ app_framework::GetCurrentTimeInMicroseconds () %
888
+ kPhoneAuthTestNumPhoneNumbers ;
871
889
phone_provider.VerifyPhoneNumber (
872
890
kPhoneAuthTestPhoneNumbers [random_phone_number], kPhoneAuthTimeoutMs ,
873
891
nullptr , &listener);
0 commit comments