first commit

This commit is contained in:
Jose Caban
2025-06-07 11:34:38 -04:00
commit 0eb2d7c07d
4708 changed files with 1500614 additions and 0 deletions

198
extern/STLport/5.2.1/test/eh/LeakCheck.h vendored Normal file
View File

@@ -0,0 +1,198 @@
/*
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
/***********************************************************************************
LeakCheck.h
SUMMARY: A suite of template functions for verifying the behavior of
operations in the presence of exceptions. Requires that the operations
be written so that each operation that could cause an exception causes
simulate_possible_failure() to be called (see "nc_alloc.h").
***********************************************************************************/
#ifndef INCLUDED_MOTU_LeakCheck
#define INCLUDED_MOTU_LeakCheck 1
#include "Prefix.h"
#include "nc_alloc.h"
#include <cstdio>
#include <cassert>
#include <iterator>
#include <iostream>
EH_BEGIN_NAMESPACE
template <class T1, class T2>
inline ostream& operator << (
ostream& s,
const pair <T1, T2>& p) {
return s<<'['<<p.first<<":"<<p.second<<']';
}
EH_END_NAMESPACE
/*===================================================================================
CheckInvariant
EFFECTS: Generalized function to check an invariant on a container. Specialize
this for particular containers if such a check is available.
====================================================================================*/
template <class C>
void CheckInvariant(const C&)
{}
/*===================================================================================
WeakCheck
EFFECTS: Given a value and an operation, repeatedly applies the operation to a
copy of the value triggering the nth possible exception, where n increments
with each repetition until no exception is thrown or max_iters is reached.
Reports any detected memory leaks and checks any invariant defined for the
value type whether the operation succeeds or fails.
====================================================================================*/
template <class Value, class Operation>
void WeakCheck(const Value& v, const Operation& op, long max_iters = 2000000) {
bool succeeded = false;
bool failed = false;
gTestController.SetCurrentTestCategory("weak");
for (long count = 0; !succeeded && !failed && count < max_iters; ++count) {
gTestController.BeginLeakDetection();
{
Value dup = v;
#ifndef EH_NO_EXCEPTIONS
try {
#endif
gTestController.SetFailureCountdown(count);
op( dup );
succeeded = true;
#ifndef EH_NO_EXCEPTIONS
}
catch (...) {} // Just try again.
#endif
gTestController.CancelFailureCountdown();
CheckInvariant(dup);
}
failed = gTestController.ReportLeaked();
EH_ASSERT( !failed );
if ( succeeded )
gTestController.ReportSuccess(count);
}
EH_ASSERT( succeeded || failed ); // Make sure the count hasn't gone over
}
/*===================================================================================
ConstCheck
EFFECTS: Similar to WeakCheck (above), but for operations which may not modify
their arguments. The operation is performed on the value itself, and no
invariant checking is performed. Leak checking still occurs.
====================================================================================*/
template <class Value, class Operation>
void ConstCheck(const Value& v, const Operation& op, long max_iters = 2000000) {
bool succeeded = false;
bool failed = false;
gTestController.SetCurrentTestCategory("const");
for (long count = 0; !succeeded && !failed && count < max_iters; ++count) {
gTestController.BeginLeakDetection();
{
#ifndef EH_NO_EXCEPTIONS
try {
#endif
gTestController.SetFailureCountdown(count);
op( v );
succeeded = true;
#ifndef EH_NO_EXCEPTIONS
}
catch(...) {} // Just try again.
# endif
gTestController.CancelFailureCountdown();
}
failed = gTestController.ReportLeaked();
EH_ASSERT( !failed );
if ( succeeded )
gTestController.ReportSuccess(count);
}
EH_ASSERT( succeeded || failed ); // Make sure the count hasn't gone over
}
/*===================================================================================
StrongCheck
EFFECTS: Similar to WeakCheck (above), but additionally checks a component of
the "strong guarantee": if the operation fails due to an exception, the
value being operated on must be unchanged, as checked with operator==().
CAVEATS: Note that this does not check everything required for the strong
guarantee, which says that if an exception is thrown, the operation has no
effects. Do do that we would have to check that no there were no side-effects
on objects which are not part of v (e.g. iterator validity must be preserved).
====================================================================================*/
template <class Value, class Operation>
void StrongCheck(const Value& v, const Operation& op, long max_iters = 2000000) {
bool succeeded = false;
bool failed = false;
gTestController.SetCurrentTestCategory("strong");
for ( long count = 0; !succeeded && !failed && count < max_iters; count++ ) {
gTestController.BeginLeakDetection();
{
Value dup = v;
{
#ifndef EH_NO_EXCEPTIONS
try {
#endif
gTestController.SetFailureCountdown(count);
op( dup );
succeeded = true;
gTestController.CancelFailureCountdown();
# ifndef EH_NO_EXCEPTIONS
}
catch (...) {
gTestController.CancelFailureCountdown();
bool unchanged = (dup == v);
EH_ASSERT( unchanged );
if ( !unchanged ) {
#if 0
typedef typename Value::value_type value_type;
EH_STD::ostream_iterator<value_type> o(EH_STD::cerr, " ");
EH_STD::cerr<<"EH test FAILED:\nStrong guaranee failed !\n";
EH_STD::copy(dup.begin(), dup.end(), o);
EH_STD::cerr<<"\nOriginal is:\n";
EH_STD::copy(v.begin(), v.end(), o);
EH_STD::cerr<<EH_STD::endl;
#endif
failed = true;
}
} // Just try again.
# endif
CheckInvariant(v);
}
}
bool leaked = gTestController.ReportLeaked();
EH_ASSERT( !leaked );
if ( leaked )
failed = true;
if ( succeeded )
gTestController.ReportSuccess(count);
}
EH_ASSERT( succeeded || failed ); // Make sure the count hasn't gone over
}
#endif // INCLUDED_MOTU_LeakCheck

313
extern/STLport/5.2.1/test/eh/Prefix.h vendored Normal file
View File

@@ -0,0 +1,313 @@
/***********************************************************************************
Prefix.h
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
SUMMARY: Configuration #defines for STL EH test suite
***********************************************************************************/
#ifndef INCLUDED_MOTU_Prefix
#define INCLUDED_MOTU_Prefix 1
// Gives much more thorough checking, but may slow the tests
// considerably if your malloc is slow.
#define TESTCLASS_DEEP_DATA 1
# ifndef NO_FAST_ALLOCATOR
// # define NO_FAST_ALLOCATOR
# endif
// Define this to use the SGI STL. Undefine it to test a different installation
#ifndef EH_NO_SGI_STL
# define EH_USE_SGI_STL 1
#endif
#if EH_USE_SGI_STL
#define EH_ASSERT _STLP_ASSERT
//=========================================================================
// SGI STL-specific #defines
// These control the behavior of the test suite when used with the SGI
// STL. They have no effect when testing other STL implementations.
//=========================================================================
#ifndef _STLP_USE_NEWALLOC
# define _STLP_USE_NEWALLOC
#endif
#if 0 // !defined (_STLP_NO_CUSTOM_IO) && ! defined (__BORLANDC__)
# define _STLP_NO_CUSTOM_IO
#endif
// Just include something to get whatever configuration header we're using.
#include <utility>
#ifndef _STLP_CALL
# define _STLP_CALL
#endif
#if defined(_STLP_USE_NAMESPACES)
# define EH_USE_NAMESPACES _STLP_USE_NAMESPACES
#endif
#define EH_BEGIN_NAMESPACE _STLP_BEGIN_NAMESPACE
#define EH_END_NAMESPACE _STLP_END_NAMESPACE
#define EH_NEW_HEADERS 1
//#if defined (_STLP_USE_NEW_IOSTREAMS)
#define EH_NEW_IOSTREAMS 1
//#endif
#if !defined (_STLP_USE_EXCEPTIONS)
# define EH_NO_EXCEPTIONS
#endif
#if defined (_STLP_TEMPLATE_PARAM_SUBTYPE_BUG)
# define EH_TEMPLATE_PARAM_SUBTYPE_BUG _STLP_TEMPLATE_PARAM_SUBTYPE_BUG
#endif
#if defined(_STLP_MULTI_CONST_TEMPLATE_ARG_BUG)
# define EH_MULTI_CONST_TEMPLATE_ARG_BUG _STLP_MULTI_CONST_TEMPLATE_ARG_BUG
#endif
#if defined (STLPORT)
# define EH_STD STLPORT
#elif defined(__STD)
# define EH_STD __STD
#endif
// we want to be portable here, so std:: won't work.
#if defined(STLPORT_CSTD)
# define EH_CSTD STLPORT_CSTD
#else
# define EH_CSTD std
#endif
#define EH_DISTANCE(a, b, result) EH_STD::distance(a, b, result)
#define EH_HASHED_CONTAINERS_IMPLEMENTED 1
#define EH_HASH_CONTAINERS_SUPPORT_RESIZE 1
#define EH_HASH_CONTAINERS_SUPPORT_ITERATOR_CONSTRUCTION 1
#define EH_SLIST_IMPLEMENTED 1
#define EH_SELECT1ST_HINT __select1st_hint
// fbp : DEC cxx is unable to compile it for some reason
#if !(defined (__DECCXX) || defined (__amigaos__) || \
(defined (__GNUC__) && (__GNUC__ <= 2) && (__GNUC_MINOR__ < 8)))
# define EH_ROPE_IMPLEMENTED 1
#endif
#define EH_STRING_IMPLEMENTED 1
// # define EH_BITSET_IMPLEMENTED 1
//# define EH_VALARRAY_IMPLEMENTED 1 - we have no tests yet for valarray
#define stl_destroy EH_STD::destroy
#include <memory>
template <class _Tp>
class /*_STLP_CLASS_DECLSPEC*/ EH_allocator;
template <class _Tp>
class /*_STLP_CLASS_DECLSPEC*/ EH_allocator {
public:
typedef _Tp value_type;
typedef value_type * pointer;
typedef const _Tp* const_pointer;
typedef _Tp& reference;
typedef const _Tp& const_reference;
typedef EH_CSTD::size_t size_type;
typedef EH_CSTD::ptrdiff_t difference_type;
# if defined (_STLP_MEMBER_TEMPLATE_CLASSES)
template <class _Tp1> struct rebind {
typedef EH_allocator<_Tp1> other;
};
# endif
EH_allocator() _STLP_NOTHROW {}
# if defined (_STLP_MEMBER_TEMPLATES)
template <class _Tp1> EH_allocator(const EH_allocator<_Tp1>&) _STLP_NOTHROW {}
# endif
EH_allocator(const EH_allocator<_Tp>&) _STLP_NOTHROW {}
~EH_allocator() _STLP_NOTHROW {}
pointer address(reference __x) { return &__x; }
const_pointer address(const_reference __x) const { return &__x; }
// __n is permitted to be 0. The C++ standard says nothing about what the return value is when __n == 0.
_Tp* allocate(size_type __n, const void* = 0) const {
return __n != 0 ? __REINTERPRET_CAST(value_type*,EH_STD::__new_alloc::allocate(__n * sizeof(value_type))) : 0;
}
// __p is permitted to be a null pointer, only if n==0.
void deallocate(pointer __p, size_type __n) const {
_STLP_ASSERT( (__p == 0) == (__n == 0) )
if (__p != 0) EH_STD::__new_alloc::deallocate((void*)__p, __n * sizeof(value_type));
}
// backwards compatibility
void deallocate(pointer __p) const { if (__p != 0) EH_STD::__new_alloc::deallocate((void*)__p, sizeof(value_type)); }
size_type max_size() const _STLP_NOTHROW { return size_t(-1) / sizeof(value_type); }
void construct(pointer __p, const _Tp& __val) const { stlport::construct(__p, __val); }
void destroy(pointer __p) const { stlport::destroy(__p); }
};
template <class _T1> inline bool _STLP_CALL operator==(const EH_allocator<_T1>&, const EH_allocator<_T1>&) { return true; }
template <class _T1> inline bool _STLP_CALL operator!=(const EH_allocator<_T1>&, const EH_allocator<_T1>&) { return false; }
_STLP_BEGIN_NAMESPACE
// If custom allocators are being used without member template classes support :
// user (on purpose) is forced to define rebind/get operations !!!
template <class _Tp1, class _Tp2>
inline EH_allocator<_Tp2>& _STLP_CALL
__stl_alloc_rebind(EH_allocator<_Tp1>& __a, const _Tp2*) { return (EH_allocator<_Tp2>&)(__a); }
template <class _Tp1, class _Tp2>
inline EH_allocator<_Tp2> _STLP_CALL
__stl_alloc_create(const EH_allocator<_Tp1>&, const _Tp2*) { return EH_allocator<_Tp2>(); }
_STLP_END_NAMESPACE
# define eh_allocator(T) ::EH_allocator<T>
# define EH_BIT_VECTOR_IMPLEMENTED
# if defined(_STLP_CLASS_PARTIAL_SPECIALIZATION) && !defined(_STLP_NO_BOOL)
# define EH_BIT_VECTOR EH_STD::vector<bool, eh_allocator(bool) >
# else
# ifdef _STLP_NO_BOOL
# undef EH_BIT_VECTOR_IMPLEMENTED
# else
# define EH_BIT_VECTOR EH_STD::vector<bool, eh_allocator(bool) >
# endif
# endif
#else // !USE_SGI_STL
//=========================================================================
// Configuration for testing other non-SGI STL implementations
//=========================================================================
// Metrowerks configuration
# ifdef __MWERKS__
# define EH_ASSERT assert
// Get MSL configuration header
# include <ansi_parms.h>
# if __MSL__ >= 24
# define EH_NEW_HEADERS 1
# if defined (_MSL_USING_NAMESPACE)
# define EH_USE_NAMESPACES 1
# endif
# define EH_BIT_VECTOR vector<bool>
# define EH_DISTANCE( a, b, result ) do { result = distance( a, b ); } while (0)
# else
# error No configuration for earlier versions of MSL
# endif // __MSL__ >= 24
// Bugs fixed in CWPro3
# if __MWERKS__ < 0x2100
# define EH_TEMPLATE_PARAM_SUBTYPE_BUG 1
# endif
// Bugs in CWPro3
# if __MWERKS__ <= 0x2110
# define EH_MULTI_CONST_TEMPLATE_ARG_BUG 1
# else
# pragma warning not sure the above bug is fixed yet
# endif
# define EH_SLIST_IMPLEMENTED 1
//# define EH_HASHED_CONTAINERS_IMPLEMENTED 1
# define EH_NEW_IOSTREAMS 1
# define EH_USE_NOTHROW 1
# endif // Metrowerks configuration
#if defined (__SUNPRO_CC)
# define stl_destroy __RWSTD::__destroy
# define EH_DISTANCE( a, b, result ) distance( a, b, result )
# define EH_BIT_VECTOR EH_STD::vector<bool>
# define EH_NEW_HEADERS 1
# define EH_USE_NAMESPACES 1
# define EH_NEW_IOSTREAMS 1
# define EH_ASSERT assert
# define EH_STRING_IMPLEMENTED 1
# elif defined (__KCC)
# define stl_destroy EH_STD::destroy
# define EH_DISTANCE( a, b, result ) do { result = distance( a, b ); } while (0)
# define EH_BIT_VECTOR EH_STD::vector<bool>
# define EH_NEW_HEADERS 1
# define EH_USE_NAMESPACES 1
# define EH_NEW_IOSTREAMS 1
# define EH_ASSERT assert
# define EH_CSTD
# define EH_STRING_IMPLEMENTED 1
# define EH_MULTI_CONST_TEMPLATE_ARG_BUG 1
# define EH_SELECT1ST_HINT select1st
# else
# define stl_destroy destroy
#endif
//
// Compiler-independent configuration
//
# ifdef EH_USE_NAMESPACES
# ifdef STLPORT
# define EH_STD STLPORT
# else
# define EH_STD std
# endif
# ifdef STLPORT_CSTD
# define EH_STD STLPORT_CSTD
# else
# define EH_STD std
# endif
# define EH_BEGIN_NAMESPACE namespace EH_STD {
# define EH_END_NAMESPACE }
# else
# define EH_BEGIN_NAMESPACE
# define EH_END_NAMESPACE
# define EH_STD
# endif
# ifndef EH_CSTD
# define EH_CSTD EH_STD
# endif
#endif // !USE_SGI_STL
//
// Library-independent configuration.
//
#if defined( EH_MULTI_CONST_TEMPLATE_ARG_BUG) && !defined( EH_SELECT1ST_HINT )
template <class Pair, class U>
// JDJ (CW Pro1 doesn't like const when first_type is also const)
struct eh_select1st_hint : public unary_function<Pair, U> {
const U& operator () (const Pair& x) const { return x.first; }
};
# define EH_SELECT1ST_HINT eh_select1st_hint
#endif
#if EH_USE_NAMESPACES
# define EH_USE_STD using namespace EH_STD;
#else
# define EH_USE_STD
#endif
#if defined (EH_USE_NAMESPACES) && !defined(_STLP_VENDOR_GLOBAL_CSTD)
# define USING_CSTD_NAME(name) using EH_CSTD :: name;
#else
# define USING_CSTD_NAME(name)
#endif
#endif // INCLUDED_MOTU_Prefix

View File

@@ -0,0 +1,81 @@
/***********************************************************************************
SortClass.h
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
SUMMARY: A class designed to test operations that compares objects. All
comparisons on SortClass may fail. Also records its own address for
the sake of testing the stability of sorting algorithms.
***********************************************************************************/
#if ! defined (INCLUDED_MOTU_SortClass)
#define INCLUDED_MOTU_SortClass 1
# include "Prefix.h"
# include "TestClass.h"
class SortClass : public TestClass
{
public:
enum { kRange = 100 };
SortClass( int v ) : TestClass( v ), addr(0) {
ResetAddress();
}
SortClass() : TestClass( (int)get_random(kRange) ), addr(0) {
ResetAddress();
}
bool operator<( const TestClass& rhs ) const
{
simulate_possible_failure();
return (const TestClass&)*this < ( rhs );
}
bool operator==( const TestClass& rhs ) const
{
simulate_possible_failure();
return (const TestClass&)*this == ( rhs );
}
SortClass* GetAddress() const { return addr; }
void ResetAddress() { addr = this; }
private:
SortClass* addr;
};
inline bool operator>( const SortClass& lhs, const SortClass& rhs ) {
return rhs < lhs;
}
inline bool operator<=( const SortClass& lhs, const SortClass& rhs ) {
return !(rhs < lhs);
}
inline bool operator>=( const SortClass& lhs, const SortClass& rhs ) {
return !(lhs < rhs);
}
inline bool operator != ( const SortClass& lhs, const SortClass& rhs ) {
return !(lhs == rhs);
}
#if defined( __MWERKS__ ) && __MWERKS__ <= 0x3000 && !__SGI_STL
# if defined( __MSL__ ) && __MSL__ < 0x2406
__MSL_FIX_ITERATORS__(SortClass);
__MSL_FIX_ITERATORS__(const SortClass);
# endif
#endif
#endif // INCLUDED_MOTU_SortClass

View File

@@ -0,0 +1,24 @@
/***********************************************************************************
TestClass.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#include "TestClass.h"
#include <iostream>
std::ostream& operator << (std::ostream& s, const TestClass& t) {
return s << t.value();
}

161
extern/STLport/5.2.1/test/eh/TestClass.h vendored Normal file
View File

@@ -0,0 +1,161 @@
/***********************************************************************************
TestClass.h
* Copyright (c) 1997-1998
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
SUMMARY: TestClass simulates a class that uses resources. It is designed to
cause exceptions when it is constructed or copied.
***********************************************************************************/
#ifndef INCLUDED_MOTU_TestClass
#define INCLUDED_MOTU_TestClass 1
# include "Prefix.h"
# include <functional>
# include <utility>
# include <climits>
#include <iosfwd>
#include "random_number.h"
#include "nc_alloc.h"
class TestClass
{
public:
inline TestClass();
inline TestClass( int value );
inline TestClass( const TestClass& rhs );
inline ~TestClass();
inline TestClass& operator=( const TestClass& rhs );
inline int value() const;
inline TestClass operator!() const;
bool operator==( const TestClass& rhs ) const
{
return value() == rhs.value();
}
bool operator<( const TestClass& rhs ) const {
return value() < rhs.value();
}
protected:
static inline unsigned int get_random(unsigned range = UINT_MAX);
private:
inline void Init( int value );
#if TESTCLASS_DEEP_DATA
int *p;
#else
int v;
#endif
};
#if defined( __MWERKS__ ) && __MWERKS__ <= 0x3000 && !__SGI_STL
# if defined( __MSL__ ) && __MSL__ < 0x2406
# include <iterator.h>
__MSL_FIX_ITERATORS__(TestClass);
__MSL_FIX_ITERATORS__(const TestClass);
typedef EH_STD::pair<const TestClass, TestClass> pair_testclass_testclass;
__MSL_FIX_ITERATORS__( pair_testclass_testclass );
__MSL_FIX_ITERATORS__( const pair_testclass_testclass );
# endif
#endif
inline void TestClass::Init( int value )
{
#if TESTCLASS_DEEP_DATA
p = new int( value );
#else
simulate_constructor();
v = value;
#endif
}
inline TestClass::TestClass()
{
Init( int(get_random()) );
}
inline TestClass::TestClass( int value )
{
Init( value );
}
inline TestClass::TestClass( const TestClass& rhs )
{
Init( rhs.value() );
}
inline TestClass::~TestClass()
{
#if TESTCLASS_DEEP_DATA
delete p;
#else
simulate_destructor();
#endif
}
inline TestClass& TestClass::operator=( const TestClass& rhs )
{
#if TESTCLASS_DEEP_DATA
int *newP = new int( rhs.value() );
delete p;
p = newP;
#else
simulate_possible_failure();
v = rhs.value();
#endif
return *this;
}
inline int TestClass::value() const
{
#if TESTCLASS_DEEP_DATA
return *p;
#else
return v;
#endif
}
inline TestClass TestClass::operator!() const
{
return TestClass( value()+1 );
}
inline bool operator>( const TestClass& lhs, const TestClass& rhs ) {
return rhs < lhs;
}
inline bool operator>=( const TestClass& lhs, const TestClass& rhs ) {
return !(lhs < rhs);
}
inline bool operator<=( const TestClass& lhs, const TestClass& rhs ) {
return !(rhs < lhs);
}
inline bool operator != ( const TestClass& lhs, const TestClass& rhs ) {
return lhs.value() != rhs.value();
}
inline unsigned int TestClass::get_random( unsigned range )
{
return random_number( range );
}
extern std::ostream& operator << ( std::ostream& s, const TestClass&);
#endif // INCLUDED_MOTU_TestClass

59
extern/STLport/5.2.1/test/eh/Tests.h vendored Normal file
View File

@@ -0,0 +1,59 @@
/***********************************************************************************
Tests.h
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
SUMMARY: Declarations of all of the tests in the exception test suite.
***********************************************************************************/
#if ! defined (INCLUDED_MOTU_Tests)
#define INCLUDED_MOTU_Tests 1
#include "Prefix.h"
void test_algobase();
void test_algo();
void test_list();
void test_map();
void test_multimap();
void test_set();
void test_multiset();
void test_vector();
void test_deque();
void test_bit_vector();
#if defined (EH_HASHED_CONTAINERS_IMPLEMENTED)
void test_hash_map();
void test_hash_multimap();
void test_hash_set();
void test_hash_multiset();
#endif
#if defined (EH_ROPE_IMPLEMENTED)
void test_rope();
#endif
#if defined( EH_SLIST_IMPLEMENTED )
void test_slist();
#endif
#if defined( EH_STRING_IMPLEMENTED )
void test_string();
#endif
#if defined( EH_BITSET_IMPLEMENTED )
void test_bitset();
#endif
#if defined( EH_VALARRAY_IMPLEMENTED )
void test_valarray();
#endif
#endif // INCLUDED_MOTU_Tests

View File

@@ -0,0 +1,46 @@
/***********************************************************************************
ThrowCompare.h
Interface for the ThrowCompare class
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#ifndef ThrowCompare_H_
#define ThrowCompare_H_
#include "Prefix.h"
#include "TestClass.h"
struct ThrowCompare {
bool operator()( const TestClass& a, const TestClass& b ) const {
simulate_possible_failure();
return a < b;
}
};
struct ThrowEqual {
inline bool operator()( const TestClass& a, const TestClass& b ) const {
simulate_possible_failure();
return a == b;
}
};
struct ThrowHash { // : private ThrowCompare
inline EH_CSTD::size_t operator()( const TestClass& a ) const {
simulate_possible_failure();
return EH_CSTD::size_t(a.value());
}
};
#endif // ThrowCompare_H_

78
extern/STLport/5.2.1/test/eh/bcb.mak vendored Normal file
View File

@@ -0,0 +1,78 @@
# ---------------------------------------------------------------------------
BCC32=bcc32
CPP32=cpp32
!if !$d(BCB)
BCB = $(MAKEDIR)\..
!endif
# ---------------------------------------------------------------------------
# IDE SECTION
# ---------------------------------------------------------------------------
# The following section of the project makefile is managed by the BCB IDE.
# It is recommended to use the IDE to change any of the values in this
# section.
# ---------------------------------------------------------------------------
# ---------------------------------------------------------------------------
PROJECT = eh_test.exe
OBJFILES = TestClass.obj \
nc_alloc.obj \
random_number.obj \
test_algo.obj \
test_algobase.obj \
test_bit_vector.obj \
test_bitset.obj \
test_deque.obj \
test_hash_map.obj \
test_hash_set.obj \
test_list.obj \
test_map.obj \
test_rope.obj \
test_set.obj \
test_slist.obj \
test_string.obj \
test_valarray.obj \
test_vector.obj main.obj
# ---------------------------------------------------------------------------
PATHCPP = .;
PATHPAS = .;
PATHASM = .;
PATHRC = .;
# USERDEFINES = _STLP_NO_OWN_IOSTREAMS
USERDEFINES = _DEBUG
SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES
# SYSDEFINES = NO_STRICT;USEPACKAGES
# ---------------------------------------------------------------------------
CFLAG1 = -w- -jb -j1 -I.;..\..\stlport;$(BCB)\include; -Od -v -N -x -xp -tWC -D$(SYSDEFINES);$(USERDEFINES)
LDFLAGS = -L..\..\lib;$(BCB)\..\lib cw32i.lib stlp.4.5.lib
.autodepend
# ---------------------------------------------------------------------------
all : $(PROJECT)
cd ..\..\lib
..\test\eh\eh_test.exe -s 100
$(PROJECT) : $(OBJFILES)
$(BCC32) -e$(PROJECT) $(CFLAG1) $(LDFLAGS) $(OBJFILES)
clean:
del *.obj *.exe *.core *.tds
# ---------------------------------------------------------------------------
.cpp.obj:
$(BCC32) $(CFLAG1) -n$(@D) -c $<
.cpp.exe:
$(BCC32) $(CFLAG1) $(LDFLAGS) -n$(@D) $<
.cpp.i:
$(CPP32) $(CFLAG1) -n. -Sr -Ss -Sd {$< }
# ---------------------------------------------------------------------------

39
extern/STLport/5.2.1/test/eh/bug.cpp vendored Normal file
View File

@@ -0,0 +1,39 @@
#include <set>
#include <vector>
#include <iostream>
#include <boost/timer.hpp>
#include <boost/lexical_cast.hpp>
struct compare
{
bool operator()(int* x, int* y)
{ return *x < *y; }
};
int main(int argc, char const* const argv[])
{
std::size_t niters = argc < 2 ? 1000 : boost::lexical_cast<std::size_t>(argv[1]);
boost::timer t;
std::vector<int> v;
for (int n = 0; n < niters; ++n)
{
v.insert(v.begin() + v.size()/2, n);
}
std::cout << "vector fill: " << t.elapsed() << std::endl;
std::multiset<int*,compare> m;
for (int n = 0; n < niters; ++n)
{
m.insert(&v[n]);
}
std::cout << "map fill 1: " << t.elapsed() << std::endl;
for (int n = 0; n < niters; ++n)
{
m.insert(&v[n]);
}
std::cout << "map fill 2: " << t.elapsed() << std::endl;
}

View File

@@ -0,0 +1,69 @@
#
# Note : this makefile has been tested for como-4.3.0.1+gcc-2.96 on Redhat 7.3
#
.SUFFIXES:
.SUFFIXES: .cc .cpp .o .exe .out
srcdir = .
VPATH = .
# point this to proper location
STL_INCL=../../stlport
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = ./eh_test
TEST = ./eh_test.out
CC = como
CXX = $(CC)
CXXFLAGS = -DLIBCIO= --diag_suppress=68 -D__null=0L -D__GNUG__ -D_STLP_DEBUG -I${STL_INCL} -I. ${CXX_EXTRA_FLAGS}
LIBS = -L../../lib -lstlport_como_stldebug -lpthread -lm
LIBSTDCXX =
check: $(TEST)
$(TEST_EXE) : $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $(TEST_EXE)
$(TEST) : $(TEST_EXE)
$(TEST_EXE)
SUFFIXES: .cpp.o.exe.out.res
%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H -o $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBS) -o $*
./$* > $@
-rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
%.E: %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
clean:
-rm -fr ${TEST_EXE} *.out *.o *.ii *.ti

67
extern/STLport/5.2.1/test/eh/como.mak vendored Normal file
View File

@@ -0,0 +1,67 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
srcdir = .
VPATH = .
# point this to proper location
STL_INCL=../../stlport
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = ./eh_test
TEST = ./eh_test.out
CC = e:\lang\como\bin\como
CXX = $(CC)
# __COMO__ appears not to be defined automatically ;(
CXXFLAGS = -D__COMO__ -D_MSC_VER=1200 --exceptions --microsoft -D_STLP_DEBUG -I${STL_INCL} -I. ${CXX_EXTRA_FLAGS}
LIBS = -lm
LIBSTDCXX =
check: $(TEST)
$(TEST_EXE) : $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $(TEST_EXE)
$(TEST) : $(TEST_EXE)
$(TEST_EXE)
SUFFIXES: .cpp.o.exe.out.res
%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H -o $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBS) -o $*
./$* > $@
-rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
%.E: %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o *.rpo *.obj *.out core *~ Templates.DB

56
extern/STLport/5.2.1/test/eh/cray.mak vendored Normal file
View File

@@ -0,0 +1,56 @@
SHELL=/bin/sh
# srcdir = .
# VPATH = .
STL_INCL=-I${PWD}/../../stlport/
AUX_LIST=TestClass.o main.o nc_alloc.o random_number.o
TEST_LIST=test_algo.o \
test_algobase.o test_list.o test_slist.o \
test_bit_vector.o test_vector.o \
test_deque_cray.o test_set.o test_map.o \
test_hash_map.o test_hash_set.o test_rope.o \
test_string.o test_bitset.o test_valarray.o
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST)
EXECS = $(LIST:%.o=%)
TESTS = $(LIST:%.o=%.out)
TEST_EXE = eh_test
TEST = eh_test.out
CC = CC
CXX = $(CC)
#CXXFLAGS = -hexceptions -DEH_DELETE_HAS_THROW_SPEC -I. ${STL_INCL} ${DEBUG_FLAGS}
CXXFLAGS = -D_STLP_HAS_NO_EXCEPTIONS -I. ${STL_INCL} ${DEBUG_FLAGS}
#LIBS = -L../../lib -lstlportx -lpthread
LIBS = -L../../lib -lstlport -lpthread
.SUFFIXES: .cpp .i .o .out
check: $(TEST)
$(TEST) : $(OBJECTS)
$(CXX) $(CXXFLAGS) $(LIBS) $(OBJECTS) -o $(TEST_EXE)
./$(TEST_EXE) -s 100
.cpp.o:
$(CXX) $(CXXFLAGS) $< -c -o $@
.cpp.i:
$(CXX) $(CXXFLAGS) $< -E > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $*.cpp -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $(LIBS) $*.o -o $*
./$* -q
-rm -f $*
clean:
-rm -fr ${TEST_EXE} *.o *.ii *.out core

123
extern/STLport/5.2.1/test/eh/cygwin.mak vendored Normal file
View File

@@ -0,0 +1,123 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
srcdir = .
VPATH = .
# point this to proper location
STL_INCL=-I../../stlport
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=obj/%.o) $(STAT_MODULE)
D_OBJECTS = $(LIST:%.cpp=d_obj/%.o) $(STAT_MODULE)
NOSGI_OBJECTS = $(LIST:%.cpp=nosgi_obj/%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = ./eh_test
D_TEST_EXE = ./eh_test_d
NOSGI_TEST_EXE = ./eh_test_nosgi
TEST = ./eh_test.out
D_TEST = ./eh_test_d.out
NOSGI_TEST = ./eh_test_nosgi.out
CC = c++
CXX = $(CC)
# dwa 12/22/99 -- had to turn off -ansi flag so we could use SGI IOSTREAMS
# also, test_slist won't compile with -O3/-O2 when targeting PPC. It fails
# in the assembler with 'invalid relocation type'
CXXFLAGS = -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW
D_CXXFLAGS = -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -D_STLP_DEBUG -D_STLP_USE_STATIC_LIB
NOSGI_CXXFLAGS = -Wall -g -O2 ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -D_STLP_NO_OWN_IOSTREAMS -D_STLP_DEBUG_UNINITIALIZED -DEH_VECTOR_OPERATOR_NEW
check: $(TEST)
LIBS = -lm
D_LIBSTLPORT = -L../../lib -lstlport_cygwin_stldebug
LIBSTLPORT = -L../../lib -lstlport_cygwin
all: $(TEST_EXE) $(D_TEST_EXE) $(NOSGI_TEST_EXE)
check_nosgi: $(NOSGI_TEST)
check_d: $(D_TEST)
OBJDIR=obj
D_OBJDIR=d_obj
NOSGI_OBJDIR=nosgi_obj
$(OBJDIR):
mkdir obj
$(D_OBJDIR):
mkdir d_obj
$(NOSGI_OBJDIR):
mkdir nosgi_obj
$(TEST_EXE) : $(OBJDIR) $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBSTLPORT) $(LIBS) -o $(TEST_EXE)
$(D_TEST_EXE) : $(D_OBJDIR) $(D_OBJECTS)
$(CXX) $(D_CXXFLAGS) $(D_OBJECTS) $(D_LIBSTLPORT) $(LIBS) -o $(D_TEST_EXE)
$(NOSGI_TEST_EXE) : $(NOSGI_OBJDIR) $(NOSGI_OBJECTS)
$(CXX) $(NOSGI_CXXFLAGS) $(NOSGI_OBJECTS) $(LIBS) -o $(NOSGI_TEST_EXE)
$(TEST) : $(TEST_EXE)
echo "Cygwin has bugs in exception handling, runnning w/o throwing exceptions..."
./$(TEST_EXE) -e
$(D_TEST) : $(D_TEST_EXE)
echo "Cygwin has bugs in exception handling, runnning w/o throwing exceptions..."
./$(D_TEST_EXE) -e
$(NOSGI_TEST) : $(NOSGI_TEST_EXE)
echo "Cygwin has bugs in exception handling, runnning w/o throwing exceptions..."
./$(NOSGI_TEST_EXE) -e
SUFFIXES: .cpp.o.exe.out.res
nosgi_obj/%.o : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -c -o $@
d_obj/%.o : %.cpp
$(CXX) $(D_CXXFLAGS) $< -c -o $@
obj/%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
nosgi_obj/%.i : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -E -H > $@
d_obj/%.i : %.cpp
$(CXX) $(D_CXXFLAGS) $< -E -H > $@
obj/%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -D_STLP_DEBUG -D_REENTRANT -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(D_LIBSTLPORT) $(LIBS) -o $*
./$* > $@
-rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
%.E: %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o */*.o *.rpo *.obj *.out core *~ Templates.DB

73
extern/STLport/5.2.1/test/eh/deccxx.mak vendored Normal file
View File

@@ -0,0 +1,73 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
SHELL=/bin/sh
# srcdir = .
# VPATH = .
# point this to proper location
STL_INCL= -I../../stlport
# STL_INCL= -DEH_NO_SGI_STL
AUX_LIST=TestClass.o main.o nc_alloc.o random_number.o
TEST_LIST=test_algo.o \
test_algobase.o test_list.o test_slist.o \
test_bit_vector.o test_vector.o \
test_deque.o test_set.o test_map.o \
test_hash_map.o test_hash_set.o test_rope.o \
test_string.o test_bitset.o test_valarray.o
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST)
EXECS = $(LIST:%.o=%)
TESTS = $(LIST:%.o=%.out)
TEST_EXE = eh_test
TEST = eh_test.out
CC = cxx
CXX = $(CC)
# -std strict_ansi_errors
CXXFLAGS = ${STL_INCL} -std strict_ansi_errors -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC -gall
# CXXFLAGS = ${STL_INCL} -std strict_ansi_errors -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC
# This is to test with native STL
# CXXFLAGS = +w2 -xildoff -D_STLP_USE_NEWALLOC -DEH_NO_SGI_STL -DEH_NEW_HEADERS -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC
LIBS = -L../../lib -lstlport_dec -lm
LIBSTDCXX =
.SUFFIXES: .cpp .i .o .out .res
check: $(TEST)
$(TEST) : $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $(TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" ./$(TEST_EXE) -s 100
.cpp.o:
$(CXX) $(CXXFLAGS) $< -c -o $@
.cpp.i:
$(CXX) $(CXXFLAGS) $< -E > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $*.cpp -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBS) -o $*
./$* -q
-rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $*.cpp -o $@
clean:
-rm -fr ${TEST_EXE} *.o *.rpo *.obj *.out core *~ Templates.DB SunWS_cache cxx_repository

View File

@@ -0,0 +1,54 @@
# ;;; -*- Mode:makefile;-*-
# Generated manually for MMS
# point this to proper location
STL_INCL= /include="../../stlport"
# STL_INCL= -DEH_NO_SGI_STL
.SUFFIXES .obj .cpp
all : check
AUX_LIST=TestClass.obj,main.obj,nc_alloc.obj,random_number.obj
TEST_LIST=test_algo.obj,-
test_algobase.obj,test_list.obj,test_slist.obj,-
test_bit_vector.obj,test_vector.obj,-
test_deque.obj,test_set.obj,test_map.obj,-
test_hash_map.obj,test_hash_set.obj,test_rope.obj,-
test_string.obj,test_bitset.obj,test_valarray.obj
LIST=$(AUX_LIST),$(TEST_LIST)
OBJECTS = $(LIST)
EXECS = $(LIST:%.obj=%.exe)
TESTS = $(LIST:%.obj=%.out)
TEST_EXE = eh_test.exe
TEST = eh_test.out
CC = cxx
CXX = $(CC)
LINK = cxxlink
# -std strict_ansi_errors
CXXFLAGS = $(STL_INCL) /define=(__NO_USE_STD_IOSTREAM,EH_VECTOR_OPERATOR_NEW,EH_DELETE_HAS_THROW_SPEC)
# This is to test with native STL
# CXXFLAGS = +w2 -xildoff -D__STL_USE_NEWALLOC -DEH_NO_SGI_STL -DEH_NEW_HEADERS -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC
LIBS =
LIBSTDCXX =
check : $(TEST)
$(TEST) : $(OBJECTS)
$(LINK)/exe=$(TEST_EXE) $(OBJECTS) $(LIBS)
run $(TEST_EXE)
.cpp.obj :
$(CXX) $(CXXFLAGS) /obj=$@ $<

121
extern/STLport/5.2.1/test/eh/djgpp.mak vendored Normal file
View File

@@ -0,0 +1,121 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
srcdir = .
VPATH = .
# point this to proper location
STL_INCL=-I../../stlport
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=obj/%.o) $(STAT_MODULE)
D_OBJECTS = $(LIST:%.cpp=d_obj/%.o) $(STAT_MODULE)
NOSGI_OBJECTS = $(LIST:%.cpp=nosgi_obj/%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = ./eh_test
D_TEST_EXE = ./eh_test_d
NOSGI_TEST_EXE = ./eh_test_nosgi
TEST = ./eh_test.out
D_TEST = ./eh_test_d.out
NOSGI_TEST = ./eh_test_nosgi.out
CC = gcc
CXX = $(CC)
# dwa 12/22/99 -- had to turn off -ansi flag so we could use SGI IOSTREAMS
# also, test_slist won't compile with -O3/-O2 when targeting PPC. It fails
# in the assembler with 'invalid relocation type'
CXXFLAGS = -Wall -ftemplate-depth-32 -mbnu210 -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -D_STLP_NO_SGI_IOSTREAMS
D_CXXFLAGS = -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -D_STLP_DEBUG -D_STLP_USE_STATIC_LIB
NOSGI_CXXFLAGS = -Wall -g -O2 ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -D_STLP_NO_SGI_IOSTREAMS -D_STLP_DEBUG_UNINITIALIZED -DEH_VECTOR_OPERATOR_NEW
check: $(TEST)
LIBS = -lstdcxx -lm
D_LIBSTLPORT = ../../lib/libstlport_djgpp_debug_static.a
LIBSTLPORT = ../../lib/libstlport_djgpp_stldebug_static.a
all: $(TEST_EXE) $(D_TEST_EXE) $(NOSGI_TEST_EXE)
check_nosgi: $(NOSGI_TEST)
check_d: $(D_TEST)
OBJDIR=obj
D_OBJDIR=d_obj
NOSGI_OBJDIR=nosgi_obj
$(OBJDIR):
mkdir obj
$(D_OBJDIR):
mkdir d_obj
$(NOSGI_OBJDIR):
mkdir nosgi_obj
$(TEST_EXE) : $(OBJDIR) $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBSTLPORT) $(LIBS) -o $(TEST_EXE)
$(D_TEST_EXE) : $(D_OBJDIR) $(D_OBJECTS)
$(CXX) $(D_CXXFLAGS) $(D_OBJECTS) $(D_LIBSTLPORT) $(LIBS) -o $(D_TEST_EXE)
$(NOSGI_TEST_EXE) : $(NOSGI_OBJDIR) $(NOSGI_OBJECTS)
$(CXX) $(NOSGI_CXXFLAGS) $(NOSGI_OBJECTS) $(LIBS) -o $(NOSGI_TEST_EXE)
$(TEST) : $(TEST_EXE)
$(TEST_EXE)
$(D_TEST) : $(D_TEST_EXE)
$(D_TEST_EXE)
$(NOSGI_TEST) : $(NOSGI_TEST_EXE)
$(NOSGI_TEST_EXE)
SUFFIXES: .cpp.o.exe.out.res
nosgi_obj/%.o : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -c -o $@
d_obj/%.o : %.cpp
$(CXX) $(D_CXXFLAGS) $< -c -o $@
obj/%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
nosgi_obj/%.i : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -E -H > $@
d_obj/%.i : %.cpp
$(CXX) $(D_CXXFLAGS) $< -E -H > $@
obj/%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBS) -o $*
./$* > $@
-rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
%.E: %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o */*.o *.rpo *.obj *.out core *~ Templates.DB

75
extern/STLport/5.2.1/test/eh/egcs.mak vendored Normal file
View File

@@ -0,0 +1,75 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
srcdir = .
VPATH = .
# point this to proper location
STL_INCL=../../stlport
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = ./eh_test
TEST = ./eh_test.out
CC = egcs-c++
CXX = $(CC)
# for egcs
REPO_FLAGS =
# CXXFLAGS = -g -Wall -I${STL_INCL} -I. -D_STLP_USE_NEWALLOC -D_STLP_DEBUG_ALLOC ${REPO_FLAGS} -DEH_NEW_HEADERS
# CXXFLAGS = -Wall -ansi -I${STL_INCL} -I. -D_STLP_DEBUG ${REPO_FLAGS} ${CXX_EXTRA_FLAGS}
CXXFLAGS = -Wall -g -D_STLP_USE_NEWALLOC -DNO_FAST_ALLOCATOR -ansi -I${STL_INCL} -I. ${REPO_FLAGS} ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -D_STLP_DEBUG -D_STLP_NO_DEBUG_EXCEPTIONS
# CXXFLAGS = -Wall -I${STL_INCL} -I. -D_STLP_USE_NEWALLOC ${REPO_FLAGS} ${CXX_EXTRA_FLAGS}
LIBS = -lm
LIBSTDCXX =
check: $(TEST)
$(TEST_EXE) : $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $(TEST_EXE)
$(TEST) : $(TEST_EXE)
$(TEST_EXE)
SUFFIXES: .cpp.o.exe.out.res
%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H -o $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBS) -o $*
./$* > $@
-rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
%.E: %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
clean:
-rm -fr ${TEST_EXE} $(OBJDIR) $(D_OBJDIR) $(NOSGI_OBJDIR) *.o *.rpo *.obj *.out core *~ Templates.DB

37
extern/STLport/5.2.1/test/eh/export vendored Normal file
View File

@@ -0,0 +1,37 @@
LeakCheck.h
Prefix.h
SortClass.h
TestClass.cpp
TestClass.h
Tests.h
ThrowCompare.h
export
gcc.mak
main.cpp
nc_alloc.cpp
nc_alloc.h
random_number.cpp
random_number.h
sunpro.mak
test_algo.cpp
test_algobase.cpp
test_assign_op.h
test_bit_vector.cpp
test_bitset.cpp
test_construct.h
test_deque.cpp
test_hash_map.cpp
test_hash_resize.h
test_hash_set.cpp
test_insert.h
test_list.cpp
test_map.cpp
test_push_back.h
test_push_front.h
test_rope.cpp
test_set.cpp
test_slist.cpp
test_string.cpp
test_valarray.cpp
test_vector.cpp
vc.mak

View File

@@ -0,0 +1,109 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
srcdir = .
VPATH = .
# point this to proper location
STL_INCL=-I../../stlport
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=obj/%.o) $(STAT_MODULE)
D_OBJECTS = $(LIST:%.cpp=d_obj/%.o) $(STAT_MODULE)
NOSGI_OBJECTS = $(LIST:%.cpp=nosgi_obj/%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = ./eh_test
D_TEST_EXE = ./eh_test_d
NOSGI_TEST_EXE = ./eh_test_nosgi
TEST = ./eh_test.out
D_TEST = ./eh_test_d.out
NOSGI_TEST = ./eh_test_nosgi.out
CC =c++
CXX = $(CC)
# dwa 12/22/99 -- had to turn off -ansi flag so we could use SGI IOSTREAMS
# also, test_slist won't compile with -O3/-O2 when targeting PPC. It fails
# in the assembler with 'invalid relocation type'
CXXFLAGS = -Wall -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -g -D_STLP_HAS_NO_NAMESPACES
D_CXXFLAGS = -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -D_STLP_DEBUG
NOSGI_CXXFLAGS = -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -D_STLP_NO_OWN_IOSTREAMS -DEH_VECTOR_OPERATOR_NEW
check: $(TEST)
LIBS = -lm
D_LIBSTLPORT = -L../../lib -lstlport_gcc_stldebug
LIBSTLPORT = -L../../lib -lstlport_gcc
all: $(TEST_EXE) $(D_TEST_EXE) $(NOSGI_TEST_EXE)
check_nosgi: $(NOSGI_TEST)
check_d: $(D_TEST)
$(TEST_EXE) : $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBSTLPORT) $(LIBS) -o $(TEST_EXE)
$(D_TEST_EXE) : $(D_OBJECTS)
$(CXX) $(D_CXXFLAGS) $(D_OBJECTS) $(D_LIBSTLPORT) $(LIBS) -o $(D_TEST_EXE)
$(NOSGI_TEST_EXE) : $(NOSGI_OBJECTS)
$(CXX) $(NOSGI_CXXFLAGS) $(NOSGI_OBJECTS) $(LIBS) -o $(NOSGI_TEST_EXE)
$(TEST) : $(TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" time ./$(TEST_EXE) -s 100
$(D_TEST) : $(D_TEST_EXE)
$(D_TEST_EXE)
$(NOSGI_TEST) : $(NOSGI_TEST_EXE)
$(NOSGI_TEST_EXE)
SUFFIXES: .cpp.o.exe.out.res
nosgi_obj/%.o : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -c -o $@
d_obj/%.o : %.cpp
$(CXX) $(D_CXXFLAGS) $< -c -o $@
obj/%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
nosgi_obj/%.i : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -E -H > $@
d_obj/%.i : %.cpp
$(CXX) $(D_CXXFLAGS) $< -E -H > $@
obj/%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -O2 -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBSTLPORT) $(LIBS) -o $*
./$* > $@
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
%.E: %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
clean:
-rm -fr ${TEST_EXE} $(D_TEST_EXE) *.o */*.o *.rpo *.obj *.out core *~ Templates.DB

View File

@@ -0,0 +1,119 @@
#
# This requires GNU make.
#
srcdir = .
VPATH = .
SHELL = /bin/sh
# point this to proper location
STL_INCL = -I../../stlport
AUX_LIST = TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST = test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST = ${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=obj/%.o) $(STAT_MODULE)
D_OBJECTS = $(LIST:%.cpp=d_obj/%.o) $(STAT_MODULE)
NOSGI_OBJECTS = $(LIST:%.cpp=nosgi_obj/%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = ./eh_test
D_TEST_EXE = ./eh_test_d
NOSGI_TEST_EXE = ./eh_test_nosgi
TEST = ./eh_test.out
D_TEST = ./eh_test_d.out
NOSGI_TEST = ./eh_test_nosgi.out
CC = gcc
CXX = g++
CXXFLAGS = -s -noixemul -m68020 -Wall -O2 ${STL_INCL} -I. -DEH_VECTOR_OPERATOR_NEW
D_CXXFLAGS = -Wall -g -O ${STL_INCL} -I. -DEH_VECTOR_OPERATOR_NEW -D_STLP_DEBUG -D_STLP_USE_STATIC_LIB
NOSGI_CXXFLAGS = -Wall -g -O2 ${STL_INCL} -I. -D_STLP_NO_OWN_IOSTREAMS -D_STLP_DEBUG_UNINITIALIZED -DEH_VECTOR_OPERATOR_NEW
check: $(TEST)
LIBS = -lm
D_LIBSTLPORT = -L../../lib -lstlport_gcc_stldebug
LIBSTLPORT = -L../../lib -lstlport_gcc
all: $(TEST_EXE)
check_nosgi: $(NOSGI_TEST)
check_d: $(D_TEST)
OBJDIR=obj
D_OBJDIR=d_obj
NOSGI_OBJDIR=nosgi_obj
$(OBJDIR):
mkdir obj
$(D_OBJDIR):
mkdir d_obj
$(NOSGI_OBJDIR):
mkdir nosgi_obj
$(TEST_EXE) : $(OBJDIR) $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBSTLPORT) $(LIBS) -o $(TEST_EXE)
$(D_TEST_EXE) : $(D_OBJDIR) $(D_OBJECTS)
$(CXX) $(D_CXXFLAGS) $(D_OBJECTS) $(D_LIBSTLPORT) $(LIBS) -o $(D_TEST_EXE)
$(NOSGI_TEST_EXE) : $(NOSGI_OBJDIR) $(NOSGI_OBJECTS)
$(CXX) $(NOSGI_CXXFLAGS) $(NOSGI_OBJECTS) $(LIBS) -o $(NOSGI_TEST_EXE)
$(TEST) : $(TEST_EXE)
$(TEST_EXE) -s 100
$(D_TEST) : $(D_TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" ./$(D_TEST_EXE) -s 100
$(NOSGI_TEST) : $(NOSGI_TEST_EXE)
$(NOSGI_TEST_EXE)
SUFFIXES: .cpp.o.exe.out.res
nosgi_obj/%.o : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -c -o $@
d_obj/%.o : %.cpp
$(CXX) $(D_CXXFLAGS) $< -c -o $@
obj/%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
nosgi_obj/%.i : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -E -H > $@
d_obj/%.i : %.cpp
$(CXX) $(D_CXXFLAGS) $< -E -H > $@
obj/%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBS) -o $*
./$* > $@
-rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
%.E: %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o */*.o *.rpo *.obj *.out core *~ Templates.DB

View File

@@ -0,0 +1,122 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
srcdir = .
VPATH = .
SHELL=/bin/sh
# point this to proper location
STL_INCL=-I../../stlport
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=obj/%.o) $(STAT_MODULE)
D_OBJECTS = $(LIST:%.cpp=d_obj/%.o) $(STAT_MODULE)
NOSGI_OBJECTS = $(LIST:%.cpp=nosgi_obj/%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = ./eh_test
D_TEST_EXE = ./eh_test_d
NOSGI_TEST_EXE = ./eh_test_nosgi
TEST = ./eh_test.out
D_TEST = ./eh_test_d.out
NOSGI_TEST = ./eh_test_nosgi.out
CC = g++
CXX = $(CC)
# dwa 12/22/99 -- had to turn off -ansi flag so we could use SGI IOSTREAMS
# also, test_slist won't compile with -O3/-O2 when targeting PPC. It fails
# in the assembler with 'invalid relocation type'
CXXFLAGS = -Wall -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW
D_CXXFLAGS = -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -D_STLP_DEBUG -D_STLP_USE_STATIC_LIB
NOSGI_CXXFLAGS = -Wall -g -O2 ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -D_STLP_NO_OWN_IOSTREAMS -D_STLP_DEBUG_UNINITIALIZED -DEH_VECTOR_OPERATOR_NEW
check: $(TEST)
LIBS = -lm
D_LIBSTLPORT = -L../../lib -lstlport_gcc_debug
LIBSTLPORT = -L../../lib -lstlport_gcc
all: $(TEST_EXE) $(D_TEST_EXE) $(NOSGI_TEST_EXE)
check_nosgi: $(NOSGI_TEST)
check_d: $(D_TEST)
OBJDIR=obj
D_OBJDIR=d_obj
NOSGI_OBJDIR=nosgi_obj
$(OBJDIR):
mkdir obj
$(D_OBJDIR):
mkdir d_obj
$(NOSGI_OBJDIR):
mkdir nosgi_obj
$(TEST_EXE) : $(OBJDIR) $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBSTLPORT) $(LIBS) -o $(TEST_EXE)
$(D_TEST_EXE) : $(D_OBJDIR) $(D_OBJECTS)
$(CXX) $(D_CXXFLAGS) $(D_OBJECTS) $(D_LIBSTLPORT) $(LIBS) -o $(D_TEST_EXE)
$(NOSGI_TEST_EXE) : $(NOSGI_OBJDIR) $(NOSGI_OBJECTS)
$(CXX) $(NOSGI_CXXFLAGS) $(NOSGI_OBJECTS) $(LIBS) -o $(NOSGI_TEST_EXE)
$(TEST) : $(TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" time ./$(TEST_EXE) -s 100
$(D_TEST) : $(D_TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" ./$(D_TEST_EXE) -s 100
$(NOSGI_TEST) : $(NOSGI_TEST_EXE)
$(NOSGI_TEST_EXE)
SUFFIXES: .cpp.o.exe.out.res
nosgi_obj/%.o : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -c -o $@
d_obj/%.o : %.cpp
$(CXX) $(D_CXXFLAGS) $< -c -o $@
obj/%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
nosgi_obj/%.i : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -E -H > $@
d_obj/%.i : %.cpp
$(CXX) $(D_CXXFLAGS) $< -E -H > $@
obj/%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBSTLPORT) $(LIBS) -o $*
./$* > $@
# -rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
%.E: %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o */*.o *.rpo *.obj *.out core *~ Templates.DB

View File

@@ -0,0 +1,123 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
srcdir = .
VPATH = .
SHELL=/bin/sh
# point this to proper location
STL_INCL=-I../../stlport
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=obj/%.o) $(STAT_MODULE)
D_OBJECTS = $(LIST:%.cpp=d_obj/%.o) $(STAT_MODULE)
NOSGI_OBJECTS = $(LIST:%.cpp=nosgi_obj/%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = ./eh_test
D_TEST_EXE = ./eh_test_d
NOSGI_TEST_EXE = ./eh_test_nosgi
TEST = ./eh_test.out
D_TEST = ./eh_test_d.out
NOSGI_TEST = ./eh_test_nosgi.out
CC = c++ -pthread
CXX = $(CC)
# dwa 12/22/99 -- had to turn off -ansi flag so we could use SGI IOSTREAMS
# also, test_slist won't compile with -O3/-O2 when targeting PPC. It fails
# in the assembler with 'invalid relocation type'
CXXFLAGS = -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW
D_CXXFLAGS = -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -D_STLP_DEBUG -D_STLP_USE_STATIC_LIB
NOSGI_CXXFLAGS = -Wall -g -O2 ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -D_STLP_NO_OWN_IOSTREAMS -D_STLP_DEBUG_UNINITIALIZED -DEH_VECTOR_OPERATOR_NEW
check: $(TEST)
LIBS = -lm
D_LIBSTLPORT = -L../../lib -lstlport_gcc_stldebug
LIBSTLPORT = -L../../lib -lstlport_gcc
all: $(TEST_EXE) $(D_TEST_EXE) $(NOSGI_TEST_EXE)
check_nosgi: $(NOSGI_TEST)
check_d: $(D_TEST)
OBJDIR=obj
D_OBJDIR=d_obj
NOSGI_OBJDIR=nosgi_obj
$(OBJDIR):
mkdir obj
$(D_OBJDIR):
mkdir d_obj
$(NOSGI_OBJDIR):
mkdir nosgi_obj
$(TEST_EXE) : $(OBJDIR) $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBSTLPORT) $(LIBS) -o $(TEST_EXE)
$(D_TEST_EXE) : $(D_OBJDIR) $(D_OBJECTS)
$(CXX) $(D_CXXFLAGS) $(D_OBJECTS) $(D_LIBSTLPORT) $(LIBS) -o $(D_TEST_EXE)
$(NOSGI_TEST_EXE) : $(NOSGI_OBJDIR) $(NOSGI_OBJECTS)
$(CXX) $(NOSGI_CXXFLAGS) $(NOSGI_OBJECTS) $(LIBS) -o $(NOSGI_TEST_EXE)
$(TEST) : $(TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" ./$(TEST_EXE) -s 100
$(D_TEST) : $(D_TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" ./$(D_TEST_EXE) -s 100
$(NOSGI_TEST) : $(NOSGI_TEST_EXE)
$(NOSGI_TEST_EXE)
SUFFIXES: .cpp.o.exe.out.res
nosgi_obj/%.o : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -c -o $@
d_obj/%.o : %.cpp
$(CXX) $(D_CXXFLAGS) $< -c -o $@
obj/%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
nosgi_obj/%.i : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -E -H > $@
d_obj/%.i : %.cpp
$(CXX) $(D_CXXFLAGS) $< -E -H > $@
obj/%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBS) -o $*
./$* > $@
-rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
%.E: %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o */*.o *.rpo *.obj *.out core *~ Templates.DB

View File

@@ -0,0 +1,123 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
srcdir = .
VPATH = .
SHELL=/bin/sh
# point this to proper location
STL_INCL=-I../../stlport
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=obj/%.o) $(STAT_MODULE)
D_OBJECTS = $(LIST:%.cpp=d_obj/%.o) $(STAT_MODULE)
NOSGI_OBJECTS = $(LIST:%.cpp=nosgi_obj/%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = ./eh_test
D_TEST_EXE = ./eh_test_d
NOSGI_TEST_EXE = ./eh_test_nosgi
TEST = ./eh_test.out
D_TEST = ./eh_test_d.out
NOSGI_TEST = ./eh_test_nosgi.out
# CC = g++ -pthreads
CC = g++ -D_REENTRANT -D_POSIX_C_SOURCE=199506L -D__EXTENSIONS__
CXX = $(CC)
# dwa 12/22/99 -- had to turn off -ansi flag so we could use SGI IOSTREAMS
# also, test_slist won't compile with -O3/-O2 when targeting PPC. It fails
# in the assembler with 'invalid relocation type'
CXXFLAGS = -Wall -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW
D_CXXFLAGS = -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -D_STLP_DEBUG -D_STLP_USE_STATIC_LIB
NOSGI_CXXFLAGS = -Wall -g -O2 ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -D_STLP_NO_OWN_IOSTREAMS -D_STLP_DEBUG_UNINITIALIZED -DEH_VECTOR_OPERATOR_NEW
check: $(TEST)
LIBS = -lpthread -lm
D_LIBSTLPORT = -L../../lib -lstlport_gcc_debug
LIBSTLPORT = -L../../lib -lstlport_gcc
all: $(TEST_EXE) $(D_TEST_EXE) $(NOSGI_TEST_EXE)
check_nosgi: $(NOSGI_TEST)
check_d: $(D_TEST)
OBJDIR=obj
D_OBJDIR=d_obj
NOSGI_OBJDIR=nosgi_obj
$(OBJDIR):
mkdir obj
$(D_OBJDIR):
mkdir d_obj
$(NOSGI_OBJDIR):
mkdir nosgi_obj
$(TEST_EXE) : $(OBJDIR) $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBSTLPORT) $(LIBS) -o $(TEST_EXE)
$(D_TEST_EXE) : $(D_OBJDIR) $(D_OBJECTS)
$(CXX) $(D_CXXFLAGS) $(D_OBJECTS) $(D_LIBSTLPORT) $(LIBS) -o $(D_TEST_EXE)
$(NOSGI_TEST_EXE) : $(NOSGI_OBJDIR) $(NOSGI_OBJECTS)
$(CXX) $(NOSGI_CXXFLAGS) $(NOSGI_OBJECTS) $(LIBS) -o $(NOSGI_TEST_EXE)
$(TEST) : $(TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" time ./$(TEST_EXE) -s 100
$(D_TEST) : $(D_TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" ./$(D_TEST_EXE) -s 100
$(NOSGI_TEST) : $(NOSGI_TEST_EXE)
$(NOSGI_TEST_EXE)
SUFFIXES: .cpp.o.exe.out.res
nosgi_obj/%.o : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -c -o $@
d_obj/%.o : %.cpp
$(CXX) $(D_CXXFLAGS) $< -c -o $@
obj/%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
nosgi_obj/%.i : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -E -H > $@
d_obj/%.i : %.cpp
$(CXX) $(D_CXXFLAGS) $< -E -H > $@
obj/%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -D_STLP_DEBUG -D_STLP_NO_OWN_IOSTREAMS -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBSTLPORT) $(LIBS) -o $*
./$* > $@
# -rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
%.E: %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o */*.o *.rpo *.obj *.out core *~ Templates.DB

View File

@@ -0,0 +1,122 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
srcdir = .
VPATH = .
SHELL=/bin/sh
# point this to proper location
STL_INCL=-I../../stlport
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=obj/%.o) $(STAT_MODULE)
D_OBJECTS = $(LIST:%.cpp=d_obj/%.o) $(STAT_MODULE)
NOSGI_OBJECTS = $(LIST:%.cpp=nosgi_obj/%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = ./eh_test
D_TEST_EXE = ./eh_test_d
NOSGI_TEST_EXE = ./eh_test_nosgi
TEST = ./eh_test.out
D_TEST = ./eh_test_d.out
NOSGI_TEST = ./eh_test_nosgi.out
CC = g++
CXX = $(CC)
# dwa 12/22/99 -- had to turn off -ansi flag so we could use SGI IOSTREAMS
# also, test_slist won't compile with -O3/-O2 when targeting PPC. It fails
# in the assembler with 'invalid relocation type'
CXXFLAGS = -Wall -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW
D_CXXFLAGS = -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -D_STLP_DEBUG -D_STLP_USE_STATIC_LIB
NOSGI_CXXFLAGS = -Wall -g -O2 ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -D_STLP_NO_OWN_IOSTREAMS -D_STLP_DEBUG_UNINITIALIZED -DEH_VECTOR_OPERATOR_NEW
check: $(TEST)
LIBS = -lm
D_LIBSTLPORT = -L../../lib -lstlport_gcc_debug
LIBSTLPORT = -L../../lib -lstlport_gcc
all: $(TEST_EXE) $(D_TEST_EXE) $(NOSGI_TEST_EXE)
check_nosgi: $(NOSGI_TEST)
check_d: $(D_TEST)
OBJDIR=obj
D_OBJDIR=d_obj
NOSGI_OBJDIR=nosgi_obj
$(OBJDIR):
mkdir obj
$(D_OBJDIR):
mkdir obj
$(NOSGI_OBJDIR):
mkdir obj
$(TEST_EXE) : $(OBJDIR) $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBSTLPORT) $(LIBS) -o $(TEST_EXE)
$(D_TEST_EXE) : $(D_OBJDIR) $(D_OBJECTS)
$(CXX) $(D_CXXFLAGS) $(D_OBJECTS) $(D_LIBSTLPORT) $(LIBS) -o $(D_TEST_EXE)
$(NOSGI_TEST_EXE) : $(NOSGI_OBJDIR) $(NOSGI_OBJECTS)
$(CXX) $(NOSGI_CXXFLAGS) $(NOSGI_OBJECTS) $(LIBS) -o $(NOSGI_TEST_EXE)
$(TEST) : $(TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" time ./$(TEST_EXE) -s 100
$(D_TEST) : $(D_TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" ./$(D_TEST_EXE) -s 100
$(NOSGI_TEST) : $(NOSGI_TEST_EXE)
$(NOSGI_TEST_EXE)
SUFFIXES: .cpp.o.exe.out.res
nosgi_obj/%.o : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -c -o $@
d_obj/%.o : %.cpp
$(CXX) $(D_CXXFLAGS) $< -c -o $@
obj/%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
nosgi_obj/%.i : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -E -H > $@
d_obj/%.i : %.cpp
$(CXX) $(D_CXXFLAGS) $< -E -H > $@
obj/%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -D_STLP_DEBUG -D_STLP_NO_OWN_IOSTREAMS -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBSTLPORT) $(LIBS) -o $*
./$* > $@
# -rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
%.E: %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o */*.o *.rpo *.obj *.out core *~ Templates.DB

View File

@@ -0,0 +1,120 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
SHELL=/bin/sh
srcdir = .
VPATH = .
# point this to proper location
STL_INCL=-I../../stlport
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=obj/%.o) $(STAT_MODULE)
D_OBJECTS = $(LIST:%.cpp=d_obj/%.o) $(STAT_MODULE)
NOSGI_OBJECTS = $(LIST:%.cpp=nosgi_obj/%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = ./eh_test
D_TEST_EXE = ./eh_test_d
NOSGI_TEST_EXE = ./eh_test_nosgi
TEST = ./eh_test.out
D_TEST = ./eh_test_d.out
NOSGI_TEST = ./eh_test_nosgi.out
CC = c++ -pthread
CXX = $(CC)
# dwa 12/22/99 -- had to turn off -ansi flag so we could use SGI IOSTREAMS
# also, test_slist won't compile with -O3/-O2 when targeting PPC. It fails
# in the assembler with 'invalid relocation type'
CXXFLAGS = -Wall ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW
D_CXXFLAGS = -Wall -g ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -D_STLP_DEBUG -D_STLP_USE_STATIC_LIB
NOSGI_CXXFLAGS = -Wall -g -O2 ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -D_STLP_NO_OWN_IOSTREAMS -D_STLP_DEBUG_UNINITIALIZED -DEH_VECTOR_OPERATOR_NEW
check: $(TEST)
LIBS = -lm
D_LIBSTLPORT = -L../../lib -lstlport_gcc_stldebug
LIBSTLPORT = -L../../lib -lstlport_gcc
all: $(TEST_EXE) $(D_TEST_EXE) $(NOSGI_TEST_EXE)
check_nosgi: $(NOSGI_TEST)
check_d: $(D_TEST)
OBJDIR=obj
D_OBJDIR=d_obj
NOSGI_OBJDIR=nosgi_obj
$(OBJDIR):
mkdir obj
$(D_OBJDIR):
mkdir d_obj
$(NOSGI_OBJDIR):
mkdir nosgi_obj
$(TEST_EXE) : $(OBJDIR) $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBSTLPORT) $(LIBS) -o $(TEST_EXE)
$(D_TEST_EXE) : $(D_OBJDIR) $(D_OBJECTS)
$(CXX) $(D_CXXFLAGS) $(D_OBJECTS) $(D_LIBSTLPORT) $(LIBS) -o $(D_TEST_EXE)
$(NOSGI_TEST_EXE) : $(NOSGI_OBJDIR) $(NOSGI_OBJECTS)
$(CXX) $(NOSGI_CXXFLAGS) $(NOSGI_OBJECTS) $(LIBS) -o $(NOSGI_TEST_EXE)
$(TEST) : $(TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" ./$(TEST_EXE) -s 100
$(D_TEST) : $(D_TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" ./$(D_TEST_EXE) -s 100
$(NOSGI_TEST) : $(NOSGI_TEST_EXE)
$(NOSGI_TEST_EXE)
SUFFIXES: .cpp.o.exe.out.res
nosgi_obj/%.o : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -c -o $@
d_obj/%.o : %.cpp
$(CXX) $(D_CXXFLAGS) $< -c -o $@
obj/%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
nosgi_obj/%.i : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -E -H > $@
d_obj/%.i : %.cpp
$(CXX) $(D_CXXFLAGS) $< -E -H > $@
obj/%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(D_CXXFLAGS) $< -c -USINGLE -DMAIN -o $*.o
$(CXX) $(D_CXXFLAGS) $*.o $(LIBS) $(D_LIBSTLPORT) -o $*
./$* > $@
# -rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
%.E: %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o */*.o *.rpo *.obj *.out core *~ Templates.DB

View File

@@ -0,0 +1,122 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
srcdir = .
VPATH = .
SHELL=/bin/sh
# point this to proper location
STL_INCL=-I../../stlport
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=obj/%.o) $(STAT_MODULE)
D_OBJECTS = $(LIST:%.cpp=d_obj/%.o) $(STAT_MODULE)
NOSGI_OBJECTS = $(LIST:%.cpp=nosgi_obj/%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = ./eh_test
D_TEST_EXE = ./eh_test_d
NOSGI_TEST_EXE = ./eh_test_nosgi
TEST = ./eh_test.out
D_TEST = ./eh_test_d.out
NOSGI_TEST = ./eh_test_nosgi.out
CC = c++
CXX = $(CC)
# dwa 12/22/99 -- had to turn off -ansi flag so we could use SGI IOSTREAMS
# also, test_slist won't compile with -O3/-O2 when targeting PPC. It fails
# in the assembler with 'invalid relocation type'
CXXFLAGS = -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW
D_CXXFLAGS = -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -D_STLP_DEBUG -D_STLP_USE_STATIC_LIB
NOSGI_CXXFLAGS = -Wall -g -O2 ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -D_STLP_NO_OWN_IOSTREAMS -D_STLP_DEBUG_UNINITIALIZED -DEH_VECTOR_OPERATOR_NEW
check: $(TEST)
LIBS = -lm -lpthread
D_LIBSTLPORT = -L../../lib -R../../lib -lstlport_gcc_stldebug
LIBSTLPORT = -L../../lib -R../../lib -lstlport_gcc
all: $(TEST_EXE) $(D_TEST_EXE) $(NOSGI_TEST_EXE)
check_nosgi: $(NOSGI_TEST)
check_d: $(D_TEST)
OBJDIR=obj
D_OBJDIR=d_obj
NOSGI_OBJDIR=nosgi_obj
$(OBJDIR):
mkdir obj
$(D_OBJDIR):
mkdir d_obj
$(NOSGI_OBJDIR):
mkdir nosgi_obj
$(TEST_EXE) : $(OBJDIR) $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBSTLPORT) $(LIBS) -o $(TEST_EXE)
$(D_TEST_EXE) : $(D_OBJDIR) $(D_OBJECTS)
$(CXX) $(D_CXXFLAGS) $(D_OBJECTS) $(D_LIBSTLPORT) $(LIBS) -o $(D_TEST_EXE)
$(NOSGI_TEST_EXE) : $(NOSGI_OBJDIR) $(NOSGI_OBJECTS)
$(CXX) $(NOSGI_CXXFLAGS) $(NOSGI_OBJECTS) $(LIBS) -o $(NOSGI_TEST_EXE)
$(TEST) : $(TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" ./$(TEST_EXE) -s 100
$(D_TEST) : $(D_TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" ./$(D_TEST_EXE) -s 100
$(NOSGI_TEST) : $(NOSGI_TEST_EXE)
$(NOSGI_TEST_EXE)
SUFFIXES: .cpp.o.exe.out.res
nosgi_obj/%.o : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -c -o $@
d_obj/%.o : %.cpp
$(CXX) $(D_CXXFLAGS) $< -c -o $@
obj/%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
nosgi_obj/%.i : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -E -H > $@
d_obj/%.i : %.cpp
$(CXX) $(D_CXXFLAGS) $< -E -H > $@
obj/%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBS) -o $*
./$* > $@
-rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
%.E: %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o */*.o *.rpo *.obj *.out core *~ Templates.DB

122
extern/STLport/5.2.1/test/eh/gcc.mak vendored Normal file
View File

@@ -0,0 +1,122 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
srcdir = .
VPATH = .
SHELL=/bin/sh
# point this to proper location
STL_INCL=-I../../stlport
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=obj/%.o) $(STAT_MODULE)
D_OBJECTS = $(LIST:%.cpp=d_obj/%.o) $(STAT_MODULE)
NOSGI_OBJECTS = $(LIST:%.cpp=nosgi_obj/%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = ./eh_test
D_TEST_EXE = ./eh_test_d
NOSGI_TEST_EXE = ./eh_test_nosgi
TEST = ./eh_test.out
D_TEST = ./eh_test_d.out
NOSGI_TEST = ./eh_test_nosgi.out
CC = g++ -pthread
CXX = $(CC)
# dwa 12/22/99 -- had to turn off -ansi flag so we could use SGI IOSTREAMS
# also, test_slist won't compile with -O3/-O2 when targeting PPC. It fails
# in the assembler with 'invalid relocation type'
CXXFLAGS = -Wall -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW
D_CXXFLAGS = -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -D_STLP_DEBUG -D_STLP_USE_STATIC_LIB
NOSGI_CXXFLAGS = -Wall -g -O2 ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -D_STLP_NO_OWN_IOSTREAMS -D_STLP_DEBUG_UNINITIALIZED -DEH_VECTOR_OPERATOR_NEW
check: $(TEST)
LIBS = -lm
D_LIBSTLPORT = -L../../lib -lstlport_gcc_debug
LIBSTLPORT = -L../../lib -lstlport_gcc
all: $(TEST_EXE) $(D_TEST_EXE) $(NOSGI_TEST_EXE)
check_nosgi: $(NOSGI_TEST)
check_d: $(D_TEST)
OBJDIR=obj
D_OBJDIR=d_obj
NOSGI_OBJDIR=nosgi_obj
$(OBJDIR):
mkdir obj
$(D_OBJDIR):
mkdir d_obj
$(NOSGI_OBJDIR):
mkdir nosgi_obj
$(TEST_EXE) : $(OBJDIR) $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBSTLPORT) $(LIBS) -o $(TEST_EXE)
$(D_TEST_EXE) : $(D_OBJDIR) $(D_OBJECTS)
$(CXX) $(D_CXXFLAGS) $(D_OBJECTS) $(D_LIBSTLPORT) $(LIBS) -o $(D_TEST_EXE)
$(NOSGI_TEST_EXE) : $(NOSGI_OBJDIR) $(NOSGI_OBJECTS)
$(CXX) $(NOSGI_CXXFLAGS) $(NOSGI_OBJECTS) $(LIBS) -o $(NOSGI_TEST_EXE)
$(TEST) : $(TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" time ./$(TEST_EXE) -s 100
$(D_TEST) : $(D_TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" ./$(D_TEST_EXE) -s 100
$(NOSGI_TEST) : $(NOSGI_TEST_EXE)
$(NOSGI_TEST_EXE)
SUFFIXES: .cpp.o.exe.out.res
nosgi_obj/%.o : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -c -o $@
d_obj/%.o : %.cpp
$(CXX) $(D_CXXFLAGS) $< -c -o $@
obj/%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
nosgi_obj/%.i : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -E -H > $@
d_obj/%.i : %.cpp
$(CXX) $(D_CXXFLAGS) $< -E -H > $@
obj/%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBSTLPORT) $(LIBS) -o $*
./$* > $@
# -rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
%.E: %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o */*.o *.rpo *.obj *.out core *~ Templates.DB

93
extern/STLport/5.2.1/test/eh/gcc7.mak vendored Normal file
View File

@@ -0,0 +1,93 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
srcdir = .
VPATH = .
# point this to proper location
STL_INCL=-I../../stlport
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=obj/%.o) $(STAT_MODULE)
D_OBJECTS = $(LIST:%.cpp=d_obj/%.o) $(STAT_MODULE)
NOSGI_OBJECTS = $(LIST:%.cpp=nosgi_obj/%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = ./eh_test
D_TEST_EXE = ./eh_test_d
NOSGI_TEST_EXE = ./eh_test_nosgi
TEST = ./eh_test.out
D_TEST = ./eh_test_d.out
NOSGI_TEST = ./eh_test_nosgi.out
CC = c++
CXX = $(CC)
CXXFLAGS = -Wall -fhandle-exceptions -g ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -D_STLP_NO_OWN_IOSTREAMS -D_STLP_DEBUG_UNINITIALIZED
check: $(TEST)
LIBS = -lm
D_LIBSTLPORT = -L../../lib -lstlport_gcc_debug
LIBSTLPORT = -L../../lib -lstlport_gcc
all: $(TEST_EXE) $(D_TEST_EXE) $(NOSGI_TEST_EXE)
check_nosgi: $(NOSGI_TEST)
check_d: $(D_TEST)
$(TEST_EXE) : $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $(TEST_EXE)
$(TEST) : $(TEST_EXE)
$(TEST_EXE)
$(D_TEST) : $(D_TEST_EXE)
$(D_TEST_EXE)
$(NOSGI_TEST) : $(NOSGI_TEST_EXE)
$(NOSGI_TEST_EXE)
SUFFIXES: .cpp.o.exe.out.res
nosgi_obj/%.o : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -c -o $@
d_obj/%.o : %.cpp
$(CXX) $(D_CXXFLAGS) $< -c -o $@
obj/%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
obj/%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBS) -o $*
./$* > $@
-rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
%.E: %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o */*.o *.rpo *.obj *.out core *~ Templates.DB

81
extern/STLport/5.2.1/test/eh/hp.mak vendored Normal file
View File

@@ -0,0 +1,81 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
# SHELL=/bin/sh
# srcdir = .
# VPATH = .
# point this to proper location
STL_INCL= -I../../stlport
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
OBJECTS = test_algo.o \
test_algobase.o test_list.o test_slist.o \
test_bit_vector.o test_vector.o \
test_deque.o test_set.o test_map.o \
test_hash_map.o test_hash_set.o test_rope.o \
test_string.o test_bitset.o test_valarray.o
LIST=${AUX_LIST} ${TEST_LIST}
# OBJECTS = $(LIST:%.cpp=%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = eh_test
TEST = eh_test.out
CC = CC
CXX = $(CC)
CXXFLAGS = -w ${STL_INCL} -D_STLP_NO_CUSTOM_IO
LIBS = -lm
LIBSTLPORT = -L../../lib -lstlport_hp
check: $(TEST)
all: $(TEST_EXE)
echo done.
$(TEST_EXE) : $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) ${LIBSTLPORT} $(LIBS) -o $(TEST_EXE)
$(TEST) : $(TEST_EXE)
$(TEST_EXE)
SUFFIXES: .cpp .o .i .s .out .res .y
.cpp.o :
$(CXX) $(CXXFLAGS) $< -c -o $@
.cpp.i :
$(CXX) $(CXXFLAGS) $< -E -H > $@
.cpp.out:
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBS) -o $*
./$* -q
-rm -f $*
.cpp.s:
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o *.rpo *.obj *.out core *~ Templates.DB SunWS_cache

119
extern/STLport/5.2.1/test/eh/hpacc.mak vendored Normal file
View File

@@ -0,0 +1,119 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
srcdir = .
VPATH = .
# point this to proper location
STL_INCL=-I../../stlport
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=obj/%.o) $(STAT_MODULE)
D_OBJECTS = $(LIST:%.cpp=d_obj/%.o) $(STAT_MODULE)
NOSGI_OBJECTS = $(LIST:%.cpp=nosgi_obj/%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = ./eh_test
D_TEST_EXE = ./eh_test_d
NOSGI_TEST_EXE = ./eh_test_nosgi
TEST = ./eh_test.out
D_TEST = ./eh_test_d.out
NOSGI_TEST = ./eh_test_nosgi.out
CC = aCC
CXX = $(CC)
CXX_EXTRA_FLAGS = -AA -DEH_DELETE_HAS_THROW_SPEC
# dwa 12/22/99 -- had to turn off -ansi flag so we could use SGI IOSTREAMS
# also, test_slist won't compile with -O3/-O2 when targeting PPC. It fails
# in the assembler with 'invalid relocation type'
CXXFLAGS = -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW
D_CXXFLAGS = -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -D_STLP_DEBUG -D_STLP_USE_STATIC_LIB
NOSGI_CXXFLAGS = -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -D_STLP_NO_OWN_IOSTREAMS -D_STLP_DEBUG_UNINITIALIZED -DEH_VECTOR_OPERATOR_NEW
check: $(TEST)
HP_VERSION=$(shell uname -r)
ifeq (${HP_VERSION},B.10.20)
PTHREAD_LIB=-lcma
else
PTHREAD_LIB=-lpthread +nostl
endif
LIBS = $(PTHREAD_LIB) -lm
D_LIBSTLPORT = -L../../lib -lstlport_aCC_debug
LIBSTLPORT = -L../../lib -lstlport_aCC
all: $(TEST_EXE) $(D_TEST_EXE) $(NOSGI_TEST_EXE)
check_nosgi: $(NOSGI_TEST)
check_d: $(D_TEST)
$(TEST_EXE) : $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBSTLPORT) $(LIBS) -o $(TEST_EXE)
$(D_TEST_EXE) : $(D_OBJECTS)
$(CXX) $(D_CXXFLAGS) $(D_OBJECTS) $(D_LIBSTLPORT) $(LIBS) -o $(D_TEST_EXE)
$(NOSGI_TEST_EXE) : $(NOSGI_OBJECTS)
$(CXX) $(NOSGI_CXXFLAGS) $(NOSGI_OBJECTS) $(LIBS) -o $(NOSGI_TEST_EXE)
$(TEST) : $(TEST_EXE)
$(TEST_EXE)
$(D_TEST) : $(D_TEST_EXE)
$(D_TEST_EXE)
$(NOSGI_TEST) : $(NOSGI_TEST_EXE)
$(NOSGI_TEST_EXE)
SUFFIXES: .cpp.o.exe.out.res
nosgi_obj/%.o : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -c -o $@
d_obj/%.o : %.cpp
$(CXX) $(D_CXXFLAGS) $< -c -o $@
obj/%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
nosgi_obj/%.i : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -E -H > $@
d_obj/%.i : %.cpp
$(CXX) $(D_CXXFLAGS) $< -E -H > $@
obj/%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBS) -o $*
./$* > $@
-rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
%.E: %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o */*.o *.rpo *.obj *.out core *~ Templates.DB

69
extern/STLport/5.2.1/test/eh/intel.mak vendored Normal file
View File

@@ -0,0 +1,69 @@
# Microsoft Developer Studio Generated NMAKE File, Format Version 4.10
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
################################################################################
# Begin Project
RSC=rc.exe
CPP=icl.exe
F90=fl32.exe
OUTDIR=.
INTDIR=.
# set this directories
STL_INCL=../../stlport
VC_INCL=.
# d:/vc41/msdev/include
Dep_stl = TestClass.obj main.obj nc_alloc.obj \
random_number.obj test_algo.obj test_algobase.obj test_bit_vector.obj test_deque.obj \
test_hash_map.obj test_hash_set.obj test_list.obj test_map.obj test_rope.obj test_set.obj \
test_slist.obj test_vector.obj test_string.obj test_bitset.obj test_valarray.obj
LINK32=link.exe
CPP_PROJ=/nologo /W3 /GX /D "WIN32" /MTd /Zi /Gm /Od /D "_CONSOLE" /I$(STL_INCL) /I. /D_DEBUG
CPP_LIBS = /link /libpath:"..\..\lib"
check: eh_test.out
eh_test.out : $(Dep_stl)
$(CPP) $(CPP_PROJ) $(Dep_stl) -o eh_test.exe $(CPP_LIBS)
.\eh_test.exe
echo done
clean :
-@erase "$(INTDIR)\*.obj"
-@erase "$(OUTDIR)\*.exe"
-@erase "$(OUTDIR)\*.obj"
.exe.out:
$< > $@
.cpp.exe:
$(CPP) $(CPP_PROJ) -DMAIN $< $(CPP_LIBS)
.c.obj:
$(CPP) $(CPP_PROJ) /c $<
.cpp.obj:
$(CPP) $(CPP_PROJ) /c $<
.cxx.obj:
$(CPP) $(CPP_PROJ) /c $<
.cpp.E:
$(CPP) $(CPP_PROJ) -E $< >$*.E
.cpp.sbr:
$(CPP) $(CPP_PROJ) $<

109
extern/STLport/5.2.1/test/eh/intel45.mak vendored Normal file
View File

@@ -0,0 +1,109 @@
# Microsoft Developer Studio Generated NMAKE File, Format Version 4.10
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
################################################################################
# Begin Project
RSC=rc.exe
CPP=icl.exe
LINK32=xilink.exe
OUTDIR=.
INTDIR=.
# set this directories
STL_PATH=..\..
Dep_stl = TestClass.obj main.obj nc_alloc.obj \
random_number.obj test_algo.obj test_algobase.obj test_bit_vector.obj test_deque.obj \
test_hash_map.obj test_hash_set.obj test_list.obj test_map.obj test_rope.obj test_set.obj \
test_slist.obj test_vector.obj test_string.obj test_bitset.obj test_valarray.obj
CPP_LIBS = /link /incremental:no /LIBPATH:$(STL_PATH)\lib
#disable warnings complaining about debug ...info exceeded....
CPP_PRJ_EXTRA = /Qwd985
CPP_PRJ_CMN = /nologo /W3 /GR /GX /DWIN32 /D_WINDOWS /D_CONSOLE /I$(STL_PATH)\stlport /I.
#
LIBTYPE = STATIC
# LIBTYPE = DYNAMIC
#
#DEBUG = STL
DEBUG = ON
#DEBUG =
#
IOS = SGI
#IOS = NOSGI
#IOS = NONE
!IF "$(IOS)" == "NOSGI"
CPP_PRJ_IOS = /D_STLP_NO_OWN_IOSTREAMS
!ELSEIF "$(IOS)" == "NONE"
CPP_PRJ_IOS = /D_STLP_NO_IOSTREAM
!ELSE
CPP_PRJ_IOS =
!ENDIF
#MT/MD etc should be LAST in CPP_PRJ_LIBTYP string!!!
#Library selection should be BEFORE debug processing!!!
!IF "$(LIBTYPE)" == "STATIC"
CPP_PRJ_LIBTYP = /MT
!ELSE
CPP_PRJ_LIBTYP = /MD
!ENDIF
!IF "$(DEBUG)" == ""
CPP_PRJ_DBG = /DNDEBUG /O2 /Qsox-
!ELSE
CPP_PRJ_LIBTYP = $(CPP_PRJ_LIBTYP)d
CPP_PRJ_DBG = /D_DEBUG /Od
!IF "$(DEBUG)" == "STL"
CPP_PRJ_DBG = $(CPP_PRJ_DBG) /D_STLP_DEBUG
!ENDIF
CPP_PRJ_CMN = $(CPP_PRJ_CMN) /Zi /Gm
!ENDIF
CPP_PROJ = $(CPP_PRJ_CMN) $(CPP_PRJ_EXTRA) $(CPP_PRJ_IOS) $(CPP_PRJ_LIBTYP) $(CPP_PRJ_DBG)
check: eh_test.out
eh_test.out : $(Dep_stl)
$(CPP) $(CPP_PROJ) $(Dep_stl) /Feeh_test.exe $(CPP_LIBS)
cd ..\..\lib
..\test\eh\eh_test.exe -s 100
echo done
clean :
-@erase "$(INTDIR)\*.obj"
-@erase "$(OUTDIR)\*.exe"
-@erase "$(OUTDIR)\*.obj"
.exe.out:
$< > $@
.cpp.exe:
$(CPP) $(CPP_PROJ) -DMAIN $<
.c.obj:
$(CPP) $(CPP_PROJ) /c $<
.cpp.obj:
$(CPP) $(CPP_PROJ) /c $<
.cxx.obj:
$(CPP) $(CPP_PROJ) /c $<
.cpp.E:
$(CPP) $(CPP_PROJ) -E $< >$*.E
.cpp.sbr:
$(CPP) $(CPP_PROJ) $<

115
extern/STLport/5.2.1/test/eh/intel50.mak vendored Normal file
View File

@@ -0,0 +1,115 @@
# Microsoft Developer Studio Generated NMAKE File, Format Version 4.10
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
################################################################################
# Begin Project
RSC=rc.exe
CPP=icl.exe
LINK32=xilink.exe
OUTDIR=.
INTDIR=.
# set this directories
STL_PATH=..\..
Dep_stl = TestClass.obj main.obj nc_alloc.obj \
random_number.obj test_algo.obj test_algobase.obj test_bit_vector.obj test_deque.obj \
test_hash_map.obj test_hash_set.obj test_list.obj test_map.obj test_rope.obj test_set.obj \
test_slist.obj test_vector.obj test_string.obj test_bitset.obj test_valarray.obj
# linker finds proper STLport lib automatically, only path to the library is needed
CPP_PRJ_LINK = /link /incremental:no /LIBPATH:$(STL_PATH)\lib
#disable warnings complaining about debug ...info exceeded....
CPP_PRJ_EXTRA = /Qwd985
CPP_PRJ_CMN = /nologo /W3 /GR /GX /DWIN32 /D_WINDOWS /D_CONSOLE /I$(STL_PATH)\stlport /I.
#
LIBTYPE = STATIC
# LIBTYPE = DYNAMIC
#
#DEBUG = STL
DEBUG = ON
#DEBUG =
#
IOS = SGI
#IOS = NOSGI
#IOS = NONE
!IF "$(IOS)" == "NOSGI"
CPP_PRJ_IOS = /D_STLP_NO_SGI_IOSTREAMS
!ELSEIF "$(IOS)" == "NONE"
CPP_PRJ_IOS = /D_STLP_NO_IOSTREAM
!ELSE
CPP_PRJ_IOS =
!ENDIF
#MT/MD etc should be LAST in CPP_PRJ_LIBTYP string!!!
#Library selection should be BEFORE debug processing!!!
!IF "$(LIBTYPE)" == "STATIC"
CPP_PRJ_LIBTYP = /D_STLP_USE_STATIC_LIB /MT
!ELSE
CPP_PRJ_LIBTYP = /D_STLP_USE_DYNAMIC_LIB /MD
!ENDIF
!IF "$(DEBUG)" == ""
CPP_PRJ_DBG = /DNDEBUG /O2 /Qsox-
!ELSE
CPP_PRJ_LIBTYP = $(CPP_PRJ_LIBTYP)d
CPP_PRJ_DBG = /D_DEBUG /Od
!IF "$(DEBUG)" == "STL"
CPP_PRJ_DBG = $(CPP_PRJ_DBG) /D_STLP_DEBUG
!ENDIF
CPP_PRJ_CMN = $(CPP_PRJ_CMN) /Zi /Gm
!ENDIF
CPP_IGNORE_LIB = LIBCMT
#CPP_PRJ_LINK = $(CPP_PRJ_LINK) /NODEFAULTLIB:$(CPP_IGNORE_LIB)
CPP_PRJ_LINK = $(CPP_PRJ_LINK) /VERBOSE:LIB
CPP_PROJ = $(CPP_PRJ_CMN) $(CPP_PRJ_EXTRA) $(CPP_PRJ_IOS) $(CPP_PRJ_LIBTYP) $(CPP_PRJ_DBG)
check: eh_test.out
eh_test.out : $(Dep_stl)
$(CPP) $(CPP_PROJ) $(Dep_stl) /Feeh_test.exe $(CPP_PRJ_LINK)
# fbp : this is to locate DLL
cd ..\..\lib
..\test\eh\eh_test.exe -s 100
echo done
clean :
-@erase "$(INTDIR)\*.obj"
-@erase "$(OUTDIR)\*.exe"
-@erase "$(OUTDIR)\*.obj"
.exe.out:
$< > $@
.cpp.exe:
$(CPP) $(CPP_PROJ) -DMAIN $< $(CPP_PRJ_LINK)
.c.obj:
$(CPP) $(CPP_PROJ) /c $<
.cpp.obj:
$(CPP) $(CPP_PROJ) /c $<
.cxx.obj:
$(CPP) $(CPP_PROJ) /c $<
.cpp.E:
$(CPP) $(CPP_PROJ) -E $< >$*.E
.cpp.sbr:
$(CPP) $(CPP_PROJ) $<

65
extern/STLport/5.2.1/test/eh/kai.mak vendored Normal file
View File

@@ -0,0 +1,65 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# point this to proper location
STL_INCL= -I../../stlport
# STL_INCL= -DEH_NO_SGI_STL
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
# TEST_LIST=test_deque.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = eh_test
TEST = eh_test.out
CC = KCC
CXX = $(CC)
CXXFLAGS = -w -mt --one_per ${STL_INCL} -D_STLP_USE_NEWALLOC -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC
# This is to test with native STL
# CXXFLAGS = -w -mt --one_per -D_STLP_USE_NEWALLOC -DEH_NO_SGI_STL -DEH_NEW_HEADERS -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC
# This is to test with STLport iostreams
LIBS = -L../../lib -lstlport_kcc -lm
LIBSTDCXX =
check: $(TEST)
$(TEST) : $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $(TEST_EXE)
$(TEST_EXE)
SUFFIXES: .cpp.o.out.res
%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBS) -o $*
./$* -q
-rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o *.rpo *.obj *.out core *~ Templates.DB SunWS_cache ti_files

60
extern/STLport/5.2.1/test/eh/locale.cpp vendored Normal file
View File

@@ -0,0 +1,60 @@
#include <exception>
#include <iostream>
#include <locale>
#include <ctime>
using namespace std;
void main()
{
try
{
locale c_loc;
//locale sys(c_loc, "LC_TIME=UKR_UKR.OCP;LC_NUMERIC=RUS_RUS.OCP;LC_CTYPE=ukr_ukr.ocp;", locale::numeric | locale::time | locale::ctype);
locale sys(".ocp");
locale::global(sys);
cin.imbue(sys);
cout.imbue(sys);
cout<<"Locale name is: "<<sys.name().c_str()<<'\n';
cout<<"Enter real number:";
double value;
cin>>value;
cout<<value<<'\n';
// Time test.
long lcur_time;
time(&lcur_time);
struct tm* cur_time=localtime(&lcur_time);
const numpunct<char>& num_punct=use_facet<numpunct<char> >(cout.getloc());
cout << num_punct.decimal_point() << '\n';
const time_put<char, ostreambuf_iterator<char, char_traits<char> > >& time_fac=
use_facet<time_put<char, ostreambuf_iterator<char, char_traits<char> > > >(cout.getloc());
time_fac.put(cout, cout, NULL, cur_time, 'x'); cout<<'\n';
time_fac.put(cout, cout, NULL, cur_time, 'x', '#'); cout<<'\n';
time_fac.put(cout, cout, NULL, cur_time, 'X'); cout<<'\n';
time_fac.put(cout, cout, NULL, cur_time, 'c'); cout<<'\n';
time_fac.put(cout, cout, NULL, cur_time, 'c', '#'); cout<<'\n';
time_fac.put(cout, cout, NULL, cur_time, 'I'); cout<<'\n';
const ctype<char>& char_type=use_facet<ctype<char> >(cout.getloc());
if(char_type.is(ctype_base::upper, '<EFBFBD>')) puts("Upper");
if(char_type.is(ctype_base::lower, '<EFBFBD>')) puts("Lower");
puts("Next");
if(isupper('<EFBFBD>', cout.getloc())) puts("Upper");
if(islower('<EFBFBD>', cout.getloc())) puts("Lower");
/*for(int ch=128; ch<256; ch++)
printf("Character %c (%d) - upper %c, lower %c\n",(char)ch, ch,toupper((char)ch, cout.getloc()), tolower((char)ch, cout.getloc()));*/
}
catch(exception &e)
{
cout<<"Exception fired:\n"<<e.what()<<'\n';
}
catch(...)
{
cout<<"Unknown exception throwed!\n";
}
cout.flush();
}

407
extern/STLport/5.2.1/test/eh/main.cpp vendored Normal file
View File

@@ -0,0 +1,407 @@
/***********************************************************************************
Main.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
* Copyright (c) 1997
* Moscow Center for SPARC Technology
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Moscow Center for SPARC Technology makes
no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#include "Prefix.h"
#include "Tests.h"
#if defined (EH_NEW_IOSTREAMS)
# include <iostream>
# else
# include <iostream.h>
#endif
#if defined(macintosh)&&(!defined(__MRC__) && !defined(__SC__)) || defined (_MAC) && defined(__MWERKS__)
# include <console.h>
# include <Types.h>
# include <Strings.h>
# ifdef EH_NEW_HEADERS
# include <cstdio>
# include <cstring>
# include <cassert>
# else
# include <stdio.h>
# include <string.h>
# include <assert.h>
# endif
# if defined (_STL_DEBUG)
# if defined ( EH_USE_SGI_STL )
// Override assertion behavior
# include <cstdarg>
//# include <stldebug.h>
void STLPORT::__stl_debug_message(const char * format_str, ...)
{
std::va_list args;
va_start( args, format_str );
char msg[256];
std::vsnprintf(msg, sizeof(msg)/sizeof(*msg) - 1, format_str, args );
DebugStr( c2pstr(msg) );
}
# else
/*===================================================================================
__assertion_failed (override standard library function)
EFFECTS: Breaks into the debugger and shows the assertion. This implementation
is Mac-specific; others could be added for other platforms.
====================================================================================*/
extern "C"
{
void __assertion_failed(char *condition, char *testfilename, int lineno);
void __assertion_failed(char *condition, char *testfilename, int lineno)
{
char msg[256];
std::strncpy( msg, condition, 255 );
std::strncat( msg, ": ", 255 );
std::strncat( msg, testfilename, 255 );
std::strncat( msg, ", ", 255 );
char line[20];
std::sprintf( line, "%d", lineno );
std::strncat( msg, line, 255 );
DebugStr( c2pstr( msg ) );
}
}
# endif
# endif
#endif
#include "nc_alloc.h"
#if defined (EH_NEW_HEADERS)
# include <vector>
# include <cstring>
# else
# include <vector.h>
# include <string.h>
#endif
#include "TestClass.h"
#include "LeakCheck.h"
#include "test_construct.h"
#ifdef __BORLANDC__
# include <except.h>
#endif
# if defined(EH_USE_NAMESPACES)
namespace // dwa 1/21/00 - must use unnamed namespace here to avoid conflict under gcc using native streams
{
using namespace std;
// using std::cerr;
// using std::endl;
}
# endif
/*===================================================================================
usage (file-static helper)
EFFECTS: Prints a message describing the command-line parameters
====================================================================================*/
static void usage(const char* name)
{
cerr<<"Usage : "<<name<<" [-n <iterations>] [-s <size>] [-l] [-e] [-q]/[-v] [-t] [test_name...]\n";
cerr<<"\t[-n <iterations>] : number of test iterations, default==100;"<<endl;
cerr<<"\t[-s <size>] : base value for random container sizes, default==1000;"<<endl;
cerr<<"\t[-e] : don't throw exceptions, test for leak in normal conditions;"<<endl;
// This option was never actually used -- dwa 9/22/97
// cerr<<"\t[-i] : ignore leak errors;"<<endl;
cerr<<"\t[-q] : quiet mode;"<<endl;
cerr<<"\t[-v] : verbose mode;"<<endl;
cerr<<"\t[-t] : track each allocation;"<<endl;
cerr<<"\t[test name [test name...]] : run only some of the tests by name (default==all tests):"<<endl;
cerr<<"\t\tpossible test names are : algo vector bit_vector list slist deque set map hash_set hash_map rope string bitset valarray"<<endl;
EH_CSTD::exit(1);
}
#ifdef EH_NEW_HEADERS
# include <set>
#else
# include <set.h>
#endif
#if defined(_WIN32_WCE)
#include <fstream>
#endif
int _STLP_CALL main(int argc, char** argv)
{
#if defined(_WIN32_WCE)
std::ofstream file( "\\eh_test.txt" );
std::streambuf* old_cout_buf = cout.rdbuf(file.rdbuf());
std::streambuf* old_cerr_buf = cerr.rdbuf(file.rdbuf());
#endif
#if defined( __MWERKS__ ) && defined( macintosh ) // Get command line.
argc = ccommand(&argv);
// Allow the i/o window to be repositioned.
// EH_STD::string s;
// getline(EH_STD::cin, s);
#endif
unsigned int niters=2;
bool run_all=true;
bool run_slist = false;
bool run_list = false;
bool run_vector = false;
bool run_bit_vector = false;
bool run_deque = false;
bool run_hash_map = false;
bool run_hash_set = false;
bool run_set = false;
bool run_map = false;
bool run_algo = false;
bool run_algobase = false;
bool run_rope = false;
bool run_string = false;
bool run_bitset = false;
bool run_valarray = false;
int cur_argv;
char *p, *p1;
#if defined (EH_NEW_IOSTREAMS)
std::ios_base::sync_with_stdio(false);
#endif
cerr << argv[0]<<" : Exception handling testsuite.\n";
cerr.flush();
bool track_allocations = false;
// parse parameters :
// leak_test [-iterations] [-test] ...
for (cur_argv=1; cur_argv<argc; cur_argv++) {
p = argv[cur_argv];
if (*p == '-') {
switch (p[1]) {
case 'q':
gTestController.SetVerbose(false);
break;
case 'v':
gTestController.SetVerbose(true);
break;
#if 0 // This option was never actually used -- dwa 9/22/97
case 'i':
gTestController.IgnoreLeaks(true);
break;
#endif
case 'n':
p1 = argv[++cur_argv];
if (p1 && EH_CSTD::sscanf(p1, "%i", &niters)==1)
cerr <<" Doing "<<niters<<" iterations\n";
else
usage(argv[0]);
break;
case 't':
track_allocations = true;
break;
case 'e':
gTestController.TurnOffExceptions();
break;
case 's':
p1 = argv[++cur_argv];
if (p1 && EH_CSTD::sscanf(p1, "%i", &random_base)==1)
cerr <<" Setting "<<random_base<<" as base for random sizes.\n";
else
usage(argv[0]);
break;
default:
usage(argv[0]);
break;
}
} else {
run_all = false;
// test name
if (EH_CSTD::strcmp(p, "algo")==0) {
run_algo=true;
} else if (EH_CSTD::strcmp(p, "vector")==0) {
run_vector=true;
} else if (EH_CSTD::strcmp(p, "bit_vector")==0) {
run_bit_vector=true;
} else if (EH_CSTD::strcmp(p, "list")==0) {
run_list=true;
} else if (EH_CSTD::strcmp(p, "slist")==0) {
run_slist=true;
} else if (EH_CSTD::strcmp(p, "deque")==0) {
run_deque=true;
} else if (EH_CSTD::strcmp(p, "set")==0) {
run_set=true;
} else if (EH_CSTD::strcmp(p, "map")==0) {
run_map=true;
} else if (EH_CSTD::strcmp(p, "hash_set")==0) {
run_hash_set=true;
} else if (EH_CSTD::strcmp(p, "hash_map")==0) {
run_hash_map=true;
} else if (EH_CSTD::strcmp(p, "rope")==0) {
run_rope=true;
} else if (EH_CSTD::strcmp(p, "string")==0) {
run_string=true;
} else if (EH_CSTD::strcmp(p, "bitset")==0) {
run_bitset=true;
} else if (EH_CSTD::strcmp(p, "valarray")==0) {
run_valarray=true;
} else {
usage(argv[0]);
}
}
}
gTestController.TrackAllocations( track_allocations );
// Over and over...
for ( unsigned i = 0; i < niters ; i++ )
{
cerr << "iteration #" << i << "\n";
if (run_all || run_algobase) {
gTestController.SetCurrentContainer("algobase");
cerr << "EH test : algobase" << endl;
test_algobase();
}
if (run_all || run_algo) {
gTestController.SetCurrentContainer("algo");
cerr << "EH test : algo" << endl;
test_algo();
}
if (run_all || run_vector) {
gTestController.SetCurrentContainer("vector");
cerr << "EH test : vector" << endl;
test_vector();
}
#if defined( EH_BIT_VECTOR_IMPLEMENTED )
if (run_all || run_bit_vector) {
gTestController.SetCurrentContainer("bit_vector");
cerr << "EH test : bit_vector" << endl;
test_bit_vector();
}
#endif
if (run_all || run_list) {
gTestController.SetCurrentContainer("list");
cerr << "EH test : list" << endl;
test_list();
}
#if defined( EH_SLIST_IMPLEMENTED )
if (run_all || run_slist) {
gTestController.SetCurrentContainer("slist");
cerr << "EH test : slist" << endl;
test_slist();
}
#endif // EH_SLIST_IMPLEMENTED
if (run_all || run_deque) {
gTestController.SetCurrentContainer("deque");
cerr << "EH test : deque" << endl;
test_deque();
}
if (run_all || run_set) {
gTestController.SetCurrentContainer("set");
cerr << "EH test : set" << endl;
test_set();
gTestController.SetCurrentContainer("multiset");
cerr << "EH test : multiset" << endl;
test_multiset();
}
if (run_all || run_map) {
gTestController.SetCurrentContainer("map");
cerr << "EH test : map" << endl;
test_map();
gTestController.SetCurrentContainer("multimap");
cerr << "EH test : multimap" << endl;
test_multimap();
}
#if defined( EH_HASHED_CONTAINERS_IMPLEMENTED )
if (run_all || run_hash_map) {
gTestController.SetCurrentContainer("hash_map");
cerr << "EH test : hash_map" << endl;
test_hash_map();
gTestController.SetCurrentContainer("hash_multimap");
cerr << "EH test : hash_multimap" << endl;
test_hash_multimap();
}
if (run_all || run_hash_set) {
gTestController.SetCurrentContainer("hash_set");
cerr << "EH test : hash_set" << endl;
test_hash_set();
gTestController.SetCurrentContainer("hash_multiset");
cerr << "EH test : hash_multiset" << endl;
test_hash_multiset();
}
#endif // EH_HASHED_CONTAINERS_IMPLEMENTED
#if defined( EH_ROPE_IMPLEMENTED )
// CW1.8 can't compile this for some reason!
#if !( defined(__MWERKS__) && __MWERKS__ < 0x1900 )
if (run_all || run_rope) {
gTestController.SetCurrentContainer("rope");
cerr << "EH test : rope" << endl;
test_rope();
}
#endif
#endif // EH_ROPE_IMPLEMENTED
#if defined( EH_STRING_IMPLEMENTED )
if (run_all || run_string) {
gTestController.SetCurrentContainer("string");
cerr << "EH test : string" << endl;
test_string();
}
#endif
#if defined( EH_BITSET_IMPLEMENTED )
if (run_all || run_bitset) {
gTestController.SetCurrentContainer("bitset");
cerr << "EH test : bitset" << endl;
test_bitset();
}
#endif
#if defined( EH_VALARRAY_IMPLEMENTED )
if (run_all || run_bitset) {
gTestController.SetCurrentContainer("valarray");
cerr << "EH test : valarray" << endl;
test_valarray();
}
#endif
}
gTestController.TrackAllocations( false );
cerr << "EH test : Done\n";
#if defined(_WIN32_WCE)
cout.rdbuf(old_cout_buf);
cerr.rdbuf(old_cerr_buf);
file.close();
#endif
return 0;
}

111
extern/STLport/5.2.1/test/eh/mingw32.mak vendored Normal file
View File

@@ -0,0 +1,111 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
srcdir = .
VPATH = .
# point this to proper location
STL_INCL=-I../../stlport
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=obj/%.o) $(STAT_MODULE)
D_OBJECTS = $(LIST:%.cpp=d_obj/%.o) $(STAT_MODULE)
NOSGI_OBJECTS = $(LIST:%.cpp=nosgi_obj/%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = ./eh_test
D_TEST_EXE = ./eh_test_d
NOSGI_TEST_EXE = ./eh_test_nosgi
TEST = ./eh_test.out
D_TEST = ./eh_test_d.out
NOSGI_TEST = ./eh_test_nosgi.out
CC = c++
CXX = $(CC)
# dwa 12/22/99 -- had to turn off -ansi flag so we could use SGI IOSTREAMS
# also, test_slist won't compile with -O3/-O2 when targeting PPC. It fails
# in the assembler with 'invalid relocation type'
CXXFLAGS = -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW
D_CXXFLAGS = -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -D_STLP_DEBUG -D_STLP_USE_STATIC_LIB
NOSGI_CXXFLAGS = -Wall -g -O2 ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -D_STLP_NO_OWN_IOSTREAMS -D_STLP_DEBUG_UNINITIALIZED -DEH_VECTOR_OPERATOR_NEW
check: $(TEST)
LIBS = -lm
D_LIBSTLPORT = -L../../lib -lstlport_mingw32_debug_static
LIBSTLPORT = -L../../lib -lstlport_mingw32_static
all: $(TEST_EXE) $(D_TEST_EXE) $(NOSGI_TEST_EXE)
check_nosgi: $(NOSGI_TEST)
check_d: $(D_TEST)
$(TEST_EXE) : $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBSTLPORT) $(LIBS) -o $(TEST_EXE)
$(D_TEST_EXE) : $(D_OBJECTS)
$(CXX) $(D_CXXFLAGS) $(D_OBJECTS) $(D_LIBSTLPORT) $(LIBS) -o $(D_TEST_EXE)
$(NOSGI_TEST_EXE) : $(NOSGI_OBJECTS)
$(CXX) $(NOSGI_CXXFLAGS) $(NOSGI_OBJECTS) $(LIBS) -o $(NOSGI_TEST_EXE)
$(TEST) : $(TEST_EXE)
$(TEST_EXE)
$(D_TEST) : $(D_TEST_EXE)
$(D_TEST_EXE)
$(NOSGI_TEST) : $(NOSGI_TEST_EXE)
$(NOSGI_TEST_EXE)
SUFFIXES: .cpp.o.exe.out.res
nosgi_obj/%.o : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -c -o $@
d_obj/%.o : %.cpp
$(CXX) $(D_CXXFLAGS) $< -c -o $@
obj/%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
nosgi_obj/%.i : %.cpp
$(CXX) $(NOSGI_CXXFLAGS) $< -E -H > $@
d_obj/%.i : %.cpp
$(CXX) $(D_CXXFLAGS) $< -E -H > $@
obj/%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBS) -o $*
./$* > $@
-rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
%.E: %.cpp
$(CXX) $(CXXFLAGS) -E $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o */*.o *.rpo *.obj *.out core *~ Templates.DB

View File

@@ -0,0 +1,193 @@
/* Metrowerks Standard Library
* Copyright <20> 1995-2002 Metrowerks Corporation. All rights reserved.
*
* $Date$
* $Revision$
*/
#include <ansi_parms.h>
#include <size_t.h>
#include <console.h>
#include <unistd.h>
#if __MACH__
short InstallConsole(short fd)
{
#pragma unused (fd)
return 0;
}
#else
#include <Carbon.h>
typedef int (*ReadPtr)(int, void *, __std(size_t));
typedef int (*WritePtr)(int, const void *, __std(size_t));
static struct
{
Boolean isLoaded;
CFBundleRef theBundle;
ReadPtr theRead;
WritePtr theWrite;
} __msl_os_x;
static OSErr __msl_CreateFrameworkBundleFromName(CFStringRef theFrameworkName,
CFBundleRef *theBundle)
{
OSErr theErr;
FSRef theRef;
CFURLRef theFrameworkURL;
CFURLRef theBundleURL;
/* Find the folder containing all the frameworks */
theErr = FSFindFolder(kOnAppropriateDisk, kFrameworksFolderType, false, &theRef);
if (theErr == noErr)
{
/* Turn the framework folder FSRef into a CFURL */
theFrameworkURL = CFURLCreateFromFSRef(kCFAllocatorSystemDefault, &theRef);
if (theFrameworkURL != NULL)
{
/* Create a CFURL pointing to the desired framework */
theBundleURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorSystemDefault,
theFrameworkURL, theFrameworkName, false);
CFRelease(theFrameworkURL);
if (theBundleURL != NULL)
{
/* Turn the CFURL into a bundle reference */
*theBundle = CFBundleCreate(kCFAllocatorSystemDefault, theBundleURL);
CFRelease(theBundleURL);
}
}
}
return theErr;
}
short InstallConsole(short fd)
{
#pragma unused (fd)
OSErr theErr;
short theResult;
theResult = -1;
/* Start with no bundle */
__msl_os_x.isLoaded = false;
__msl_os_x.theBundle = NULL;
__msl_os_x.theRead = NULL;
__msl_os_x.theWrite = NULL;
/* Create a bundle reference based on its name */
theErr = __msl_CreateFrameworkBundleFromName(CFSTR("System.framework"),
&__msl_os_x.theBundle);
if ((theErr == noErr) && (__msl_os_x.theBundle != NULL))
{
theResult = 0;
__msl_os_x.isLoaded = CFBundleLoadExecutable(__msl_os_x.theBundle);
if (__msl_os_x.isLoaded)
{
/* Lookup the functions in the bundle by name */
__msl_os_x.theRead = (ReadPtr)
CFBundleGetFunctionPointerForName(__msl_os_x.theBundle, CFSTR("read"));
__msl_os_x.theWrite = (WritePtr)
CFBundleGetFunctionPointerForName(__msl_os_x.theBundle, CFSTR("write"));
}
}
return theResult;
}
#endif
void RemoveConsole(void)
{
#if !__MACH__
if (__msl_os_x.theBundle != NULL)
{
if (__msl_os_x.isLoaded)
{
__msl_os_x.theRead = NULL;
__msl_os_x.theWrite = NULL;
CFBundleUnloadExecutable(__msl_os_x.theBundle);
__msl_os_x.isLoaded = false;
}
CFRelease(__msl_os_x.theBundle);
__msl_os_x.theBundle = NULL;
}
#endif
}
long WriteCharsToConsole(char *buffer, long n)
{
#if __MACH__
return write(1, buffer, n);
#else
/* Call the function if it was found */
if (__msl_os_x.theWrite == NULL)
return -1;
else
return __msl_os_x.theWrite(1, buffer, n);
#endif
}
#if __MACH__
long WriteCharsToErrorConsole(char *buffer, long n)
{
return write(2, buffer, n);
}
#endif
long ReadCharsFromConsole(char *buffer, long n)
{
#if __MACH__
return read(0, buffer, n);
#else
/* Call the function if it was found */
if (__msl_os_x.theRead == NULL)
return -1;
else
return __msl_os_x.theRead(0, buffer, n);
#endif
}
/* JWW - This code should never be reached, but it's needed for link purposes */
char *__ttyname(long fildes)
{
#pragma unused (fildes)
/* all streams have the same name */
static char *__devicename = "Terminal";
if (fildes >= 0 && fildes <= 2)
return (__devicename);
return (0L);
}
int kbhit(void)
{
return 0;
}
int getch(void)
{
return 0;
}
void clrscr()
{
return;
}
/* Change record:
* JWW 010919 Created Mach-O console stubs file
* JWW 020418 Use __std() for all size_t, and #include <size_t.h> to get proper C++ definitions
*/

View File

@@ -0,0 +1,8 @@
//mwerks_debug_prefix.h
#define _STLP_NO_FORCE_INSTANTIATE 1// for debugging
#define EH_VECTOR_OPERATOR_NEW 1
#define _STLP_DEBUG 1 // enable the use of allocation debugging
#if __MWERKS__ >= 0x3000
#include <MSLCarbonPrefix.h>
#endif

View File

@@ -0,0 +1,5 @@
//mwerks_nosgi_debug_prefix.h
#define _STLP_NO_SGI_IOSTREAMS 1
#define _STLP_NO_FORCE_INSTANTIATE 1 // for debugging
#define _STLP_DEBUG_UNINITIALIZED 1 // enable the use of allocation debugging
#define EH_VECTOR_OPERATOR_NEW 1

View File

@@ -0,0 +1,5 @@
//mwerks_nosgi_prefix.h
#define _STLP_NO_SGI_IOSTREAMS 1
#define _STLP_NO_FORCE_INSTANTIATE 1 // for debugging
#define EH_VECTOR_OPERATOR_NEW 1
#define NDEBUG 1

View File

@@ -0,0 +1,8 @@
//mwerks_prefix.h
#define _STLP_NO_FORCE_INSTANTIATE 1// for debugging
#define EH_VECTOR_OPERATOR_NEW 1
#define NDEBUG 1
#if __MWERKS__ >= 0x3000
#include <MSLCarbonPrefix.h>
#endif

View File

@@ -0,0 +1,328 @@
/************************************************************************************************
NC_ALLOC.CPP
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
************************************************************************************************/
#include "nc_alloc.h"
#include <string>
#if defined (EH_NEW_HEADERS)
# include <new>
# include <cassert>
# include <cstdlib>
#else
# include <assert.h>
# include <stdlib.h>
# include <new.h>
#endif
#if defined (EH_NEW_IOSTREAMS)
# include <iostream>
#else
# include <iostream.h>
#endif
long alloc_count = 0;
long object_count = 0;
long TestController::possible_failure_count = 0;
const char* TestController::current_test = "<unknown>";
const char* TestController::current_test_category = "no category";
const char* TestController::current_container = 0;
bool TestController::nc_verbose = true;
bool TestController::never_fail = false;
bool TestController::track_allocations = false;
bool TestController::leak_detection_enabled = false;
TestController gTestController;
//************************************************************************************************
void TestController::maybe_fail(long) {
if (never_fail || Failure_threshold() == kNotInExceptionTest)
return;
// throw if allocation would satisfy the threshold
if (possible_failure_count++ >= Failure_threshold()) {
// what about doing some standard new_handler() behavior here (to test it!) ???
// reset and simulate an out-of-memory failure
Failure_threshold() = kNotInExceptionTest;
#ifndef EH_NO_EXCEPTIONS
throw EH_STD::bad_alloc();
#endif
}
}
#if defined (EH_HASHED_CONTAINERS_IMPLEMENTED)
# if defined (__SGI_STL)
# if defined (EH_NEW_HEADERS)
# include <hash_set>
# else
# include <hash_set.h>
# endif
# elif defined (__MSL__)
# include <hashset.h>
# else
# error what do I include to get hash_set?
# endif
#else
# if defined (EH_NEW_HEADERS)
# include <set>
# else
# include <set.h>
# endif
#endif
#if !defined (EH_HASHED_CONTAINERS_IMPLEMENTED)
typedef EH_STD::set<void*, EH_STD::less<void*> > allocation_set;
#else
USING_CSTD_NAME(size_t)
struct hash_void {
size_t operator()(void* x) const { return (size_t)x; }
};
typedef EH_STD::hash_set<void*, ::hash_void, EH_STD::equal_to<void*> > allocation_set;
#endif
static allocation_set& alloc_set() {
static allocation_set s;
return s;
}
// Prevents infinite recursion during allocation
static bool using_alloc_set = false;
#if !defined (NO_FAST_ALLOCATOR)
//
// FastAllocator -- speeds up construction of TestClass objects when
// TESTCLASS_DEEP_DATA is enabled, and speeds up tracking of allocations
// when the suite is run with the -t option.
//
class FastAllocator {
public:
//FastAllocator() : mFree(0), mUsed(0) {}
static void *Allocate(size_t s) {
void *result = 0;
if (s <= sizeof(Block)) {
if (mFree != 0) {
result = mFree;
mFree = mFree->next;
}
else if (mBlocks != 0 && mUsed < kBlockCount) {
result = (void*)&mBlocks[mUsed++];
}
}
return result;
}
static bool Free(void* p) {
Block* b = (Block*)p;
if (mBlocks == 0 || b < mBlocks || b >= mBlocks + kBlockCount)
return false;
b->next = mFree;
mFree = b;
return true;
}
struct Block;
friend struct Block;
enum {
// Number of fast allocation blocks to create.
kBlockCount = 1500,
// You may need to adjust this number for your platform.
// A good choice will speed tests. A bad choice will still work.
kMinBlockSize = 48
};
struct Block {
union {
Block *next;
double dummy; // fbp - force alignment
char dummy2[kMinBlockSize];
};
};
static Block* mBlocks;
static Block *mFree;
static size_t mUsed;
};
FastAllocator::Block *FastAllocator::mBlocks =
(FastAllocator::Block*)EH_CSTD::calloc( sizeof(FastAllocator::Block), FastAllocator::kBlockCount );
FastAllocator::Block *FastAllocator::mFree;
size_t FastAllocator::mUsed;
static FastAllocator gFastAllocator;
#endif
inline char* AllocateBlock(size_t s) {
#if !defined (NO_FAST_ALLOCATOR)
char * const p = (char*)gFastAllocator.Allocate( s );
if (p != 0)
return p;
#endif
return (char*)EH_CSTD::malloc(s);
}
static void* OperatorNew( size_t s ) {
if (!using_alloc_set) {
simulate_possible_failure();
++alloc_count;
}
char *p = AllocateBlock(s);
if (gTestController.TrackingEnabled() &&
gTestController.LeakDetectionEnabled() &&
!using_alloc_set) {
using_alloc_set = true;
bool inserted = alloc_set().insert(p).second;
// Suppress warning about unused variable.
inserted;
EH_ASSERT(inserted);
using_alloc_set = false;
}
return p;
}
void* _STLP_CALL operator new(size_t s)
#ifdef EH_DELETE_HAS_THROW_SPEC
throw(EH_STD::bad_alloc)
#endif
{ return OperatorNew( s ); }
#ifdef EH_USE_NOTHROW
void* _STLP_CALL operator new(size_t size, const EH_STD::nothrow_t&) throw() {
try {
return OperatorNew( size );
}
catch (...) {
return 0;
}
}
#endif
#if 1 /* defined (EH_VECTOR_OPERATOR_NEW) */
void* _STLP_CALL operator new[](size_t size ) throw(EH_STD::bad_alloc) {
return OperatorNew( size );
}
# ifdef EH_USE_NOTHROW
void* _STLP_CALL operator new[](size_t size, const EH_STD::nothrow_t&) throw() {
try {
return OperatorNew(size);
}
catch (...) {
return 0;
}
}
# endif
void _STLP_CALL operator delete[](void* ptr) throw()
{ operator delete( ptr ); }
#endif
#if defined (EH_DELETE_HAS_THROW_SPEC)
void _STLP_CALL operator delete(void* s) throw()
#else
void _STLP_CALL operator delete(void* s)
#endif
{
if ( s != 0 ) {
if ( !using_alloc_set ) {
--alloc_count;
if ( gTestController.TrackingEnabled() && gTestController.LeakDetectionEnabled() ) {
using_alloc_set = true;
allocation_set::iterator p = alloc_set().find( (char*)s );
EH_ASSERT( p != alloc_set().end() );
alloc_set().erase( p );
using_alloc_set = false;
}
}
# if ! defined (NO_FAST_ALLOCATOR)
if ( !gFastAllocator.Free( s ) )
# endif
EH_CSTD::free(s);
}
}
/*===================================================================================
ClearAllocationSet (private helper)
EFFECTS: Empty the set of allocated blocks.
====================================================================================*/
void TestController::ClearAllocationSet() {
if (!using_alloc_set) {
using_alloc_set = true;
alloc_set().clear();
using_alloc_set = false;
}
}
bool TestController::ReportLeaked() {
EndLeakDetection();
EH_ASSERT( !using_alloc_set || (alloc_count == static_cast<int>(alloc_set().size())) );
if (alloc_count != 0 || object_count != 0) {
EH_STD::cerr<<"\nEH TEST FAILURE !\n";
PrintTestName(true);
if (alloc_count)
EH_STD::cerr << "ERROR : " << alloc_count << " outstanding allocations.\n";
if (object_count)
EH_STD::cerr << "ERROR : " << object_count << " non-destroyed objects.\n";
alloc_count = object_count = 0;
return true;
}
return false;
}
/*===================================================================================
PrintTestName
EFFECTS: Prints information about the current test. If err is false, ends with
an ellipsis, because the test is ongoing. If err is true an error is being
reported, and the output ends with an endl.
====================================================================================*/
void TestController::PrintTestName(bool err) {
if (current_container)
EH_STD::cerr<<"["<<current_container<<"] :";
EH_STD::cerr<<"testing "<<current_test <<" (" << current_test_category <<")";
if (err)
EH_STD::cerr<<EH_STD::endl;
else
EH_STD::cerr<<" ... ";
}
void TestController::ReportSuccess(int count) {
if (nc_verbose)
EH_STD::cerr<<(count+1)<<" try successful"<<EH_STD::endl;
}
long& TestController::Failure_threshold() {
static long failure_threshold = kNotInExceptionTest;
return failure_threshold;
}

184
extern/STLport/5.2.1/test/eh/nc_alloc.h vendored Normal file
View File

@@ -0,0 +1,184 @@
/***********************************************************************************
TestController.h
SUMMARY: An "faux-singleton" object to encapsulate a hodgepodge of state and
functionality relating to the test suite. Probably should be broken
into smaller pieces.
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#if !INCLUDED_MOTU_nc_alloc
#define INCLUDED_MOTU_nc_alloc 1
#include "Prefix.h"
#if defined (EH_NEW_HEADERS)
# include <utility>
#else
# include <pair.h>
#endif
extern long alloc_count;
extern long object_count;
struct TestController {
// Report that the current test has succeeded.
static void ReportSuccess(int);
//
// Leak detection
//
// Turn the recording of the addresses of individual allocated
// blocks on or off. If not called, allocations will only be
// counted, but deallocations won't be checked for validity.
static void TrackAllocations( bool );
static bool TrackingEnabled();
// Call this to begin a new leak-detection cycle. Resets all
// allocation counts, etc.
static void BeginLeakDetection();
// Returns true iff leak detection is currently in effect
static bool LeakDetectionEnabled();
// Ends leak detection and reports any resource leaks.
// Returns true if any occurred.
static bool ReportLeaked();
//
// Exception-safety
//
// Don't test for exception-safety
static void TurnOffExceptions();
// Set operator new to fail on the nth invocation
static void SetFailureCountdown( long n );
// Set operator new to never fail.
static void CancelFailureCountdown();
// Throws an exception if the count has been reached. Call this
// before every operation that might fail in the real world.
static void maybe_fail(long);
//
// Managing verbose feedback.
//
// Call to begin a strong, weak, or const test. If verbose
// reporting is enabled, prints the test category.
static void SetCurrentTestCategory( const char* str );
// Call to set the name of the container being tested.
static void SetCurrentContainer( const char* str );
// Sets the name of the current test.
static void SetCurrentTestName(const char* str);
// Turn verbose reporting on or off.
static void SetVerbose(bool val);
private:
enum { kNotInExceptionTest = -1 };
static void ClearAllocationSet();
static void EndLeakDetection();
static void PrintTestName( bool err=false );
static long& Failure_threshold();
static long possible_failure_count;
static const char* current_test;
static const char* current_test_category;
static const char* current_container;
static bool nc_verbose;
static bool never_fail;
static bool track_allocations;
static bool leak_detection_enabled;
};
extern TestController gTestController;
//
// inline implementations
//
inline void simulate_possible_failure() {
gTestController.maybe_fail(0);
}
inline void simulate_constructor() {
gTestController.maybe_fail(0);
++object_count;
}
inline void simulate_destructor() {
--object_count;
}
inline void TestController::TrackAllocations(bool track) {
track_allocations = track;
}
inline bool TestController::TrackingEnabled() {
return track_allocations;
}
inline void TestController::SetFailureCountdown(long count) {
Failure_threshold() = count;
possible_failure_count = 0;
}
inline void TestController::CancelFailureCountdown() {
Failure_threshold() = kNotInExceptionTest;
}
inline void TestController::BeginLeakDetection() {
alloc_count = 0;
object_count = 0;
ClearAllocationSet();
leak_detection_enabled = true;
}
inline bool TestController::LeakDetectionEnabled() {
return leak_detection_enabled;
}
inline void TestController::EndLeakDetection() {
leak_detection_enabled = false;
}
inline void TestController::SetCurrentTestCategory(const char* str) {
current_test_category = str;
if (nc_verbose)
PrintTestName();
}
inline void TestController::SetCurrentContainer(const char* str) {
current_container=str;
}
inline void TestController::SetCurrentTestName(const char* str) {
current_test = str;
}
inline void TestController::SetVerbose(bool val) {
nc_verbose = val;
}
inline void TestController::TurnOffExceptions() {
never_fail = true;
}
#endif // INCLUDED_MOTU_nc_alloc

View File

@@ -0,0 +1,39 @@
/***********************************************************************************
random_number.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#include "random_number.h"
#include "Prefix.h"
#if defined (EH_NEW_HEADERS)
# include <functional>
# include <cstdlib>
#else
# include <function.h>
# include <stdlib.h>
#endif
unsigned random_number( size_t range )
{
#if !defined( __SGI_STL )
if (range == 0) return 0;
return (unsigned)(EH_STD::rand() + EH_STD::rand()) % range;
#else
static EH_STD::subtractive_rng rnd;
if (range==0) return 0;
return rnd(range);
#endif
}
// default base for random container sizes
unsigned random_base = 1000;

View File

@@ -0,0 +1,27 @@
/***********************************************************************************
random_number.h
* Copyright (c) 1997-1998
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#ifndef RANDOM_NUMBER_DWA120298_H_
#define RANDOM_NUMBER_DWA120298_H_
#include <stddef.h>
// Return a random number in the given range.
unsigned random_number( size_t range );
// default base for random container sizes
extern unsigned random_base;
#endif // #include guard

View File

@@ -0,0 +1,62 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
SHELL=/bin/sh
# srcdir = .
# VPATH = .
STL_INCL=-I${PWD}/../../stlport/
# STL_INCL= -DEH_NO_SGI_STL
AUX_LIST=TestClass.o main.o nc_alloc.o random_number.o
TEST_LIST=test_algo.o \
test_algobase.o test_list.o test_slist.o \
test_bit_vector.o test_vector.o \
test_deque.o test_set.o test_map.o \
test_hash_map.o test_hash_set.o test_rope.o \
test_string.o test_bitset.o test_valarray.o
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST)
EXECS = $(LIST:%.o=%)
TESTS = $(LIST:%.o=%.out)
TEST_EXE = eh_test
TEST = eh_test.out
CC = CC
CXX = $(CC)
# CXXFLAGS = -J 4 -ansi -LANG:std -I. ${STL_INCL} ${DEBUG_FLAGS} -I. -D_STLP_NO_OWN_IOSTREAMS -D_STLP_NO_NEW_IOSTREAMS
CXXFLAGS = -J 4 -ansi -LANG:std -I. ${STL_INCL} ${DEBUG_FLAGS} -I.
LIBS = -L../../lib -lstlport_mipspro -lm
LIBSTDCXX =
.SUFFIXES: .cpp .i .o .out .res
check: $(TEST)
$(TEST) : $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBS) -o $(TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" ./$(TEST_EXE) -s 100
.cpp.o:
$(CXX) $(CXXFLAGS) $< -c -o $@
.cpp.i:
$(CXX) $(CXXFLAGS) $< -E > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $*.cpp -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBS) -o $*
./$* -q
-rm -f $*
clean:
-rm -fr ${TEST_EXE} *.o *.rpo *.obj *.out core *~ Templates.DB SunWS_cache cxx_repository

View File

@@ -0,0 +1,69 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
SHELL=/bin/sh
# point this to proper location
STL_INCL= -I${PWD}/../../stlport
# STL_INCL= -DEH_NO_SGI_STL
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = eh_test
TEST = eh_test.out
CC = CC
CXX = $(CC)
CXXFLAGS = ${STL_INCL} -xarch=v9 -library=no%Cstd -features=rtti -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC -xildoff -g -D_REENTRANT -DNO_FAST_ALLOCATOR
# This is to test with native STL
# CXXFLAGS = +w2 -xildoff -D_STLP_USE_NEWALLOC -DEH_NO_SGI_STL -DEH_NEW_HEADERS -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC
LIBS = -lm
LIBSTDCXX =
LIBSTLPORT = -library=no%Cstd -L../../lib -lstlport_sunpro64
check: $(TEST)
$(TEST) : $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) ${LIBSTLPORT} $(LIBS) -o $(TEST_EXE)
LD_LIBRARY_PATH="../../lib;${LD_LIBRARY_PATH}" ./$(TEST_EXE) -s 100
SUFFIXES: .cpp.o.out.res
%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBS) -o $*
./$* -q
-rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o *.rpo *.obj *.out core *~ Templates.DB SunWS_cache

71
extern/STLport/5.2.1/test/eh/sunpro.mak vendored Normal file
View File

@@ -0,0 +1,71 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
SHELL=/bin/sh
# point this to proper location
STL_INCL= -I${PWD}/../../stlport
# STL_INCL= -DEH_NO_SGI_STL
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = eh_test
TEST = eh_test.out
CC = CC
CXX = $(CC)
# CXXFLAGS = ${STL_INCL} -library=no%Cstd -qoption ccfe -instlib=../../lib/libstlport_sunpro.so -features=rtti -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC
CXXFLAGS = ${STL_INCL} -library=no%Cstd -features=rtti -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC
# This is to test with native STL
# CXXFLAGS = +w2 -xildoff -D_STLP_USE_NEWALLOC -DEH_NO_SGI_STL -DEH_NEW_HEADERS -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC
LIBS = -lm
LIBSTDCXX =
LIBSTLPORT = -library=no%Cstd -L../../lib -lstlport_sunpro
check: $(TEST)
$(TEST) : $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) ${LIBSTLPORT} $(LIBS) -o $(TEST_EXE)
LD_LIBRARY_PATH="../../lib;${LD_LIBRARY_PATH}" ./$(TEST_EXE) -s 100
SUFFIXES: .cpp.o.out.res
%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBS) ${LIBSTLPORT} -o $*
LD_LIBRARY_PATH="../../lib;${LD_LIBRARY_PATH}" ./$*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o *.rpo *.obj *.out core *~ Templates.DB SunWS_cache

View File

@@ -0,0 +1,76 @@
# ;;; -*- Mode:makefile;-*-
# Generated automatically from Makefile.in by configure.
# This requires GNU make.
# SHELL=/bin/sh
# srcdir = .
# VPATH = .
SHELL=/bin/sh
# point this to proper location
STL_INCL= -I../../stlport
# STL_INCL= -DEH_NO_SGI_STL
AUX_LIST=TestClass.cpp main.cpp nc_alloc.cpp random_number.cpp
TEST_LIST=test_algo.cpp \
test_algobase.cpp test_list.cpp test_slist.cpp \
test_bit_vector.cpp test_vector.cpp \
test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
OBJECTS = $(LIST:%.cpp=%.o) $(STAT_MODULE)
EXECS = $(LIST:%.cpp=%)
TESTS = $(LIST:%.cpp=%.out)
TEST_EXE = eh_test
TEST = eh_test.out
CC = CC
CXX = $(CC)
CXXFLAGS = $(ARCHF) +w2 -mt -features=rtti ${STL_INCL}
# CXXFLAGS = +w2 ${STL_INCL}
LIBS = -lm
LIBSTLPORT = -L../../lib -lstlport_sunpro42
check: $(TEST)
$(TEST) : $(OBJECTS)
echo 'Info: For CC 4.x, warnings from ld in the form "symbol `XXX' has differing sizes" are normal.'
$(CXX) $(CXXFLAGS) $(OBJECTS) ${LIBSTLPORT} $(LIBS) -o $(TEST_EXE)
LD_LIBRARY_PATH="../../lib:$(LD_LIBRARY_PATH)" ./$(TEST_EXE) -s 100
SUFFIXES: .cpp.o.out.res
%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
%.i : %.cpp
$(CXX) $(CXXFLAGS) $< -E -H > $@
%.out: %.cpp
$(CXX) $(CXXFLAGS) $< -c -USINGLE -DMAIN -g -o $*.o
$(CXX) $(CXXFLAGS) $*.o $(LIBSTLPORT) $(LIBS) -o $*
./$* -q
-rm -f $*
%.s: %.cpp
$(CXX) $(CXXFLAGS) -O4 -S -pto $< -o $@
clean:
-rm -fr ${TEST_EXE} *.o *.rpo *.obj *.out core *~ Templates.DB SunWS_cache

42
extern/STLport/5.2.1/test/eh/test.cpp vendored Normal file
View File

@@ -0,0 +1,42 @@
#include <iostream>
#include <set>
#include <vector>
template<class T>
inline void printElements(const T& coll, const char* msg = "")
{
typename T::const_iterator it;
std::cout << msg;
for(it = coll.begin(); it != coll.end(); ++it) {
std::cout << *it << ' ';
}
std::cout << std:: endl;
}
int main(int /* argc */, char** /* argv */)
{
std::set<int> set1, set2;
std::vector<int> aVector;
aVector.push_back(1);
aVector.push_back(1);
set1.insert(aVector.begin(), aVector.end());
set2.insert(1);
set2.insert(1);
printElements(aVector, "vector: ");
printElements(set1, "set1 : ");
printElements(set2, "set2 : ");
return 0;
}
# if 0
# include <iostream>
main()
{
// std::stringstream tstr;
std::cout<<"hello world\n";
}
# endif

