lullaby/tests/layout_box_system_test.cc
// If there is no component from Set, the System will default to reading from
// transform's aabb.
If there is no component from Set, the System will default to reading from
transform's aabb.
If there is no component from Set the System will default to reading from transform ' s aabb .
TEST_F(LayoutBoxSystemTest, NoSetOnlyTransformAabb) {
  Entity e = CreateEntity();
  bool changed = false;
  Entity source = kNullEntity;
  ConnectOriginalBoxChangedListener(&changed);
  ConnectActualBoxChangedListener(&changed, &source);
  float f;
  int count;
  for (f = 1.f, count = 1; f < 5.f; ++f, ++count) {
    changed = false;
    transform_system_->SetAabb(e, Aabb({-f, -f, 0.f}, {f, f, 0.f}));
    EXPECT_EQ(changed, false);
    dispatcher_->Dispatch();
    EXPECT_EQ(changed, false);
    AssertAabbEq(layout_box_system_->GetOriginalBox(e),
                 Aabb({-f, -f, 0.f}, {f, f, 0.f}));
    AssertAabbEq(layout_box_system_->GetActualBox(e),
                 Aabb({-f, -f, 0.f}, {f, f, 0.f}));
  }
}
TEST_F ( LayoutBoxSystemTest , NoSetOnlyTransformAabb ) { Entity e = CreateEntity ( ) ; bool changed = false ; Entity source = kNullEntity ; ConnectOriginalBoxChangedListener ( & changed ) ; ConnectActualBoxChangedListener ( & changed , & source ) ; float f ; int count ; for ( f = 1.f , count = 1 ; f < 5.f ; ++ f , ++ count ) { changed = false ; transform_system_ -> SetAabb ( e , Aabb ( { - f , - f , 0.f } , { f , f , 0.f } ) ) ; EXPECT_EQ ( changed , false ) ; dispatcher_ -> Dispatch ( ) ; EXPECT_EQ ( changed , false ) ; AssertAabbEq ( layout_box_system_ -> GetOriginalBox ( e ) , Aabb ( { - f , - f , 0.f } , { f , f , 0.f } ) ) ; AssertAabbEq ( layout_box_system_ -> GetActualBox ( e ) , Aabb ( { - f , - f , 0.f } , { f , f , 0.f } ) ) ; } }
If there is no component from Set, the System will default to reading from
transform's aabb.
If there is no component from Set the System will default to reading from transform ' s aabb .