text
stringlengths
0
2.2M
#include <bdlat_typecategory.h>
#include <bslim_testutil.h>
#include <bslmf_issame.h>
#include <bslmf_nil.h>
#include <bsl_string.h>
#include <bsl_vector.h>
#include <bsl_cstdlib.h>
#include <bsl_cstring.h>
#include <bsl_iostream.h>
#include <bsl_sstream.h>
#include <bdlb_nullablevalue.h>
using namespace BloombergLP;
using namespace bsl;
//=============================================================================
// TEST PLAN
//-----------------------------------------------------------------------------
// Overview
// --------
// TBD doc
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// ============================================================================
// STANDARD BDE ASSERT TEST FUNCTION
// ----------------------------------------------------------------------------
namespace {
int testStatus = 0;
void aSsErT(bool condition, const char *message, int line)
{
if (condition) {
cout << "Error " __FILE__ "(" << line << "): " << message
<< " (failed)" << endl;
if (0 <= testStatus && testStatus <= 100) {
++testStatus;
}
}
}
} // close unnamed namespace
// ============================================================================
// STANDARD BDE TEST DRIVER MACRO ABBREVIATIONS
// ----------------------------------------------------------------------------
#define ASSERT BSLIM_TESTUTIL_ASSERT
#define ASSERTV BSLIM_TESTUTIL_ASSERTV
#define LOOP_ASSERT BSLIM_TESTUTIL_LOOP_ASSERT
#define LOOP0_ASSERT BSLIM_TESTUTIL_LOOP0_ASSERT
#define LOOP1_ASSERT BSLIM_TESTUTIL_LOOP1_ASSERT
#define LOOP2_ASSERT BSLIM_TESTUTIL_LOOP2_ASSERT
#define LOOP3_ASSERT BSLIM_TESTUTIL_LOOP3_ASSERT
#define LOOP4_ASSERT BSLIM_TESTUTIL_LOOP4_ASSERT
#define LOOP5_ASSERT BSLIM_TESTUTIL_LOOP5_ASSERT
#define LOOP6_ASSERT BSLIM_TESTUTIL_LOOP6_ASSERT
#define Q BSLIM_TESTUTIL_Q // Quote identifier literally.
#define P BSLIM_TESTUTIL_P // Print identifier and value.
#define P_ BSLIM_TESTUTIL_P_ // P(X) without '\n'.
#define T_ BSLIM_TESTUTIL_T_ // Print a tab (w/o newline).
#define L_ BSLIM_TESTUTIL_L_ // current Line number
// ============================================================================
// GLOBAL TYPEDEFS/CONSTANTS FOR TESTING
// ----------------------------------------------------------------------------
struct MyArrayType {
enum { SELECTION = bdlat_TypeCategory::e_ARRAY_CATEGORY };
typedef bdlat_TypeCategory::Array Category;
};
namespace BloombergLP {
namespace bdlat_ArrayFunctions {
template <>
struct IsArray<MyArrayType> {
enum { VALUE = 1 };
};
} // close namespace bdlat_ArrayFunctions
} // close enterprise namespace
struct MyChoiceType {
enum { SELECTION = bdlat_TypeCategory::e_CHOICE_CATEGORY };
typedef bdlat_TypeCategory::Choice Category;
};
namespace BloombergLP {
namespace bdlat_ChoiceFunctions {
template <>
struct IsChoice<MyChoiceType> {