text
stringlengths
0
2.2M
// ============================================================================
// MAIN PROGRAM
// ----------------------------------------------------------------------------
int main(int argc, char *argv[])
{
int test = argc > 1 ? atoi(argv[1]) : 0;
int verbose = argc > 2;
int veryVerbose = argc > 3;
// int veryVeryVerbose = argc > 4;
cout << "TEST " << __FILE__ << " CASE " << test << endl;
switch (test) { case 0: // Zero is always the leading case.
case 9: {
// --------------------------------------------------------------------
// TESTING USAGE EXAMPLES
//
// Concerns:
//
// Plan:
//
// Testing:
// --------------------------------------------------------------------
if (verbose) cout << "\nTESTING USAGE EXAMPLES"
<< "\n======================" << endl;
runUsageExample1();
runUsageExample2();
runUsageExample3();
if (verbose) cout << "\nEnd of test." << endl;
} break;
case 8: {
// --------------------------------------------------------------------
// TESTING USAGE EXAMPLE 1
//
// Concerns:
//
// Plan:
//
// Testing:
// --------------------------------------------------------------------
if (verbose) cout << "\nTESTING USAGE EXAMPLE 1"
<< "\n============= " << endl;
runUsageExample1();
if (verbose) cout << "\nEnd of test." << endl;
} break;
case 7: {
// --------------------------------------------------------------------
// TEST ENUMERATORS
//
// Concerns
//: 1 When BDE_OMIT_INTERNAL_DEPRECATED is not defined, the BDEAT_...
//: enumeration literals should exist and evaluate to their e_...
//: equivalents.
//:
//: 2 When BDE_OMIT_INTERNAL_DEPRECATED is defined, the BDEAT_...
//: enumeration literals should not exist.
//
// Plan
//: 1 When BDE_OMIT_INTERNAL_DEPRECATED is not defined, check that the
//: BDEAT_... enumeration literals evaluate to their e_...
//: equivalents. (C-1)
//:
//: 2 We cannot check for (C-2), so hope for the best.
//
// Testing:
// ENUMERATORS
// --------------------------------------------------------------------
if (verbose) cout << "\nTEST ENUMERATORS"
<< "\n================" << endl;
#undef e
#define e(Class, Enumerator) \
{ L_, #Class "::..._" #Enumerator, \
Class::e_##Enumerator, Class::BDEAT_##Enumerator }
static struct {
int d_line; // line number
const char *d_name; // printable enumerator name
int d_bdeat_value; // value of BDEAT_... version
int d_bdlat_value; // value of e_... version
} DATA [] = {
#ifndef BDE_OMIT_INTERNAL_DEPRECATED
e(bdlat_TypeCategory, DYNAMIC_CATEGORY),
e(bdlat_TypeCategory, ARRAY_CATEGORY),
e(bdlat_TypeCategory, CHOICE_CATEGORY),
e(bdlat_TypeCategory, CUSTOMIZED_TYPE_CATEGORY),
e(bdlat_TypeCategory, ENUMERATION_CATEGORY),
e(bdlat_TypeCategory, NULLABLE_VALUE_CATEGORY),
e(bdlat_TypeCategory, SEQUENCE_CATEGORY),
e(bdlat_TypeCategory, SIMPLE_CATEGORY),
e(bdlat_TypeCategory::Select<void*>, SELECTION),