MCPcopy Create free account
hub / github.com/apache/thrift / binary_test

Function binary_test

test/cpp/src/TestClient.cpp:1232–1261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1230}
1231
1232int binary_test(ThriftTestClient& testClient, string::size_type siz)
1233{
1234 string bin_request;
1235 string bin_result;
1236
1237 cout << "testBinary(siz = " << siz << ")" << '\n';
1238 binary_fill(bin_request, siz);
1239 try {
1240 testClient.testBinary(bin_result, bin_request);
1241
1242 if (bin_request.size() != bin_result.size()) {
1243 cout << "*** FAILED: request size " << bin_request.size() << "; result size " << bin_result.size() << '\n';
1244 return ERR_BASETYPES;
1245 }
1246
1247 for (string::size_type i = 0; i < siz; ++i) {
1248 if (bin_request.at(i) != bin_result.at(i)) {
1249 cout << "*** FAILED: at position " << i << " request[i] is h" << hex << bin_request.at(i) << " result[i] is h" << hex << bin_result.at(i) << '\n';
1250 return ERR_BASETYPES;
1251 }
1252 }
1253 } catch (TTransportException&) {
1254 throw;
1255 } catch (exception& ex) {
1256 cout << "*** FAILED ***" << '\n' << ex.what() << '\n';
1257 return ERR_BASETYPES;
1258 }
1259
1260 return 0;
1261}

Callers 1

mainFunction · 0.85

Calls 4

binary_fillFunction · 0.85
testBinaryMethod · 0.45
sizeMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected