MCPcopy Create free account
hub / github.com/apache/impala / TestStringToFloatPreprocess

Function TestStringToFloatPreprocess

be/src/util/string-parser-test.cc:158–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158void TestStringToFloatPreprocess(const char* s, const char* expected) {
159 string trailers[] = {"", "4567", "fdfgh"};
160 for (int i = 0; i < 3; ++i) {
161 string input = s + trailers[i];
162 // don't process trailers
163 int processing_len = input.length() - trailers[i].length();
164 char result[input.length() + 2];
165 int res = StringParser::StringToFloatPreprocess(input.data(), processing_len,
166 result);
167 EXPECT_EQ(strlen(expected), res);
168 EXPECT_EQ(string(result), string(expected));
169 }
170}
171
172TEST(StringToInt, Basic) {
173 TestIntValue<int8_t>("123", 123, StringParser::PARSE_SUCCESS);

Callers 1

TESTFunction · 0.85

Calls 2

lengthMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected