text
stringlengths 0
2.2M
|
---|
ENCODED.data(),
|
intLength(ENCODED)));
|
ASSERTV(LINE, ENCODED, decoded, INPUT, INPUT == decoded);
|
const Type INPUT2(buildPrintTextInput(HEADER, INPUT, ""));
|
ss.str("");
|
Print::printText(ss, INPUT2);
|
ASSERTV(LINE, ss.good());
|
const bsl::string ENCODED2(replaceCharEntities(ss.str()));
|
ASSERTV(LINE, 0 == Util::parseText(&decoded,
|
ENCODED2.data(),
|
intLength(ENCODED2)));
|
ASSERTV(LINE, ENCODED2, decoded, INPUT2,
|
INPUT2 == decoded);
|
const Type INPUT3(buildPrintTextInput("", INPUT, TRAILER));
|
ss.str("");
|
Print::printText(ss, INPUT3);
|
ASSERTV(LINE, ss.good());
|
const bsl::string ENCODED3(replaceCharEntities(ss.str()));
|
ASSERTV(LINE, 0 == Util::parseText(&decoded,
|
ENCODED3.data(),
|
intLength(ENCODED3)));
|
ASSERTV(LINE, ENCODED3, decoded, INPUT3,
|
INPUT3 == decoded);
|
const Type INPUT4(buildPrintTextInput(HEADER,
|
INPUT,
|
TRAILER));
|
ss.str("");
|
Print::printText(ss, INPUT4);
|
ASSERTV(LINE, ss.good());
|
const bsl::string ENCODED4(replaceCharEntities(ss.str()));
|
ASSERTV(LINE, 0 == Util::parseText(&decoded,
|
ENCODED4.data(),
|
intLength(ENCODED4)));
|
ASSERTV(LINE, ENCODED4, decoded, INPUT4,
|
INPUT4 == decoded);
|
}
|
}
|
if (verbose) cout << "\nUsing 'CustomizedString'." << endl;
|
{
|
typedef test::CustomizedString Type;
|
for (int i = 0; i < NUM_DATA; ++i) {
|
const int LINE = DATA[i].d_line;
|
const bsl::string INSTR = DATA[i].d_input;
|
const Type INPUT(INSTR);
|
bsl::stringstream ss;
|
Print::printText(ss, INPUT);
|
ASSERTV(LINE, ss.good());
|
const bsl::string ENCODED(replaceCharEntities(ss.str()));
|
Type decoded;
|
ASSERTV(LINE, 0 == Util::parseText(&decoded,
|
ENCODED.data(),
|
intLength(ENCODED)));
|
ASSERTV(LINE, ENCODED, decoded, INPUT, INPUT == decoded);
|
if (25 < HEADER.size() + INSTR.size()) {
|
continue; // CONTINUE
|
}
|
const Type INPUT2(buildPrintTextInput(HEADER, INSTR, ""));
|
ss.str("");
|
Print::printText(ss, INPUT2);
|
ASSERTV(LINE, ss.good());
|
const bsl::string ENCODED2(replaceCharEntities(ss.str()));
|
ASSERTV(LINE, 0 == Util::parseText(&decoded,
|
ENCODED2.data(),
|
intLength(ENCODED2)));
|
ASSERTV(LINE, ENCODED2, decoded, INPUT2,
|
INPUT2 == decoded);
|
if (25 < INSTR.size() + TRAILER.size()) {
|
continue; // CONTINUE
|
}
|
const Type INPUT3(buildPrintTextInput("", INSTR, TRAILER));
|
ss.str("");
|
Print::printText(ss, INPUT3);
|
ASSERTV(LINE, ss.good());
|
const bsl::string ENCODED3(replaceCharEntities(ss.str()));
|
ASSERTV(LINE, 0 == Util::parseText(&decoded,
|
ENCODED3.data(),
|
intLength(ENCODED3)));
|
ASSERTV(LINE, ENCODED3, decoded, INPUT3,
|
INPUT3 == decoded);
|
if (25 < HEADER.size() + INSTR.size() + TRAILER.size()) {
|
continue; // CONTINUE
|
}
|
const Type INPUT4(buildPrintTextInput(HEADER,
|
INSTR,
|
TRAILER));
|
ss.str("");
|
Print::printText(ss, INPUT4);
|
ASSERTV(LINE, ss.good());
|
const bsl::string ENCODED4(replaceCharEntities(ss.str()));
|
ASSERTV(LINE, 0 == Util::parseText(&decoded,
|
ENCODED4.data(),
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.