| // Copyright 2025 The Dawn & Tint Authors | |
| // | |
| // Redistribution and use in source and binary forms, with or without | |
| // modification, are permitted provided that the following conditions are met: | |
| // | |
| // 1. Redistributions of source code must retain the above copyright notice, this | |
| // list of conditions and the following disclaimer. | |
| // | |
| // 2. Redistributions in binary form must reproduce the above copyright notice, | |
| // this list of conditions and the following disclaimer in the documentation | |
| // and/or other materials provided with the distribution. | |
| // | |
| // 3. Neither the name of the copyright holder nor the names of its | |
| // contributors may be used to endorse or promote products derived from | |
| // this software without specific prior written permission. | |
| // | |
| // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
| // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
| // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
| // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |
| // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
| // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
| // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |
| // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
| // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| //////////////////////////////////////////////////////////////////////////////// | |
| // File generated by 'tools/src/cmd/gen' using the template: | |
| // src/tint/lang/core/enums_test.cc.tmpl | |
| // | |
| // To regenerate run: './tools/run gen' | |
| // | |
| // Do not modify this file directly | |
| //////////////////////////////////////////////////////////////////////////////// | |
| // clang-format off | |
| #include "src/tint/lang/core/enums.h" | |
| #include <gtest/gtest.h> | |
| #include <string> | |
| #include "src/tint/utils/text/string.h" | |
| namespace tint::core { | |
| namespace { | |
| namespace parse_print_tests { | |
| struct AccessCase { | |
| const char* string; | |
| Access value; | |
| }; | |
| inline std::ostream& operator<<(std::ostream& out, AccessCase c) { | |
| return out << "'" << std::string(c.string) << "'"; | |
| } | |
| static constexpr AccessCase kValidAccessCases[] = { | |
| {"read", Access::kRead}, | |
| {"read_write", Access::kReadWrite}, | |
| {"write", Access::kWrite}, | |
| }; | |
| static constexpr AccessCase kInvalidAccessCases[] = { | |
| {"ccad", Access::kUndefined}, | |
| {"3", Access::kUndefined}, | |
| {"rVad", Access::kUndefined}, | |
| {"read1write", Access::kUndefined}, | |
| {"reaJqqrite", Access::kUndefined}, | |
| {"rea7ll_write", Access::kUndefined}, | |
| {"wrqHtpp", Access::kUndefined}, | |
| {"ve", Access::kUndefined}, | |
| {"Grbe", Access::kUndefined}, | |
| }; | |
| using AccessParseTest = testing::TestWithParam<AccessCase>; | |
| TEST_P(AccessParseTest, Parse) { | |
| const char* string = GetParam().string; | |
| Access expect = GetParam().value; | |
| EXPECT_EQ(expect, ParseAccess(string)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidAccessCases, AccessParseTest, testing::ValuesIn(kValidAccessCases)); | |
| INSTANTIATE_TEST_SUITE_P(InvalidAccessCases, AccessParseTest, testing::ValuesIn(kInvalidAccessCases)); | |
| using AccessPrintTest = testing::TestWithParam<AccessCase>; | |
| TEST_P(AccessPrintTest, Print) { | |
| Access value = GetParam().value; | |
| const char* expect = GetParam().string; | |
| EXPECT_EQ(expect, ToString(value)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidAccessCases, AccessPrintTest, testing::ValuesIn(kValidAccessCases)); | |
| } // namespace parse_print_tests | |
| namespace parse_print_tests { | |
| struct AddressSpaceCase { | |
| const char* string; | |
| AddressSpace value; | |
| }; | |
| inline std::ostream& operator<<(std::ostream& out, AddressSpaceCase c) { | |
| return out << "'" << std::string(c.string) << "'"; | |
| } | |
| static constexpr AddressSpaceCase kValidAddressSpaceCases[] = { | |
| {"function", AddressSpace::kFunction}, | |
| {"immediate", AddressSpace::kImmediate}, | |
| {"pixel_local", AddressSpace::kPixelLocal}, | |
| {"private", AddressSpace::kPrivate}, | |
| {"storage", AddressSpace::kStorage}, | |
| {"uniform", AddressSpace::kUniform}, | |
| {"workgroup", AddressSpace::kWorkgroup}, | |
| }; | |
| static constexpr AddressSpaceCase kInvalidAddressSpaceCases[] = { | |
| {"fuviition", AddressSpace::kUndefined}, | |
| {"fuWWcti8n", AddressSpace::kUndefined}, | |
| {"fxxcMion", AddressSpace::kUndefined}, | |
| {"iXediggte", AddressSpace::kUndefined}, | |
| {"immXVue", AddressSpace::kUndefined}, | |
| {"3mmediate", AddressSpace::kUndefined}, | |
| {"pixel_locaE", AddressSpace::kUndefined}, | |
| {"piTTel_locPl", AddressSpace::kUndefined}, | |
| {"pxxdxel_loal", AddressSpace::kUndefined}, | |
| {"p44ivate", AddressSpace::kUndefined}, | |
| {"prSSvaVVe", AddressSpace::kUndefined}, | |
| {"RriR22e", AddressSpace::kUndefined}, | |
| {"sFra9e", AddressSpace::kUndefined}, | |
| {"stoage", AddressSpace::kUndefined}, | |
| {"VOORRHge", AddressSpace::kUndefined}, | |
| {"unfoym", AddressSpace::kUndefined}, | |
| {"llnnrrf77rm", AddressSpace::kUndefined}, | |
| {"unif4r00", AddressSpace::kUndefined}, | |
| {"wooogup", AddressSpace::kUndefined}, | |
| {"wozzgrop", AddressSpace::kUndefined}, | |
| {"o11pkgriiu", AddressSpace::kUndefined}, | |
| }; | |
| using AddressSpaceParseTest = testing::TestWithParam<AddressSpaceCase>; | |
| TEST_P(AddressSpaceParseTest, Parse) { | |
| const char* string = GetParam().string; | |
| AddressSpace expect = GetParam().value; | |
| EXPECT_EQ(expect, ParseAddressSpace(string)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidAddressSpaceCases, AddressSpaceParseTest, testing::ValuesIn(kValidAddressSpaceCases)); | |
| INSTANTIATE_TEST_SUITE_P(InvalidAddressSpaceCases, AddressSpaceParseTest, testing::ValuesIn(kInvalidAddressSpaceCases)); | |
| using AddressSpacePrintTest = testing::TestWithParam<AddressSpaceCase>; | |
| TEST_P(AddressSpacePrintTest, Print) { | |
| AddressSpace value = GetParam().value; | |
| const char* expect = GetParam().string; | |
| EXPECT_EQ(expect, ToString(value)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidAddressSpaceCases, AddressSpacePrintTest, testing::ValuesIn(kValidAddressSpaceCases)); | |
| } // namespace parse_print_tests | |
| namespace interpolation_sampling_tests { | |
| namespace parse_print_tests { | |
| struct InterpolationSamplingCase { | |
| const char* string; | |
| InterpolationSampling value; | |
| }; | |
| inline std::ostream& operator<<(std::ostream& out, InterpolationSamplingCase c) { | |
| return out << "'" << std::string(c.string) << "'"; | |
| } | |
| static constexpr InterpolationSamplingCase kValidInterpolationSamplingCases[] = { | |
| {"center", InterpolationSampling::kCenter}, | |
| {"centroid", InterpolationSampling::kCentroid}, | |
| {"either", InterpolationSampling::kEither}, | |
| {"first", InterpolationSampling::kFirst}, | |
| {"sample", InterpolationSampling::kSample}, | |
| }; | |
| static constexpr InterpolationSamplingCase kInvalidInterpolationSamplingCases[] = { | |
| {"ceXXter", InterpolationSampling::kUndefined}, | |
| {"55IIntnn99", InterpolationSampling::kUndefined}, | |
| {"aHHrrnteSS", InterpolationSampling::kUndefined}, | |
| {"ckknod", InterpolationSampling::kUndefined}, | |
| {"gjnrRRi", InterpolationSampling::kUndefined}, | |
| {"cnbrid", InterpolationSampling::kUndefined}, | |
| {"eithjr", InterpolationSampling::kUndefined}, | |
| {"ether", InterpolationSampling::kUndefined}, | |
| {"ehqr", InterpolationSampling::kUndefined}, | |
| {"Nirst", InterpolationSampling::kUndefined}, | |
| {"frvv", InterpolationSampling::kUndefined}, | |
| {"fisQQ", InterpolationSampling::kUndefined}, | |
| {"aplrf", InterpolationSampling::kUndefined}, | |
| {"sampje", InterpolationSampling::kUndefined}, | |
| {"s82wNNe", InterpolationSampling::kUndefined}, | |
| }; | |
| using InterpolationSamplingParseTest = testing::TestWithParam<InterpolationSamplingCase>; | |
| TEST_P(InterpolationSamplingParseTest, Parse) { | |
| const char* string = GetParam().string; | |
| InterpolationSampling expect = GetParam().value; | |
| EXPECT_EQ(expect, ParseInterpolationSampling(string)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidInterpolationSamplingCases, InterpolationSamplingParseTest, testing::ValuesIn(kValidInterpolationSamplingCases)); | |
| INSTANTIATE_TEST_SUITE_P(InvalidInterpolationSamplingCases, InterpolationSamplingParseTest, testing::ValuesIn(kInvalidInterpolationSamplingCases)); | |
| using InterpolationSamplingPrintTest = testing::TestWithParam<InterpolationSamplingCase>; | |
| TEST_P(InterpolationSamplingPrintTest, Print) { | |
| InterpolationSampling value = GetParam().value; | |
| const char* expect = GetParam().string; | |
| EXPECT_EQ(expect, ToString(value)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidInterpolationSamplingCases, InterpolationSamplingPrintTest, testing::ValuesIn(kValidInterpolationSamplingCases)); | |
| } // namespace parse_print_tests | |
| } // namespace interpolation_sampling_tests | |
| namespace interpolation_type_tests { | |
| namespace parse_print_tests { | |
| struct InterpolationTypeCase { | |
| const char* string; | |
| InterpolationType value; | |
| }; | |
| inline std::ostream& operator<<(std::ostream& out, InterpolationTypeCase c) { | |
| return out << "'" << std::string(c.string) << "'"; | |
| } | |
| static constexpr InterpolationTypeCase kValidInterpolationTypeCases[] = { | |
| {"flat", InterpolationType::kFlat}, | |
| {"linear", InterpolationType::kLinear}, | |
| {"perspective", InterpolationType::kPerspective}, | |
| }; | |
| static constexpr InterpolationTypeCase kInvalidInterpolationTypeCases[] = { | |
| {"fat", InterpolationType::kUndefined}, | |
| {"flrrt", InterpolationType::kUndefined}, | |
| {"fGat", InterpolationType::kUndefined}, | |
| {"linFFar", InterpolationType::kUndefined}, | |
| {"lna", InterpolationType::kUndefined}, | |
| {"lrrnea", InterpolationType::kUndefined}, | |
| {"persetive", InterpolationType::kUndefined}, | |
| {"XrspJJcDive", InterpolationType::kUndefined}, | |
| {"pesect8v", InterpolationType::kUndefined}, | |
| }; | |
| using InterpolationTypeParseTest = testing::TestWithParam<InterpolationTypeCase>; | |
| TEST_P(InterpolationTypeParseTest, Parse) { | |
| const char* string = GetParam().string; | |
| InterpolationType expect = GetParam().value; | |
| EXPECT_EQ(expect, ParseInterpolationType(string)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidInterpolationTypeCases, InterpolationTypeParseTest, testing::ValuesIn(kValidInterpolationTypeCases)); | |
| INSTANTIATE_TEST_SUITE_P(InvalidInterpolationTypeCases, InterpolationTypeParseTest, testing::ValuesIn(kInvalidInterpolationTypeCases)); | |
| using InterpolationTypePrintTest = testing::TestWithParam<InterpolationTypeCase>; | |
| TEST_P(InterpolationTypePrintTest, Print) { | |
| InterpolationType value = GetParam().value; | |
| const char* expect = GetParam().string; | |
| EXPECT_EQ(expect, ToString(value)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidInterpolationTypeCases, InterpolationTypePrintTest, testing::ValuesIn(kValidInterpolationTypeCases)); | |
| } // namespace parse_print_tests | |
| } // namespace interpolation_type_tests | |
| namespace parse_print_tests { | |
| struct MajornessCase { | |
| const char* string; | |
| Majorness value; | |
| }; | |
| inline std::ostream& operator<<(std::ostream& out, MajornessCase c) { | |
| return out << "'" << std::string(c.string) << "'"; | |
| } | |
| static constexpr MajornessCase kValidMajornessCases[] = { | |
| {"col_major", Majorness::kColMajor}, | |
| {"row_major", Majorness::kRowMajor}, | |
| }; | |
| static constexpr MajornessCase kInvalidMajornessCases[] = { | |
| {"ol_mk1o", Majorness::kUndefined}, | |
| {"colmajor", Majorness::kUndefined}, | |
| {"Jol_mjor", Majorness::kUndefined}, | |
| {"row_macor", Majorness::kUndefined}, | |
| {"row_majOr", Majorness::kUndefined}, | |
| {"rowttKK_ajovv", Majorness::kUndefined}, | |
| }; | |
| using MajornessParseTest = testing::TestWithParam<MajornessCase>; | |
| TEST_P(MajornessParseTest, Parse) { | |
| const char* string = GetParam().string; | |
| Majorness expect = GetParam().value; | |
| EXPECT_EQ(expect, ParseMajorness(string)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidMajornessCases, MajornessParseTest, testing::ValuesIn(kValidMajornessCases)); | |
| INSTANTIATE_TEST_SUITE_P(InvalidMajornessCases, MajornessParseTest, testing::ValuesIn(kInvalidMajornessCases)); | |
| using MajornessPrintTest = testing::TestWithParam<MajornessCase>; | |
| TEST_P(MajornessPrintTest, Print) { | |
| Majorness value = GetParam().value; | |
| const char* expect = GetParam().string; | |
| EXPECT_EQ(expect, ToString(value)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidMajornessCases, MajornessPrintTest, testing::ValuesIn(kValidMajornessCases)); | |
| } // namespace parse_print_tests | |
| namespace parse_print_tests { | |
| struct TexelFormatCase { | |
| const char* string; | |
| TexelFormat value; | |
| }; | |
| inline std::ostream& operator<<(std::ostream& out, TexelFormatCase c) { | |
| return out << "'" << std::string(c.string) << "'"; | |
| } | |
| static constexpr TexelFormatCase kValidTexelFormatCases[] = { | |
| {"bgra8unorm", TexelFormat::kBgra8Unorm}, | |
| {"r16float", TexelFormat::kR16Float}, | |
| {"r16sint", TexelFormat::kR16Sint}, | |
| {"r16snorm", TexelFormat::kR16Snorm}, | |
| {"r16uint", TexelFormat::kR16Uint}, | |
| {"r16unorm", TexelFormat::kR16Unorm}, | |
| {"r32float", TexelFormat::kR32Float}, | |
| {"r32sint", TexelFormat::kR32Sint}, | |
| {"r32uint", TexelFormat::kR32Uint}, | |
| {"r8sint", TexelFormat::kR8Sint}, | |
| {"r8snorm", TexelFormat::kR8Snorm}, | |
| {"r8uint", TexelFormat::kR8Uint}, | |
| {"r8unorm", TexelFormat::kR8Unorm}, | |
| {"rg11b10ufloat", TexelFormat::kRg11B10Ufloat}, | |
| {"rg16float", TexelFormat::kRg16Float}, | |
| {"rg16sint", TexelFormat::kRg16Sint}, | |
| {"rg16snorm", TexelFormat::kRg16Snorm}, | |
| {"rg16uint", TexelFormat::kRg16Uint}, | |
| {"rg16unorm", TexelFormat::kRg16Unorm}, | |
| {"rg32float", TexelFormat::kRg32Float}, | |
| {"rg32sint", TexelFormat::kRg32Sint}, | |
| {"rg32uint", TexelFormat::kRg32Uint}, | |
| {"rg8sint", TexelFormat::kRg8Sint}, | |
| {"rg8snorm", TexelFormat::kRg8Snorm}, | |
| {"rg8uint", TexelFormat::kRg8Uint}, | |
| {"rg8unorm", TexelFormat::kRg8Unorm}, | |
| {"rgb10a2uint", TexelFormat::kRgb10A2Uint}, | |
| {"rgb10a2unorm", TexelFormat::kRgb10A2Unorm}, | |
| {"rgba16float", TexelFormat::kRgba16Float}, | |
| {"rgba16sint", TexelFormat::kRgba16Sint}, | |
| {"rgba16snorm", TexelFormat::kRgba16Snorm}, | |
| {"rgba16uint", TexelFormat::kRgba16Uint}, | |
| {"rgba16unorm", TexelFormat::kRgba16Unorm}, | |
| {"rgba32float", TexelFormat::kRgba32Float}, | |
| {"rgba32sint", TexelFormat::kRgba32Sint}, | |
| {"rgba32uint", TexelFormat::kRgba32Uint}, | |
| {"rgba8sint", TexelFormat::kRgba8Sint}, | |
| {"rgba8snorm", TexelFormat::kRgba8Snorm}, | |
| {"rgba8uint", TexelFormat::kRgba8Uint}, | |
| {"rgba8unorm", TexelFormat::kRgba8Unorm}, | |
| }; | |
| static constexpr TexelFormatCase kInvalidTexelFormatCases[] = { | |
| {"bg5a8uxxrm", TexelFormat::kUndefined}, | |
| {"__ra8nqqFm", TexelFormat::kUndefined}, | |
| {"bgrqqunorm", TexelFormat::kUndefined}, | |
| {"r1633loa6", TexelFormat::kUndefined}, | |
| {"rtto6fl9QQt", TexelFormat::kUndefined}, | |
| {"r1666loa", TexelFormat::kUndefined}, | |
| {"r6Oizz66", TexelFormat::kUndefined}, | |
| {"r16syynt", TexelFormat::kUndefined}, | |
| {"Z1HHnZ", TexelFormat::kUndefined}, | |
| {"qWW46snrm", TexelFormat::kUndefined}, | |
| {"r16OOnrm", TexelFormat::kUndefined}, | |
| {"16snoYm", TexelFormat::kUndefined}, | |
| {"r16i", TexelFormat::kUndefined}, | |
| {"r1uiFt", TexelFormat::kUndefined}, | |
| {"16uinw", TexelFormat::kUndefined}, | |
| {"K6unrff", TexelFormat::kUndefined}, | |
| {"q16KKnorm", TexelFormat::kUndefined}, | |
| {"rF6mmn3rm", TexelFormat::kUndefined}, | |
| {"r32foat", TexelFormat::kUndefined}, | |
| {"r32flat", TexelFormat::kUndefined}, | |
| {"3bbflobt", TexelFormat::kUndefined}, | |
| {"risint", TexelFormat::kUndefined}, | |
| {"r3OOsiq", TexelFormat::kUndefined}, | |
| {"r32Tvvint", TexelFormat::kUndefined}, | |
| {"r3FFuint", TexelFormat::kUndefined}, | |
| {"P300iQt", TexelFormat::kUndefined}, | |
| {"rP2uint", TexelFormat::kUndefined}, | |
| {"rssin77", TexelFormat::kUndefined}, | |
| {"r8CiRRbb", TexelFormat::kUndefined}, | |
| {"r8sinXX", TexelFormat::kUndefined}, | |
| {"q8CCnoOOm", TexelFormat::kUndefined}, | |
| {"r8nsrL", TexelFormat::kUndefined}, | |
| {"rXsnorm", TexelFormat::kUndefined}, | |
| {"r8uin", TexelFormat::kUndefined}, | |
| {"qqut", TexelFormat::kUndefined}, | |
| {"r8uin22", TexelFormat::kUndefined}, | |
| {"ryzzn0XX", TexelFormat::kUndefined}, | |
| {"r8uVViP", TexelFormat::kUndefined}, | |
| {"r8nnCrm", TexelFormat::kUndefined}, | |
| {"AHH11b10flqqat", TexelFormat::kUndefined}, | |
| {"r11b10ufloat", TexelFormat::kUndefined}, | |
| {"rg1K10ufloaf", TexelFormat::kUndefined}, | |
| {"lgg16flP", TexelFormat::kUndefined}, | |
| {"rg6float", TexelFormat::kUndefined}, | |
| {"4g16cTNoat", TexelFormat::kUndefined}, | |
| {"pgl6sin77", TexelFormat::kUndefined}, | |
| {"rz1Ngint", TexelFormat::kUndefined}, | |
| {"bg16sXXut", TexelFormat::kUndefined}, | |
| {"rg16norm", TexelFormat::kUndefined}, | |
| {"Q688norK", TexelFormat::kUndefined}, | |
| {"rg9snqrm", TexelFormat::kUndefined}, | |
| {"rg116uint", TexelFormat::kUndefined}, | |
| {"rg122iFii", TexelFormat::kUndefined}, | |
| {"rg16u7nt", TexelFormat::kUndefined}, | |
| {"NNg16unom", TexelFormat::kUndefined}, | |
| {"VVg16unorm", TexelFormat::kUndefined}, | |
| {"rg116unowWW", TexelFormat::kUndefined}, | |
| {"rg3flowwt", TexelFormat::kUndefined}, | |
| {"rD32float", TexelFormat::kUndefined}, | |
| {"rg32foaK", TexelFormat::kUndefined}, | |
| {"rf3r11inPP", TexelFormat::kUndefined}, | |
| {"rg32snt", TexelFormat::kUndefined}, | |
| {"rg3YYsint", TexelFormat::kUndefined}, | |
| {"kkHH2uVtt", TexelFormat::kUndefined}, | |
| {"rg3rruint", TexelFormat::kUndefined}, | |
| {"rs32uinWW", TexelFormat::kUndefined}, | |
| {"Y8sint", TexelFormat::kUndefined}, | |
| {"r8sqft", TexelFormat::kUndefined}, | |
| {"rgv22siut", TexelFormat::kUndefined}, | |
| {"rgsnor", TexelFormat::kUndefined}, | |
| {"Yg8norm", TexelFormat::kUndefined}, | |
| {"7YEg8snorm", TexelFormat::kUndefined}, | |
| {"dguiMot", TexelFormat::kUndefined}, | |
| {"rg8MMin", TexelFormat::kUndefined}, | |
| {"rg8ui55t", TexelFormat::kUndefined}, | |
| {"rg8Nor", TexelFormat::kUndefined}, | |
| {"38unoO33", TexelFormat::kUndefined}, | |
| {"r38unorm", TexelFormat::kUndefined}, | |
| {"rgbIa2uimt", TexelFormat::kUndefined}, | |
| {"rrbK0a2unnnt", TexelFormat::kUndefined}, | |
| {"rb102uXX", TexelFormat::kUndefined}, | |
| {"rgb1ILLunorp", TexelFormat::kUndefined}, | |
| {"rb1f2unorm", TexelFormat::kUndefined}, | |
| {"rgb10DuYorUR", TexelFormat::kUndefined}, | |
| {"rgha16float", TexelFormat::kUndefined}, | |
| {"rba1quulIIa", TexelFormat::kUndefined}, | |
| {"rgba16Hloat", TexelFormat::kUndefined}, | |
| {"gbaQQvvint", TexelFormat::kUndefined}, | |
| {"66a16sent", TexelFormat::kUndefined}, | |
| {"rW7a16sin", TexelFormat::kUndefined}, | |
| {"rg0a556snorDD", TexelFormat::kUndefined}, | |
| {"rgbH16snIIrm", TexelFormat::kUndefined}, | |
| {"rba16snorm", TexelFormat::kUndefined}, | |
| {"rgba1ruin", TexelFormat::kUndefined}, | |
| {"rgba1luint", TexelFormat::kUndefined}, | |
| {"ttgJJa16Gt", TexelFormat::kUndefined}, | |
| {"rgb16unyrm", TexelFormat::kUndefined}, | |
| {"rgba16unor", TexelFormat::kUndefined}, | |
| {"rgbBB16unorII", TexelFormat::kUndefined}, | |
| {"TTb33882flKat", TexelFormat::kUndefined}, | |
| {"rgbdd3UnnfSSYoat", TexelFormat::kUndefined}, | |
| {"rgda32fZx5CC", TexelFormat::kUndefined}, | |
| {"rgba3qksint", TexelFormat::kUndefined}, | |
| {"g005p32sint", TexelFormat::kUndefined}, | |
| {"rnnbII32sint", TexelFormat::kUndefined}, | |
| {"ccWb2uiKt", TexelFormat::kUndefined}, | |
| {"rgb32uKK", TexelFormat::kUndefined}, | |
| {"rgba32ui66t", TexelFormat::kUndefined}, | |
| {"rgaKPPsin", TexelFormat::kUndefined}, | |
| {"rgxxa8int", TexelFormat::kUndefined}, | |
| {"rgbq8sint", TexelFormat::kUndefined}, | |
| {"rMba8SSnyyrm", TexelFormat::kUndefined}, | |
| {"rgbusnrm", TexelFormat::kUndefined}, | |
| {"rgbSnrm", TexelFormat::kUndefined}, | |
| {"5FFba8uint", TexelFormat::kUndefined}, | |
| {"rgb44r8zint", TexelFormat::kUndefined}, | |
| {"rWWb8in", TexelFormat::kUndefined}, | |
| {"JJgbCZZunorX", TexelFormat::kUndefined}, | |
| {"rgba8PPnor", TexelFormat::kUndefined}, | |
| {"rgbacunorm", TexelFormat::kUndefined}, | |
| }; | |
| using TexelFormatParseTest = testing::TestWithParam<TexelFormatCase>; | |
| TEST_P(TexelFormatParseTest, Parse) { | |
| const char* string = GetParam().string; | |
| TexelFormat expect = GetParam().value; | |
| EXPECT_EQ(expect, ParseTexelFormat(string)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidTexelFormatCases, TexelFormatParseTest, testing::ValuesIn(kValidTexelFormatCases)); | |
| INSTANTIATE_TEST_SUITE_P(InvalidTexelFormatCases, TexelFormatParseTest, testing::ValuesIn(kInvalidTexelFormatCases)); | |
| using TexelFormatPrintTest = testing::TestWithParam<TexelFormatCase>; | |
| TEST_P(TexelFormatPrintTest, Print) { | |
| TexelFormat value = GetParam().value; | |
| const char* expect = GetParam().string; | |
| EXPECT_EQ(expect, ToString(value)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidTexelFormatCases, TexelFormatPrintTest, testing::ValuesIn(kValidTexelFormatCases)); | |
| } // namespace parse_print_tests | |
| namespace parse_print_tests { | |
| struct BuiltinTypeCase { | |
| const char* string; | |
| BuiltinType value; | |
| }; | |
| inline std::ostream& operator<<(std::ostream& out, BuiltinTypeCase c) { | |
| return out << "'" << std::string(c.string) << "'"; | |
| } | |
| static constexpr BuiltinTypeCase kValidBuiltinTypeCases[] = { | |
| {"__atomic_compare_exchange_result_i32", BuiltinType::kAtomicCompareExchangeResultI32}, | |
| {"__atomic_compare_exchange_result_u32", BuiltinType::kAtomicCompareExchangeResultU32}, | |
| {"__frexp_result_abstract", BuiltinType::kFrexpResultAbstract}, | |
| {"__frexp_result_f16", BuiltinType::kFrexpResultF16}, | |
| {"__frexp_result_f32", BuiltinType::kFrexpResultF32}, | |
| {"__frexp_result_vec2_abstract", BuiltinType::kFrexpResultVec2Abstract}, | |
| {"__frexp_result_vec2_f16", BuiltinType::kFrexpResultVec2F16}, | |
| {"__frexp_result_vec2_f32", BuiltinType::kFrexpResultVec2F32}, | |
| {"__frexp_result_vec3_abstract", BuiltinType::kFrexpResultVec3Abstract}, | |
| {"__frexp_result_vec3_f16", BuiltinType::kFrexpResultVec3F16}, | |
| {"__frexp_result_vec3_f32", BuiltinType::kFrexpResultVec3F32}, | |
| {"__frexp_result_vec4_abstract", BuiltinType::kFrexpResultVec4Abstract}, | |
| {"__frexp_result_vec4_f16", BuiltinType::kFrexpResultVec4F16}, | |
| {"__frexp_result_vec4_f32", BuiltinType::kFrexpResultVec4F32}, | |
| {"__modf_result_abstract", BuiltinType::kModfResultAbstract}, | |
| {"__modf_result_f16", BuiltinType::kModfResultF16}, | |
| {"__modf_result_f32", BuiltinType::kModfResultF32}, | |
| {"__modf_result_vec2_abstract", BuiltinType::kModfResultVec2Abstract}, | |
| {"__modf_result_vec2_f16", BuiltinType::kModfResultVec2F16}, | |
| {"__modf_result_vec2_f32", BuiltinType::kModfResultVec2F32}, | |
| {"__modf_result_vec3_abstract", BuiltinType::kModfResultVec3Abstract}, | |
| {"__modf_result_vec3_f16", BuiltinType::kModfResultVec3F16}, | |
| {"__modf_result_vec3_f32", BuiltinType::kModfResultVec3F32}, | |
| {"__modf_result_vec4_abstract", BuiltinType::kModfResultVec4Abstract}, | |
| {"__modf_result_vec4_f16", BuiltinType::kModfResultVec4F16}, | |
| {"__modf_result_vec4_f32", BuiltinType::kModfResultVec4F32}, | |
| {"array", BuiltinType::kArray}, | |
| {"atomic", BuiltinType::kAtomic}, | |
| {"bf16", BuiltinType::kBf16}, | |
| {"binding_array", BuiltinType::kBindingArray}, | |
| {"bool", BuiltinType::kBool}, | |
| {"buffer", BuiltinType::kBuffer}, | |
| {"f16", BuiltinType::kF16}, | |
| {"f32", BuiltinType::kF32}, | |
| {"i32", BuiltinType::kI32}, | |
| {"i8", BuiltinType::kI8}, | |
| {"input_attachment", BuiltinType::kInputAttachment}, | |
| {"mat2x2", BuiltinType::kMat2X2}, | |
| {"mat2x2f", BuiltinType::kMat2X2F}, | |
| {"mat2x2h", BuiltinType::kMat2X2H}, | |
| {"mat2x3", BuiltinType::kMat2X3}, | |
| {"mat2x3f", BuiltinType::kMat2X3F}, | |
| {"mat2x3h", BuiltinType::kMat2X3H}, | |
| {"mat2x4", BuiltinType::kMat2X4}, | |
| {"mat2x4f", BuiltinType::kMat2X4F}, | |
| {"mat2x4h", BuiltinType::kMat2X4H}, | |
| {"mat3x2", BuiltinType::kMat3X2}, | |
| {"mat3x2f", BuiltinType::kMat3X2F}, | |
| {"mat3x2h", BuiltinType::kMat3X2H}, | |
| {"mat3x3", BuiltinType::kMat3X3}, | |
| {"mat3x3f", BuiltinType::kMat3X3F}, | |
| {"mat3x3h", BuiltinType::kMat3X3H}, | |
| {"mat3x4", BuiltinType::kMat3X4}, | |
| {"mat3x4f", BuiltinType::kMat3X4F}, | |
| {"mat3x4h", BuiltinType::kMat3X4H}, | |
| {"mat4x2", BuiltinType::kMat4X2}, | |
| {"mat4x2f", BuiltinType::kMat4X2F}, | |
| {"mat4x2h", BuiltinType::kMat4X2H}, | |
| {"mat4x3", BuiltinType::kMat4X3}, | |
| {"mat4x3f", BuiltinType::kMat4X3F}, | |
| {"mat4x3h", BuiltinType::kMat4X3H}, | |
| {"mat4x4", BuiltinType::kMat4X4}, | |
| {"mat4x4f", BuiltinType::kMat4X4F}, | |
| {"mat4x4h", BuiltinType::kMat4X4H}, | |
| {"ptr", BuiltinType::kPtr}, | |
| {"sampler", BuiltinType::kSampler}, | |
| {"sampler_comparison", BuiltinType::kSamplerComparison}, | |
| {"subgroup_matrix_left", BuiltinType::kSubgroupMatrixLeft}, | |
| {"subgroup_matrix_result", BuiltinType::kSubgroupMatrixResult}, | |
| {"subgroup_matrix_right", BuiltinType::kSubgroupMatrixRight}, | |
| {"texel_buffer", BuiltinType::kTexelBuffer}, | |
| {"texture_1d", BuiltinType::kTexture1D}, | |
| {"texture_2d", BuiltinType::kTexture2D}, | |
| {"texture_2d_array", BuiltinType::kTexture2DArray}, | |
| {"texture_3d", BuiltinType::kTexture3D}, | |
| {"texture_cube", BuiltinType::kTextureCube}, | |
| {"texture_cube_array", BuiltinType::kTextureCubeArray}, | |
| {"texture_depth_2d", BuiltinType::kTextureDepth2D}, | |
| {"texture_depth_2d_array", BuiltinType::kTextureDepth2DArray}, | |
| {"texture_depth_cube", BuiltinType::kTextureDepthCube}, | |
| {"texture_depth_cube_array", BuiltinType::kTextureDepthCubeArray}, | |
| {"texture_depth_multisampled_2d", BuiltinType::kTextureDepthMultisampled2D}, | |
| {"texture_external", BuiltinType::kTextureExternal}, | |
| {"texture_multisampled_2d", BuiltinType::kTextureMultisampled2D}, | |
| {"texture_multisampled_2d_array", BuiltinType::kTextureMultisampled2DArray}, | |
| {"texture_storage_1d", BuiltinType::kTextureStorage1D}, | |
| {"texture_storage_2d", BuiltinType::kTextureStorage2D}, | |
| {"texture_storage_2d_array", BuiltinType::kTextureStorage2DArray}, | |
| {"texture_storage_3d", BuiltinType::kTextureStorage3D}, | |
| {"u16", BuiltinType::kU16}, | |
| {"u32", BuiltinType::kU32}, | |
| {"u8", BuiltinType::kU8}, | |
| {"vec2", BuiltinType::kVec2}, | |
| {"vec2f", BuiltinType::kVec2F}, | |
| {"vec2h", BuiltinType::kVec2H}, | |
| {"vec2i", BuiltinType::kVec2I}, | |
| {"vec2u", BuiltinType::kVec2U}, | |
| {"vec3", BuiltinType::kVec3}, | |
| {"vec3f", BuiltinType::kVec3F}, | |
| {"vec3h", BuiltinType::kVec3H}, | |
| {"vec3i", BuiltinType::kVec3I}, | |
| {"vec3u", BuiltinType::kVec3U}, | |
| {"vec4", BuiltinType::kVec4}, | |
| {"vec4f", BuiltinType::kVec4F}, | |
| {"vec4h", BuiltinType::kVec4H}, | |
| {"vec4i", BuiltinType::kVec4I}, | |
| {"vec4u", BuiltinType::kVec4U}, | |
| }; | |
| static constexpr BuiltinTypeCase kInvalidBuiltinTypeCases[] = { | |
| {"__a6llmic_comparePPexchange_result_i32", BuiltinType::kUndefined}, | |
| {"__a99omic_compare_xchanyye_result_i32", BuiltinType::kUndefined}, | |
| {"__atoKKic_compare_exchange_result_i32", BuiltinType::kUndefined}, | |
| {"__atomic_xompareexchange__esult_u32", BuiltinType::kUndefined}, | |
| {"__atomi_compare_exhanyy_result_uK2", BuiltinType::kUndefined}, | |
| {"__atomic_compare_zxchangeVresukt_u32", BuiltinType::kUndefined}, | |
| {"__freqp_rKsult_abstract", BuiltinType::kUndefined}, | |
| {"__rexp_result_abstract", BuiltinType::kUndefined}, | |
| {"__frexpresult_abstrVVct", BuiltinType::kUndefined}, | |
| {"__frexpIresulAU_f16", BuiltinType::kUndefined}, | |
| {"j_frxp_resulRf16", BuiltinType::kUndefined}, | |
| {"_frep44resuYYt_f1", BuiltinType::kUndefined}, | |
| {"__frxp_result_f32", BuiltinType::kUndefined}, | |
| {"__frex11_rxxsul_f2", BuiltinType::kUndefined}, | |
| {"__frccxpmmresulJ_f", BuiltinType::kUndefined}, | |
| {"__frexp_result_vec2_astraJJt", BuiltinType::kUndefined}, | |
| {"_CCfrUlp_result_vec2_fbsDDract", BuiltinType::kUndefined}, | |
| {"__frexp_result_vec2_abgtract", BuiltinType::kUndefined}, | |
| {"__rxp_rsult_CCec2_f16", BuiltinType::kUndefined}, | |
| {"__frexp_result_vec_f16", BuiltinType::kUndefined}, | |
| {"__frex___result_vIc2_f16", BuiltinType::kUndefined}, | |
| {"__rep_resultt_vecN_fPP2", BuiltinType::kUndefined}, | |
| {"_3frexp_result_vedd2_f32", BuiltinType::kUndefined}, | |
| {"__frKxp_reult_yyec2_f32", BuiltinType::kUndefined}, | |
| {"__rexp_resultvec3_abstacu", BuiltinType::kUndefined}, | |
| {"__frexi_re3ult_venn3_abs0ract", BuiltinType::kUndefined}, | |
| {"__frexpKrenultuuvecCC_vbstract", BuiltinType::kUndefined}, | |
| {"__rexp_resultllvec3_X16", BuiltinType::kUndefined}, | |
| {"__frexpppresult_veo3_f16", BuiltinType::kUndefined}, | |
| {"__frepwwresult_vec3_f16", BuiltinType::kUndefined}, | |
| {"uu_fgxp_reslt_vec3mmf32", BuiltinType::kUndefined}, | |
| {"aa_frexpesmmltvec3_f32", BuiltinType::kUndefined}, | |
| {"__TrexRR_result_vecZ_cc32", BuiltinType::kUndefined}, | |
| {"__88rexpTresultOvec4_abstract", BuiltinType::kUndefined}, | |
| {"__frexp_resulm00vec4_abstract", BuiltinType::kUndefined}, | |
| {"__frexp_resumt_vec4_abBBtract", BuiltinType::kUndefined}, | |
| {"__frex_ppeslt_vecM_f16", BuiltinType::kUndefined}, | |
| {"__fexp_result_vOOc4_f16", BuiltinType::kUndefined}, | |
| {"__GGrexp_reult_Gec4_f16", BuiltinType::kUndefined}, | |
| {"__frex11_resulHH_vec4_f32", BuiltinType::kUndefined}, | |
| {"_eere6p_resulFF_vec4_f32", BuiltinType::kUndefined}, | |
| {"__frexpresult_vec4_f2", BuiltinType::kUndefined}, | |
| {"__modf_result_aKiitract", BuiltinType::kUndefined}, | |
| {"__modf_rsult_abstract", BuiltinType::kUndefined}, | |
| {"__mov99_result_abIItract", BuiltinType::kUndefined}, | |
| {"_modf_result_f16", BuiltinType::kUndefined}, | |
| {"__modf_resulh_f16", BuiltinType::kUndefined}, | |
| {"__modzz_ellPPlt_f16", BuiltinType::kUndefined}, | |
| {"modfrsult_f32", BuiltinType::kUndefined}, | |
| {"__mod_qqeffult_f32", BuiltinType::kUndefined}, | |
| {"_Wmodf_ddesulJ_f32", BuiltinType::kUndefined}, | |
| {"_modXX_rzzsrlt_vec2_absract", BuiltinType::kUndefined}, | |
| {"__modf_result2vec2_abstrat", BuiltinType::kUndefined}, | |
| {"__Nodf_result_vec2yyabstract", BuiltinType::kUndefined}, | |
| {"__modf_rsul_vc2_f1OO", BuiltinType::kUndefined}, | |
| {"_EZodf_resulr_vec2_P16", BuiltinType::kUndefined}, | |
| {"__m22df_reluleevedd2_f16", BuiltinType::kUndefined}, | |
| {"__modf_eslt_VVec9_f32", BuiltinType::kUndefined}, | |
| {"__modf_rI1sult_vec_f32", BuiltinType::kUndefined}, | |
| {"__modf_result_bec2_f32", BuiltinType::kUndefined}, | |
| {"__mdf_risultzv7c3_abstrct", BuiltinType::kUndefined}, | |
| {"__modf_resolt_vec3_abstiiact", BuiltinType::kUndefined}, | |
| {"__modf_reul5_vecn_abstrac", BuiltinType::kUndefined}, | |
| {"__modf_result_vec3S16", BuiltinType::kUndefined}, | |
| {"__modf_reult_22e3_f16", BuiltinType::kUndefined}, | |
| {"_modf_C11su7t_Gec3_f16", BuiltinType::kUndefined}, | |
| {"__modf_result_vffc38f32", BuiltinType::kUndefined}, | |
| {"__mdf_rsult_vec3_f32", BuiltinType::kUndefined}, | |
| {"_JJSSodf_result_vec3_f32", BuiltinType::kUndefined}, | |
| {"__odf_reslt_vec4_a9stract", BuiltinType::kUndefined}, | |
| {"__modf_reTTbblt_veJJ4_abstract", BuiltinType::kUndefined}, | |
| {"__modf_reslt_vec_abs66ract", BuiltinType::kUndefined}, | |
| {"__m0df_resutuvec4_f166", BuiltinType::kUndefined}, | |
| {"__yodf_resWt_vec4_f16", BuiltinType::kUndefined}, | |
| {"_modf_reslt_vec4_f16", BuiltinType::kUndefined}, | |
| {"__modf_result_ec4_f32", BuiltinType::kUndefined}, | |
| {"__modf_result_vec4_fr2", BuiltinType::kUndefined}, | |
| {"__modB_result2vec4_f32", BuiltinType::kUndefined}, | |
| {"arBBy", BuiltinType::kUndefined}, | |
| {"aRray", BuiltinType::kUndefined}, | |
| {"aaLL0", BuiltinType::kUndefined}, | |
| {"tomKOO", BuiltinType::kUndefined}, | |
| {"twgmic", BuiltinType::kUndefined}, | |
| {"atLhhp", BuiltinType::kUndefined}, | |
| {"Eii1", BuiltinType::kUndefined}, | |
| {"bf6", BuiltinType::kUndefined}, | |
| {"b88U", BuiltinType::kUndefined}, | |
| {"binding_rrrrvvy", BuiltinType::kUndefined}, | |
| {"bindwg_arrmm", BuiltinType::kUndefined}, | |
| {"binjing44aray", BuiltinType::kUndefined}, | |
| {"bXol", BuiltinType::kUndefined}, | |
| {"b8ol", BuiltinType::kUndefined}, | |
| {"bEEvv", BuiltinType::kUndefined}, | |
| {"bzzife", BuiltinType::kUndefined}, | |
| {"buGGQfJJr", BuiltinType::kUndefined}, | |
| {"buffssr", BuiltinType::kUndefined}, | |
| {"K1P", BuiltinType::kUndefined}, | |
| {"pt1", BuiltinType::kUndefined}, | |
| {"1", BuiltinType::kUndefined}, | |
| {"f3MM", BuiltinType::kUndefined}, | |
| {"fJJ0", BuiltinType::kUndefined}, | |
| {"", BuiltinType::kUndefined}, | |
| {"hhKgg", BuiltinType::kUndefined}, | |
| {"i3f", BuiltinType::kUndefined}, | |
| {"773Q", BuiltinType::kUndefined}, | |
| {"iY", BuiltinType::kUndefined}, | |
| {"k", BuiltinType::kUndefined}, | |
| {"n", BuiltinType::kUndefined}, | |
| {"iput_atFFchment", BuiltinType::kUndefined}, | |
| {"inpUPPI_atGGauhment", BuiltinType::kUndefined}, | |
| {"iaputvEEttachmet", BuiltinType::kUndefined}, | |
| {"mBet2dd2", BuiltinType::kUndefined}, | |
| {"55atExcc", BuiltinType::kUndefined}, | |
| {"txKK", BuiltinType::kUndefined}, | |
| {"mat2x2R", BuiltinType::kUndefined}, | |
| {"maDx29", BuiltinType::kUndefined}, | |
| {"mt2x2f", BuiltinType::kUndefined}, | |
| {"aaat2I", BuiltinType::kUndefined}, | |
| {"m77t2x2h", BuiltinType::kUndefined}, | |
| {"matIx2h", BuiltinType::kUndefined}, | |
| {"matd3", BuiltinType::kUndefined}, | |
| {"mt2x3", BuiltinType::kUndefined}, | |
| {"mtt2", BuiltinType::kUndefined}, | |
| {"ma3XX2x3f", BuiltinType::kUndefined}, | |
| {"Eat23f", BuiltinType::kUndefined}, | |
| {"maXX2x3", BuiltinType::kUndefined}, | |
| {"matxBx3h", BuiltinType::kUndefined}, | |
| {"m2x3h", BuiltinType::kUndefined}, | |
| {"mat2x366", BuiltinType::kUndefined}, | |
| {"atTv0", BuiltinType::kUndefined}, | |
| {"kt", BuiltinType::kUndefined}, | |
| {"mpt2x", BuiltinType::kUndefined}, | |
| {"at114f", BuiltinType::kUndefined}, | |
| {"EaJ2yBBf", BuiltinType::kUndefined}, | |
| {"mqIm2x4f", BuiltinType::kUndefined}, | |
| {"ma2xFh", BuiltinType::kUndefined}, | |
| {"Yt2x4h", BuiltinType::kUndefined}, | |
| {"mHHtDh4h", BuiltinType::kUndefined}, | |
| {"23H2", BuiltinType::kUndefined}, | |
| {"m3x2", BuiltinType::kUndefined}, | |
| {"mat32", BuiltinType::kUndefined}, | |
| {"matx2f", BuiltinType::kUndefined}, | |
| {"matddx2f", BuiltinType::kUndefined}, | |
| {"Oat3x2f", BuiltinType::kUndefined}, | |
| {"atBbb2", BuiltinType::kUndefined}, | |
| {"m003x2h", BuiltinType::kUndefined}, | |
| {"mat3xhh", BuiltinType::kUndefined}, | |
| {"matgYx", BuiltinType::kUndefined}, | |
| {"Oat3x3", BuiltinType::kUndefined}, | |
| {"mhx3", BuiltinType::kUndefined}, | |
| {"fpaEEx3f", BuiltinType::kUndefined}, | |
| {"mavx3f", BuiltinType::kUndefined}, | |
| {"mzztx3f", BuiltinType::kUndefined}, | |
| {"ma3x3h", BuiltinType::kUndefined}, | |
| {"OOaJxii", BuiltinType::kUndefined}, | |
| {"mft3G3h", BuiltinType::kUndefined}, | |
| {"mTT223x4", BuiltinType::kUndefined}, | |
| {"lat3x4", BuiltinType::kUndefined}, | |
| {"mab3x4", BuiltinType::kUndefined}, | |
| {"BBatx4f", BuiltinType::kUndefined}, | |
| {"PPIXt3S4f", BuiltinType::kUndefined}, | |
| {"mjjt3x4f", BuiltinType::kUndefined}, | |
| {"_at3xcch", BuiltinType::kUndefined}, | |
| {"ax6z3xSSh", BuiltinType::kUndefined}, | |
| {"a3xG", BuiltinType::kUndefined}, | |
| {"mxxtvN", BuiltinType::kUndefined}, | |
| {"AA00t42", BuiltinType::kUndefined}, | |
| {"tyexy", BuiltinType::kUndefined}, | |
| {"mabWWx0f", BuiltinType::kUndefined}, | |
| {"ttatMMxmf", BuiltinType::kUndefined}, | |
| {"madf", BuiltinType::kUndefined}, | |
| {"mat_2h", BuiltinType::kUndefined}, | |
| {"Vat4EE2h", BuiltinType::kUndefined}, | |
| {"mat44h", BuiltinType::kUndefined}, | |
| {"aRtx3", BuiltinType::kUndefined}, | |
| {"Sammx", BuiltinType::kUndefined}, | |
| {"apjx3", BuiltinType::kUndefined}, | |
| {"mat4xf", BuiltinType::kUndefined}, | |
| {"aaxf", BuiltinType::kUndefined}, | |
| {"mad4x3f", BuiltinType::kUndefined}, | |
| {"CCat4xPth", BuiltinType::kUndefined}, | |
| {"matx3", BuiltinType::kUndefined}, | |
| {"m5t4x3h", BuiltinType::kUndefined}, | |
| {"mat499jf", BuiltinType::kUndefined}, | |
| {"maRXXYxv", BuiltinType::kUndefined}, | |
| {"ma44", BuiltinType::kUndefined}, | |
| {"XX8t5x4", BuiltinType::kUndefined}, | |
| {"t4x4f", BuiltinType::kUndefined}, | |
| {"mcctxppf", BuiltinType::kUndefined}, | |
| {"mat4v4h", BuiltinType::kUndefined}, | |
| {"EESSt4xh", BuiltinType::kUndefined}, | |
| {"mt4xh", BuiltinType::kUndefined}, | |
| {"", BuiltinType::kUndefined}, | |
| {"ptw", BuiltinType::kUndefined}, | |
| {"pd99r", BuiltinType::kUndefined}, | |
| {"99amplP", BuiltinType::kUndefined}, | |
| {"saKKler", BuiltinType::kUndefined}, | |
| {"smDDooeM", BuiltinType::kUndefined}, | |
| {"aBpiir_comprison", BuiltinType::kUndefined}, | |
| {"samler_comparqon", BuiltinType::kUndefined}, | |
| {"samplercmparis0LLn", BuiltinType::kUndefined}, | |
| {"snbvvroup_matrix_lef66", BuiltinType::kUndefined}, | |
| {"srrbgroun_mtrix_left", BuiltinType::kUndefined}, | |
| {"sxxgrou_matrix_leeet", BuiltinType::kUndefined}, | |
| {"subgroup_ONNtCCix_result", BuiltinType::kUndefined}, | |
| {"subgroup_matrix_rsult", BuiltinType::kUndefined}, | |
| {"subgroup_4atrixaresult", BuiltinType::kUndefined}, | |
| {"sbgroup_matrNNx_riNNht", BuiltinType::kUndefined}, | |
| {"ubgroup_matrix_right", BuiltinType::kUndefined}, | |
| {"suugroup_mtix_right", BuiltinType::kUndefined}, | |
| {"tSxelAuffYYEE", BuiltinType::kUndefined}, | |
| {"texel_b0ffer", BuiltinType::kUndefined}, | |
| {"texaal_buffer", BuiltinType::kUndefined}, | |
| {"tqqmmtur_d", BuiltinType::kUndefined}, | |
| {"textue_1d", BuiltinType::kUndefined}, | |
| {"tUUxtureE", BuiltinType::kUndefined}, | |
| {"tKKture_Dd", BuiltinType::kUndefined}, | |
| {"text__r0_2d", BuiltinType::kUndefined}, | |
| {"tAtuel2p", BuiltinType::kUndefined}, | |
| {"txture_2M_array", BuiltinType::kUndefined}, | |
| {"BBexture_2d_array", BuiltinType::kUndefined}, | |
| {"nnxtbbre_2_a99ray", BuiltinType::kUndefined}, | |
| {"tx1EEre_AAd", BuiltinType::kUndefined}, | |
| {"tex66ur5_3d", BuiltinType::kUndefined}, | |
| {"tHxture_3d", BuiltinType::kUndefined}, | |
| {"textrexxHcub", BuiltinType::kUndefined}, | |
| {"tzx0uryy_cnbe", BuiltinType::kUndefined}, | |
| {"texture_cue", BuiltinType::kUndefined}, | |
| {"texurH_kube_array", BuiltinType::kUndefined}, | |
| {"exture_cube_array", BuiltinType::kUndefined}, | |
| {"ooexrrre_cbe_array", BuiltinType::kUndefined}, | |
| {"JJexture_dep_2d", BuiltinType::kUndefined}, | |
| {"text0re_dCCpth_2", BuiltinType::kUndefined}, | |
| {"99eAAure_dexth_2d", BuiltinType::kUndefined}, | |
| {"cexture_depth_2d_array", BuiltinType::kUndefined}, | |
| {"teSture_depth_2d_array", BuiltinType::kUndefined}, | |
| {"texturedepoh_2d_srraBB", BuiltinType::kUndefined}, | |
| {"teture_depth_cube", BuiltinType::kUndefined}, | |
| {"texturemmepth_cube", BuiltinType::kUndefined}, | |
| {"tQQturPP_depth_cubgg", BuiltinType::kUndefined}, | |
| {"exture_deBth_cube_ar", BuiltinType::kUndefined}, | |
| {"teKture_dNpth_cubearrlly", BuiltinType::kUndefined}, | |
| {"texrrre_depth_cube_aray", BuiltinType::kUndefined}, | |
| {"texture_depth_ulrppsampled_2d", BuiltinType::kUndefined}, | |
| {"tPPxture_depth_myltisampled_2d", BuiltinType::kUndefined}, | |
| {"tccxture_depth_multismZZled2d", BuiltinType::kUndefined}, | |
| {"texure_externa", BuiltinType::kUndefined}, | |
| {"tex00ure_external", BuiltinType::kUndefined}, | |
| {"texPssre_exterJBBl", BuiltinType::kUndefined}, | |
| {"texture_ffuftsamJJwwed_2d", BuiltinType::kUndefined}, | |
| {"textr1_multisaXXpled_2I", BuiltinType::kUndefined}, | |
| {"tetuemultisapled2d", BuiltinType::kUndefined}, | |
| {"texture_multisampled_2d_arra", BuiltinType::kUndefined}, | |
| {"texture_muluisamled_2d_arraKK", BuiltinType::kUndefined}, | |
| {"texture_44ulisampledm2d_array", BuiltinType::kUndefined}, | |
| {"pexture_storage_1d", BuiltinType::kUndefined}, | |
| {"textre_sjohhaNNeHH1d", BuiltinType::kUndefined}, | |
| {"textu33e_storagE_wwUU", BuiltinType::kUndefined}, | |
| {"texture_strauue2d", BuiltinType::kUndefined}, | |
| {"cextur_strrddaKe_2d", BuiltinType::kUndefined}, | |
| {"tex2re_stttPPage_2r", BuiltinType::kUndefined}, | |
| {"texture_storawwe_21sarray", BuiltinType::kUndefined}, | |
| {"nnexture_storace112d_array", BuiltinType::kUndefined}, | |
| {"texture_storae_2d_array", BuiltinType::kUndefined}, | |
| {"textre_storage_3d", BuiltinType::kUndefined}, | |
| {"aaex66SSre_sorIge_3d", BuiltinType::kUndefined}, | |
| {"DEExture_storge_3d", BuiltinType::kUndefined}, | |
| {"IRV6", BuiltinType::kUndefined}, | |
| {"1", BuiltinType::kUndefined}, | |
| {"ha6", BuiltinType::kUndefined}, | |
| {"SL2", BuiltinType::kUndefined}, | |
| {"mm", BuiltinType::kUndefined}, | |
| {"uV", BuiltinType::kUndefined}, | |
| {"_", BuiltinType::kUndefined}, | |
| {"J", BuiltinType::kUndefined}, | |
| {"2", BuiltinType::kUndefined}, | |
| {"vecooi", BuiltinType::kUndefined}, | |
| {"vv4", BuiltinType::kUndefined}, | |
| {"zn", BuiltinType::kUndefined}, | |
| {"vecf", BuiltinType::kUndefined}, | |
| {"vecQQf", BuiltinType::kUndefined}, | |
| {"ve02", BuiltinType::kUndefined}, | |
| {"33cACCPh", BuiltinType::kUndefined}, | |
| {"veiihhddo", BuiltinType::kUndefined}, | |
| {"e7766h", BuiltinType::kUndefined}, | |
| {"vec2P", BuiltinType::kUndefined}, | |
| {"vecwi", BuiltinType::kUndefined}, | |
| {"ecu", BuiltinType::kUndefined}, | |
| {"vXXc2u", BuiltinType::kUndefined}, | |
| {"Rc2", BuiltinType::kUndefined}, | |
| {"e1V", BuiltinType::kUndefined}, | |
| {"GGeHH3", BuiltinType::kUndefined}, | |
| {"MFFc3", BuiltinType::kUndefined}, | |
| {"ec3", BuiltinType::kUndefined}, | |
| {"cTgg", BuiltinType::kUndefined}, | |
| {"KK1c_Q", BuiltinType::kUndefined}, | |
| {"vEc3", BuiltinType::kUndefined}, | |
| {"c3M", BuiltinType::kUndefined}, | |
| {"veS77G3", BuiltinType::kUndefined}, | |
| {"vKFtth", BuiltinType::kUndefined}, | |
| {"vZZUss3i", BuiltinType::kUndefined}, | |
| {"vc3i", BuiltinType::kUndefined}, | |
| {"lec3i", BuiltinType::kUndefined}, | |
| {"veh3u", BuiltinType::kUndefined}, | |
| {"vkcTT", BuiltinType::kUndefined}, | |
| {"vewwu", BuiltinType::kUndefined}, | |
| {"vKvjj", BuiltinType::kUndefined}, | |
| {"vYY", BuiltinType::kUndefined}, | |
| {"EcI4", BuiltinType::kUndefined}, | |
| {"vQQc4f", BuiltinType::kUndefined}, | |
| {"veP", BuiltinType::kUndefined}, | |
| {"eff4HH", BuiltinType::kUndefined}, | |
| {"vec4n", BuiltinType::kUndefined}, | |
| {"g6F4h", BuiltinType::kUndefined}, | |
| {"vssh8h", BuiltinType::kUndefined}, | |
| {"veFlli", BuiltinType::kUndefined}, | |
| {"00e2j", BuiltinType::kUndefined}, | |
| {"gec4i", BuiltinType::kUndefined}, | |
| {"vece", BuiltinType::kUndefined}, | |
| {"ffc4u", BuiltinType::kUndefined}, | |
| {"ve", BuiltinType::kUndefined}, | |
| }; | |
| using BuiltinTypeParseTest = testing::TestWithParam<BuiltinTypeCase>; | |
| TEST_P(BuiltinTypeParseTest, Parse) { | |
| const char* string = GetParam().string; | |
| BuiltinType expect = GetParam().value; | |
| EXPECT_EQ(expect, ParseBuiltinType(string)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidBuiltinTypeCases, BuiltinTypeParseTest, testing::ValuesIn(kValidBuiltinTypeCases)); | |
| INSTANTIATE_TEST_SUITE_P(InvalidBuiltinTypeCases, BuiltinTypeParseTest, testing::ValuesIn(kInvalidBuiltinTypeCases)); | |
| using BuiltinTypePrintTest = testing::TestWithParam<BuiltinTypeCase>; | |
| TEST_P(BuiltinTypePrintTest, Print) { | |
| BuiltinType value = GetParam().value; | |
| const char* expect = GetParam().string; | |
| EXPECT_EQ(expect, ToString(value)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidBuiltinTypeCases, BuiltinTypePrintTest, testing::ValuesIn(kValidBuiltinTypeCases)); | |
| } // namespace parse_print_tests | |
| namespace parse_print_tests { | |
| struct BuiltinValueCase { | |
| const char* string; | |
| BuiltinValue value; | |
| }; | |
| inline std::ostream& operator<<(std::ostream& out, BuiltinValueCase c) { | |
| return out << "'" << std::string(c.string) << "'"; | |
| } | |
| static constexpr BuiltinValueCase kValidBuiltinValueCases[] = { | |
| {"barycentric_coord", BuiltinValue::kBarycentricCoord}, | |
| {"clip_distances", BuiltinValue::kClipDistances}, | |
| {"frag_depth", BuiltinValue::kFragDepth}, | |
| {"front_facing", BuiltinValue::kFrontFacing}, | |
| {"global_invocation_id", BuiltinValue::kGlobalInvocationId}, | |
| {"global_invocation_index", BuiltinValue::kGlobalInvocationIndex}, | |
| {"instance_index", BuiltinValue::kInstanceIndex}, | |
| {"local_invocation_id", BuiltinValue::kLocalInvocationId}, | |
| {"local_invocation_index", BuiltinValue::kLocalInvocationIndex}, | |
| {"num_subgroups", BuiltinValue::kNumSubgroups}, | |
| {"num_workgroups", BuiltinValue::kNumWorkgroups}, | |
| {"position", BuiltinValue::kPosition}, | |
| {"primitive_index", BuiltinValue::kPrimitiveIndex}, | |
| {"sample_index", BuiltinValue::kSampleIndex}, | |
| {"sample_mask", BuiltinValue::kSampleMask}, | |
| {"subgroup_id", BuiltinValue::kSubgroupId}, | |
| {"subgroup_invocation_id", BuiltinValue::kSubgroupInvocationId}, | |
| {"subgroup_size", BuiltinValue::kSubgroupSize}, | |
| {"vertex_index", BuiltinValue::kVertexIndex}, | |
| {"view_index", BuiltinValue::kViewIndex}, | |
| {"workgroup_id", BuiltinValue::kWorkgroupId}, | |
| {"workgroup_index", BuiltinValue::kWorkgroupIndex}, | |
| }; | |
| static constexpr BuiltinValueCase kInvalidBuiltinValueCases[] = { | |
| {"baryentric_coord", BuiltinValue::kUndefined}, | |
| {"baryqqenric_coord", BuiltinValue::kUndefined}, | |
| {"AAaycnric_coord", BuiltinValue::kUndefined}, | |
| {"cli_dvstances", BuiltinValue::kUndefined}, | |
| {"cjjip_distancs", BuiltinValue::kUndefined}, | |
| {"ZZlip_distances", BuiltinValue::kUndefined}, | |
| {"frIIOU2Pepth", BuiltinValue::kUndefined}, | |
| {"ZZrag_depth", BuiltinValue::kUndefined}, | |
| {"fnnag_depth", BuiltinValue::kUndefined}, | |
| {"fronH_faZkki22g", BuiltinValue::kUndefined}, | |
| {"front_fcing", BuiltinValue::kUndefined}, | |
| {"fronRfacng", BuiltinValue::kUndefined}, | |
| {"global_inqq9ocation_id", BuiltinValue::kUndefined}, | |
| {"global_in77ocation_id", BuiltinValue::kUndefined}, | |
| {"global_nvo3tion_id", BuiltinValue::kUndefined}, | |
| {"global_invoation_uundccx", BuiltinValue::kUndefined}, | |
| {"gloRRal_invocaton_inde1", BuiltinValue::kUndefined}, | |
| {"lollal_invocation_indJJx", BuiltinValue::kUndefined}, | |
| {"inItanMMeinx", BuiltinValue::kUndefined}, | |
| {"6Tnstan7_inxex", BuiltinValue::kUndefined}, | |
| {"instanJe_indQQx", BuiltinValue::kUndefined}, | |
| {"locAl_invoatiuun_i", BuiltinValue::kUndefined}, | |
| {"local_invocationd", BuiltinValue::kUndefined}, | |
| {"loclqinv33cationid", BuiltinValue::kUndefined}, | |
| {"local_ixxvocation_index", BuiltinValue::kUndefined}, | |
| {"localNinvoarion_indx", BuiltinValue::kUndefined}, | |
| {"lo99al_invcation_index", BuiltinValue::kUndefined}, | |
| {"num_sugroups", BuiltinValue::kUndefined}, | |
| {"nuH_sublrups", BuiltinValue::kUndefined}, | |
| {"nu__ubgrous", BuiltinValue::kUndefined}, | |
| {"num_workgrops", BuiltinValue::kUndefined}, | |
| {"nm_jorkgroups", BuiltinValue::kUndefined}, | |
| {"num_workmttrouEEs", BuiltinValue::kUndefined}, | |
| {"posion", BuiltinValue::kUndefined}, | |
| {"porrtion", BuiltinValue::kUndefined}, | |
| {"psitixn", BuiltinValue::kUndefined}, | |
| {"prmtive_izzdex", BuiltinValue::kUndefined}, | |
| {"primetive_index", BuiltinValue::kUndefined}, | |
| {"pimituve_indeZp", BuiltinValue::kUndefined}, | |
| {"TTample_id00u7", BuiltinValue::kUndefined}, | |
| {"samplJvvnde", BuiltinValue::kUndefined}, | |
| {"saQple_index", BuiltinValue::kUndefined}, | |
| {"sa3Rle_Cak", BuiltinValue::kUndefined}, | |
| {"saplCas", BuiltinValue::kUndefined}, | |
| {"amlePPrppask", BuiltinValue::kUndefined}, | |
| {"suDDxxuuup_88d", BuiltinValue::kUndefined}, | |
| {"sumgqqoddpYYlld", BuiltinValue::kUndefined}, | |
| {"subgro_Fp_id", BuiltinValue::kUndefined}, | |
| {"sNNbgGGrrup_invocatin_id", BuiltinValue::kUndefined}, | |
| {"subgrlup_invocation_Md", BuiltinValue::kUndefined}, | |
| {"ubgroup_nvoation_id", BuiltinValue::kUndefined}, | |
| {"suqgxouplsize", BuiltinValue::kUndefined}, | |
| {"subroup_size", BuiltinValue::kUndefined}, | |
| {"subgroapsi44e", BuiltinValue::kUndefined}, | |
| {"veGtex_iWWdex", BuiltinValue::kUndefined}, | |
| {"vertex_jjdex", BuiltinValue::kUndefined}, | |
| {"vjjrtex_index", BuiltinValue::kUndefined}, | |
| {"view_ij1x", BuiltinValue::kUndefined}, | |
| {"view_idex", BuiltinValue::kUndefined}, | |
| {"view99index", BuiltinValue::kUndefined}, | |
| {"worygroupVVid", BuiltinValue::kUndefined}, | |
| {"woxkrZZup_id", BuiltinValue::kUndefined}, | |
| {"orkgrouvv_i33", BuiltinValue::kUndefined}, | |
| {"work9rous_index", BuiltinValue::kUndefined}, | |
| {"woFkgroupindex", BuiltinValue::kUndefined}, | |
| {"orkgroue_uundex", BuiltinValue::kUndefined}, | |
| }; | |
| using BuiltinValueParseTest = testing::TestWithParam<BuiltinValueCase>; | |
| TEST_P(BuiltinValueParseTest, Parse) { | |
| const char* string = GetParam().string; | |
| BuiltinValue expect = GetParam().value; | |
| EXPECT_EQ(expect, ParseBuiltinValue(string)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidBuiltinValueCases, BuiltinValueParseTest, testing::ValuesIn(kValidBuiltinValueCases)); | |
| INSTANTIATE_TEST_SUITE_P(InvalidBuiltinValueCases, BuiltinValueParseTest, testing::ValuesIn(kInvalidBuiltinValueCases)); | |
| using BuiltinValuePrintTest = testing::TestWithParam<BuiltinValueCase>; | |
| TEST_P(BuiltinValuePrintTest, Print) { | |
| BuiltinValue value = GetParam().value; | |
| const char* expect = GetParam().string; | |
| EXPECT_EQ(expect, ToString(value)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidBuiltinValueCases, BuiltinValuePrintTest, testing::ValuesIn(kValidBuiltinValueCases)); | |
| } // namespace parse_print_tests | |
| namespace parse_print_tests { | |
| struct AttributeCase { | |
| const char* string; | |
| Attribute value; | |
| }; | |
| inline std::ostream& operator<<(std::ostream& out, AttributeCase c) { | |
| return out << "'" << std::string(c.string) << "'"; | |
| } | |
| static constexpr AttributeCase kValidAttributeCases[] = { | |
| {"align", Attribute::kAlign}, | |
| {"binding", Attribute::kBinding}, | |
| {"blend_src", Attribute::kBlendSrc}, | |
| {"builtin", Attribute::kBuiltin}, | |
| {"color", Attribute::kColor}, | |
| {"compute", Attribute::kCompute}, | |
| {"diagnostic", Attribute::kDiagnostic}, | |
| {"fragment", Attribute::kFragment}, | |
| {"group", Attribute::kGroup}, | |
| {"id", Attribute::kId}, | |
| {"input_attachment_index", Attribute::kInputAttachmentIndex}, | |
| {"interpolate", Attribute::kInterpolate}, | |
| {"invariant", Attribute::kInvariant}, | |
| {"location", Attribute::kLocation}, | |
| {"must_use", Attribute::kMustUse}, | |
| {"size", Attribute::kSize}, | |
| {"subgroup_size", Attribute::kSubgroupSize}, | |
| {"vertex", Attribute::kVertex}, | |
| {"workgroup_size", Attribute::kWorkgroupSize}, | |
| }; | |
| static constexpr AttributeCase kInvalidAttributeCases[] = { | |
| {"lIKK", Attribute::kUndefined}, | |
| {"algJ", Attribute::kUndefined}, | |
| {"aSSCCXXn", Attribute::kUndefined}, | |
| {"bZZndWW6Jg", Attribute::kUndefined}, | |
| {"bmm5ng", Attribute::kUndefined}, | |
| {"binBBBUg", Attribute::kUndefined}, | |
| {"bJJ11nd_src", Attribute::kUndefined}, | |
| {"bttfnd_src", Attribute::kUndefined}, | |
| {"blXn_ttr", Attribute::kUndefined}, | |
| {"builwiL", Attribute::kUndefined}, | |
| {"built1n", Attribute::kUndefined}, | |
| {"builtiww", Attribute::kUndefined}, | |
| {"ole", Attribute::kUndefined}, | |
| {"clor", Attribute::kUndefined}, | |
| {"coloNN", Attribute::kUndefined}, | |
| {"__RRUUputl", Attribute::kUndefined}, | |
| {"cHmpute", Attribute::kUndefined}, | |
| {"crmpCCte", Attribute::kUndefined}, | |
| {"diagostic", Attribute::kUndefined}, | |
| {"diagnpdtic", Attribute::kUndefined}, | |
| {"diagostic", Attribute::kUndefined}, | |
| {"LrgNet", Attribute::kUndefined}, | |
| {"ent", Attribute::kUndefined}, | |
| {"fragqqRRGxt", Attribute::kUndefined}, | |
| {"groGSp", Attribute::kUndefined}, | |
| {"qccup", Attribute::kUndefined}, | |
| {"grou", Attribute::kUndefined}, | |
| {"pd", Attribute::kUndefined}, | |
| {"qqFF05", Attribute::kUndefined}, | |
| {"i", Attribute::kUndefined}, | |
| {"input_attchent_index", Attribute::kUndefined}, | |
| {"input_attachmntOindex", Attribute::kUndefined}, | |
| {"inHHut_atachment_indeT", Attribute::kUndefined}, | |
| {"iOterpolSSt66", Attribute::kUndefined}, | |
| {"ddnterpYYTTte", Attribute::kUndefined}, | |
| {"iggterposte", Attribute::kUndefined}, | |
| {"invGGriant", Attribute::kUndefined}, | |
| {"llQOvariant", Attribute::kUndefined}, | |
| {"invariat", Attribute::kUndefined}, | |
| {"locatrron", Attribute::kUndefined}, | |
| {"lo7atiyn", Attribute::kUndefined}, | |
| {"lBBcWti22n", Attribute::kUndefined}, | |
| {"mustyyusV", Attribute::kUndefined}, | |
| {"mus_e", Attribute::kUndefined}, | |
| {"must_udde", Attribute::kUndefined}, | |
| {"zzVV", Attribute::kUndefined}, | |
| {"siyye", Attribute::kUndefined}, | |
| {"s__zA", Attribute::kUndefined}, | |
| {"subgroup_sizhh", Attribute::kUndefined}, | |
| {"vvubgrou_siz", Attribute::kUndefined}, | |
| {"subroup_sie", Attribute::kUndefined}, | |
| {"vsoNgtex", Attribute::kUndefined}, | |
| {"veZmtx", Attribute::kUndefined}, | |
| {"ertk", Attribute::kUndefined}, | |
| {"woffgrAup_size", Attribute::kUndefined}, | |
| {"woWrzzup_sizrr", Attribute::kUndefined}, | |
| {"workgRoupsize", Attribute::kUndefined}, | |
| }; | |
| using AttributeParseTest = testing::TestWithParam<AttributeCase>; | |
| TEST_P(AttributeParseTest, Parse) { | |
| const char* string = GetParam().string; | |
| Attribute expect = GetParam().value; | |
| EXPECT_EQ(expect, ParseAttribute(string)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidAttributeCases, AttributeParseTest, testing::ValuesIn(kValidAttributeCases)); | |
| INSTANTIATE_TEST_SUITE_P(InvalidAttributeCases, AttributeParseTest, testing::ValuesIn(kInvalidAttributeCases)); | |
| using AttributePrintTest = testing::TestWithParam<AttributeCase>; | |
| TEST_P(AttributePrintTest, Print) { | |
| Attribute value = GetParam().value; | |
| const char* expect = GetParam().string; | |
| EXPECT_EQ(expect, ToString(value)); | |
| } | |
| INSTANTIATE_TEST_SUITE_P(ValidAttributeCases, AttributePrintTest, testing::ValuesIn(kValidAttributeCases)); | |
| } // namespace parse_print_tests | |
| } // namespace | |
| } // namespace tint::core | |
| // clang-format on |