text
stringlengths
0
2.2M
// limitations under the License.
// ----------------------------- END-OF-FILE ----------------------------------
// bdldfp_intelimpwrapper.t.cpp -*-C++-*-
#include <bdldfp_intelimpwrapper.h>
#include <bslim_testutil.h>
#include <bsls_platform.h>
#include <bsl_cstdlib.h>
#include <bsl_cstring.h>
#include <bsl_iostream.h>
// We include the 'fenv.h' header to ensure that there are no definition
// conflicts between the Intel DFP code and the system 'fenv' header.
#ifndef BSLS_PLATFORM_CMP_MSVC
#include <fenv.h>
#endif
#include <wchar.h>
using namespace BloombergLP;
using bsl::cout;
using bsl::cerr;
using bsl::flush;
using bsl::endl;
using bsl::atoi;
#if !defined(BSLS_PLATFORM_OS_WINDOWS)
// ============================================================================
// TEST PLAN
// ----------------------------------------------------------------------------
// Overview
// --------
// The component under test wraps and includes the Intel DFP headers in a
// specific build mode.
//
// Global Concerns:
//: o Intel Headers are included correctly
//: o No #define detritus is left behind
//: o Intel Headers do not interact poorly with system headers
//
// TBD:
// ----------------------------------------------------------------------------
// CREATORS
//
// MANIPULATORS
//
// ACCESSORS
//
// FREE OPERATORS
//
// TRAITS
// ----------------------------------------------------------------------------
// [ 4] Macro clean environment
// [ 3] Simple function call tests
// [ 2] Intel Decimal types sanity test
// [ 1] Include Sanity Test
// ----------------------------------------------------------------------------
// ============================================================================
// 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