• Home
  • Raw
  • Download

Lines Matching full:flatbuffers

3 #include "flatbuffers/util.h"
6 namespace flatbuffers { namespace
13 TEST_EQ(flatbuffers::StringToNumber("1q", &x), false); in NumericUtilsTestInteger()
15 TEST_EQ(flatbuffers::StringToNumber(upper, &x), false); in NumericUtilsTestInteger()
16 TEST_EQ(x, flatbuffers::numeric_limits<T>::max()); in NumericUtilsTestInteger()
17 TEST_EQ(flatbuffers::StringToNumber(lower, &x), false); in NumericUtilsTestInteger()
18 auto expval = flatbuffers::is_unsigned<T>::value in NumericUtilsTestInteger()
19 ? flatbuffers::numeric_limits<T>::max() in NumericUtilsTestInteger()
20 : flatbuffers::numeric_limits<T>::lowest(); in NumericUtilsTestInteger()
27 TEST_EQ(flatbuffers::StringToNumber("", &f), false); in NumericUtilsTestFloat()
28 TEST_EQ(flatbuffers::StringToNumber("1q", &f), false); in NumericUtilsTestFloat()
30 TEST_EQ(flatbuffers::StringToNumber(upper, &f), true); in NumericUtilsTestFloat()
31 TEST_EQ(f, +flatbuffers::numeric_limits<T>::infinity()); in NumericUtilsTestFloat()
32 TEST_EQ(flatbuffers::StringToNumber(lower, &f), true); in NumericUtilsTestFloat()
33 TEST_EQ(f, -flatbuffers::numeric_limits<T>::infinity()); in NumericUtilsTestFloat()
53 TEST_EQ(flatbuffers::is_alpha(c), alpha); in IsAsciiUtilsTest()
54 TEST_EQ(flatbuffers::is_alnum(c), alpha || dec); in IsAsciiUtilsTest()
55 TEST_EQ(flatbuffers::is_digit(c), dec); in IsAsciiUtilsTest()
56 TEST_EQ(flatbuffers::is_xdigit(c), dec || hex); in IsAsciiUtilsTest()
65 flatbuffers::Case output_case; in UtilConvertCase()
72 cases.push_back({ "the_quick_brown_fox", flatbuffers::Case::kUpperCamel, in UtilConvertCase()
74 cases.push_back({ "the_quick_brown_fox", flatbuffers::Case::kLowerCamel, in UtilConvertCase()
76 cases.push_back({ "the_quick_brown_fox", flatbuffers::Case::kSnake, in UtilConvertCase()
78 cases.push_back({ "the_quick_brown_fox", flatbuffers::Case::kScreamingSnake, in UtilConvertCase()
80 cases.push_back({ "the_quick_brown_fox", flatbuffers::Case::kAllLower, in UtilConvertCase()
82 cases.push_back({ "the_quick_brown_fox", flatbuffers::Case::kAllUpper, in UtilConvertCase()
84 cases.push_back({ "the_quick_brown_fox", flatbuffers::Case::kUnknown, in UtilConvertCase()
86 cases.push_back({ "the_quick_brown_fox", flatbuffers::Case::kKeep, in UtilConvertCase()
88 cases.push_back({ "the_quick_brown_fox", flatbuffers::Case::kSnake2, in UtilConvertCase()
93 cases.push_back({ "single", flatbuffers::Case::kUpperCamel, "Single" }); in UtilConvertCase()
94 cases.push_back({ "Single", flatbuffers::Case::kUpperCamel, "Single" }); in UtilConvertCase()
95 cases.push_back({ "_leading", flatbuffers::Case::kUpperCamel, "_Leading" }); in UtilConvertCase()
97 { "trailing_", flatbuffers::Case::kUpperCamel, "Trailing_" }); in UtilConvertCase()
98 cases.push_back({ "double__underscore", flatbuffers::Case::kUpperCamel, in UtilConvertCase()
100 cases.push_back({ "single", flatbuffers::Case::kLowerCamel, "single" }); in UtilConvertCase()
101 cases.push_back({ "Single", flatbuffers::Case::kLowerCamel, "single" }); in UtilConvertCase()
102 cases.push_back({ "_leading", flatbuffers::Case::kLowerCamel, "_Leading" }); in UtilConvertCase()
104 { "trailing_", flatbuffers::Case::kLowerCamel, "trailing_" }); in UtilConvertCase()
105 cases.push_back({ "double__underscore", flatbuffers::Case::kLowerCamel, in UtilConvertCase()
109 cases.push_back({ "single", flatbuffers::Case::kSnake, "single" }); in UtilConvertCase()
110 cases.push_back({ "single", flatbuffers::Case::kScreamingSnake, "SINGLE" }); in UtilConvertCase()
112 { "_leading", flatbuffers::Case::kScreamingSnake, "_LEADING" }); in UtilConvertCase()
114 { "trailing_", flatbuffers::Case::kScreamingSnake, "TRAILING_" }); in UtilConvertCase()
115 cases.push_back({ "double__underscore", flatbuffers::Case::kScreamingSnake, in UtilConvertCase()
120 flatbuffers::ConvertCase(test_case.input, test_case.output_case)); in UtilConvertCase()
127 flatbuffers::Case input_case; in UtilConvertCase()
129 flatbuffers::Case output_case; in UtilConvertCase()
135 cases.push_back({ flatbuffers::Case::kUpperCamel, "TheQuickBrownFox", in UtilConvertCase()
136 flatbuffers::Case::kSnake, "the_quick_brown_fox" }); in UtilConvertCase()
137 cases.push_back({ flatbuffers::Case::kLowerCamel, "theQuickBrownFox", in UtilConvertCase()
138 flatbuffers::Case::kSnake, "the_quick_brown_fox" }); in UtilConvertCase()
139 cases.push_back({ flatbuffers::Case::kSnake, "the_quick_brown_fox", in UtilConvertCase()
140 flatbuffers::Case::kSnake, "the_quick_brown_fox" }); in UtilConvertCase()
141 cases.push_back({ flatbuffers::Case::kScreamingSnake, "THE_QUICK_BROWN_FOX", in UtilConvertCase()
142 flatbuffers::Case::kSnake, "THE_QUICK_BROWN_FOX" }); in UtilConvertCase()
143 cases.push_back({ flatbuffers::Case::kAllUpper, "SINGLE", in UtilConvertCase()
144 flatbuffers::Case::kSnake, "SINGLE" }); in UtilConvertCase()
145 cases.push_back({ flatbuffers::Case::kAllLower, "single", in UtilConvertCase()
146 flatbuffers::Case::kSnake, "single" }); in UtilConvertCase()
147 cases.push_back({ flatbuffers::Case::kUpperCamel, "ABCtest", in UtilConvertCase()
148 flatbuffers::Case::kSnake, "abctest" }); in UtilConvertCase()
149 cases.push_back({ flatbuffers::Case::kUpperCamel, "tHe_qUiCk_BrOwN_fOx", in UtilConvertCase()
150 flatbuffers::Case::kKeep, "tHe_qUiCk_BrOwN_fOx" }); in UtilConvertCase()
151 cases.push_back({ flatbuffers::Case::kLowerCamel, "theQuick12345Fox", in UtilConvertCase()
152 flatbuffers::Case::kSnake, "the_quick_12345_fox" }); in UtilConvertCase()
153 cases.push_back({ flatbuffers::Case::kLowerCamel, "a12b34c45", in UtilConvertCase()
154 flatbuffers::Case::kSnake, "a_12b_34c_45" }); in UtilConvertCase()
155 cases.push_back({ flatbuffers::Case::kLowerCamel, "a12b34c45", in UtilConvertCase()
156 flatbuffers::Case::kSnake2, "a12_b34_c45" }); in UtilConvertCase()
157 cases.push_back({ flatbuffers::Case::kUpperCamel, "Int32Stamped", in UtilConvertCase()
158 flatbuffers::Case::kSnake, "int_32_stamped" }); in UtilConvertCase()
159 cases.push_back({ flatbuffers::Case::kUpperCamel, "101DogsTest", in UtilConvertCase()
160 flatbuffers::Case::kSnake, "101_dogs_test" }); in UtilConvertCase()
161 cases.push_back({ flatbuffers::Case::kUpperCamel, "Int32Stamped", in UtilConvertCase()
162 flatbuffers::Case::kScreamingSnake, "INT_32_STAMPED" }); in UtilConvertCase()
163 cases.push_back({ flatbuffers::Case::kUpperCamel, "101DogsTest", in UtilConvertCase()
164 flatbuffers::Case::kScreamingSnake, "101_DOGS_TEST" }); in UtilConvertCase()
168 flatbuffers::ConvertCase(test_case.input, test_case.output_case, in UtilConvertCase()
175 } // namespace flatbuffers