lullaby/tests/sort_order_test.cc
// Tests that our debug check for exceeding the max depth is caught.
Tests that our debug check for exceeding the max depth is caught.
Tests that our debug check for exceeding the max depth is caught .
TEST(SortOrderDeathTest, MaxDepth) {
  Registry registry;
  SortOrderManager manager(&registry);
  const int kNumEntities = RenderSortOrder::kMaxDepth + 1;
  auto* transform_system =
      CreateTransformSystemWithEntities(&registry, kNumEntities);
  for (int i = 1; i < kNumEntities; ++i) {
    transform_system->AddChild(i, i + 1);
  }
  PORT_EXPECT_DEBUG_DEATH(manager.CalculateSortOrder(Entity(kNumEntities)),
                          "Cannot exceed max depth");
}
TEST ( SortOrderDeathTest , MaxDepth ) { Registry registry ; SortOrderManager manager ( & registry ) ; const int kNumEntities = RenderSortOrder :: kMaxDepth + 1 ; auto * transform_system = CreateTransformSystemWithEntities ( & registry , kNumEntities ) ; for ( int i = 1 ; i < kNumEntities ; ++ i ) { transform_system -> AddChild ( i , i + 1 ) ; } PORT_EXPECT_DEBUG_DEATH ( manager . CalculateSortOrder ( Entity ( kNumEntities ) ) , " " ) ; }
Tests that our debug check for exceeding the max depth is caught.
Tests that our debug check for exceeding the max depth is caught .