@@ -391,6 +391,7 @@ static const int kSimpleInt = 2;
391391static const int kSimplePriority = 100 ;
392392static const double kSimpleDouble = 3.4 ;
393393static const bool kSimpleBool = true ;
394+ static const double kLongDouble = 0.123456789876543 ;
394395
395396TEST_F (FirebaseDatabaseTest, TestSetAndGetSimpleValues) {
396397 const char * test_name = test_info_->name ();
@@ -415,12 +416,15 @@ TEST_F(FirebaseDatabaseTest, TestSetAndGetSimpleValues) {
415416 ref.Child (test_name)
416417 .Child (" IntAndPriority" )
417418 .SetValueAndPriority (kSimpleInt , kSimplePriority );
419+ firebase::Future<void > f7 =
420+ ref.Child (test_name).Child (" LongDouble" ).SetValue (kLongDouble );
418421 WaitForCompletion (f1, " SetSimpleString" );
419422 WaitForCompletion (f2, " SetSimpleInt" );
420423 WaitForCompletion (f3, " SetSimpleDouble" );
421424 WaitForCompletion (f4, " SetSimpleBool" );
422425 WaitForCompletion (f5, " SetSimpleTimestamp" );
423426 WaitForCompletion (f6, " SetSimpleIntAndPriority" );
427+ WaitForCompletion (f7, " SetLongDouble" );
424428 }
425429
426430 // Get the values that we just set, and confirm that they match what we
@@ -439,12 +443,15 @@ TEST_F(FirebaseDatabaseTest, TestSetAndGetSimpleValues) {
439443 ref.Child (test_name).Child (" Timestamp" ).GetValue ();
440444 firebase::Future<firebase::database::DataSnapshot> f6 =
441445 ref.Child (test_name).Child (" IntAndPriority" ).GetValue ();
446+ firebase::Future<firebase::database::DataSnapshot> f7 =
447+ ref.Child (test_name).Child (" LongDouble" ).GetValue ();
442448 WaitForCompletion (f1, " GetSimpleString" );
443449 WaitForCompletion (f2, " GetSimpleInt" );
444450 WaitForCompletion (f3, " GetSimpleDouble" );
445451 WaitForCompletion (f4, " GetSimpleBool" );
446452 WaitForCompletion (f5, " GetSimpleTimestamp" );
447453 WaitForCompletion (f6, " GetSimpleIntAndPriority" );
454+ WaitForCompletion (f7, " GetLongDouble" );
448455
449456 // Get the current time to compare to the Timestamp.
450457 int64_t current_time_milliseconds =
@@ -458,6 +465,7 @@ TEST_F(FirebaseDatabaseTest, TestSetAndGetSimpleValues) {
458465 TimestampIsNear (current_time_milliseconds));
459466 EXPECT_EQ (f6.result ()->value ().AsInt64 (), kSimpleInt );
460467 EXPECT_EQ (f6.result ()->priority ().AsInt64 (), kSimplePriority );
468+ EXPECT_EQ (f7.result ()->value ().AsDouble (), kLongDouble );
461469 }
462470}
463471
0 commit comments