View File

@@ -0,0 +1,261 @@
/***********************************************************************************
test_algo.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#include "Tests.h"
#include "LeakCheck.h"
#include "SortClass.h"
#if defined (EH_NEW_HEADERS)
# include <algorithm>
# include <cassert>
#else
# include <algo.h>
# include <assert.h>
#endif
#if defined (EH_NEW_IOSTREAMS)
# include <iostream>
#else
# include <iostream.h>
#endif
//
// SortBuffer -- a buffer of SortClass objects that can be used to test sorting.
//
struct SortBuffer
{
enum { kBufferSize = 100 };
SortClass* begin() { return items; }
const SortClass* begin() const { return items; }
SortClass* end() { return items + kBufferSize; }
const SortClass* end() const { return items + kBufferSize; }
// Sort each half of the buffer and reset the address of each element
// so that merge() can be tested for stability.
void PrepareMerge()
{
EH_STD::sort( begin(), begin() + ( end() - begin() )/2 );
EH_STD::sort( begin() + ( end() - begin() )/2, end() );
for ( SortClass* p = begin(); p != end(); p++ )
p->ResetAddress();
}
SortBuffer()
{
PrepareMerge();
}
SortBuffer( const SortBuffer& rhs )
{
SortClass* q = begin();
for ( const SortClass* p = rhs.begin() ; p != rhs.end(); p++,q++ )
*q = *p;
}
private:
SortClass items[kBufferSize];
};
//
// less_by_reference -- a functor for comparing objects against a
// constant value.
//
template <class T>
struct less_by_reference
{
less_by_reference( const T& arg ) : fArg(arg) {}
bool operator()( const T& x ) const { return x < fArg; }
private:
const T& fArg;
};
struct test_stable_partition
{
test_stable_partition( const SortBuffer& buf )
: orig( buf ), partitionPoint(SortClass::kRange / 2) {
gTestController.SetCurrentTestName("stable_partition()");
}
void operator()( SortBuffer& buf ) const
{
less_by_reference<SortClass> throw_cmp( partitionPoint );
SortClass* d = EH_STD::stable_partition( buf.begin(), buf.end(), throw_cmp );
// Suppress warning about unused variable.
d;
// If we get here no exception occurred during the operation.
// Stop any potential failures that might occur during verification.
gTestController.CancelFailureCountdown();
// Prepare an array of counts of the occurrence of each value in
// the legal range.
unsigned counts[SortClass::kRange];
EH_STD::fill_n( counts, (int)SortClass::kRange, 0 );
for ( const SortClass *q = orig.begin(); q != orig.end(); q++ )
counts[ q->value() ]++;
less_by_reference<TestClass> cmp( partitionPoint );
for ( const SortClass* p = buf.begin(); p != buf.end(); p++ )
{
// Check that adjacent items with the same value haven't been
// reordered. This could be a more thorough test.
if ( p != buf.begin() && p->value() == p[-1].value() ) {
EH_ASSERT( p->GetAddress() > p[-1].GetAddress() );
}
// Check that the partitioning worked.
EH_ASSERT( (p < d) == cmp( *p ) );
// Decrement the appropriate count for each value.
counts[ p->value() ]--;
}
// Check that the values were only rearranged, and none were lost.
for ( unsigned j = 0; j < SortClass::kRange; j++ ) {
EH_ASSERT( counts[j] == 0 );
}
}
private:
const SortBuffer& orig;
SortClass partitionPoint;
};
void assert_sorted_version( const SortBuffer& orig, const SortBuffer& buf );
/*===================================================================================
assert_sorted_version
EFFECTS: Asserts that buf is a stable-sorted version of orig.
====================================================================================*/
void assert_sorted_version( const SortBuffer& orig, const SortBuffer& buf )
{
// Stop any potential failures that might occur during verification.
gTestController.CancelFailureCountdown();
// Prepare an array of counts of the occurrence of each value in
// the legal range.
unsigned counts[SortClass::kRange];
EH_STD::fill_n( counts, (int)SortClass::kRange, 0 );
for ( const SortClass *q = orig.begin(); q != orig.end(); q++ )
counts[ q->value() ]++;
// Check that each element is greater than the previous one, or if they are
// equal, that their order has been preserved.
for ( const SortClass* p = buf.begin(); p != buf.end(); p++ )
{
if ( p != buf.begin() ) {
EH_ASSERT( p->value() > p[-1].value()
|| p->value() == p[-1].value() && p->GetAddress() > p[-1].GetAddress() );
}
// Decrement the appropriate count for each value.
counts[ p->value() ]--;
}
// Check that the values were only rearranged, and none were lost.
for ( unsigned j = 0; j < SortClass::kRange; j++ ) {
EH_ASSERT( counts[j] == 0 );
}
}
//
// The test operators
//
struct test_stable_sort_1
{
test_stable_sort_1( const SortBuffer& buf )
: orig( buf ) {
gTestController.SetCurrentTestName("stable_sort() #1");
}
void operator()( SortBuffer& buf ) const
{
EH_STD::stable_sort( buf.begin(), buf.end() );
assert_sorted_version( orig, buf );
}
private:
const SortBuffer& orig;
};
struct test_stable_sort_2
{
test_stable_sort_2( const SortBuffer& buf )
: orig( buf ) {
gTestController.SetCurrentTestName("stable_sort() #2");
}
void operator()( SortBuffer& buf ) const
{
EH_STD::stable_sort( buf.begin(), buf.end(), EH_STD::less<SortClass>() );
assert_sorted_version( orig, buf );
}
private:
const SortBuffer& orig;
};
struct test_inplace_merge_1
{
test_inplace_merge_1( SortBuffer& buf )
: orig( buf ) {
gTestController.SetCurrentTestName("inplace_merge #1()");
}
void operator()( SortBuffer& buf ) const
{
EH_STD::inplace_merge( buf.begin(), buf.begin() + ( buf.end() - buf.begin() )/2, buf.end() );
assert_sorted_version( orig, buf );
}
private:
const SortBuffer& orig;
};
struct test_inplace_merge_2
{
test_inplace_merge_2( SortBuffer& buf )
: orig( buf ) {
gTestController.SetCurrentTestName("inplace_merge() #2");
}
void operator()( SortBuffer& buf ) const
{
EH_STD::inplace_merge( buf.begin(), buf.begin() + ( buf.end() - buf.begin() )/2, buf.end(),
EH_STD::less<SortClass>() );
assert_sorted_version( orig, buf );
}
private:
const SortBuffer& orig;
};
void test_algo()
{
SortBuffer mergeBuf;
mergeBuf.PrepareMerge();
EH_STD::cerr<<"EH test : testing algo.h"<<EH_STD::endl;
WeakCheck( mergeBuf, test_inplace_merge_1( mergeBuf ) );
WeakCheck( mergeBuf, test_inplace_merge_2( mergeBuf ) );
SortBuffer buf;
WeakCheck( buf, test_stable_sort_1( buf ) );
WeakCheck( buf, test_stable_sort_2( buf ) );
WeakCheck( buf, test_stable_partition( buf ) );
}

View File

@@ -0,0 +1,98 @@
/***********************************************************************************
test_algobase.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
# include "Prefix.h"
# if defined (EH_NEW_HEADERS)
# ifdef __SUNPRO_CC
# include <stdio.h>
# endif
#include <algorithm>
# else
#include <algo.h>
# endif
#include "Tests.h"
#include "LeakCheck.h"
#include "TestClass.h"
// EH_USE_STD
enum { kBufferSize = 100 };
struct test_uninitialized_copy
{
test_uninitialized_copy()
: stuff( new TestClass[kBufferSize] ), end_of_stuff(stuff + kBufferSize) {
gTestController.SetCurrentTestName("uninitialized_copy()");
}
~test_uninitialized_copy() { delete[] stuff; }
void operator()( TestClass* buffer ) const
{
EH_STD::uninitialized_copy((TestClass*)stuff, (TestClass*)end_of_stuff, buffer );
EH_ASSERT( EH_STD::equal( (TestClass*)stuff, (TestClass*)end_of_stuff, buffer ) );
stl_destroy( buffer, buffer+kBufferSize );
}
private:
TestClass * stuff;
TestClass * end_of_stuff;
};
struct test_uninitialized_fill
{
test_uninitialized_fill() {
gTestController.SetCurrentTestName("uninitialized_fill()");
}
void operator()( TestClass* buffer ) const
{
TestClass* buf_end = buffer + kBufferSize;
EH_STD::uninitialized_fill( buffer, buf_end, testValue );
for ( EH_CSTD::size_t i = 0; i < kBufferSize; i++ )
EH_ASSERT( buffer[i] == testValue );
stl_destroy( buffer, buf_end );
}
private:
TestClass testValue;
};
struct test_uninitialized_fill_n
{
test_uninitialized_fill_n() {
gTestController.SetCurrentTestName("uninitialized_fill_n()");
}
void operator()( TestClass* buffer ) const
{
TestClass* end = buffer + kBufferSize;
EH_STD::uninitialized_fill_n( buffer, (EH_CSTD::size_t)kBufferSize, testValue );
for ( EH_CSTD::size_t i = 0; i < kBufferSize; i++ )
EH_ASSERT( buffer[i] == testValue );
stl_destroy( buffer, end );
}
private:
TestClass testValue;
};
void test_algobase()
{
// force alignment
double arr[ sizeof(TestClass) * kBufferSize ];
TestClass* c = (TestClass*)arr;
WeakCheck( c, test_uninitialized_copy() );
WeakCheck( c, test_uninitialized_fill() );
WeakCheck( c, test_uninitialized_fill_n() );
}

View File

@@ -0,0 +1,47 @@
/***********************************************************************************
test_assign_op.h
SUMMARY: Test functor template for assignment operators.
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#ifndef test_assign_op_H_
#define test_assign_op_H_
#include "Prefix.h"
#ifdef EH_NEW_HEADERS
# include <cassert>
#else
# include <assert.h>
#endif
#include "nc_alloc.h"
template <class T>
struct test_assign_op {
test_assign_op( const T& src )
: source(src) {
gTestController.SetCurrentTestName("assignment operator");
}
void operator()( T& t ) const {
t = source;
// Prevent simulated failures during verification
gTestController.CancelFailureCountdown();
//EH_ASSERT( source == t );
}
private:
const T& source;
};
#endif // test_assign_op_H_

View File

@@ -0,0 +1,129 @@
/***********************************************************************************
test_bit_vector.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#include "Tests.h"
#if defined( EH_BIT_VECTOR_IMPLEMENTED )
# if defined (EH_NEW_HEADERS)
# ifdef __SUNPRO_CC
# include <stdio.h>
# endif
#include <vector>
# else
#include <bvector.h>
# endif
#include "LeakCheck.h"
#include "test_construct.h"
#include "test_assign_op.h"
#include "test_push_back.h"
#include "test_insert.h"
#include "test_push_front.h"
typedef EH_BIT_VECTOR BitVector;
inline sequence_container_tag
container_category(const BitVector&)
{
return sequence_container_tag();
}
USING_CSTD_NAME(size_t)
//
// test_BitVector_reserve
//
struct test_BitVector_reserve
{
test_BitVector_reserve( size_t n ) : fAmount(n)
{
gTestController.SetCurrentTestName("BitVector::reserve()");
}
void operator()( BitVector& v ) const
{
v.reserve( fAmount );
}
private:
size_t fAmount;
};
/*===================================================================================
test_bit_vector
EFFECTS: Performs tests on bit vectors
====================================================================================*/
void test_bit_vector()
{
#define __WORD_BIT (int(CHAR_BIT*sizeof(unsigned int)))
// Make some bit vectors to work with.
BitVector emptyVector;
BitVector testVector, testVector2;
EH_ASSERT( testVector.size() == 0 );
size_t BitVectorSize = random_number( random_base );
// Half the time, choose a size that will guarantee immediate reallocation
if ( random_number(2) )
BitVectorSize = BitVectorSize / __WORD_BIT * __WORD_BIT;
EH_ASSERT( testVector.size() == 0 );
testVector.reserve(BitVectorSize);
EH_ASSERT( testVector.size() == 0 );
while (testVector.size() < BitVectorSize) {
testVector.push_back(random_number(2) != 0);
testVector2.push_back(random_number(2) != 0);
}
// Test insertions
StrongCheck(testVector, test_insert_one<BitVector>(testVector) );
StrongCheck(testVector, test_insert_one<BitVector>(testVector,0) );
StrongCheck(testVector, test_insert_one<BitVector>(testVector, (int)testVector.size()) );
StrongCheck(testVector, test_insert_n<BitVector>(testVector, random_number(random_base) ) );
StrongCheck(testVector, test_insert_n<BitVector>(testVector, random_number(random_base),0 ) );
StrongCheck(testVector, test_insert_n<BitVector>(testVector, random_number(random_base), (int)testVector.size()) );
#if 0
// Allocate some random bools to insert
size_t insCnt = 1 + random_number(random_base);
bool *insFirst = new BitVector::value_type[insCnt];
for (size_t n = 0; n < insCnt; n++)
insFirst[n] = random_number(2);
StrongCheck(testVector, insert_range_tester(testVector, insFirst, insFirst+insCnt));
StrongCheck(testVector, insert_range_at_begin_tester(testVector, insFirst, insFirst+insCnt));
StrongCheck(testVector, insert_range_at_end_tester(testVector, insFirst, insFirst+insCnt));
ConstCheck(0, test_construct_pointer_range<BitVector>( insFirst, insFirst + insCnt));
delete[] insFirst;
#endif
StrongCheck(testVector, insert_range_tester(testVector, testVector2.begin(), testVector2.end()));
StrongCheck(testVector, insert_range_at_begin_tester(testVector, testVector2.begin(),
testVector2.end()));
StrongCheck(testVector, insert_range_at_end_tester(testVector, testVector2.begin(),
testVector2.end()));
StrongCheck(testVector, test_BitVector_reserve( testVector.capacity() + random_number(50)));
StrongCheck(testVector, test_push_back<BitVector>(testVector));
StrongCheck(emptyVector, test_push_back<BitVector>(emptyVector));
ConstCheck(0, test_default_construct<BitVector>());
ConstCheck(0, test_construct_n<BitVector>(random_number(random_base)));
ConstCheck(0, test_construct_n_instance<BitVector>(random_number(random_base)));
ConstCheck(0, test_construct_iter_range<BitVector>(testVector2));
ConstCheck(testVector, test_copy_construct<BitVector>() );
WeakCheck(testVector, test_assign_op<BitVector>(testVector2) );
}
# endif /* BIT_VECTOR_IMPLEMENTED */

View File

@@ -0,0 +1,39 @@
/***********************************************************************************
test_bitset.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#include "Prefix.h"
#if defined( EH_BITSET_IMPLEMENTED )
#include "Tests.h"
#include <bitset>
#include "TestClass.h"
#include "LeakCheck.h"
#include "test_construct.h"
#include "test_assign_op.h"
#include "test_push_back.h"
#include "test_insert.h"
#include "test_push_front.h"
typedef bitset<100> TestBitset;
inline sequence_container_tag
container_category(const TestBitset&)
{
return sequence_container_tag();
}
void test_bitset()
{
}
#endif // EH_BITSET_IMPLEMENTED

View File

@@ -0,0 +1,125 @@
/***********************************************************************************
test_construct.h
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#ifndef test_construct_H_
#define test_construct_H_
#include "Prefix.h"
#if defined (EH_NEW_HEADERS)
# include <algorithm>
# include <cassert>
# include <cstdlib>
#else
# include <algo.h>
# include <assert.h>
# include <stdlib.h>
#endif
USING_CSTD_NAME(size_t)
template <class T>
struct test_copy_construct {
test_copy_construct() {
gTestController.SetCurrentTestName("copy constructor");
}
void operator()( const T& t ) const {
T aCopy( t );
// Prevent simulated failures during verification
gTestController.CancelFailureCountdown();
//EH_ASSERT( aCopy == t );
CheckInvariant(t);
}
};
template <class T>
struct test_default_construct {
test_default_construct() {
gTestController.SetCurrentTestName("default constructor");
}
void operator()( int ) const {
T t;
CheckInvariant(t);
}
};
template <class T>
struct test_construct_n {
test_construct_n( size_t _n ) : n(_n+1) {
gTestController.SetCurrentTestName("n-size constructor");
}
void operator()( int ) const {
T t(n);
CheckInvariant(t);
}
size_t n;
};
template <class T>
struct test_construct_n_instance {
test_construct_n_instance( size_t _n ) : n(_n+1) {
gTestController.SetCurrentTestName("n-size with instance constructor");
}
void operator()( int ) const {
typedef typename T::value_type Value_type;
Value_type Val = 0;
T t( n, Val );
CheckInvariant(t);
}
size_t n;
};
template <class T>
struct test_construct_pointer_range {
test_construct_pointer_range( const typename T::value_type *first,
const typename T::value_type* last )
: fItems( first ), fEnd( last ) {
gTestController.SetCurrentTestName("pointer range constructor");
}
void operator()( int ) const {
T t( fItems, fEnd );
// Prevent simulated failures during verification
gTestController.CancelFailureCountdown();
CheckInvariant(t);
}
const typename T::value_type* fItems, *fEnd;
};
template <class T>
struct test_construct_iter_range {
test_construct_iter_range( const T& src ) : fItems( src ) {
gTestController.SetCurrentTestName("iterator range constructor");
}
void operator()( int ) const {
T t( fItems.begin(), fItems.end() );
// Prevent simulated failures during verification
gTestController.CancelFailureCountdown();
EH_ASSERT( t == fItems );
CheckInvariant(t);
}
const T& fItems;
};
#endif // test_construct_H_

View File

@@ -0,0 +1,95 @@
/***********************************************************************************
test_deque.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#include "Tests.h"
# if defined (EH_NEW_HEADERS)
# ifdef __SUNPRO_CC
# include <stdio.h>
# else
# include <cstdio>
# endif
# include <deque>
# else
# include <stdio.h>
# include <deque.h>
# endif
#include "TestClass.h"
#include "LeakCheck.h"
#include "test_construct.h"
#include "test_assign_op.h"
#include "test_push_back.h"
#include "test_insert.h"
#include "test_push_front.h"
typedef TestClass DQTestClass;
typedef EH_STD::deque<DQTestClass, eh_allocator(DQTestClass) > TestDeque;
inline sequence_container_tag
container_category(const TestDeque&)
{
return sequence_container_tag();
}
void test_deque()
{
size_t dequeSize = random_number(random_base);
TestDeque emptyDeque;
TestDeque testDeque, testDeque2;
while ( testDeque.size() < dequeSize )
{
DQTestClass x;
testDeque.push_back( x );
testDeque2.push_back( DQTestClass() );
}
ConstCheck( testDeque, test_copy_construct<TestDeque>() );
WeakCheck( testDeque, test_insert_one<TestDeque>(testDeque) );
StrongCheck( testDeque, test_insert_one<TestDeque>(testDeque, 0) );
StrongCheck( testDeque, test_insert_one<TestDeque>(testDeque, (int)testDeque.size()) );
WeakCheck( testDeque, test_insert_n<TestDeque>(testDeque, random_number(random_base) ) );
StrongCheck( testDeque, test_insert_n<TestDeque>(testDeque, random_number(random_base), 0 ) );
StrongCheck( testDeque, test_insert_n<TestDeque>(testDeque, random_number(random_base), (int)testDeque.size() ) );
size_t insCnt = random_number(random_base);
DQTestClass *insFirst = new TestDeque::value_type[insCnt + 1];
WeakCheck( testDeque, insert_range_tester(testDeque, insFirst, insFirst + insCnt) );
StrongCheck( testDeque, insert_range_at_begin_tester(testDeque, insFirst, insFirst + insCnt) );
StrongCheck( testDeque, insert_range_at_end_tester(testDeque, insFirst, insFirst + insCnt) );
ConstCheck( 0, test_construct_pointer_range<TestDeque>(insFirst, insFirst + insCnt) );
delete[] insFirst;
WeakCheck( testDeque, insert_range_tester(testDeque, testDeque2.begin(), testDeque2.end() ) );
StrongCheck( testDeque, test_push_back<TestDeque>(testDeque) );
StrongCheck( emptyDeque, test_push_back<TestDeque>(emptyDeque) );
StrongCheck( testDeque, test_push_front<TestDeque>(testDeque) );
StrongCheck( emptyDeque, test_push_front<TestDeque>(emptyDeque) );
ConstCheck( 0, test_default_construct<TestDeque>() );
ConstCheck( 0, test_construct_n<TestDeque>( random_number(random_base) ) );
ConstCheck( 0, test_construct_n_instance<TestDeque>( random_number(random_base) ) );
ConstCheck( 0, test_construct_iter_range<TestDeque>( testDeque2 ) );
testDeque2.resize( testDeque.size() * 3 / 2 );
WeakCheck( testDeque, test_assign_op<TestDeque>( testDeque2 ) );
testDeque2.resize( testDeque.size() * 2 / 3 );
WeakCheck( testDeque, test_assign_op<TestDeque>( testDeque2 ) );
}

View File

@@ -0,0 +1,131 @@
/***********************************************************************************
test_hash_map.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#include "Tests.h"
#if defined( EH_HASHED_CONTAINERS_IMPLEMENTED )
#include "TestClass.h"
#include "LeakCheck.h"
# include <hash_map>
#include "test_construct.h"
#include "test_assign_op.h"
#include "test_push_back.h"
#include "test_insert.h"
#include "test_push_front.h"
#include "ThrowCompare.h"
#include "test_hash_resize.h"
/*
template struct pair<const TestClass, TestClass>;
template struct __hashtable_node<pair<const TestClass, TestClass> >;
template class hash_map<TestClass, TestClass, ThrowHash, ThrowEqual>;
template class hash_multimap<TestClass, TestClass, ThrowHash, ThrowEqual>;
*/
typedef EH_STD::__hash_multimap__<TestClass, TestClass, ThrowHash, ThrowEqual,
eh_allocator(TestClass) > TestMultiMap;
inline multimap_tag
container_category(const TestMultiMap&) {
return multimap_tag();
}
void test_hash_multimap() {
# if !(defined (_MSC_VER) && (_MSC_VER < 1100))
TestMultiMap testMultiMap, testMultiMap2;
const size_t hash_mapSize = random_number(random_base);
while ( testMultiMap.size() < hash_mapSize )
{
TestMultiMap::value_type x;
testMultiMap.insert( x );
testMultiMap2.insert( TestMultiMap::value_type() );
}
# if defined( EH_HASH_CONTAINERS_SUPPORT_RESIZE )
WeakCheck( testMultiMap, test_hash_resize<TestMultiMap>() );
// TestMultiMap == TestMultiMap: no such operator! - ptr
// StrongCheck( testMultiMap, test_insert_noresize<TestMultiMap>(testMultiMap) );
# endif
WeakCheck( testMultiMap, test_insert_value<TestMultiMap>(testMultiMap) );
size_t insCnt = random_number(random_base);
TestMultiMap::value_type *insFirst = new TestMultiMap::value_type[1+insCnt];
WeakCheck( testMultiMap, insert_range_tester(testMultiMap, insFirst, insFirst+insCnt) );
ConstCheck( 0, test_construct_pointer_range<TestMultiMap>(insFirst, insFirst+insCnt) );
delete[] insFirst;
WeakCheck( testMultiMap, insert_range_tester(testMultiMap, testMultiMap2.begin(), testMultiMap2.end() ) );
ConstCheck( 0, test_default_construct<TestMultiMap>() );
# if EH_HASH_CONTAINERS_SUPPORT_ITERATOR_CONSTRUCTION
ConstCheck( 0, test_construct_iter_range_n<TestMultiMap>( testMultiMap2 ) );
# endif
ConstCheck( testMultiMap, test_copy_construct<TestMultiMap>() );
WeakCheck( testMultiMap, test_assign_op<TestMultiMap>( testMultiMap2 ) );
# endif
}
typedef EH_STD::__hash_map__<TestClass, TestClass, ThrowHash,
ThrowEqual, eh_allocator(TestClass) > TestMap;
inline map_tag
container_category(const TestMap&)
{
return map_tag();
}
void test_hash_map()
{
# if !(defined (_MSC_VER) && (_MSC_VER < 1100))
TestMap testMap, testMap2;
const size_t hash_mapSize = random_number(random_base);
while ( testMap.size() < hash_mapSize ) {
TestMap::value_type x;
testMap.insert( x );
testMap2.insert( TestMap::value_type() );
}
#if defined( EH_HASH_CONTAINERS_SUPPORT_RESIZE )
WeakCheck( testMap, test_hash_resize<TestMap>() );
// TestMultiMap == TestMultiMap: no such operator! - ptr
// StrongCheck( testMap, test_insert_noresize<TestMap>(testMap) );
#endif
WeakCheck( testMap, test_insert_value<TestMap>(testMap) );
size_t insCnt = random_number(random_base);
TestMap::value_type *insFirst = new TestMap::value_type[1+insCnt];
WeakCheck( testMap, insert_range_tester(testMap, insFirst, insFirst+insCnt) );
ConstCheck( 0, test_construct_pointer_range<TestMap>(insFirst, insFirst+insCnt) );
delete[] insFirst;
WeakCheck( testMap, insert_range_tester(testMap, testMap2.begin(), testMap2.end() ) );
ConstCheck( 0, test_default_construct<TestMap>() );
# if EH_HASH_CONTAINERS_SUPPORT_ITERATOR_CONSTRUCTION
ConstCheck( 0, test_construct_iter_range_n<TestMap>( testMap2 ) );
# endif
ConstCheck( testMap, test_copy_construct<TestMap>() );
WeakCheck( testMap, test_assign_op<TestMap>( testMap2 ) );
# endif
}
#endif // EH_HASHED_CONTAINERS_IMPLEMENTED

