@@ -160,7 +160,6 @@ class TestEventRegistration : public EventRegistration {
160
160
}
161
161
162
162
bool MatchesListener (const void * listener_ptr) const override {
163
- EXPECT_TRUE (false ) << " Can't raise test events!" ;
164
163
return static_cast <const void *>(this ) == listener_ptr;
165
164
}
166
165
};
@@ -257,7 +256,8 @@ void SyncTreeTest::RunTest(const test_data::TestCase* test_spec,
257
256
EventRegistration* event_registration = nullptr ;
258
257
int callback_id = spec->callbackId ();
259
258
if (callback_id != 0 && registrations.count (callback_id) != 0 ) {
260
- event_registration = registrations[callback_id];
259
+ event_registration = new TestEventRegistration (
260
+ registrations[callback_id]->query_spec ());
261
261
} else {
262
262
event_registration = new TestEventRegistration (query->query_spec ());
263
263
if (callback_id != 0 ) {
@@ -296,8 +296,9 @@ void SyncTreeTest::RunTest(const test_data::TestCase* test_spec,
296
296
break ;
297
297
}
298
298
case test_data::StepType_serverMerge: {
299
- std::map<Path, Variant> merges =
300
- VariantToPathMap (FlexbufferToVariant (spec->data_flexbuffer_root ()));
299
+ std::map<Path, Variant> merges = VariantToPathMap (
300
+ spec->data () ? FlexbufferToVariant (spec->data_flexbuffer_root ())
301
+ : Variant::Null ());
301
302
std::vector<Event> actual;
302
303
if (spec->tag ()) {
303
304
actual =
@@ -309,7 +310,9 @@ void SyncTreeTest::RunTest(const test_data::TestCase* test_spec,
309
310
break ;
310
311
}
311
312
case test_data::StepType_set: {
312
- Variant to_set = FlexbufferToVariant (spec->data_flexbuffer_root ());
313
+ Variant to_set = spec->data ()
314
+ ? FlexbufferToVariant (spec->data_flexbuffer_root ())
315
+ : Variant::Null ();
313
316
OverwriteVisibility visible =
314
317
spec->visible () ? kOverwriteVisible : kOverwriteInvisible ;
315
318
// For now, assume anything visible should be persisted.
@@ -321,7 +324,8 @@ void SyncTreeTest::RunTest(const test_data::TestCase* test_spec,
321
324
}
322
325
case test_data::StepType_update: {
323
326
CompoundWrite merges = CompoundWrite::FromVariantMerge (
324
- FlexbufferToVariant (spec->data_flexbuffer_root ()));
327
+ spec->data () ? FlexbufferToVariant (spec->data_flexbuffer_root ())
328
+ : Variant::Null ());
325
329
std::vector<Event> actual = sync_tree_->ApplyUserMerge (
326
330
path, merges, merges, current_write_id++, kPersist );
327
331
EXPECT_THAT (actual, UnorderedPointwise (EventEq (), expected));
@@ -420,12 +424,10 @@ TEST_F(SyncTreeTest, AQueryCanGetACompleteCacheThenAMerge) {
420
424
}
421
425
422
426
TEST_F (SyncTreeTest, ServerMergeOnListenerWithCompleteChildren) {
423
- GTEST_SKIP (); // Fails assert.
424
427
RunOne (" Server merge on listener with complete children" );
425
428
}
426
429
427
430
TEST_F (SyncTreeTest, DeepMergeOnListenerWithCompleteChildren) {
428
- GTEST_SKIP (); // Fails assert.
429
431
RunOne (" Deep merge on listener with complete children" );
430
432
}
431
433
@@ -490,7 +492,6 @@ TEST_F(SyncTreeTest, RevertDeepSetWithNoServerData) {
490
492
}
491
493
492
494
TEST_F (SyncTreeTest, RevertSetCoveredByNonvisibleTransaction) {
493
- GTEST_SKIP (); // Fails expectations.
494
495
RunOne (" Revert set covered by non-visible transaction" );
495
496
}
496
497
@@ -511,17 +512,14 @@ TEST_F(SyncTreeTest, CanSetAlongsideARemoteMerge) {
511
512
}
512
513
513
514
TEST_F (SyncTreeTest, SetPriorityOnALocationWithNoCache) {
514
- // GTEST_SKIP();
515
515
RunOne (" setPriority on a location with no cache" );
516
516
}
517
517
518
518
TEST_F (SyncTreeTest, DeepUpdateDeletesChildFromLimitWindowAndPullsInNewChild) {
519
- GTEST_SKIP (); // Fails assert.
520
519
RunOne (" deep update deletes child from limit window and pulls in new child" );
521
520
}
522
521
523
522
TEST_F (SyncTreeTest, DeepSetDeletesChildFromLimitWindowAndPullsInNewChild) {
524
- GTEST_SKIP (); // Fails assert.
525
523
RunOne (" deep set deletes child from limit window and pulls in new child" );
526
524
}
527
525
@@ -534,7 +532,6 @@ TEST_F(SyncTreeTest, RevertSetInQueryWindow) {
534
532
}
535
533
536
534
TEST_F (SyncTreeTest, HandlesAServerValueMovingAChildOutOfAQueryWindow) {
537
- GTEST_SKIP (); // Fails assert.
538
535
RunOne (" Handles a server value moving a child out of a query window" );
539
536
}
540
537
@@ -551,12 +548,10 @@ TEST_F(SyncTreeTest, LimitIsRefilledFromServerDataAfterMerge) {
551
548
}
552
549
553
550
TEST_F (SyncTreeTest, HandleRepeatedListenWithMergeAsFirstUpdate) {
554
- GTEST_SKIP (); // Fails assert.
555
551
RunOne (" Handle repeated listen with merge as first update" );
556
552
}
557
553
558
554
TEST_F (SyncTreeTest, LimitIsRefilledFromServerDataAfterSet) {
559
- GTEST_SKIP (); // Fails assert.
560
555
RunOne (" Limit is refilled from server data after set" );
561
556
}
562
557
@@ -615,7 +610,6 @@ TEST_F(SyncTreeTest, WriteLeafNodeOverwriteAtParentNode) {
615
610
}
616
611
617
612
TEST_F (SyncTreeTest, ConfirmCompleteChildrenFromTheServer) {
618
- GTEST_SKIP (); // Fails expectations.
619
613
RunOne (" Confirm complete children from the server" );
620
614
}
621
615
@@ -634,7 +628,6 @@ TEST_F(SyncTreeTest, BasicKeyIndexSanityCheck) {
634
628
}
635
629
636
630
TEST_F (SyncTreeTest, CollectCorrectSubviewsToListenOn) {
637
- GTEST_SKIP (); // Fails assert.
638
631
RunOne (" Collect correct subviews to listen on" );
639
632
}
640
633
@@ -663,7 +656,6 @@ TEST_F(SyncTreeTest, ServerDataIsNotPurgedForNonServerIndexedQueries) {
663
656
}
664
657
665
658
TEST_F (SyncTreeTest, LimitWithCustomOrderByIsRefilledWithCorrectItem) {
666
- GTEST_SKIP (); // Fails assert.
667
659
RunOne (" Limit with custom orderBy is refilled with correct item" );
668
660
}
669
661
@@ -680,7 +672,6 @@ TEST_F(SyncTreeTest, LimitedQueryDoesntPullInOutOfRangeChild) {
680
672
}
681
673
682
674
TEST_F (SyncTreeTest, MergerForLocationWithDefaultAndLimitedListener) {
683
- GTEST_SKIP (); // Fails assert.
684
675
RunOne (" Merge for location with default and limited listener" );
685
676
}
686
677
@@ -716,7 +707,6 @@ TEST_F(SyncTreeTest, UserWriteWithDeepOverwrite) {
716
707
TEST_F (SyncTreeTest, DeepServerMerge) { RunOne (" Deep server merge" ); }
717
708
718
709
TEST_F (SyncTreeTest, ServerUpdatesPriority) {
719
- GTEST_SKIP (); // Fails expectations.
720
710
RunOne (" Server updates priority" );
721
711
}
722
712
@@ -729,27 +719,22 @@ TEST_F(SyncTreeTest, UserChildOverwriteForNonexistentServerNode) {
729
719
}
730
720
731
721
TEST_F (SyncTreeTest, RevertUserOverwriteOfChildOnLeafNode) {
732
- GTEST_SKIP (); // Fails expectations.
733
722
RunOne (" Revert user overwrite of child on leaf node" );
734
723
}
735
724
736
725
TEST_F (SyncTreeTest, ServerOverwriteWithDeepUserDelete) {
737
- GTEST_SKIP (); // Fails assert.
738
726
RunOne (" Server overwrite with deep user delete" );
739
727
}
740
728
741
729
TEST_F (SyncTreeTest, UserOverwritesLeafNodeWithPriority) {
742
- GTEST_SKIP (); // Fails expectations.
743
730
RunOne (" User overwrites leaf node with priority" );
744
731
}
745
732
746
733
TEST_F (SyncTreeTest, UserOverwritesInheritPriorityValuesFromLeafNodes) {
747
- GTEST_SKIP (); // Fails assert.
748
734
RunOne (" User overwrites inherit priority values from leaf nodes" );
749
735
}
750
736
751
737
TEST_F (SyncTreeTest, UserUpdateOnUserSetLeafNodeWithPriorityAfterServerUpdate) {
752
- GTEST_SKIP (); // Fails expectations.
753
738
RunOne (" User update on user set leaf node with priority after server update" );
754
739
}
755
740
@@ -762,32 +747,26 @@ TEST_F(SyncTreeTest, UserSetsRootPriority) {
762
747
}
763
748
764
749
TEST_F (SyncTreeTest, UserUpdatesPriorityOnEmptyRoot) {
765
- GTEST_SKIP (); // Fails assert.
766
750
RunOne (" User updates priority on empty root" );
767
751
}
768
752
769
753
TEST_F (SyncTreeTest, RevertSetAtRootWithPriority) {
770
- GTEST_SKIP (); // Fails assert.
771
754
RunOne (" Revert set at root with priority" );
772
755
}
773
756
774
757
TEST_F (SyncTreeTest, ServerUpdatesPriorityAfterUserSetsPriority) {
775
- GTEST_SKIP (); // Fails expectations.
776
758
RunOne (" Server updates priority after user sets priority" );
777
759
}
778
760
779
761
TEST_F (SyncTreeTest, EmptySetDoesntPreventServerUpdates) {
780
- GTEST_SKIP (); // Fails assert.
781
762
RunOne (" Empty set doesn't prevent server updates" );
782
763
}
783
764
784
765
TEST_F (SyncTreeTest, UserUpdatesPriorityTwiceFirstIsReverted) {
785
- GTEST_SKIP (); // Fails expectations.
786
766
RunOne (" User updates priority twice, first is reverted" );
787
767
}
788
768
789
769
TEST_F (SyncTreeTest, ServerAcksRootPrioritySetAfterUserDeletesRootNode) {
790
- GTEST_SKIP (); // Fails assert.
791
770
RunOne (" Server acks root priority set after user deletes root node" );
792
771
}
793
772
@@ -796,7 +775,6 @@ TEST_F(SyncTreeTest, ADeleteInAMergeDoesntPushOutNodes) {
796
775
}
797
776
798
777
TEST_F (SyncTreeTest, ATaggedQueryFiresEventsEventually) {
799
- GTEST_SKIP (); // Fails assert.
800
778
RunOne (" A tagged query fires events eventually" );
801
779
}
802
780
@@ -817,13 +795,11 @@ TEST_F(SyncTreeTest, ClearParentShadowingServerValuesMergeWithServerChildren) {
817
795
}
818
796
819
797
TEST_F (SyncTreeTest, PrioritiesDontMakeMeSick) {
820
- GTEST_SKIP (); // Fails assert.
821
798
RunOne (" Priorities don't make me sick" );
822
799
}
823
800
824
801
TEST_F (SyncTreeTest,
825
802
MergeThatMovesChildFromWindowToBoundaryDoesNotCauseChildToBeReadded) {
826
- GTEST_SKIP (); // Fails expectations.
827
803
RunOne (
828
804
" Merge that moves child from window to boundary does not cause child "
829
805
" to be readded" );
@@ -865,7 +841,6 @@ TEST_F(SyncTreeTest, UnrelatedAckedUpdateIsNotCachedInTaggedListen) {
865
841
}
866
842
867
843
TEST_F (SyncTreeTest, DeepUpdateRaisesImmediateEventsOnlyIfHasCompleteData) {
868
- GTEST_SKIP (); // Fails expectations.
869
844
RunOne (" Deep update raises immediate events only if has complete data" );
870
845
}
871
846
0 commit comments