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

Function TestBase64

be/src/kudu/util/url-coding-test.cc:57–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57void TestBase64(const string& input, const string& expected_encoded) {
58 string intermediate;
59 Base64Encode(input, &intermediate);
60 string output;
61 if (!expected_encoded.empty()) {
62 EXPECT_EQ(intermediate, expected_encoded);
63 }
64 EXPECT_TRUE(Base64Decode(intermediate, &output));
65 EXPECT_EQ(input, output);
66
67 // Convert string to vector and try that also
68 vector<uint8_t> input_vector;
69 input_vector.resize(input.size());
70 memcpy(&input_vector[0], input.c_str(), input.size());
71 string intermediate2;
72 Base64Encode(input_vector, &intermediate2);
73 EXPECT_EQ(intermediate, intermediate2);
74}
75
76// Test URL encoding. Check that the values that are put in are the
77// same that come out.

Callers 1

TESTFunction · 0.70

Calls 5

resizeMethod · 0.80
Base64EncodeFunction · 0.70
Base64DecodeFunction · 0.70
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected