lullaby/tests/layout_system_test.cc
// Test that LayoutSystem handles setting the sqt of multiple child components
// when the entities are created via the entity factory and the layout is linear
// instead of radial.
Test that LayoutSystem handles setting the sqt of multiple child components
when the entities are created via the entity factory and the layout is linear
instead of radial.
Test that LayoutSystem handles setting the sqt of multiple child components when the entities are created via the entity factory and the layout is linear instead of radial .
TEST_F(LayoutSystemTest, CreateLayout) {
  const int num_children = 5;
  const Entity parent = CreateParent();
  Entity children[num_children];
  for (int i = 0; i < num_children; ++i) {
    children[i] = CreateChild(parent);
  }
  for (int i = 0; i < num_children; ++i) {
    const Sqt* sqt = transform_system_->GetSqt(children[i]);
    EXPECT_NEAR(-1, sqt->translation.x, kEpsilon);
    EXPECT_NEAR(1, sqt->translation.y, kEpsilon);
  }
}
TEST_F ( LayoutSystemTest , CreateLayout ) { const int num_children = 5 ; const Entity parent = CreateParent ( ) ; Entity children [ num_children ] ; for ( int i = 0 ; i < num_children ; ++ i ) { children [ i ] = CreateChild ( parent ) ; } for ( int i = 0 ; i < num_children ; ++ i ) { const Sqt * sqt = transform_system_ -> GetSqt ( children [ i ] ) ; EXPECT_NEAR ( -1 , sqt -> translation . x , kEpsilon ) ; EXPECT_NEAR ( 1 , sqt -> translation . y , kEpsilon ) ; } }
Test that LayoutSystem handles setting the sqt of multiple child components
when the entities are created via the entity factory and the layout is linear
instead of radial.
Test that LayoutSystem handles setting the sqt of multiple child components when the entities are created via the entity factory and the layout is linear instead of radial .