View File

@@ -0,0 +1,56 @@
/***********************************************************************************
test_hash_resize.h
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#ifndef test_hash_resize__
#define test_hash_resize__
#include "random_number.h"
#include "nc_alloc.h"
template <class T>
struct test_hash_resize
{
test_hash_resize()
{
gTestController.SetCurrentTestName("hash resize");
}
void operator()( T& t ) const
{
t.resize( 1+random_number(random_base) + t.bucket_count() );
}
};
template <class T>
struct test_construct_iter_range_n
{
test_construct_iter_range_n( const T& src )
: fItems( src )
{
gTestController.SetCurrentTestName("iterator range n-size constructor");
}
void operator()( int ) const
{
T t( fItems.begin(), fItems.end(), fItems.size() );
// prevent simulated failures during verification
gTestController.CancelFailureCountdown();
CheckInvariant(t);
}
const T& fItems;
};
#endif //__test_hash_resize__

View File

@@ -0,0 +1,127 @@
/***********************************************************************************
test_hash_set.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#include "Tests.h"
#if defined( EH_HASHED_CONTAINERS_IMPLEMENTED )
# include <hash_set>
#include "TestClass.h"
#include "LeakCheck.h"
#include "test_construct.h"
#include "test_assign_op.h"
#include "test_push_back.h"
#include "test_insert.h"
#include "test_push_front.h"
#include "ThrowCompare.h"
#include "test_hash_resize.h"
typedef EH_STD::__hash_multiset__<TestClass, ThrowHash, ThrowEqual,
eh_allocator(TestClass) > TestMultiSet;
inline multiset_tag
container_category(const TestMultiSet&)
{
return multiset_tag();
}
void test_hash_multiset()
{
# if !(defined (_MSC_VER) && (_MSC_VER < 1100))
TestMultiSet testMultiSet, testMultiSet2;
const size_t hash_setSize = random_number(random_base);
while ( testMultiSet.size() < hash_setSize )
{
TestMultiSet::value_type x;
testMultiSet.insert( x );
testMultiSet2.insert( TestMultiSet::value_type() );
}
# if defined( EH_HASH_CONTAINERS_SUPPORT_RESIZE )
WeakCheck( testMultiSet, test_hash_resize<TestMultiSet>() );
// TestMultiSet == TestMultiSet: no such operator! - ptr
// StrongCheck( testMultiSet, test_insert_noresize<TestMultiSet>(testMultiSet) );
# endif
WeakCheck( testMultiSet, test_insert_value<TestMultiSet>(testMultiSet) );
size_t insCnt = random_number(random_base);
TestMultiSet::value_type *insFirst = new TestMultiSet::value_type[1+insCnt];
WeakCheck( testMultiSet, insert_range_tester(testMultiSet, insFirst, insFirst+insCnt) );
ConstCheck( 0, test_construct_pointer_range<TestMultiSet>(insFirst, insFirst+insCnt) );
delete[] insFirst;
WeakCheck( testMultiSet, insert_range_tester(testMultiSet, testMultiSet2.begin(), testMultiSet2.end() ) );
ConstCheck( 0, test_default_construct<TestMultiSet>() );
# if EH_HASH_CONTAINERS_SUPPORT_ITERATOR_CONSTRUCTION
ConstCheck( 0, test_construct_iter_range_n<TestMultiSet>( testMultiSet2 ) );
# endif
ConstCheck( testMultiSet, test_copy_construct<TestMultiSet>() );
WeakCheck( testMultiSet, test_assign_op<TestMultiSet>( testMultiSet2 ) );
# endif
}
typedef EH_STD::__hash_set__<TestClass, ThrowHash, ThrowEqual, eh_allocator(TestClass) > TestSet;
inline set_tag
container_category(const TestSet&)
{
return set_tag();
}
void test_hash_set()
{
# if !(defined (_MSC_VER) && (_MSC_VER < 1100))
TestSet testSet, testSet2;
const size_t hash_setSize = random_number(random_base);
while ( testSet.size() < hash_setSize )
{
TestSet::value_type x;
testSet.insert( x );
testSet2.insert( TestSet::value_type() );
}
# if defined( EH_HASH_CONTAINERS_SUPPORT_RESIZE )
WeakCheck( testSet, test_hash_resize<TestSet>() );
// TestMultiSet == TestMultiSet: no such operator! - ptr
// StrongCheck( testSet, test_insert_noresize<TestSet>(testSet) );
# endif
WeakCheck( testSet, test_insert_value<TestSet>(testSet) );
size_t insCnt = random_number(random_base);
TestSet::value_type *insFirst = new TestSet::value_type[1+insCnt];
WeakCheck( testSet, insert_range_tester(testSet, insFirst, insFirst+insCnt) );
ConstCheck( 0, test_construct_pointer_range<TestSet>(insFirst, insFirst+insCnt) );
delete[] insFirst;
WeakCheck( testSet, insert_range_tester(testSet, testSet2.begin(), testSet2.end() ) );
ConstCheck( 0, test_default_construct<TestSet>() );
# if EH_HASH_CONTAINERS_SUPPORT_ITERATOR_CONSTRUCTION
ConstCheck( 0, test_construct_iter_range_n<TestSet>( testSet2 ) );
# endif
ConstCheck( testSet, test_copy_construct<TestSet>() );
WeakCheck( testSet, test_assign_op<TestSet>( testSet2 ) );
# endif
}
#endif // EH_HASHED_CONTAINERS_IMPLEMENTED

View File

@@ -0,0 +1,552 @@
/***********************************************************************************
test_insert.h
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#ifndef test_insert_H_
#define test_insert_H_
# include "Prefix.h"
# if defined (EH_NEW_HEADERS)
# include <utility>
# include <vector>
# include <cassert>
# include <climits>
# else
# include <vector.h>
# include <assert.h>
# include <limits.h>
# endif
#include "random_number.h"
#include "nc_alloc.h"
#include "ThrowCompare.h"
// A classification system for containers, for verification
struct container_tag {};
struct sequence_container_tag {};
struct associative_container_tag {};
struct set_tag {};
struct multiset_tag {};
struct map_tag {};
struct multimap_tag {};
template <class C, class Iter>
size_t CountNewItems( const C&, const Iter& firstNew,
const Iter& lastNew, sequence_container_tag )
{
size_t dist = 0;
#if 0 //def __SUNPRO_CC
EH_DISTANCE( firstNew, lastNew, dist );
#else
EH_DISTANCE( Iter(firstNew), Iter(lastNew), dist );
#endif
return dist;
}
template <class C, class Iter>
size_t CountNewItems( const C& c, const Iter& firstNew,
const Iter& lastNew, multimap_tag )
{
return CountNewItems( c, firstNew, lastNew, sequence_container_tag() );
}
template <class C, class Iter>
size_t CountNewItems( const C& c, const Iter& firstNew,
const Iter& lastNew, multiset_tag )
{
return CountNewItems( c, firstNew, lastNew, sequence_container_tag() );
}
template <class C, class Iter, class KeyOfValue>
#ifdef __BORLANDC__
size_t CountUniqueItems_Aux( const C& original, const Iter& firstNew,
#else
size_t CountUniqueItems_Aux( const C& original, Iter firstNew,
#endif
Iter lastNew, const KeyOfValue& keyOfValue )
{
typedef typename C::key_type key;
typedef typename C::const_iterator const_iter;
typedef EH_STD::vector<key> key_list;
typedef typename key_list::iterator key_iterator;
key_list keys;
size_t dist = 0;
#ifdef __SUNPRO_CC
EH_DISTANCE( firstNew, lastNew, dist );
#else
EH_DISTANCE( Iter(firstNew), Iter(lastNew), dist );
#endif
keys.reserve( dist );
for ( Iter x = firstNew; x != lastNew; ++x )
keys.push_back( keyOfValue(*x) );
EH_STD::sort( keys.begin(), keys.end() );
key_iterator last = EH_STD::unique( keys.begin(), keys.end() );
size_t cnt = 0;
for ( key_iterator tmp = keys.begin(); tmp != last; ++tmp )
{
if ( const_iter(original.find( *tmp )) == const_iter(original.end()) )
++cnt;
}
return cnt;
}
#if ! defined (__SGI_STL)
EH_BEGIN_NAMESPACE
template <class T>
struct identity
{
const T& operator()( const T& x ) const { return x; }
};
# if ! defined (__KCC)
template <class _Pair>
struct select1st : public unary_function<_Pair, typename _Pair::first_type> {
const typename _Pair::first_type& operator()(const _Pair& __x) const {
return __x.first;
}
};
# endif
EH_END_NAMESPACE
#endif
template <class C, class Iter>
size_t CountUniqueItems( const C& original, const Iter& firstNew,
const Iter& lastNew, set_tag )
{
typedef typename C::value_type value_type;
return CountUniqueItems_Aux( original, firstNew, lastNew,
EH_STD::identity<value_type>() );
}
template <class C, class Iter>
size_t CountUniqueItems( const C& original, const Iter& firstNew,
const Iter& lastNew, map_tag )
{
#ifdef EH_MULTI_CONST_TEMPLATE_ARG_BUG
return CountUniqueItems_Aux( original, firstNew, lastNew,
EH_SELECT1ST_HINT<C::value_type, C::key_type>() );
#else
typedef typename C::value_type value_type;
return CountUniqueItems_Aux( original, firstNew, lastNew,
EH_STD::select1st<value_type>() );
#endif
}
template <class C, class Iter>
size_t CountNewItems( const C& original, const Iter& firstNew,
const Iter& lastNew, map_tag )
{
return CountUniqueItems( original, firstNew, lastNew,
container_category( original ) );
}
template <class C, class Iter>
size_t CountNewItems( const C& original, const Iter& firstNew,
const Iter& lastNew, set_tag )
{
return CountUniqueItems( original, firstNew, lastNew,
container_category( original ) );
}
template <class C, class SrcIter>
inline void VerifyInsertion( const C& original, const C& result,
const SrcIter& firstNew, const SrcIter& lastNew,
size_t, associative_container_tag )
{
typedef typename C::const_iterator DstIter;
DstIter first1 = original.begin();
DstIter first2 = result.begin();
DstIter* from_orig = new DstIter[original.size()];
DstIter* last_from_orig = from_orig;
// fbp : for hashed containers, the following is needed :
while ( first2 != result.end() )
{
EH_STD::pair<DstIter, DstIter> p = EH_STD::mismatch( first1, original.end(), first2 );
if ( p.second != result.end() )
{
SrcIter srcItem = EH_STD::find( SrcIter(firstNew), SrcIter(lastNew), *p.second );
if (srcItem == lastNew)
{
// not found in input range, probably re-ordered from the orig
DstIter* tmp;
tmp = EH_STD::find( from_orig, last_from_orig, p.first );
// if already here, exclude
if (tmp != last_from_orig)
{
EH_STD::copy(tmp+1, last_from_orig, tmp);
last_from_orig--;
}
else
{
// register re-ordered element
DstIter dstItem;
dstItem = EH_STD::find( first1, original.end(), *p.first );
EH_ASSERT( dstItem != original.end() );
*last_from_orig = dstItem;
last_from_orig++;
++p.first;
}
}
++p.second;
}
first1 = p.first;
first2 = p.second;
}
delete [] from_orig;
}
// VC++
template <class C, class SrcIter>
inline void VerifyInsertion(
const C& original, const C& result, const SrcIter& firstNew,
const SrcIter& lastNew, size_t, set_tag )
{
VerifyInsertion( original, result, firstNew, lastNew,
size_t(0), associative_container_tag() );
}
template <class C, class SrcIter>
inline void VerifyInsertion(const C& original, const C& result,
const SrcIter& firstNew, const SrcIter& lastNew,
size_t, multiset_tag )
{
VerifyInsertion( original, result, firstNew, lastNew,
size_t(0), associative_container_tag() );
}
template <class C, class SrcIter>
inline void VerifyInsertion(
const C& original, const C& result, const SrcIter& firstNew,
const SrcIter& lastNew, size_t, map_tag )
{
VerifyInsertion( original, result, firstNew, lastNew,
size_t(0), associative_container_tag() );
}
template <class C, class SrcIter>
inline void VerifyInsertion(
const C& original, const C& result, const SrcIter& firstNew,
const SrcIter& lastNew, size_t, multimap_tag )
{
VerifyInsertion( original, result, firstNew, lastNew,
size_t(0), associative_container_tag() );
}
template <class C, class SrcIter>
void VerifyInsertion(
# ifdef _MSC_VER
const C& original, const C& result, SrcIter firstNew,
SrcIter lastNew, size_t insPos, sequence_container_tag )
# else
const C& original, const C& result, const SrcIter& firstNew,
const SrcIter& lastNew, size_t insPos, sequence_container_tag )
# endif
{
typename C::const_iterator p1 = original.begin();
typename C::const_iterator p2 = result.begin();
SrcIter tmp(firstNew);
for ( size_t n = 0; n < insPos; n++, ++p1, ++p2)
EH_ASSERT( *p1 == *p2 );
for (; tmp != lastNew; ++p2, ++tmp ) {
EH_ASSERT(p2 != result.end());
EH_ASSERT(*p2 == *tmp);
}
for (; p2 != result.end(); ++p1, ++p2 )
EH_ASSERT( *p1 == *p2 );
EH_ASSERT( p1 == original.end() );
}
template <class C, class SrcIter>
inline void VerifyInsertion( const C& original, const C& result,
const SrcIter& firstNew,
const SrcIter& lastNew, size_t insPos )
{
EH_ASSERT( result.size() == original.size() +
CountNewItems( original, firstNew, lastNew,
container_category(original) ) );
VerifyInsertion( original, result, firstNew, lastNew, insPos,
container_category(original) );
}
template <class C, class Value>
void VerifyInsertN( const C& original, const C& result, size_t insCnt,
const Value& val, size_t insPos )
{
typename C::const_iterator p1 = original.begin();
typename C::const_iterator p2 = result.begin();
(void)val; //*TY 02/06/2000 - to suppress unused variable warning under nondebug build
for ( size_t n = 0; n < insPos; n++ )
EH_ASSERT( *p1++ == *p2++ );
while ( insCnt-- > 0 )
{
EH_ASSERT(p2 != result.end());
EH_ASSERT(*p2 == val );
++p2;
}
while ( p2 != result.end() ) {
EH_ASSERT( *p1 == *p2 );
++p1; ++p2;
}
EH_ASSERT( p1 == original.end() );
}
template <class C>
void prepare_insert_n( C&, size_t ) {}
// Metrowerks 1.8 compiler requires that specializations appear first (!!)
// or it won't call them. Fixed in 1.9, though.
inline void MakeRandomValue(bool& b) { b = bool(random_number(2) != 0); }
template<class T>
inline void MakeRandomValue(T&) {}
template <class C>
struct test_insert_one
{
test_insert_one( const C& orig, int pos =-1 )
: original( orig ), fPos( random_number( orig.size() ))
{
MakeRandomValue( fInsVal );
if ( pos != -1 )
{
fPos = size_t(pos);
if ( pos == 0 )
gTestController.SetCurrentTestName("single insertion at begin()");
else
gTestController.SetCurrentTestName("single insertion at end()");
}
else
gTestController.SetCurrentTestName("single insertion at random position");
}
void operator()( C& c ) const
{
prepare_insert_n( c, (size_t)1 );
typename C::iterator pos = c.begin();
EH_STD::advance( pos, size_t(fPos) );
c.insert( pos, fInsVal );
// Prevent simulated failures during verification
gTestController.CancelFailureCountdown();
// Success. Check results.
VerifyInsertion( original, c, &fInsVal, 1+&fInsVal, fPos );
}
private:
typename C::value_type fInsVal;
const C& original;
size_t fPos;
};
template <class C>
struct test_insert_n
{
test_insert_n( const C& orig, size_t insCnt, int pos =-1 )
: original( orig ), fPos( random_number( orig.size() )), fInsCnt(insCnt)
{
MakeRandomValue( fInsVal );
if (pos!=-1)
{
fPos=size_t(pos);
if (pos==0)
gTestController.SetCurrentTestName("n-ary insertion at begin()");
else
gTestController.SetCurrentTestName("n-ary insertion at end()");
}
else
gTestController.SetCurrentTestName("n-ary insertion at random position");
}
void operator()( C& c ) const
{
prepare_insert_n( c, fInsCnt );
typename C::iterator pos = c.begin();
EH_STD::advance( pos, fPos );
c.insert( pos, fInsCnt, fInsVal );
// Prevent simulated failures during verification
gTestController.CancelFailureCountdown();
// Success. Check results.
VerifyInsertN( original, c, fInsCnt, fInsVal, fPos );
}
private:
typename C::value_type fInsVal;
const C& original;
size_t fPos;
size_t fInsCnt;
};
template <class C>
struct test_insert_value
{
test_insert_value( const C& orig )
: original( orig )
{
MakeRandomValue( fInsVal );
gTestController.SetCurrentTestName("insertion of random value");
}
void operator()( C& c ) const
{
c.insert( fInsVal );
// Prevent simulated failures during verification
gTestController.CancelFailureCountdown();
// Success. Check results.
VerifyInsertion( original, c, &fInsVal, 1+&fInsVal, size_t(0) );
}
private:
typename C::value_type fInsVal;
const C& original;
};
template <class C>
struct test_insert_noresize
{
test_insert_noresize( const C& orig )
: original( orig )
{
MakeRandomValue( fInsVal );
gTestController.SetCurrentTestName("insertion of random value without resize");
}
void operator()( C& c ) const
{
c.insert_noresize( fInsVal );
// Prevent simulated failures during verification
gTestController.CancelFailureCountdown();
// Success. Check results.
VerifyInsertion( original, c, &fInsVal, 1+&fInsVal, size_t(0) );
}
private:
typename C::value_type fInsVal;
const C& original;
};
template <class C, class Position, class Iter>
void do_insert_range( C& c_inst, Position offset,
Iter first, Iter last, sequence_container_tag )
{
typedef typename C::iterator CIter;
CIter pos = c_inst.begin();
EH_STD::advance( pos, offset );
c_inst.insert( pos, first, last );
}
template <class C, class Position, class Iter>
void do_insert_range( C& c, Position,
Iter first, Iter last, associative_container_tag )
{
c.insert( first, last );
}
template <class C, class Position, class Iter>
void do_insert_range( C& c, Position, Iter first, Iter last, multiset_tag )
{
c.insert( first, last );
}
template <class C, class Position, class Iter>
void do_insert_range( C& c, Position, Iter first, Iter last, multimap_tag )
{
c.insert( first, last );
}
template <class C, class Position, class Iter>
void do_insert_range( C& c, Position, Iter first, Iter last, set_tag )
{
c.insert( first, last );
}
template <class C, class Position, class Iter>
void do_insert_range( C& c, Position, Iter first, Iter last, map_tag )
{
c.insert( first, last );
}
/*
template <class C, class Iter>
void prepare_insert_range( C&, size_t, Iter, Iter) {}
*/
template <class C, class Iter>
struct test_insert_range
{
test_insert_range( const C& orig, Iter first, Iter last, int pos=-1 )
: fFirst( first ),
fLast( last ),
original( orig ),
fPos( random_number( orig.size() ))
{
gTestController.SetCurrentTestName("range insertion");
if ( pos != -1 )
{
fPos = size_t(pos);
if ( pos == 0 )
gTestController.SetCurrentTestName("range insertion at begin()");
else
gTestController.SetCurrentTestName("range insertion at end()");
}
else
gTestController.SetCurrentTestName("range insertion at random position");
}
void operator()( C& c ) const
{
// prepare_insert_range( c, fPos, fFirst, fLast );
do_insert_range( c, fPos, fFirst, fLast, container_category(c) );
// Prevent simulated failures during verification
gTestController.CancelFailureCountdown();
// Success. Check results.
VerifyInsertion( original, c, fFirst, fLast, fPos );
}
private:
Iter fFirst, fLast;
const C& original;
size_t fPos;
};
template <class C, class Iter>
test_insert_range<C, Iter> insert_range_tester( const C& orig, const Iter& first, const Iter& last )
{
return test_insert_range<C, Iter>( orig, first, last );
}
template <class C, class Iter>
test_insert_range<C, Iter> insert_range_at_begin_tester( const C& orig, const Iter& first, const Iter& last )
{
return test_insert_range<C, Iter>( orig, first, last , 0);
}
template <class C, class Iter>
test_insert_range<C, Iter> insert_range_at_end_tester( const C& orig, const Iter& first, const Iter& last )
{
return test_insert_range<C, Iter>( orig, first, last , (int)orig.size());
}
#endif // test_insert_H_

View File

