text
stringlengths 0
2.2M
|
---|
const char *INPUT = DATA[i].d_input;
|
const int INPUT_LENGTH =
|
static_cast<int>(bsl::strlen(INPUT)) - 1;
|
const Type EXPECTED_RESULT = DATA[i].d_result;
|
Type mX; const Type& X = mX;
|
int retCode = Util::parseText(&mX, INPUT, INPUT_LENGTH);
|
LOOP2_ASSERT(LINE, retCode, 0 == retCode);
|
LOOP2_ASSERT(LINE, X, EXPECTED_RESULT == X);
|
}
|
}
|
if (verbose) cout << "\nUsing 'MyEnumeration::Value' (with failure)."
|
<< endl;
|
{
|
typedef test::MyEnumeration::Value Type;
|
static const struct {
|
int d_lineNum;
|
const char *d_input;
|
} DATA[] = {
|
//line input
|
//---- -----
|
{ L_, "VALUE0X", },
|
{ L_, "VALUE3X", },
|
};
|
const int NUM_DATA = sizeof DATA / sizeof *DATA;
|
for (int i = 0; i < NUM_DATA; ++i) {
|
const int LINE = DATA[i].d_lineNum;
|
const char *INPUT = DATA[i].d_input;
|
const int INPUT_LENGTH =
|
static_cast<int>(bsl::strlen(INPUT)) - 1;
|
Type mX;
|
int retCode = Util::parseText(&mX, INPUT, INPUT_LENGTH);
|
LOOP2_ASSERT(LINE, retCode, 0 != retCode);
|
}
|
}
|
if (verbose) cout << "\nUsing 'CustomizedString' (with success)."
|
<< endl;
|
{
|
typedef test::CustomizedString Type;
|
static const struct {
|
int d_lineNum;
|
const char *d_input;
|
Type d_result;
|
} DATA[] = {
|
//line input result
|
//---- ----- ------
|
{ L_, "X", Type(""), },
|
{ L_, "aX", Type("a"), },
|
{ L_, "abX", Type("ab"), },
|
{ L_, "abcX", Type("abc"), },
|
{ L_, "abcdX", Type("abcd"), },
|
{ L_, "abcdeX", Type("abcde"), },
|
};
|
const int NUM_DATA = sizeof DATA / sizeof *DATA;
|
for (int i = 0; i < NUM_DATA; ++i) {
|
const int LINE = DATA[i].d_lineNum;
|
const char *INPUT = DATA[i].d_input;
|
const int INPUT_LENGTH =
|
static_cast<int>(bsl::strlen(INPUT)) - 1;
|
const Type EXPECTED_RESULT = DATA[i].d_result;
|
Type mX; const Type& X = mX;
|
int retCode = Util::parseText(&mX, INPUT, INPUT_LENGTH);
|
LOOP2_ASSERT(LINE, retCode, 0 == retCode);
|
LOOP2_ASSERT(LINE, X, EXPECTED_RESULT == X);
|
}
|
}
|
if (verbose) cout << "\nUsing 'CustomizedString' (with failure)."
|
<< endl;
|
{
|
typedef test::CustomizedString Type;
|
static const struct {
|
int d_lineNum;
|
const char *d_input;
|
} DATA[] = {
|
//line input
|
//---- -----
|
{ L_, "0123456789_0123456789_12345X", },
|
{ L_, "0123456789_0123456789_123456X", },
|
};
|
const int NUM_DATA = sizeof DATA / sizeof *DATA;
|
for (int i = 0; i < NUM_DATA; ++i) {
|
const int LINE = DATA[i].d_lineNum;
|
const char *INPUT = DATA[i].d_input;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.