lullaby/tests/nine_patch_test.cc
// These parameterized tests try different original_sizes, which shouldn't
// change the result.
These parameterized tests try different original_sizes, which shouldn't
change the result.
These parameterized tests try different original_sizes which shouldn ' t change the result .
TEST_P(NinePatchOriginalSizesTest, CheckZeroSlices) {
  NinePatch nine_patch;
  nine_patch.size = mathfu::vec2(1, 1);
  nine_patch.original_size = GetParam();
  nine_patch.left_slice = 0;
  nine_patch.right_slice = 0;
  nine_patch.bottom_slice = 0;
  nine_patch.top_slice = 0;
  std::vector<lull::VertexPTT> nine_patch_vertices(nine_patch.GetVertexCount());
  std::vector<uint16_t> nine_patch_indices(nine_patch.GetIndexCount());
  MeshData mesh = BuildMeshFromNinePatchVerticesAndIndices(
      &nine_patch_vertices, &nine_patch_indices);
  GenerateNinePatchMesh(nine_patch, &mesh);
  float expected_positions[] = {
      -.5f, -.5f, 0, -.5f, -.5f, 0, .5f, -.5f, 0, .5f, -.5f, 0,
      -.5f, -.5f, 0, -.5f, -.5f, 0, .5f, -.5f, 0, .5f, -.5f, 0,
      -.5f, .5f,  0, -.5f, .5f,  0, .5f, .5f,  0, .5f, .5f,  0,
      -.5f, .5f,  0, -.5f, .5f,  0, .5f, .5f,  0, .5f, .5f,  0};
  float expected_uvs[] = {0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1,
                          0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0};
  float expected_uv1s[] = {0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1,
                           0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0};
  AssertCorrectTranslations(nine_patch, nine_patch_vertices,
                            expected_positions, expected_uvs, expected_uv1s);
}
TEST_P ( NinePatchOriginalSizesTest , CheckZeroSlices ) { NinePatch nine_patch ; nine_patch . size = mathfu :: vec2 ( 1 , 1 ) ; nine_patch . original_size = GetParam ( ) ; nine_patch . left_slice = 0 ; nine_patch . right_slice = 0 ; nine_patch . bottom_slice = 0 ; nine_patch . top_slice = 0 ; std :: vector < lull :: VertexPTT > nine_patch_vertices ( nine_patch . GetVertexCount ( ) ) ; std :: vector < uint16_t > nine_patch_indices ( nine_patch . GetIndexCount ( ) ) ; MeshData mesh = BuildMeshFromNinePatchVerticesAndIndices ( & nine_patch_vertices , & nine_patch_indices ) ; GenerateNinePatchMesh ( nine_patch , & mesh ) ; float expected_positions [ ] = { -.5f , -.5f , 0 , -.5f , -.5f , 0 , .5f , -.5f , 0 , .5f , -.5f , 0 , -.5f , -.5f , 0 , -.5f , -.5f , 0 , .5f , -.5f , 0 , .5f , -.5f , 0 , -.5f , .5f , 0 , -.5f , .5f , 0 , .5f , .5f , 0 , .5f , .5f , 0 , -.5f , .5f , 0 , -.5f , .5f , 0 , .5f , .5f , 0 , .5f , .5f , 0 } ; float expected_uvs [ ] = { 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 } ; float expected_uv1s [ ] = { 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 } ; AssertCorrectTranslations ( nine_patch , nine_patch_vertices , expected_positions , expected_uvs , expected_uv1s ) ; }
These parameterized tests try different original_sizes, which shouldn't
change the result.
These parameterized tests try different original_sizes which shouldn ' t change the result .