@@ -0,0 +1,108 @@
/***********************************************************************************
test_list.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#include "Tests.h"
#include "TestClass.h"
#include "LeakCheck.h"
# if defined (EH_NEW_HEADERS)
#include <list>
#else
#include <list.h>
#endif
#include "test_construct.h"
#include "test_assign_op.h"
#include "test_push_back.h"
#include "test_insert.h"
#include "test_push_front.h"
#include "nc_alloc.h"
typedef EH_STD::__list__<TestClass, eh_allocator(TestClass) > TestList;
inline sequence_container_tag
container_category(const TestList&)
{
return sequence_container_tag();
}
//
// list sort() member test operation. Does not verify stability.
//
struct test_list_sort
{
test_list_sort()
{
gTestController.SetCurrentTestName("list::sort()");
}
void operator()( TestList& list ) const
{
list.sort();
gTestController.CancelFailureCountdown();
for ( TestList::iterator p = list.begin(); p != list.end(); p++ )
if ( p != list.begin() ) {
TestList::iterator tmp=p;
--tmp;
EH_ASSERT( *p >= *tmp );
}
}
};
void test_list()
{
TestList testList, testList2;
size_t listSize = random_number(random_base);
while ( testList.size() < listSize )
{
TestClass x;
testList.push_back( x );
testList2.push_back( TestClass() );
}
StrongCheck( testList, test_insert_one<TestList>(testList) );
StrongCheck( testList, test_insert_one<TestList>(testList, 0) );
StrongCheck( testList, test_insert_one<TestList>(testList, (int)testList.size()) );
WeakCheck( testList, test_insert_n<TestList>(testList, random_number(random_base) ) );
WeakCheck( testList, test_insert_n<TestList>(testList, random_number(random_base), 0 ) );
WeakCheck( testList, test_insert_n<TestList>(testList, random_number(random_base), (int)testList.size() ) );
size_t insCnt = random_number(random_base);
TestClass *insFirst = new TestList::value_type[1+insCnt];
WeakCheck( testList, insert_range_tester(testList, insFirst, insFirst+insCnt) );
WeakCheck( testList, insert_range_at_begin_tester(testList, insFirst, insFirst+insCnt) );
WeakCheck( testList, insert_range_at_end_tester(testList, insFirst, insFirst+insCnt) );
ConstCheck( 0, test_construct_pointer_range<TestList>(insFirst, insFirst+insCnt) );
delete[] insFirst;
WeakCheck( testList, insert_range_tester(testList, testList2.begin(), testList2.end() ) );
StrongCheck( testList, test_push_front<TestList>(testList) );
StrongCheck( testList, test_push_back<TestList>(testList) );
StrongCheck( testList, test_list_sort() ); // Simply to verify strength.
ConstCheck( 0, test_default_construct<TestList>() );
ConstCheck( 0, test_construct_n<TestList>( random_number(random_base) ) );
ConstCheck( 0, test_construct_n_instance<TestList>( random_number(random_base) ) );
ConstCheck( 0, test_construct_iter_range<TestList>( testList2 ) );
ConstCheck( testList, test_copy_construct<TestList>() );
WeakCheck( testList, test_assign_op<TestList>( testList2 ) );
}

View File

@@ -0,0 +1,127 @@
/***********************************************************************************
test_map.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#include "Tests.h"
#include "TestClass.h"
#include "LeakCheck.h"
# if defined (EH_NEW_HEADERS)
#include <map>
# else
#include <multimap.h>
#include <map.h>
# endif
#include "test_construct.h"
#include "test_assign_op.h"
#include "test_push_back.h"
#include "test_insert.h"
#include "test_push_front.h"
#include "ThrowCompare.h"
#include "test_insert.h"
template <class K, class V, class Comp, class A>
inline multimap_tag
container_category(const EH_STD::__multimap__<K,V,Comp, A>&)
{
return multimap_tag();
}
template <class K, class V, class Comp, class A >
inline map_tag
container_category(const EH_STD::__map__<K,V,Comp, A>&)
{
return map_tag();
}
typedef EH_STD::__multimap__<TestClass, TestClass, ThrowCompare, eh_allocator(TestClass) > TestMultiMap;
void test_multimap()
{
TestMultiMap testMultiMap, testMultiMap2;
const size_t mapSize = random_number(random_base);
while ( testMultiMap.size() < mapSize )
{
TestMultiMap::value_type x;
testMultiMap.insert( x );
testMultiMap2.insert( TestMultiMap::value_type() );
}
StrongCheck( testMultiMap, test_insert_value<TestMultiMap>(testMultiMap) );
size_t insCnt = 1 + random_number(random_base);
TestMultiMap::value_type *insFirst = new TestMultiMap::value_type[insCnt];
WeakCheck( testMultiMap, insert_range_tester(testMultiMap, insFirst, insFirst+insCnt) );
ConstCheck( 0, test_construct_pointer_range<TestMultiMap>(insFirst, insFirst+insCnt) );
delete[] insFirst;
WeakCheck( testMultiMap, insert_range_tester(testMultiMap, testMultiMap2.begin(), testMultiMap2.end() ) );
ConstCheck( 0, test_default_construct<TestMultiMap>() );
ConstCheck( 0, test_construct_iter_range<TestMultiMap>( testMultiMap2 ) );
ConstCheck( testMultiMap, test_copy_construct<TestMultiMap>() );
WeakCheck( testMultiMap, test_assign_op<TestMultiMap>( testMultiMap2 ) );
}
typedef EH_STD::__map__<TestClass, TestClass, ThrowCompare, eh_allocator(TestClass) > TestMap;
void CheckInvariant( const TestMap& m );
void CheckInvariant( const TestMap& m )
{
// assert( map.__rb_verify() );
size_t total = 0;
EH_DISTANCE( m.begin(), m.end(), total );
assert( m.size() == total );
}
void test_map()
{
TestMap testMap, testMap2;
const size_t mapSize = random_number(random_base);
while ( testMap.size() < mapSize )
{
TestMap::value_type x;
testMap.insert( x );
testMap2.insert( TestMap::value_type() );
}
StrongCheck( testMap, test_insert_value<TestMap>(testMap) );
size_t insCnt = random_number(random_base);
TestMap::value_type *insFirst = new TestMap::value_type[1+insCnt];
WeakCheck( testMap, insert_range_tester(testMap, insFirst, insFirst+insCnt) );
ConstCheck( 0, test_construct_pointer_range<TestMap>(insFirst, insFirst+insCnt) );
delete[] insFirst;
WeakCheck( testMap, insert_range_tester(testMap, testMap2.begin(), testMap2.end() ) );
ConstCheck( 0, test_default_construct<TestMap>() );
ConstCheck( 0, test_construct_iter_range<TestMap>( testMap2 ) );
ConstCheck( testMap, test_copy_construct<TestMap>() );
WeakCheck( testMap, test_assign_op<TestMap>( testMap2 ) );
}

View File

@@ -0,0 +1,50 @@
/***********************************************************************************
test_push_back.h
Interface for the test_push_back class
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#ifndef test_push_back_H_
#define test_push_back_H_
# ifdef EH_NEW_HEADERS
# include <cassert>
# else
# include <assert.h>
# endif
# include "Prefix.h"
#include "nc_alloc.h"
template <class C>
struct test_push_back
{
test_push_back( const C& orig ) : original( orig )
{
gTestController.SetCurrentTestName("push_back() method");
}
void operator()( C& c ) const
{
typedef typename C::value_type _value_type;
c.push_back(_value_type() );
// Prevent simulated failures during verification
gTestController.CancelFailureCountdown();
EH_ASSERT( c.size() == original.size() + 1 );
EH_ASSERT( EH_STD::equal( original.begin(), original.end(), c.begin() ) );
}
private:
const C& original;
};
#endif // test_push_back_H_

View File

@@ -0,0 +1,46 @@
/***********************************************************************************
test_push_front.h
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#ifndef test_push_front_H_
#define test_push_front_H_
# if defined (EH_NEW_HEADERS)
# include <cassert>
# else
# include <assert.h>
# endif
# include "Prefix.h"
template <class C>
struct test_push_front
{
test_push_front( const C& orig ) : original( orig ) {
gTestController.SetCurrentTestName("push_front() method");
}
void operator()( C& c ) const
{
typedef typename C::value_type _value_type;
c.push_front( _value_type() );
EH_ASSERT( c.size() == original.size() + 1 );
typename C::const_iterator next = c.begin();
EH_ASSERT( EH_STD::equal( original.begin(), original.end(), ++next ) );
}
private:
const C& original;
};
#endif // test_push_front_H_

View File

@@ -0,0 +1,99 @@
/***********************************************************************************
test_rope.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
# ifdef __SUNPRO_CC
# define _STLP_NO_MEMBER_TEMPLATE_CLASSES 1
# endif
#include "Prefix.h"
#include "Tests.h"
#include "TestClass.h"
#include "LeakCheck.h"
#include "test_construct.h"
#include "test_assign_op.h"
#include "test_push_back.h"
#include "test_insert.h"
#include "test_push_front.h"
#if defined( EH_ROPE_IMPLEMENTED )
#if !( defined(__MWERKS__) && __MWERKS__ < 0x1900 ) // CW1.8 can't compile this!
# define __STD_STUFF 1
# if defined (EH_NEW_HEADERS)
#include <rope>
#else
#include <rope.h>
#endif
typedef STLPORT::rope<char, eh_allocator(char) > TestRope;
inline sequence_container_tag
container_category(const TestRope&)
{
return sequence_container_tag();
}
void test_rope()
{
TestRope testRope, testRope2;
size_t ropeSize = random_number(random_base);
while ( testRope.size() < ropeSize )
{
TestRope::value_type x = TestRope::value_type(random_number(random_base)); // initialize before use
testRope.push_back( x );
testRope2.push_back( TestRope::value_type() );
}
WeakCheck( testRope, test_insert_one<TestRope>(testRope) );
WeakCheck( testRope, test_insert_one<TestRope>(testRope, 0) );
WeakCheck( testRope, test_insert_one<TestRope>(testRope, (int)testRope.size()) );
WeakCheck( testRope, test_insert_n<TestRope>(testRope, random_number(random_base) ) );
WeakCheck( testRope, test_insert_n<TestRope>(testRope, random_number(random_base), 0 ) );
WeakCheck( testRope, test_insert_n<TestRope>(testRope, random_number(random_base), (int)testRope.size() ) );
size_t insCnt = random_number(random_base);
TestRope::value_type *insFirst = new TestRope::value_type[1+insCnt];
WeakCheck( testRope, insert_range_tester(testRope, insFirst, insFirst+insCnt) );
WeakCheck( testRope, insert_range_at_begin_tester(testRope, insFirst, insFirst+insCnt) );
WeakCheck( testRope, insert_range_at_end_tester(testRope, insFirst, insFirst+insCnt) );
ConstCheck( 0, test_construct_pointer_range<TestRope>(insFirst, insFirst+insCnt) );
delete[] insFirst;
WeakCheck( testRope, insert_range_tester(testRope, testRope2.begin(), testRope2.end() ) );
WeakCheck( testRope, test_push_front<TestRope>(testRope) );
WeakCheck( testRope, test_push_back<TestRope>(testRope) );
ConstCheck( 0, test_default_construct<TestRope>() );
// dwa 1/25/00 - not actually valid for rope, because it doesn't
// have the constructor in question! The code will compile, but with the
// wrong result (the constructor that gets used does something different).
// ConstCheck( 0, test_construct_n<TestRope>( random_number(random_base) ) );
ConstCheck( 0, test_construct_n_instance<TestRope>( random_number(random_base) ) );
ConstCheck( 0, test_construct_iter_range<TestRope>( testRope2 ) );
ConstCheck( testRope, test_copy_construct<TestRope>() );
WeakCheck( testRope, test_assign_op<TestRope>( testRope2 ) );
}
#endif // __MWERKS__
#endif // EH_ROPE_IMPLEMENTED

View File

@@ -0,0 +1,100 @@
/***********************************************************************************
test_set.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#include "Tests.h"
#include "TestClass.h"
#include "LeakCheck.h"
#if defined (EH_NEW_HEADERS)
# include <set>
#else
# include <multiset.h>
# include <set.h>
#endif
#include "test_construct.h"
#include "test_assign_op.h"
#include "test_push_back.h"
#include "test_insert.h"
#include "test_push_front.h"
#include "ThrowCompare.h"
void test_multiset();
typedef EH_STD::__multiset__<TestClass, ThrowCompare, eh_allocator(TestClass) > TestMultiSet;
inline multiset_tag
container_category(const TestMultiSet&) {
return multiset_tag();
}
void test_multiset() {
TestMultiSet testMultiSet, testMultiSet2;
const size_t setSize = random_number(random_base);
while (testMultiSet.size() < setSize) {
TestMultiSet::value_type x;
testMultiSet.insert( x );
testMultiSet2.insert( TestMultiSet::value_type() );
}
StrongCheck( testMultiSet, test_insert_value<TestMultiSet>(testMultiSet) );
size_t insCnt = random_number(random_base);
TestMultiSet::value_type *insFirst = new TestMultiSet::value_type[1+insCnt];
WeakCheck( testMultiSet, insert_range_tester(testMultiSet, insFirst, insFirst+insCnt) );
ConstCheck( 0, test_construct_pointer_range<TestMultiSet>(insFirst, insFirst+insCnt) );
delete[] insFirst;
WeakCheck( testMultiSet, insert_range_tester(testMultiSet, testMultiSet2.begin(), testMultiSet2.end() ) );
ConstCheck( 0, test_default_construct<TestMultiSet>() );
ConstCheck( 0, test_construct_iter_range<TestMultiSet>( testMultiSet2 ) );
ConstCheck( testMultiSet, test_copy_construct<TestMultiSet>() );
WeakCheck( testMultiSet, test_assign_op<TestMultiSet>( testMultiSet2 ) );
}
typedef EH_STD::__set__<TestClass, ThrowCompare, eh_allocator(TestClass) > TestSet;
inline set_tag
container_category(const TestSet&) {
return set_tag();
}
void test_set() {
TestSet testSet, testSet2;
const size_t setSize = random_number(random_base);
while ( testSet.size() < setSize ) {
TestSet::value_type x;
testSet.insert( x );
testSet2.insert( TestSet::value_type() );
}
StrongCheck( testSet, test_insert_value<TestSet>(testSet) );
size_t insCnt = random_number(random_base);
TestSet::value_type *insFirst = new TestSet::value_type[1+insCnt];
WeakCheck( testSet, insert_range_tester(testSet, insFirst, insFirst+insCnt) );
ConstCheck( 0, test_construct_pointer_range<TestSet>(insFirst, insFirst+insCnt) );
delete[] insFirst;
WeakCheck( testSet, insert_range_tester(testSet, testSet2.begin(), testSet2.end() ) );
ConstCheck( 0, test_default_construct<TestSet>() );
ConstCheck( 0, test_construct_iter_range<TestSet>( testSet2 ) );
ConstCheck( testSet, test_copy_construct<TestSet>() );
WeakCheck( testSet, test_assign_op<TestSet>( testSet2 ) );
}

View File

@@ -0,0 +1,91 @@
/***********************************************************************************
test_slist.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#include "Tests.h"
#if defined( EH_SLIST_IMPLEMENTED )
# include "TestClass.h"
# include "LeakCheck.h"
# if defined (EH_NEW_HEADERS) && defined (EH_USE_SGI_STL)
# include <slist>
# else
# include <slist.h>
# endif
#include "test_construct.h"
#include "test_assign_op.h"
#include "test_push_back.h"
#include "test_insert.h"
#include "test_push_front.h"
#if defined (__GNUC__) && defined (__APPLE__)
typedef EH_STD::slist<TestClass, eh_allocator(TestClass) > TestSList;
#else
typedef EH_STD::__slist__<TestClass, eh_allocator(TestClass) > TestSList;
#endif
inline sequence_container_tag
container_category(const TestSList&) {
return sequence_container_tag();
}
struct test_slist_sort {
test_slist_sort() {
gTestController.SetCurrentTestName("slist::sort()");
}
void operator()( TestSList& slist ) const {
slist.sort();
for ( TestSList::iterator p = slist.begin(), q; p != slist.end(); q = p, p++ )
if ( p != slist.begin() ) {
EH_ASSERT( *p >= *q );
}
}
};
void test_slist() {
TestSList testSList, testSList2;
size_t slistSize = random_number(random_base);
while (testSList.size() < slistSize) {
TestClass x;
testSList.push_front( x );
testSList2.push_front( TestClass() );
}
StrongCheck( testSList, test_insert_one<TestSList>(testSList) );
StrongCheck( testSList, test_insert_one<TestSList>(testSList, 0) );
StrongCheck( testSList, test_insert_one<TestSList>(testSList, (int)testSList.size()) );
WeakCheck( testSList, test_insert_n<TestSList>(testSList, random_number(random_base) ) );
WeakCheck( testSList, test_insert_n<TestSList>(testSList, random_number(random_base), 0 ) );
WeakCheck( testSList, test_insert_n<TestSList>(testSList, random_number(random_base), (int)testSList.size() ) );
size_t insCnt = random_number(random_base);
TestClass *insFirst = new TestSList::value_type[1+insCnt];
WeakCheck( testSList, insert_range_tester(testSList, insFirst, insFirst+insCnt) );
ConstCheck( 0, test_construct_pointer_range<TestSList>(insFirst, insFirst+insCnt) );
delete[] insFirst;
WeakCheck( testSList, test_insert_range<TestSList,TestSList::iterator>(testSList, testSList2.begin(), testSList2.end() ) );
StrongCheck( testSList, test_push_front<TestSList>(testSList) );
StrongCheck( testSList, test_slist_sort() ); // Simply to verify strength.
ConstCheck( 0, test_default_construct<TestSList>() );
ConstCheck( 0, test_construct_n<TestSList>( random_number(random_base) ) );
ConstCheck( 0, test_construct_n_instance<TestSList>( random_number(random_base) ) );
ConstCheck( 0, test_construct_iter_range<TestSList>( testSList2 ) );
ConstCheck( testSList, test_copy_construct<TestSList>() );
WeakCheck( testSList, test_assign_op<TestSList>( testSList2 ) );
}
#endif // EH_SLIST_IMPLEMENTED

View File

@@ -0,0 +1,79 @@
/***********************************************************************************
test_string.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#include "Prefix.h"
#if defined( EH_STRING_IMPLEMENTED )
#include "Tests.h"
#include "TestClass.h"
#include "LeakCheck.h"
#include "test_construct.h"
#include "test_assign_op.h"
#include "test_push_back.h"
#include "test_insert.h"
#include "test_push_front.h"
#include <string>
USING_CSTD_NAME(size_t)
typedef EH_STD::basic_string<char, EH_STD::char_traits<char>, eh_allocator(char) > TestString;
inline sequence_container_tag
container_category(const TestString&)
{
return sequence_container_tag();
}
void test_string() {
TestString testString, testString2;
size_t ropeSize = random_number(random_base);
while ( testString.size() < ropeSize ) {
TestString::value_type x = TestString::value_type(random_number(random_base)) ; // initialize before use
testString.append(1, x );
testString2.append(1, TestString::value_type() );
}
WeakCheck( testString, test_insert_one<TestString>(testString) );
WeakCheck( testString, test_insert_one<TestString>(testString, 0) );
WeakCheck( testString, test_insert_one<TestString>(testString, (int)testString.size()) );
WeakCheck( testString, test_insert_n<TestString>(testString, random_number(random_base) ) );
WeakCheck( testString, test_insert_n<TestString>(testString, random_number(random_base), 0 ) );
WeakCheck( testString, test_insert_n<TestString>(testString, random_number(random_base), (int)testString.size() ) );
size_t insCnt = random_number(random_base);
TestString::value_type *insFirst = new TestString::value_type[1+insCnt];
WeakCheck( testString, insert_range_tester(testString, insFirst, insFirst+insCnt) );
WeakCheck( testString, insert_range_at_begin_tester(testString, insFirst, insFirst+insCnt) );
WeakCheck( testString, insert_range_at_end_tester(testString, insFirst, insFirst+insCnt) );
ConstCheck( 0, test_construct_pointer_range<TestString>(insFirst, insFirst+insCnt) );
delete[] insFirst;
WeakCheck( testString, insert_range_tester(testString, testString2.begin(), testString2.end() ) );
/*
WeakCheck( testString, test_push_front<TestString>(testString) );
WeakCheck( testString, test_push_back<TestString>(testString) );
*/
ConstCheck( 0, test_default_construct<TestString>() );
// requires _Reserve_t ConstCheck( 0, test_construct_n<TestString>( random_number(random_base) ) );
ConstCheck( 0, test_construct_n_instance<TestString>( random_number(random_base) ) );
ConstCheck( 0, test_construct_iter_range<TestString>( testString2 ) );
ConstCheck( testString, test_copy_construct<TestString>() );
WeakCheck( testString, test_assign_op<TestString>( testString2 ) );
}
#endif // EH_ROPE_IMPLEMENTED

View File

@@ -0,0 +1,81 @@
// Boris - this file is, um, rather incomplete. Please remove from distribution.
/***********************************************************************************
test_string.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#include "Prefix.h"
#if defined( EH_VALARRAY_IMPLEMENTED )
#include "Tests.h"
#include <valarray>
#include "TestClass.h"
#include "LeakCheck.h"
#include "test_construct.h"
#include "test_assign_op.h"
#include "test_push_back.h"
#include "test_insert.h"
#include "test_push_front.h"
typedef __valarray__<TestClass, eh_allocator(TestClass) > TestValarray;
inline sequence_container_tag
container_category(const TestValarray&)
{
return sequence_container_tag();
}
void test_rope()
{
TestValarray testValarray, testValarray2;
size_t ropeSize = random_number(random_base);
while ( testValarray.size() < ropeSize )
{
TestValarray::value_type x = random_number(random_base) ; // initialize before use
testValarray.push_back( x );
testValarray2.push_back( TestValarray::value_type() );
}
WeakCheck( testValarray, test_insert_one<TestValarray>(testValarray) );
WeakCheck( testValarray, test_insert_one<TestValarray>(testValarray, 0) );
WeakCheck( testValarray, test_insert_one<TestValarray>(testValarray, testValarray.size()) );
WeakCheck( testValarray, test_insert_n<TestValarray>(testValarray, random_number(random_base) ) );
WeakCheck( testValarray, test_insert_n<TestValarray>(testValarray, random_number(random_base), 0 ) );
WeakCheck( testValarray, test_insert_n<TestValarray>(testValarray, random_number(random_base), testValarray.size() ) );
size_t insCnt = random_number(random_base);
TestValarray::value_type *insFirst = new TestValarray::value_type[1+insCnt];
WeakCheck( testValarray, insert_range_tester(testValarray, insFirst, insFirst+insCnt) );
WeakCheck( testValarray, insert_range_at_begin_tester(testValarray, insFirst, insFirst+insCnt) );
WeakCheck( testValarray, insert_range_at_end_tester(testValarray, insFirst, insFirst+insCnt) );
ConstCheck( 0, test_construct_pointer_range<TestValarray>(insFirst, insFirst+insCnt) );
delete[] insFirst;
WeakCheck( testValarray, insert_range_tester(testValarray, testValarray2.begin(), testValarray2.end() ) );
WeakCheck( testValarray, test_push_front<TestValarray>(testValarray) );
WeakCheck( testValarray, test_push_back<TestValarray>(testValarray) );
ConstCheck( 0, test_default_construct<TestValarray>() );
ConstCheck( 0, test_construct_n<TestValarray>( random_number(random_base) ) );
ConstCheck( 0, test_construct_n_instance<TestValarray>( random_number(random_base) ) );
ConstCheck( 0, test_construct_iter_range<TestValarray>( testValarray2 ) );
ConstCheck( testValarray, test_copy_construct<TestValarray>() );
WeakCheck( testValarray, test_assign_op<TestValarray>( testValarray2 ) );
}
#endif // EH_ROPE_IMPLEMENTED

View File

@@ -0,0 +1,126 @@
/***********************************************************************************
test_vector.cpp
* Copyright (c) 1997
* Mark of the Unicorn, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Mark of the Unicorn makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
***********************************************************************************/
#include "Tests.h"
#include "TestClass.h"
#include "LeakCheck.h"
# if defined (EH_NEW_HEADERS)
#include <vector>
#else
#include <vector.h>
#endif
#include "test_construct.h"
#include "test_assign_op.h"
#include "test_push_back.h"
#include "test_insert.h"
#include "test_push_front.h"
# if defined (__GNUC__) && defined (__APPLE__)
typedef EH_STD::vector<TestClass, eh_allocator(TestClass) > TestVector;
# else
typedef EH_STD::__vector__<TestClass, eh_allocator(TestClass) > TestVector;
# endif
inline sequence_container_tag
container_category(const TestVector&)
{
return sequence_container_tag();
}
void prepare_insert_n( TestVector& c, size_t insCnt );
void prepare_insert_n( TestVector& c, size_t insCnt )
{
if ( random_number(2) )
c.reserve( c.size() + insCnt );
}
struct test_reserve
{
test_reserve( size_t n ) : fAmount(n) {
gTestController.SetCurrentTestName("vector::reserve()");
}
void operator()( TestVector& v ) const
{
v.reserve( fAmount );
}
private:
size_t fAmount;
};
inline void prepare_insert_range( TestVector& vec, size_t, TestClass* first, TestClass* last )
{
if ( random_number(2) )
{
ptrdiff_t d = 0;
EH_DISTANCE( first, last, d );
vec.reserve( vec.size() + d );
}
}
void test_vector()
{
ConstCheck( 0, test_construct_n<TestVector>( random_number(random_base) ) );
TestVector emptyVector;
TestVector testVector, testVector2;
size_t vectorSize = random_number(random_base);
testVector.reserve(vectorSize*4);
while ( testVector.size() < vectorSize )
{
TestClass x;
testVector.push_back( x );
testVector2.push_back( TestClass() );
}
size_t insCnt = random_number(random_base);
TestClass *insFirst = new TestVector::value_type[1+ insCnt];
ConstCheck( 0, test_construct_pointer_range<TestVector>(insFirst, insFirst+insCnt) );
WeakCheck( testVector, insert_range_tester(testVector, insFirst, insFirst+insCnt) );
WeakCheck( testVector, insert_range_at_begin_tester(testVector, insFirst, insFirst+insCnt) );
WeakCheck( testVector, insert_range_at_end_tester(testVector, insFirst, insFirst+insCnt) );
delete[] insFirst;
WeakCheck( testVector, test_insert_one<TestVector>(testVector) );
WeakCheck( testVector, test_insert_one<TestVector>(testVector, 0) );
WeakCheck( testVector, test_insert_one<TestVector>(testVector, (int)testVector.size()) );
WeakCheck( testVector, test_insert_n<TestVector>(testVector, random_number(random_base) ) );
WeakCheck( testVector, test_insert_n<TestVector>(testVector, random_number(random_base), 0 ) );
WeakCheck( testVector, test_insert_n<TestVector>(testVector, random_number(random_base), (int)testVector.size() ) );
WeakCheck( testVector, insert_range_tester(testVector, testVector2.begin(), testVector2.end() ) );
StrongCheck( testVector, test_reserve( testVector.capacity() + random_number(random_base) ) );
StrongCheck( testVector, test_push_back<TestVector>(testVector) );
StrongCheck( emptyVector, test_push_back<TestVector>(emptyVector) );
ConstCheck( 0, test_default_construct<TestVector>() );
ConstCheck( 0, test_construct_n_instance<TestVector>( random_number(random_base) ) );
ConstCheck( 0, test_construct_iter_range<TestVector>( testVector2 ) );
ConstCheck( testVector, test_copy_construct<TestVector>() );
testVector2.resize( testVector.size() * 3 / 2 );
WeakCheck( testVector, test_assign_op<TestVector>( testVector2 ) );
testVector2.clear();
testVector2.resize( testVector.size() * 2 / 3 );
WeakCheck( testVector, test_assign_op<TestVector>( testVector2 ) );
}