This commit is contained in:
romkazvo
2023-08-07 19:29:24 +08:00
commit 34d6c5d489
4832 changed files with 1389451 additions and 0 deletions

219
STLPORT/test/eh/LeakCheck.h Normal file
View File

@@ -0,0 +1,219 @@
/*
* 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").
***********************************************************************************/
#if !INCLUDED_MOTU_LeakCheck
#define INCLUDED_MOTU_LeakCheck 1
# include "Prefix.h"
# include "nc_alloc.h"
# if defined (EH_NEW_HEADERS)
# include <cstdio>
# include <cassert>
# include <iterator>
# else
# include <stdio.h>
# include <assert.h>
# include <iterator.h>
# endif
# if defined (EH_NEW_IOSTREAMS)
# include <iostream>
# else
# include <iostream.h>
# endif
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

317
STLPORT/test/eh/Prefix.h Normal file
View File

@@ -0,0 +1,317 @@
/***********************************************************************************
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
***********************************************************************************/
#if ! defined (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.
//=========================================================================
// # define _STLP_USE_RAW_SGI_ALLOCATORS
# ifndef _STLP_USE_NEWALLOC
# define _STLP_USE_NEWALLOC
# endif
# if !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 <stl/_config.h>
# 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_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 size_t size_type;
typedef 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 { _STLP_STD::construct(__p, __val); }
void destroy(pointer __p) const { _STLP_STD::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,76 @@
/***********************************************************************************
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(this) {}
SortClass() : TestClass( (int)get_random(kRange) ), addr(this) {}
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,35 @@
/***********************************************************************************
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"
# if defined (EH_NEW_IOSTREAMS)
#include <iostream>
# else
#include <iostream.h>
# endif
# ifdef EH_NEW_IOSTREAMS
EH_STD::ostream&
operator << (EH_STD::ostream& s,
const TestClass& t) {
return s<<t.value();
}
# else
ostream&
operator << (ostream& s, const TestClass& t) { return s<<t.value(); }
# endif

172
STLPORT/test/eh/TestClass.h Normal file
View File

@@ -0,0 +1,172 @@
/***********************************************************************************
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"
# if defined (EH_NEW_HEADERS)
# include <functional>
# include <utility>
# include <climits>
# else
# include <function.h>
# include <pair.h>
# include <limits.h>
# endif
#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 );
}
# ifdef EH_NEW_IOSTREAMS
extern EH_STD::ostream& operator << ( EH_STD::ostream& s, const TestClass&);
# else
extern ostream& operator << ( ostream& s, const TestClass&);
# endif
#endif // INCLUDED_MOTU_TestClass

59
STLPORT/test/eh/Tests.h 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,51 @@
/***********************************************************************************
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
STLPORT/test/eh/bcb.mak 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
STLPORT/test/eh/bug.cpp 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;
}

67
STLPORT/test/eh/como.mak 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
STLPORT/test/eh/cray.mak 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
STLPORT/test/eh/cygwin.mak 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

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
STLPORT/test/eh/djgpp.mak 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
STLPORT/test/eh/egcs.mak 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
STLPORT/test/eh/export 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
STLPORT/test/eh/gcc.mak 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
STLPORT/test/eh/gcc7.mak 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
STLPORT/test/eh/hp.mak 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
STLPORT/test/eh/hpacc.mak 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
STLPORT/test/eh/intel.mak 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
STLPORT/test/eh/intel45.mak 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
STLPORT/test/eh/intel50.mak 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
STLPORT/test/eh/kai.mak 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

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();
}

381
STLPORT/test/eh/main.cpp Normal file
View File

@@ -0,0 +1,381 @@
/***********************************************************************************
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 ( EH_USE_SGI_STL )
// Override assertion behavior
# include <cstdarg>
//# include <stldebug.h>
void __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
#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
EH_USE_STD
/*===================================================================================
usage (file-static helper)
EFFECTS: Prints a message describing the command-line parameters
====================================================================================*/
static void usage(const char* name)
{
cerr<<name<<
" Usage : leak_test [-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
int _STLP_CALL main(int argc, char** argv)
{
#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";
return 0;
}

111
STLPORT/test/eh/mingw32.mak 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,4 @@
//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

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,4 @@
//mwerks_prefix.h
#define _STLP_NO_FORCE_INSTANTIATE 1// for debugging
#define EH_VECTOR_OPERATOR_NEW 1
#define NDEBUG 1

Binary file not shown.

View File

@@ -0,0 +1,2 @@
include ..\..\..\..\..\..\tlibuser.cfg
include ..\..\..\..\..\..\tlibproj.cfg

View File

@@ -0,0 +1,374 @@
/************************************************************************************************
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;
EH_ASSERT( alloc_set().find( p ) == alloc_set().end() );
alloc_set().insert( p );
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 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();
if (using_alloc_set)
EH_ASSERT( 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;
}

197
STLPORT/test/eh/nc_alloc.h Normal file
View File

@@ -0,0 +1,197 @@
/***********************************************************************************
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( unsigned 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,25 @@
/***********************************************************************************
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_
// Return a random number in the given range.
unsigned random_number( unsigned 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

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
STLPORT/test/eh/test.cpp 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,255 @@
/***********************************************************************************
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 );
// 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,50 @@
/***********************************************************************************
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( bool(random_number(2)) );
testVector2.push_back( bool(random_number(2)) );
}
// 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,145 @@
/***********************************************************************************
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,99 @@
/***********************************************************************************
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, 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), testDeque.size() ) );
size_t insCnt = random_number(random_base);
DQTestClass *insFirst = new TestDeque::value_type[insCnt+1];
WeakCheck( testDeque, insert_range_tester(testDeque, (DQTestClass *)insFirst,
insFirst+insCnt) );
StrongCheck( testDeque, insert_range_at_begin_tester(testDeque, (DQTestClass *)insFirst,
insFirst+insCnt) );
StrongCheck( testDeque, insert_range_at_end_tester(testDeque, (DQTestClass *)insFirst,
insFirst+insCnt) );
ConstCheck( 0, test_construct_pointer_range<TestDeque>( (DQTestClass *)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,141 @@
/***********************************************************************************
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"
#if defined (__SGI_STL)
# if defined (EH_NEW_HEADERS)
# include <hash_map>
# else
# include <hash_map.h>
# endif
#elif defined (__MSL__)
# include <hashmap.h>
# include <hashmmap.h>
#else
# error where do I get hash_map/hash_multimap?
#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_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>() );
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>() );
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,133 @@
/***********************************************************************************
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 )
#if defined (__SGI_STL)
# if defined (EH_NEW_HEADERS)
# include <hash_set>
# else
# include <hash_set.h>
# endif
#elif defined (__MSL__)
# include <hashset.h>
# include <hashmset.h>
#else
# error where do I get hash_set/hash_multiset?
#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"
#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>() );
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>() );
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,551 @@
/***********************************************************************************
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)); }
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 or 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,117 @@
/***********************************************************************************
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;
# if ( _STLP_STATIC_TEMPLATE_DATA < 1 )
// Instantiate TestRope static data members
const unsigned long TestRope::_S_min_len[46] = { \
/* 0 */1, /* 1 */2, /* 2 */3, /* 3 */5, /* 4 */8, /* 5 */13, /* 6 */21, \
/* 7 */34, /* 8 */55, /* 9 */89, /* 10 */144, /* 11 */233, /* 12 */377, \
/* 13 */610, /* 14 */987, /* 15 */1597, /* 16 */2584, /* 17 */4181, \
/* 18 */6765ul, /* 19 */10946ul, /* 20 */17711ul, /* 21 */28657ul, /* 22 */46368ul, \
/* 23 */75025ul, /* 24 */121393ul, /* 25 */196418ul, /* 26 */317811ul, \
/* 27 */514229ul, /* 28 */832040ul, /* 29 */1346269ul, /* 30 */2178309ul, \
/* 31 */3524578ul, /* 32 */5702887ul, /* 33 */9227465ul, /* 34 */14930352ul, \
/* 35 */24157817ul, /* 36 */39088169ul, /* 37 */63245986ul, /* 38 */102334155ul, \
/* 39 */165580141ul, /* 40 */267914296ul, /* 41 */433494437ul, \
/* 42 */701408733ul, /* 43 */1134903170ul, /* 44 */1836311903ul, \
/* 45 */2971215073ul };
# endif /* ( _STLP_STATIC_TEMPLATE_DATA < 1 ) */
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,107 @@
/***********************************************************************************
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"
typedef EH_STD::__slist__<TestClass, eh_allocator(TestClass) > TestSList;
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,82 @@
/***********************************************************************************
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,122 @@
/***********************************************************************************
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"
typedef EH_STD::__vector__<TestClass, eh_allocator(TestClass) > TestVector;
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 ) );
}

View File

@@ -0,0 +1,74 @@
# 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=cl.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 /Gr /MDd /W3 /GX /GR /D "WIN32" /D "_CONSOLE" /I$(STL_INCL) /I. /D "_STLP_DEBUG"
CPP_PROJ=/nologo /MT /W3 /GX /GR /D "WIN32" /D "_CONSOLE" /I$(STL_INCL) /I.
# linker finds proper STLport lib automatically, only path to the
# library is needed
CPP_LIBS = /link /libpath:"..\..\lib"
check: eh_test.exe
# fbp : this is to locate DLL
cd ..\..\lib
..\test\eh\eh_test.exe -s 100
echo done
eh_test.exe : $(Dep_stl)
$(CC) $(CPP_PROJ) $(Dep_stl) -o eh_test.exe $(CPP_LIBS)
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) $<

74
STLPORT/test/eh/vc.mak Normal file
View File

@@ -0,0 +1,74 @@
# 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=cl.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 /Gr /MDd /W3 /GX /GR /D "WIN32" /D "_CONSOLE" /I$(STL_INCL) /I. /D "_STLP_DEBUG" /D "_STLP_NO_CUSTOM_IO"
CPP_PROJ=/nologo /MD /W3 /GX /GR /D "WIN32" /D "_CONSOLE" /I$(STL_INCL) /I.
# linker finds proper STLport lib automatically, only path to the
# library is needed
CPP_LIBS = /link /libpath:"..\..\lib"
check: eh_test.exe
# fbp : this is to locate DLL
cd ..\..\lib
..\test\eh\eh_test.exe -s 100
echo done
eh_test.exe : $(Dep_stl)
$(CC) $(CPP_PROJ) $(Dep_stl) -o eh_test.exe $(CPP_LIBS)
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) $<

74
STLPORT/test/eh/vc5.mak Normal file
View File

@@ -0,0 +1,74 @@
# 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=cl.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 /Gr /MTd /W3 /GX /GR /D "WIN32" /D "_CONSOLE" /I$(STL_INCL) /I. /D "_STLP_DEBUG"
# CPP_PROJ=/nologo /MDd /W3 /GX /GR /D "WIN32" /D "_CONSOLE" /I$(STL_INCL) /I.
# linker finds proper STLport lib automatically, only path to the
# library is needed
CPP_LIBS = /link /libpath:"..\..\lib"
check: eh_test.exe
# fbp : this is to locate DLL
cd ..\..\lib
..\test\eh\eh_test.exe -s 100
echo done
eh_test.exe : $(Dep_stl)
$(CC) $(CPP_PROJ) $(Dep_stl) -o eh_test.exe $(CPP_LIBS)
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) $<

116
STLPORT/test/eh/vc6.mak Normal file
View File

@@ -0,0 +1,116 @@
# 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=cl.exe
F90=fl32.exe
LINK32=link.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 =
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 = /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) $<

View File

@@ -0,0 +1,8 @@
-w
-R
-v
-vi
-H
-WC
-g255
-H-

View File

@@ -0,0 +1,335 @@
!include "{stl}:src:MrCpp.mak"
MAKEFILE = MrCpp.mak
Needed_SysLibs = <20>
# "{PPCLibraries}MrCIOStreams.o" <20>
"{STL}:lib:STLportLib{config_}.o" <20>
"{SharedLibraries}InterfaceLib" <20>
"{SharedLibraries}StdCLib_3.7" <20>
"{SharedLibraries}MathLib" <20>
"{PPCLibraries}StdCRuntime.o" <20>
"{PPCLibraries}PPCCRuntime.o" <20>
"{PPCLibraries}PPCToolLibs.o" <20>
"{PPCLibraries}MrCPlusLib.o" <20>
"{SharedLibraries}MrCExceptionsLib_4.1" <20>
# end
##################################################################################
# test:regression: build rule
##################################################################################
Regression_Objects_PPC = <20>
"{ObjDir}accum1.cpp.x" <20>
"{ObjDir}accum2.cpp.x" <20>
"{ObjDir}adjdiff0.cpp.x" <20>
"{ObjDir}adjdiff1.cpp.x" <20>
"{ObjDir}adjdiff2.cpp.x" <20>
"{ObjDir}adjfind0.cpp.x" <20>
"{ObjDir}adjfind1.cpp.x" <20>
"{ObjDir}adjfind2.cpp.x" <20>
"{ObjDir}advance.cpp.x" <20>
"{ObjDir}alg1.cpp.x" <20>
"{ObjDir}alg2.cpp.x" <20>
"{ObjDir}alg3.cpp.x" <20>
"{ObjDir}alg4.cpp.x" <20>
"{ObjDir}alg5.cpp.x" <20>
"{ObjDir}bcompos1.cpp.x" <20>
"{ObjDir}bcompos2.cpp.x" <20>
"{ObjDir}bind1st1.cpp.x" <20>
"{ObjDir}bind1st2.cpp.x" <20>
"{ObjDir}bind2nd1.cpp.x" <20>
"{ObjDir}bind2nd2.cpp.x" <20>
"{ObjDir}binsert1.cpp.x" <20>
"{ObjDir}binsert2.cpp.x" <20>
"{ObjDir}binsrch1.cpp.x" <20>
"{ObjDir}binsrch2.cpp.x" <20>
"{ObjDir}bitset1.cpp.x" <20>
"{ObjDir}bnegate1.cpp.x" <20>
"{ObjDir}bnegate2.cpp.x" <20>
"{ObjDir}bvec1.cpp.x" <20>
"{ObjDir}copy1.cpp.x" <20>
"{ObjDir}copy2.cpp.x" <20>
"{ObjDir}copy3.cpp.x" <20>
"{ObjDir}copy4.cpp.x" <20>
"{ObjDir}copyb.cpp.x" <20>
"{ObjDir}copyb0.cpp.x" <20>
"{ObjDir}count0.cpp.x" <20>
"{ObjDir}count1.cpp.x" <20>
"{ObjDir}countif1.cpp.x" <20>
"{ObjDir}deque1.cpp.x" <20>
"{ObjDir}divides.cpp.x" <20>
"{ObjDir}eqlrnge0.cpp.x" <20>
"{ObjDir}eqlrnge1.cpp.x" <20>
"{ObjDir}eqlrnge2.cpp.x" <20>
"{ObjDir}equal0.cpp.x" <20>
"{ObjDir}equal1.cpp.x" <20>
"{ObjDir}equal2.cpp.x" <20>
"{ObjDir}equalto.cpp.x" <20>
"{ObjDir}fill1.cpp.x" <20>
"{ObjDir}filln1.cpp.x" <20>
"{ObjDir}find0.cpp.x" <20>
"{ObjDir}find1.cpp.x" <20>
"{ObjDir}findif0.cpp.x" <20>
"{ObjDir}findif1.cpp.x" <20>
"{ObjDir}finsert1.cpp.x" <20>
"{ObjDir}finsert2.cpp.x" <20>
"{ObjDir}foreach0.cpp.x" <20>
"{ObjDir}foreach1.cpp.x" <20>
"{ObjDir}func1.cpp.x" <20>
"{ObjDir}func2.cpp.x" <20>
"{ObjDir}func3.cpp.x" <20>
"{ObjDir}gener1.cpp.x" <20>
"{ObjDir}gener2.cpp.x" <20>
"{ObjDir}genern1.cpp.x" <20>
"{ObjDir}genern2.cpp.x" <20>
"{ObjDir}greateq.cpp.x" <20>
"{ObjDir}greater.cpp.x" <20>
"{ObjDir}hmap1.cpp.x" <20>
"{ObjDir}hmmap1.cpp.x" <20>
"{ObjDir}hmset1.cpp.x" <20>
"{ObjDir}hset2.cpp.x" <20>
"{ObjDir}incl0.cpp.x" <20>
"{ObjDir}incl1.cpp.x" <20>
"{ObjDir}incl2.cpp.x" <20>
"{ObjDir}inplmrg1.cpp.x" <20>
"{ObjDir}inplmrg2.cpp.x" <20>
"{ObjDir}inrprod0.cpp.x" <20>
"{ObjDir}inrprod1.cpp.x" <20>
"{ObjDir}inrprod2.cpp.x" <20>
"{ObjDir}insert1.cpp.x" <20>
"{ObjDir}insert2.cpp.x" <20>
"{ObjDir}iota1.cpp.x" <20>
"{ObjDir}istmit1.cpp.x" <20>
"{ObjDir}iter1.cpp.x" <20>
"{ObjDir}iter2.cpp.x" <20>
"{ObjDir}iter3.cpp.x" <20>
"{ObjDir}iter4.cpp.x" <20>
"{ObjDir}iterswp0.cpp.x" <20>
"{ObjDir}iterswp1.cpp.x" <20>
"{ObjDir}less.cpp.x" <20>
"{ObjDir}lesseq.cpp.x" <20>
"{ObjDir}lexcmp1.cpp.x" <20>
"{ObjDir}lexcmp2.cpp.x" <20>
"{ObjDir}list1.cpp.x" <20>
"{ObjDir}list2.cpp.x" <20>
"{ObjDir}list3.cpp.x" <20>
"{ObjDir}list4.cpp.x" <20>
"{ObjDir}logicand.cpp.x" <20>
"{ObjDir}logicnot.cpp.x" <20>
"{ObjDir}logicor.cpp.x" <20>
"{ObjDir}lwrbnd1.cpp.x" <20>
"{ObjDir}lwrbnd2.cpp.x" <20>
"{ObjDir}map1.cpp.x" <20>
"{ObjDir}max1.cpp.x" <20>
"{ObjDir}max2.cpp.x" <20>
"{ObjDir}maxelem1.cpp.x" <20>
"{ObjDir}maxelem2.cpp.x" <20>
"{ObjDir}memfunptr.cpp.x" <20>
"{ObjDir}merge0.cpp.x" <20>
"{ObjDir}merge1.cpp.x" <20>
"{ObjDir}merge2.cpp.x" <20>
"{ObjDir}min1.cpp.x" <20>
"{ObjDir}min2.cpp.x" <20>
"{ObjDir}minelem1.cpp.x" <20>
"{ObjDir}minelem2.cpp.x" <20>
"{ObjDir}minus.cpp.x" <20>
"{ObjDir}mismtch0.cpp.x" <20>
"{ObjDir}mismtch1.cpp.x" <20>
"{ObjDir}mismtch2.cpp.x" <20>
"{ObjDir}mkheap0.cpp.x" <20>
"{ObjDir}mkheap1.cpp.x" <20>
"{ObjDir}mmap1.cpp.x" <20>
"{ObjDir}mmap2.cpp.x" <20>
"{ObjDir}modulus.cpp.x" <20>
"{ObjDir}mset1.cpp.x" <20>
"{ObjDir}mset3.cpp.x" <20>
"{ObjDir}mset4.cpp.x" <20>
"{ObjDir}mset5.cpp.x" <20>
"{ObjDir}negate.cpp.x" <20>
"{ObjDir}nequal.cpp.x" <20>
"{ObjDir}nextprm0.cpp.x" <20>
"{ObjDir}nextprm1.cpp.x" <20>
"{ObjDir}nextprm2.cpp.x" <20>
"{ObjDir}nthelem0.cpp.x" <20>
"{ObjDir}nthelem1.cpp.x" <20>
"{ObjDir}nthelem2.cpp.x" <20>
"{ObjDir}ostmit.cpp.x" <20>
"{ObjDir}pair0.cpp.x" <20>
"{ObjDir}pair1.cpp.x" <20>
"{ObjDir}pair2.cpp.x" <20>
"{ObjDir}parsrt0.cpp.x" <20>
"{ObjDir}parsrt1.cpp.x" <20>
"{ObjDir}parsrt2.cpp.x" <20>
"{ObjDir}parsrtc0.cpp.x" <20>
"{ObjDir}parsrtc1.cpp.x" <20>
"{ObjDir}parsrtc2.cpp.x" <20>
"{ObjDir}partsrt0.cpp.x" <20>
"{ObjDir}partsum0.cpp.x" <20>
"{ObjDir}partsum1.cpp.x" <20>
"{ObjDir}partsum2.cpp.x" <20>
"{ObjDir}pheap1.cpp.x" <20>
"{ObjDir}pheap2.cpp.x" <20>
"{ObjDir}plus.cpp.x" <20>
"{ObjDir}pqueue1.cpp.x" <20>
"{ObjDir}prevprm0.cpp.x" <20>
"{ObjDir}prevprm1.cpp.x" <20>
"{ObjDir}prevprm2.cpp.x" <20>
"{ObjDir}ptition0.cpp.x" <20>
"{ObjDir}ptition1.cpp.x" <20>
"{ObjDir}ptrbinf1.cpp.x" <20>
"{ObjDir}ptrbinf2.cpp.x" <20>
"{ObjDir}ptrunf1.cpp.x" <20>
"{ObjDir}ptrunf2.cpp.x" <20>
"{ObjDir}queue1.cpp.x" <20>
"{ObjDir}rawiter.cpp.x" <20>
"{ObjDir}remcopy1.cpp.x" <20>
"{ObjDir}remcpif1.cpp.x" <20>
"{ObjDir}remif1.cpp.x" <20>
"{ObjDir}remove1.cpp.x" <20>
"{ObjDir}repcpif1.cpp.x" <20>
"{ObjDir}replace0.cpp.x" <20>
"{ObjDir}replace1.cpp.x" <20>
"{ObjDir}replcpy1.cpp.x" <20>
"{ObjDir}replif1.cpp.x" <20>
"{ObjDir}revbit1.cpp.x" <20>
"{ObjDir}revbit2.cpp.x" <20>
"{ObjDir}revcopy1.cpp.x" <20>
"{ObjDir}reverse1.cpp.x" <20>
"{ObjDir}reviter1.cpp.x" <20>
"{ObjDir}reviter2.cpp.x" <20>
"{ObjDir}rndshuf0.cpp.x" <20>
"{ObjDir}rndshuf1.cpp.x" <20>
"{ObjDir}rndshuf2.cpp.x" <20>
"{ObjDir}rotate0.cpp.x" <20>
"{ObjDir}rotate1.cpp.x" <20>
"{ObjDir}rotcopy0.cpp.x" <20>
"{ObjDir}rotcopy1.cpp.x" <20>
"{ObjDir}search0.cpp.x" <20>
"{ObjDir}search1.cpp.x" <20>
"{ObjDir}search2.cpp.x" <20>
"{ObjDir}set1.cpp.x" <20>
"{ObjDir}set2.cpp.x" <20>
"{ObjDir}setdiff0.cpp.x" <20>
"{ObjDir}setdiff1.cpp.x" <20>
"{ObjDir}setdiff2.cpp.x" <20>
"{ObjDir}setintr0.cpp.x" <20>
"{ObjDir}setintr1.cpp.x" <20>
"{ObjDir}setintr2.cpp.x" <20>
"{ObjDir}setsymd0.cpp.x" <20>
"{ObjDir}setsymd1.cpp.x" <20>
"{ObjDir}setsymd2.cpp.x" <20>
"{ObjDir}setunon0.cpp.x" <20>
"{ObjDir}setunon1.cpp.x" <20>
"{ObjDir}setunon2.cpp.x" <20>
# "{ObjDir}single.cpp.x" <20>
"{ObjDir}slist1.cpp.x" <20>
"{ObjDir}sort1.cpp.x" <20>
"{ObjDir}sort2.cpp.x" <20>
"{ObjDir}stack1.cpp.x" <20>
"{ObjDir}stack2.cpp.x" <20>
# "{ObjDir}stat.cpp.x" <20>
"{ObjDir}stblptn0.cpp.x" <20>
"{ObjDir}stblptn1.cpp.x" <20>
"{ObjDir}stblsrt1.cpp.x" <20>
"{ObjDir}stblsrt2.cpp.x" <20>
# "{ObjDir}stl_single.cpp.x" <20>
"{ObjDir}stl_test.cpp.x" <20>
"{ObjDir}string1.cpp.x" <20>
"{ObjDir}swap1.cpp.x" <20>
"{ObjDir}swprnge1.cpp.x" <20>
"{ObjDir}times.cpp.x" <20>
"{ObjDir}trnsfrm1.cpp.x" <20>
"{ObjDir}trnsfrm2.cpp.x" <20>
"{ObjDir}ucompos1.cpp.x" <20>
"{ObjDir}ucompos2.cpp.x" <20>
"{ObjDir}unegate1.cpp.x" <20>
"{ObjDir}unegate2.cpp.x" <20>
"{ObjDir}uniqcpy1.cpp.x" <20>
"{ObjDir}uniqcpy2.cpp.x" <20>
"{ObjDir}unique1.cpp.x" <20>
"{ObjDir}unique2.cpp.x" <20>
"{ObjDir}uprbnd1.cpp.x" <20>
"{ObjDir}uprbnd2.cpp.x" <20>
"{ObjDir}vec1.cpp.x" <20>
"{ObjDir}vec2.cpp.x" <20>
"{ObjDir}vec3.cpp.x" <20>
"{ObjDir}vec4.cpp.x" <20>
"{ObjDir}vec5.cpp.x" <20>
"{ObjDir}vec6.cpp.x" <20>
"{ObjDir}vec7.cpp.x" <20>
"{ObjDir}vec8.cpp.x" <20>
# end
Regression_test <EFBFBD><EFBFBD> setup
Regression_test <EFBFBD><EFBFBD> "{ObjDir}"Regression_test.PPC
echo "<22>n'{ObjDir}Regression_test.PPC' < '{stl}:test:regression:stdin' # execute it"
"{ObjDir}"Regression_test.PPC <EFBFBD><EFBFBD> {<EFBFBD>MondoBuild<EFBFBD>} {Regression_Objects_PPC} {Needed_SysLibs}
###########
if "{compile_status}"
echo "### LINK NOT PERFORMED DUE TO COMPILE ERROR"
exit "{compile_status}"
end
echo "<22>nLinking: {Targ}"
if "`exists {Targ}`"
delete {Targ} #*TY 01/14/1999 - it is faster to generate executable from the ground up than modifying the existing ones.
end
PPCLink <20>
-t 'MPST' <20>
-o {Targ} <20>
{Regression_Objects_PPC} <20>
{Needed_SysLibs} <20>
{Link_options} <20>
# end
##################################################################################
# test:eh: build rule
##################################################################################
eh_Objects_PPC = <20>
"{ObjDir}main.cpp.x" <20>
"{ObjDir}nc_alloc.cpp.x" <20>
"{ObjDir}random_number.cpp.x" <20>
"{ObjDir}test_algo.cpp.x" <20>
"{ObjDir}test_algobase.cpp.x" <20>
"{ObjDir}test_bit_vector.cpp.x" <20>
"{ObjDir}test_bitset.cpp.x" <20>
"{ObjDir}test_deque.cpp.x" <20>
"{ObjDir}test_hash_map.cpp.x" <20>
"{ObjDir}test_hash_set.cpp.x" <20>
"{ObjDir}test_list.cpp.x" <20>
"{ObjDir}test_map.cpp.x" <20>
"{ObjDir}test_rope.cpp.x" <20>
"{ObjDir}test_set.cpp.x" <20>
"{ObjDir}test_slist.cpp.x" <20>
"{ObjDir}test_string.cpp.x" <20>
"{ObjDir}test_valarray.cpp.x" <20>
"{ObjDir}test_vector.cpp.x" <20>
"{ObjDir}TestClass.cpp.x" <20>
#end
EH_test <EFBFBD><EFBFBD> setup
EH_test <EFBFBD><EFBFBD> "{ObjDir}"EH_test.PPC
echo "<22>n'{ObjDir}EH_test.PPC' # execute it"
"{ObjDir}"EH_test.PPC <20><> "{stl}:test:regression:{<7B>MondoBuild<EFBFBD>}" {eh_Objects_PPC} {Needed_SysLibs}
###########
if "{compile_status}"
echo "### LINK NOT PERFORMED DUE TO COMPILE TIME ERROR"
exit "{compile_status}"
end
echo "<22>nLinking: {Targ}"
if "`exists {Targ}`"
delete {Targ}
end
PPCLink <20>
-t 'MPST' <20>
-o {Targ} <20>
{eh_Objects_PPC} <20>
{Link_options} <20>
{Needed_SysLibs} <20>
# end

View File

@@ -0,0 +1,65 @@
Test suite for SGI STL implementation
Boris P. Fomitchev <fbp@metabyte.com>
Last updated : Nov 14, 1997
----------------------------------------------------------------------------
Preface
One of the problems one is faced when deciding whether using STL or not is
the question of portability and reliability. It's not a rare case when
compiler begins to crash when template constructs get too complex. While
it's not possible to predict such effects on arbitrary code, it is often
useful to test basic STL compatibility of the compiler. That's what this
testsuite is for. It don't use too complex construct with STL items. But it
do instantiate about every item to see if it works properly.
----------------------------------------------------------------------------
Genesis
This testsuite is derived from Cygnus Solutions STL testsuite, which is
based on ObjectSpace STL examples. The changes that have been made mostly
involve restructuring. You can run a single short test for particular STL
construct , or try to compile them all and link to single executable. You
may also test if your compiler can handle extremely long source files by
compiling a single source including all others.
----------------------------------------------------------------------------
Platforms
Makefiles for gcc, SUNPro, Borland, Visual C++ compilers are provided with
the suite. Look for .mak files in the distribution. It should be not
difficult to adjust one of them to your compiler.
----------------------------------------------------------------------------
Trying it out
After unpacking, edit appropriate makefile to fit your compiler and include
directories . After you've done, try "make check". This target is output
(stl_test.out) of single executable containing all the tests. Compare it
with stl_test.exp output (or stl_test.rand.exp, see below).
There should be no differences. If some test fails
to compile, you may try "make test_name.out" to produce single test
executable and run it.
----------------------------------------------------------------------------
Expected differences
As many tests use pseudo-random generators, you may get differences
in test output.
Basically, there are 2 random generator scemes used :
via rand() function : expected result in stl_test.rand.exp
via lrand48() function : expected result in stl_test.exp.
System-dependent notices:
If you are using STLport on OS390 machine, you should compare with stl_test.ibm390.exp.
Linux libc uses different random generator which doesn't match any of the above. Be prepared.
map1_test : some compilers don't zero-initialize data when builtin-type default constructor called, thus you may see some garbage instead of 0 in the output.

View File

@@ -0,0 +1,356 @@
# MPW adaptation of STLport
#
# written by Tsutomu Yoshida, Minokamo, Japan. Aug/14/1998
# #*TY 05/23/1999 - updated for STLport-3.2
# #*TY 08/03/1999 - updated for STLport-3.2.1
# #*TY 05/21/2000 - updated for STLport-4.0
# #*TY 05/13/2001 - updated for STLport-4.1
#
# this document describes the detailed instructions for building and running the STL testsuite (regression and eh)
# as the mpw tools, as well as building STLportLib which provides the standard conforming iostream.
# *** IMPORTANT NOTES ON ENVIRONMENT CONFIGURATION
#
# <09> STLport under MPW expects CIncludes folder (or alias of it) be presented at the same level as "stlport" folder.
# <09> C++ Compilers should be given the chance to search include files in "stlport" folder before searching in "CIncludes" folder.
# <09> If you use old style STL header (i.e., map.h, etc.), "stoport:old_hp" folder also has to be added in the include
# search paths (old style headers are not verified to work. use them on your own risk).
# <09> This version of STLport uses <exception> header supplied with the package. <exception> supplied elsewhere is not used,
# unlike the earlier version of STLport.
# <09> You may have to increase the stack size of MPW shell since MrCpp's backend uses a lot of stack space for code optimization.
# Use a shell command shown below.
SetShellSize -s 1280k # relaunch of MPW shell required to take effect
# *** how to setup STL under MPW environment:
# ===============================================================================================================
# (1) run the MPW script shown below to setup the shell variable {STL} to point to the STLport
# directory. to run this script, open this file (ReadMe.MPW) under MPW and select the script block below
# and then press "enter' key (not the 'return' key).
#
# Note: this setup script will install a startup script named "!STL_Folder_SetUp"
# under "{ShellDirectory}Startup Items:" directory.
#
#(# INSTALL (1)
begin
unset STL # to unconditionally re-setup STL variable
if !"{STL}"
Set exit 0
Set temp "{Boot}"
unset STL
if "{active}" =~ /(<28>)<29>1:<3A>/
directory "{<7B>1}:"
set temp "{<7B>1}:::"
(Set temp `ResolveAlias "{temp}stlport:"`)<29>dev:null
end
Loop
If !"`Exists "{temp}stl:_config.h"`"
Alert "The folder you have chosen, <20>'{temp}<7D>', does not appear to be the correct STL folder."<22>
"<22>nPlease choose the main STLport folder (the folder which contains stl_config.h)."
Else
Break
End
Set temp "`(GetFileName "{temp}" -q -d -m "Where is your <20>"STLport<72>" folder?")<29>dev:null`"
exit if !"{temp}"
End
Set -e STL "{temp}"
set STL > "{ShellDirectory}Startup Items:!STL_Folder_SetUp" # save the {STL} setting so that you do not have to run this script every time mpw is booted.
unset temp
Set exit 1
else
alert "the path to <20>"<22>{STL<54>}<7D>" has been set up as: <20>n'{STL}' .<2E>nMake sure this is up to date."
end
end <20><> "{worksheet}"
#)#
# ===============================================================================================================
# (2) make alias for the CIncludes folder at the same level as 'stlport' folder.
#
#(# INSTALL (2)
begin
SendAE -e "FNDRsali" -t "Finder" -----alis "{CIncludes}:CIncludes" <20>dev:null # create the alias
set alias_ `exists -a "{CIncludes}:"<22>CIncludes<65>` # get the exact name for the alias
duplicate -y "{alias_}" "{STL}:CIncludes" # copy it into the destination
delete -ay "{alias_}" # clean up
end <20><> "{worksheet}"
#)#
# ===============================================================================================================
# (3) OPTIONAL: change the creator of files to MPW, colorize them to Blue and set the default font information
#
# WARNING: THIS STEP IS QUITE TIME CONSUMING
#
#(# INSTALL (3) OPTIONAL
begin
set -e exit 0
if !"{Font}";set -e Font "Monaco";end
if !"{FontSize}";set -e FontSize 9;end
set self_ "{active}"
for f_ in `exists -f <20>
"{stl}"[<5B>.]+ "{stl}"<22>.[hc]<5D> <20>
"{stl}config:"<22>.[hc]<5D> <20>
"{stl}old_hp:"<22>.[hc]<5D> <20>
"{stl}stl:"[<5B>.]+ "{stl}stl:"<22>.[hc]<5D> <20>
"{stl}stl:debug:"<22>.[hc]<5D> <20>
"{stl}stl:wrappers:"<22>.[hc]<5D> <20>
"{stl}wrap_std:"<22>[<5B>.]+ <20>
"{stl}wrap_std:h:"<22>.[hc]<5D> <20>
"{stl}using:"[<5B>.]+ <20>
"{stl}using:h:"<22>.[hc]<5D> <20>
"{stl}:src:"<22>.[hc]<5D> <20>
"{stl}:test:regression:"<22>.[hc]<5D> <20>
"{stl}:test:eh:"<22>.[hc]<5D> <20>
`
SetFile -a l "{f_}"
Open -h -r "{f_}"
Format -l 'C/C++/Objective-C' -f "{Font}" -s "{FontSize}" "{f_}"
Close "{f_}"
SetFile -c 'MPS ' -label 3 -a L "{f_}"
end
for f_ in `exists -f <20>
"{stl}:src:"<22>.mak <20>
"{stl}:test:regression:"<22>.mak <20>
"{stl}:test:eh:"<22>.mak <20>
`
SetFile -a l "{f_}"
Open -h -r "{f_}"
Format -l 'MPW Shell Script' -f "{Font}" -s "{FontSize}" "{f_}"
Close "{f_}"
SetFile -c 'MPS ' -label 4 -a L "{f_}" # blue color
end
open "{self_}"
SetFile -a l "{self_}"
Format -l 'MPW Shell Script' -f "{Font}" -s "{FontSize}" "{self_}"
SetFile -c 'MPS ' -label 6 "{self_}" # sky color
set -e exit 1
end <20><> "{worksheet}"
#)#
# ===============================================================================================================
# (4) build and install PPC version of STLportLib into "{stl}:lib:" folder. Both debugging and non-debugging versions will be built.
#
# target compiler: apple's mpw MrCpp 5.0.0 or better
#
#(# INSTALL (4) PPC STLportLib
begin
set -e MrCpp `which MrCpp` # ver.5.0.0 or better is required
save -a # save all files (optional)
directory "{stl}:src:" # setup the working directory
target "{worksheet}"
echo -n "<22>n####### START BUILDING PPC VERSION OF STLportLib LIBRARY ####### "; date -s
unset fullbuild
# set -e fullbuild "-e" # uncomment this line to force full build
for debug_build in '-d DEBUG' ''
make {fullbuild} {debug_build} install -f "{stl}:src:MrCpp.mak" > MrCpp.MakeIt; execute MrCpp.MakeIt
end
echo "Finished building STLportLib (PPC)<29>n"
end <20><> "{worksheet}"
#)#
# ===============================================================================================================
# (5) build and install 68K version of STLportLib into "{stl}:lib:" folder. Both debugging and non-debugging versions will be built.
#
# target compiler: apple's mpw SCpp 8.9.0 or better
#
#(# INSTALL (5) 68K STLportLib
begin
set -e SCpp `which SCpp` # ver.8.9.0 or better is required
save -a # save all files (optional)
directory "{stl}:src:" # setup the working directory
target "{worksheet}"
echo -n "<22>n####### START BUILDING 68K VERSION OF STLportLib LIBRARY ####### "; date -s
unset fullbuild
# set -e fullbuild "-e" # uncomment this line to force full build
set -e other_SCpp_Options "-seg STLPortLib"
for debug_build in '-d DEBUG' ''
make {fullbuild} {debug_build} install -f "{stl}:src:SCpp.mak" > SCpp.MakeIt; execute SCpp.MakeIt
end
unset other_SCpp_Options
echo "Finished building STLportLib (68K)<29>n"
end <20><> "{worksheet}"
#)#
# *** how to try out the regression testsuite (PPC version):
# ===============================================================================================================
# target compiler: apple's mpw MrCpp 5.0.0
#
# (1) run the shell script listed below to compile and link the PPC version of testsuite as the mpw
# tool by selecting it and press enter.
#
#(# PPC (1) Regression Build
begin
set -e MrCpp `which MrCpp` # ver.5.0.0 or better is required
save -a # save all files (optional)
directory "{stl}:test:regression:" # setup the working directory
target "{worksheet}"
echo -n "<22>n####### START BUILDING PPC VERSION OF STL REGRESSION TEST SUITE ####### "; date -s
unset other_STL_Options
unset other_MrCpp_Options
unset fullbuild
# set -e fullbuild "-e" # uncomment this line to force full build
unset debug_build
set -e debug_build '-d DEBUG' # uncomment this line to build non-debug version
make -w {fullbuild} {debug_build} Regression_test -f "{stl}:test:regression:MrCpp.mak" > MrCpp.MakeIt
set -e exit 0
execute MrCpp.MakeIt
set -e exit 1
end <20><> "{worksheet}"
#)#
# (2) run the shell script listed below to execute the PPC version of testsuite mpw tool and
# compare the output with the standard "stl_test.exp" output.
#
#(# PPC (2)
set proj "{stl}:test:regression:"
set obj "{proj}.PPC.DBG:"
set Regression_test.PPC.output "{obj}"MrCpp.exp # output to separate file
#set Regression_test.PPC.output "dev:stdout" # output to {worksheet}
directory "{proj}"
target "{worksheet}"
begin
echo 'a string' > "{proj}"stdin # prepare input
echo "###### START: Regression_test.PPC"
"{obj}"Regression_test.PPC < "{proj}"stdin > "{Regression_test.PPC.output}" # run
echo "###### FINISHED: Regression_test.PPC"
end <20><> "{worksheet}"
if "{Regression_test.PPC.output}" != "dev:stdout"
set exit 0
comparefiles "{Regression_test.PPC.output}" "{proj}"stl_test.exp # compare output file
set exit 1
end <20><> "{worksheet}"
#)#
# *** how to try out the EH testsuite (PPC version):
# ===============================================================================================================
# target compiler: apple's mpw MrCpp 5.0.0
#
# (3) run the shell script listed below to compile and link the PPC version of testsuite as the mpw
# tool by selecting it and press enter.
#
# Note: MrCpp and SCpp still can not pass all eh tests. You will get failed assertion when run the test.
#
#(# PPC (3)
begin
set -e MrCpp `which MrCpp` # ver.5.0.0 or better is required
save -a # save all files (optional)
directory "{stl}:test:eh:" # setup the working directory
target "{worksheet}"
echo -n "<22>n####### START BUILDING PPC VERSION OF STL EH TEST SUITE ####### "; date -s
unset other_STL_Options
unset other_MrCpp_Options
unset fullbuild
# set -e fullbuild "-e" # uncomment this line to force full build
unset debug_build
# set -e debug_build '-d DEBUG' # debug flavor can not pass the eh test yet.
make -w {fullbuild} {debug_build} EH_test -f "{stl}:test:regression:MrCpp.mak" > MrCpp.MakeIt
set -e exit 0
execute MrCpp.MakeIt
set -e exit 1
end <20><> "{worksheet}"
#)#
# *** how to try out the testsuite (68K version):
# ===============================================================================================================
# target compiler: apple's mpw SCpp 8.9.0
#
# (1) run the shell script listed below to compile and link the 68K version of testsuite as the mpw
# tool by selecting it and press enter.
#
#(# 68K (1)
begin
set SCpp `which SCpp` # ver.8.9.0 or better is required
save -a # save all files (optional)
directory "{stl}:test:regression:" # setup the working directory
target "{worksheet}"
echo -n "<22>n####### START BUILDING 68K VERSION OF STL REGRESSION TEST SUITE ####### "; date -s
unset other_STL_Options
unset other_SCpp_Options
unset fullbuild
# set fullbuild "-e" # uncomment this line to force full build
unset debug_build
set -e debug_build '-d DEBUG' # uncomment this line to build non-debug version
set -e other_SCpp_Options "-model far"
make -w {fullbuild} {debug_build} Regression_test -f "{stl}:test:regression:SCpp.mak" > SCpp.MakeIt
set -e exit 0
execute SCpp.MakeIt
set -e exit 1
unset other_SCpp_Options
end <20><> "{worksheet}"
#)#
# (2) run the shell script listed below to execute the 68K version of testsuite mpw tool and
# compare the output with the standard "stl_test.exp" output.
#
#(# 68K (2)
set -e proj "{stl}:test:regression:"
set -e obj "{proj}.68K.DBG:"
set Regression_test.68K.output "{obj}"SCpp.exp # output to separate file
#set Regression_test.68K.output "dev:stdout" # output to {worksheet}
if "{active}" =~ /(<28>)<29>1:<3A>/
directory "{<7B>1}:" # setup the working directory
end
target "{worksheet}"
begin
echo 'a string' > "{proj}"stdin # prepare input
echo "###### START: Regression_test.68K"
"{obj}"Regression_test.68K < "{proj}"stdin > "{Regression_test.68K.output}" # run
echo "###### FINISHED: Regression_test.68K"
end <20><> "{worksheet}"
if "{Regression_test.68K.output}" != "dev:stdout"
set exit 0
comparefiles "{Regression_test.68K.output}" "{proj}"stl_test.exp # compare output file
set exit 1
end <20><> "{worksheet}"
#)#
# *** how to try out the eh testsuite (68K version):
# ===============================================================================================================
# target compiler: apple's mpw SCpp 8.9.0
#
# (1) run the shell script listed below to compile and link the 68K version of testsuite as the mpw
# tool by selecting it and press enter.
#
# Note: MrCpp and SCpp still can not pass all eh tests. You will get failed assertion when run the test.
#
#(# 68K (1)
begin
set SCpp `which SCpp` # ver.8.9.0 or better is required
save -a # save all files (optional)
directory "{stl}:test:eh:" # setup the working directory
target "{worksheet}"
echo -n "<22>n####### START BUILDING 68K VERSION OF STL EH TEST SUITE ####### "; date -s
unset other_STL_Options
unset other_SCpp_Options
unset fullbuild
# set fullbuild "-e" # uncomment this line to force full build
unset debug_build
set -e debug_build '-d DEBUG'
set -e other_SCpp_Options "-model far"
make -w {fullbuild} {debug_build} EH_test -f "{stl}:test:regression:SCpp.mak" > SCpp.MakeIt
set -e exit 0
execute SCpp.MakeIt
set -e exit 1
end <20><> "{worksheet}"
#)#
# - end of ReadMe.MPW

View File

@@ -0,0 +1,998 @@
!include "{stl}:src:SCpp.mak"
MAKEFILE = SCpp.mak
Needed_SysLibs = <20>
# "{CLibraries}IOStreams.o" <20>
"{STL}:lib:STLportLib{config_}.o" <20>
"{Libraries}Stubs.o" <20>
"{Libraries}MathLib.o" <20>
"{CLibraries}CPlusLib.o" <20>
"{CLibraries}StdCLib.o" <20>
"{Libraries}MacRuntime.o" <20>
"{Libraries}IntEnv.o" <20>
#"{Libraries}ToolLibs.o" <20>
"{Libraries}Interface.o" <20>
# end
##################################################################################
# test:regression: build rule
##################################################################################
Regression_Objects_68K = <20>
"{ObjDir}accum1.cpp.o" <20>
"{ObjDir}accum2.cpp.o" <20>
"{ObjDir}adjdiff0.cpp.o" <20>
"{ObjDir}adjdiff1.cpp.o" <20>
"{ObjDir}adjdiff2.cpp.o" <20>
"{ObjDir}adjfind0.cpp.o" <20>
"{ObjDir}adjfind1.cpp.o" <20>
"{ObjDir}adjfind2.cpp.o" <20>
"{ObjDir}advance.cpp.o" <20>
"{ObjDir}alg1.cpp.o" <20>
"{ObjDir}alg2.cpp.o" <20>
"{ObjDir}alg3.cpp.o" <20>
"{ObjDir}alg4.cpp.o" <20>
"{ObjDir}alg5.cpp.o" <20>
"{ObjDir}bcompos1.cpp.o" <20>
"{ObjDir}bcompos2.cpp.o" <20>
"{ObjDir}bind1st1.cpp.o" <20>
"{ObjDir}bind1st2.cpp.o" <20>
"{ObjDir}bind2nd1.cpp.o" <20>
"{ObjDir}bind2nd2.cpp.o" <20>
"{ObjDir}binsert1.cpp.o" <20>
"{ObjDir}binsert2.cpp.o" <20>
"{ObjDir}binsrch1.cpp.o" <20>
"{ObjDir}binsrch2.cpp.o" <20>
"{ObjDir}bitset1.cpp.o" <20>
"{ObjDir}bnegate1.cpp.o" <20>
"{ObjDir}bnegate2.cpp.o" <20>
"{ObjDir}bvec1.cpp.o" <20>
"{ObjDir}copy1.cpp.o" <20>
"{ObjDir}copy2.cpp.o" <20>
"{ObjDir}copy3.cpp.o" <20>
"{ObjDir}copy4.cpp.o" <20>
"{ObjDir}copyb.cpp.o" <20>
"{ObjDir}copyb0.cpp.o" <20>
"{ObjDir}count0.cpp.o" <20>
"{ObjDir}count1.cpp.o" <20>
"{ObjDir}countif1.cpp.o" <20>
"{ObjDir}deque1.cpp.o" <20>
"{ObjDir}divides.cpp.o" <20>
"{ObjDir}eqlrnge0.cpp.o" <20>
"{ObjDir}eqlrnge1.cpp.o" <20>
"{ObjDir}eqlrnge2.cpp.o" <20>
"{ObjDir}equal0.cpp.o" <20>
"{ObjDir}equal1.cpp.o" <20>
"{ObjDir}equal2.cpp.o" <20>
"{ObjDir}equalto.cpp.o" <20>
"{ObjDir}fill1.cpp.o" <20>
"{ObjDir}filln1.cpp.o" <20>
"{ObjDir}find0.cpp.o" <20>
"{ObjDir}find1.cpp.o" <20>
"{ObjDir}findif0.cpp.o" <20>
"{ObjDir}findif1.cpp.o" <20>
"{ObjDir}finsert1.cpp.o" <20>
"{ObjDir}finsert2.cpp.o" <20>
"{ObjDir}foreach0.cpp.o" <20>
"{ObjDir}foreach1.cpp.o" <20>
"{ObjDir}func1.cpp.o" <20>
"{ObjDir}func2.cpp.o" <20>
"{ObjDir}func3.cpp.o" <20>
"{ObjDir}gener1.cpp.o" <20>
"{ObjDir}gener2.cpp.o" <20>
"{ObjDir}genern1.cpp.o" <20>
"{ObjDir}genern2.cpp.o" <20>
"{ObjDir}greateq.cpp.o" <20>
"{ObjDir}greater.cpp.o" <20>
"{ObjDir}hmap1.cpp.o" <20>
"{ObjDir}hmmap1.cpp.o" <20>
"{ObjDir}hmset1.cpp.o" <20>
"{ObjDir}hset2.cpp.o" <20>
"{ObjDir}incl0.cpp.o" <20>
"{ObjDir}incl1.cpp.o" <20>
"{ObjDir}incl2.cpp.o" <20>
"{ObjDir}inplmrg1.cpp.o" <20>
"{ObjDir}inplmrg2.cpp.o" <20>
"{ObjDir}inrprod0.cpp.o" <20>
"{ObjDir}inrprod1.cpp.o" <20>
"{ObjDir}inrprod2.cpp.o" <20>
"{ObjDir}insert1.cpp.o" <20>
"{ObjDir}insert2.cpp.o" <20>
"{ObjDir}iota1.cpp.o" <20>
"{ObjDir}istmit1.cpp.o" <20>
"{ObjDir}iter1.cpp.o" <20>
"{ObjDir}iter2.cpp.o" <20>
"{ObjDir}iter3.cpp.o" <20>
"{ObjDir}iter4.cpp.o" <20>
"{ObjDir}iterswp0.cpp.o" <20>
"{ObjDir}iterswp1.cpp.o" <20>
"{ObjDir}less.cpp.o" <20>
"{ObjDir}lesseq.cpp.o" <20>
"{ObjDir}lexcmp1.cpp.o" <20>
"{ObjDir}lexcmp2.cpp.o" <20>
"{ObjDir}list1.cpp.o" <20>
"{ObjDir}list2.cpp.o" <20>
"{ObjDir}list3.cpp.o" <20>
"{ObjDir}list4.cpp.o" <20>
"{ObjDir}logicand.cpp.o" <20>
"{ObjDir}logicnot.cpp.o" <20>
"{ObjDir}logicor.cpp.o" <20>
"{ObjDir}lwrbnd1.cpp.o" <20>
"{ObjDir}lwrbnd2.cpp.o" <20>
"{ObjDir}map1.cpp.o" <20>
"{ObjDir}max1.cpp.o" <20>
"{ObjDir}max2.cpp.o" <20>
"{ObjDir}maxelem1.cpp.o" <20>
"{ObjDir}maxelem2.cpp.o" <20>
"{ObjDir}merge0.cpp.o" <20>
"{ObjDir}merge1.cpp.o" <20>
"{ObjDir}merge2.cpp.o" <20>
"{ObjDir}min1.cpp.o" <20>
"{ObjDir}min2.cpp.o" <20>
"{ObjDir}minelem1.cpp.o" <20>
"{ObjDir}minelem2.cpp.o" <20>
"{ObjDir}minus.cpp.o" <20>
"{ObjDir}mismtch0.cpp.o" <20>
"{ObjDir}mismtch1.cpp.o" <20>
"{ObjDir}mismtch2.cpp.o" <20>
"{ObjDir}mkheap0.cpp.o" <20>
"{ObjDir}mkheap1.cpp.o" <20>
"{ObjDir}mmap1.cpp.o" <20>
"{ObjDir}mmap2.cpp.o" <20>
"{ObjDir}modulus.cpp.o" <20>
"{ObjDir}mset1.cpp.o" <20>
"{ObjDir}mset3.cpp.o" <20>
"{ObjDir}mset4.cpp.o" <20>
"{ObjDir}mset5.cpp.o" <20>
"{ObjDir}negate.cpp.o" <20>
"{ObjDir}nequal.cpp.o" <20>
"{ObjDir}nextprm0.cpp.o" <20>
"{ObjDir}nextprm1.cpp.o" <20>
"{ObjDir}nextprm2.cpp.o" <20>
"{ObjDir}nthelem0.cpp.o" <20>
"{ObjDir}nthelem1.cpp.o" <20>
"{ObjDir}nthelem2.cpp.o" <20>
"{ObjDir}ostmit.cpp.o" <20>
"{ObjDir}pair0.cpp.o" <20>
"{ObjDir}pair1.cpp.o" <20>
"{ObjDir}pair2.cpp.o" <20>
"{ObjDir}parsrt0.cpp.o" <20>
"{ObjDir}parsrt1.cpp.o" <20>
"{ObjDir}parsrt2.cpp.o" <20>
"{ObjDir}parsrtc0.cpp.o" <20>
"{ObjDir}parsrtc1.cpp.o" <20>
"{ObjDir}parsrtc2.cpp.o" <20>
"{ObjDir}partsrt0.cpp.o" <20>
"{ObjDir}partsum0.cpp.o" <20>
"{ObjDir}partsum1.cpp.o" <20>
"{ObjDir}partsum2.cpp.o" <20>
"{ObjDir}pheap1.cpp.o" <20>
"{ObjDir}pheap2.cpp.o" <20>
"{ObjDir}plus.cpp.o" <20>
"{ObjDir}pqueue1.cpp.o" <20>
"{ObjDir}prevprm0.cpp.o" <20>
"{ObjDir}prevprm1.cpp.o" <20>
"{ObjDir}prevprm2.cpp.o" <20>
"{ObjDir}ptition0.cpp.o" <20>
"{ObjDir}ptition1.cpp.o" <20>
"{ObjDir}ptrbinf1.cpp.o" <20>
"{ObjDir}ptrbinf2.cpp.o" <20>
"{ObjDir}ptrunf1.cpp.o" <20>
"{ObjDir}ptrunf2.cpp.o" <20>
"{ObjDir}queue1.cpp.o" <20>
"{ObjDir}rawiter.cpp.o" <20>
"{ObjDir}remcopy1.cpp.o" <20>
"{ObjDir}remcpif1.cpp.o" <20>
"{ObjDir}remif1.cpp.o" <20>
"{ObjDir}remove1.cpp.o" <20>
"{ObjDir}repcpif1.cpp.o" <20>
"{ObjDir}replace0.cpp.o" <20>
"{ObjDir}replace1.cpp.o" <20>
"{ObjDir}replcpy1.cpp.o" <20>
"{ObjDir}replif1.cpp.o" <20>
"{ObjDir}revbit1.cpp.o" <20>
"{ObjDir}revbit2.cpp.o" <20>
"{ObjDir}revcopy1.cpp.o" <20>
"{ObjDir}reverse1.cpp.o" <20>
"{ObjDir}reviter1.cpp.o" <20>
"{ObjDir}reviter2.cpp.o" <20>
"{ObjDir}rndshuf0.cpp.o" <20>
"{ObjDir}rndshuf1.cpp.o" <20>
"{ObjDir}rndshuf2.cpp.o" <20>
"{ObjDir}rotate0.cpp.o" <20>
"{ObjDir}rotate1.cpp.o" <20>
"{ObjDir}rotcopy0.cpp.o" <20>
"{ObjDir}rotcopy1.cpp.o" <20>
"{ObjDir}search0.cpp.o" <20>
"{ObjDir}search1.cpp.o" <20>
"{ObjDir}search2.cpp.o" <20>
"{ObjDir}set1.cpp.o" <20>
"{ObjDir}set2.cpp.o" <20>
"{ObjDir}setdiff0.cpp.o" <20>
"{ObjDir}setdiff1.cpp.o" <20>
"{ObjDir}setdiff2.cpp.o" <20>
"{ObjDir}setintr0.cpp.o" <20>
"{ObjDir}setintr1.cpp.o" <20>
"{ObjDir}setintr2.cpp.o" <20>
"{ObjDir}setsymd0.cpp.o" <20>
"{ObjDir}setsymd1.cpp.o" <20>
"{ObjDir}setsymd2.cpp.o" <20>
"{ObjDir}setunon0.cpp.o" <20>
"{ObjDir}setunon1.cpp.o" <20>
"{ObjDir}setunon2.cpp.o" <20>
# "{ObjDir}single.cpp.o" <20>
"{ObjDir}slist1.cpp.o" <20>
"{ObjDir}sort1.cpp.o" <20>
"{ObjDir}sort2.cpp.o" <20>
"{ObjDir}stack1.cpp.o" <20>
"{ObjDir}stack2.cpp.o" <20>
# "{ObjDir}stat.cpp.o" <20>
"{ObjDir}stblptn0.cpp.o" <20>
"{ObjDir}stblptn1.cpp.o" <20>
"{ObjDir}stblsrt1.cpp.o" <20>
"{ObjDir}stblsrt2.cpp.o" <20>
# "{ObjDir}stl_single.cpp.o" <20>
"{ObjDir}stl_test.cpp.o" <20>
"{ObjDir}string1.cpp.o" <20>
"{ObjDir}swap1.cpp.o" <20>
"{ObjDir}swprnge1.cpp.o" <20>
"{ObjDir}times.cpp.o" <20>
"{ObjDir}trnsfrm1.cpp.o" <20>
"{ObjDir}trnsfrm2.cpp.o" <20>
"{ObjDir}ucompos1.cpp.o" <20>
"{ObjDir}ucompos2.cpp.o" <20>
"{ObjDir}unegate1.cpp.o" <20>
"{ObjDir}unegate2.cpp.o" <20>
"{ObjDir}uniqcpy1.cpp.o" <20>
"{ObjDir}uniqcpy2.cpp.o" <20>
"{ObjDir}unique1.cpp.o" <20>
"{ObjDir}unique2.cpp.o" <20>
"{ObjDir}uprbnd1.cpp.o" <20>
"{ObjDir}uprbnd2.cpp.o" <20>
"{ObjDir}vec1.cpp.o" <20>
"{ObjDir}vec2.cpp.o" <20>
"{ObjDir}vec3.cpp.o" <20>
"{ObjDir}vec4.cpp.o" <20>
"{ObjDir}vec5.cpp.o" <20>
"{ObjDir}vec6.cpp.o" <20>
"{ObjDir}vec7.cpp.o" <20>
"{ObjDir}vec8.cpp.o" <20>
# end
Regression_test <EFBFBD><EFBFBD> setup
Regression_test <EFBFBD><EFBFBD> "{ObjDir}"Regression_test.68K
echo "<22>n'{ObjDir}Regression_test.68K' < '{stl}:test:regression:stdin' # execute it"
"{ObjDir}"Regression_test.68K <EFBFBD><EFBFBD> {<EFBFBD>MondoBuild<EFBFBD>} {Regression_Objects_68K} {Needed_SysLibs}
###########
if "{compile_status}"
echo "### LINK NOT PERFORMED DUE TO COMPILE ERROR"
exit "{compile_status}"
end
echo <20>n<EFBFBD>nLinking: "{Targ}"
ILink <20>
#Link <20>
-t 'MPST' <20>
-o {Targ} <20>
{Regression_Objects_68K} <20>
{Link_options} <20>
{Needed_SysLibs} <20>
# end
##################################################################################
# test:eh: build rule
##################################################################################
eh_Objects_68K = <20>
"{ObjDir}main.cpp.o" <20>
"{ObjDir}nc_alloc.cpp.o" <20>
"{ObjDir}random_number.cpp.o" <20>
"{ObjDir}test_algo.cpp.o" <20>
"{ObjDir}test_algobase.cpp.o" <20>
"{ObjDir}test_bit_vector.cpp.o" <20>
"{ObjDir}test_bitset.cpp.o" <20>
"{ObjDir}test_deque.cpp.o" <20>
"{ObjDir}test_hash_map.cpp.o" <20>
"{ObjDir}test_hash_set.cpp.o" <20>
"{ObjDir}test_list.cpp.o" <20>
"{ObjDir}test_map.cpp.o" <20>
"{ObjDir}test_rope.cpp.o" <20>
"{ObjDir}test_set.cpp.o" <20>
"{ObjDir}test_slist.cpp.o" <20>
"{ObjDir}test_string.cpp.o" <20>
"{ObjDir}test_valarray.cpp.o" <20>
"{ObjDir}test_vector.cpp.o" <20>
"{ObjDir}TestClass.cpp.o" <20>
#end
EH_test <EFBFBD><EFBFBD> setup
EH_test <EFBFBD><EFBFBD> "{ObjDir}"EH_test.68K
echo "<22>n'{ObjDir}EH_test.68K' # execute it"
"{ObjDir}"EH_test.68K <20><> "{stl}:test:regression:{<7B>MondoBuild<EFBFBD>}" {eh_Objects_68K} {Needed_SysLibs}
###########
if "{compile_status}"
echo "### LINK NOT PERFORMED DUE TO COMPILE TIME ERROR"
exit "{compile_status}"
end
echo <20>n<EFBFBD>nLinking: "{Targ}"
ILink <20>
#Link <20>
-t 'MPST' <20>
-o {Targ} <20>
{eh_Objects_68K} <20>
{Link_options} <20>
{Needed_SysLibs} <20>
# end
=======
!include "{stl}:src:SCpp.mak"
MAKEFILE = SCpp.mak
Needed_SysLibs = <20>
# "{CLibraries}IOStreams.o" <20>
"{STL}:lib:STLportLib{config_}.o" <20>
"{Libraries}Stubs.o" <20>
"{Libraries}MathLib.o" <20>
"{CLibraries}CPlusLib.o" <20>
"{CLibraries}StdCLib.o" <20>
"{Libraries}MacRuntime.o" <20>
"{Libraries}IntEnv.o" <20>
#"{Libraries}ToolLibs.o" <20>
"{Libraries}Interface.o" <20>
# end
##################################################################################
# test:regression: build rule
##################################################################################
Regression_Objects_68K = <20>
"{ObjDir}accum1.cpp.o" <20>
"{ObjDir}accum2.cpp.o" <20>
"{ObjDir}adjdiff0.cpp.o" <20>
"{ObjDir}adjdiff1.cpp.o" <20>
"{ObjDir}adjdiff2.cpp.o" <20>
"{ObjDir}adjfind0.cpp.o" <20>
"{ObjDir}adjfind1.cpp.o" <20>
"{ObjDir}adjfind2.cpp.o" <20>
"{ObjDir}advance.cpp.o" <20>
"{ObjDir}alg1.cpp.o" <20>
"{ObjDir}alg2.cpp.o" <20>
"{ObjDir}alg3.cpp.o" <20>
"{ObjDir}alg4.cpp.o" <20>
"{ObjDir}alg5.cpp.o" <20>
"{ObjDir}bcompos1.cpp.o" <20>
"{ObjDir}bcompos2.cpp.o" <20>
"{ObjDir}bind1st1.cpp.o" <20>
"{ObjDir}bind1st2.cpp.o" <20>
"{ObjDir}bind2nd1.cpp.o" <20>
"{ObjDir}bind2nd2.cpp.o" <20>
"{ObjDir}binsert1.cpp.o" <20>
"{ObjDir}binsert2.cpp.o" <20>
"{ObjDir}binsrch1.cpp.o" <20>
"{ObjDir}binsrch2.cpp.o" <20>
"{ObjDir}bitset1.cpp.o" <20>
"{ObjDir}bnegate1.cpp.o" <20>
"{ObjDir}bnegate2.cpp.o" <20>
"{ObjDir}bvec1.cpp.o" <20>
"{ObjDir}copy1.cpp.o" <20>
"{ObjDir}copy2.cpp.o" <20>
"{ObjDir}copy3.cpp.o" <20>
"{ObjDir}copy4.cpp.o" <20>
"{ObjDir}copyb.cpp.o" <20>
"{ObjDir}copyb0.cpp.o" <20>
"{ObjDir}count0.cpp.o" <20>
"{ObjDir}count1.cpp.o" <20>
"{ObjDir}countif1.cpp.o" <20>
"{ObjDir}deque1.cpp.o" <20>
"{ObjDir}divides.cpp.o" <20>
"{ObjDir}eqlrnge0.cpp.o" <20>
"{ObjDir}eqlrnge1.cpp.o" <20>
"{ObjDir}eqlrnge2.cpp.o" <20>
"{ObjDir}equal0.cpp.o" <20>
"{ObjDir}equal1.cpp.o" <20>
"{ObjDir}equal2.cpp.o" <20>
"{ObjDir}equalto.cpp.o" <20>
"{ObjDir}fill1.cpp.o" <20>
"{ObjDir}filln1.cpp.o" <20>
"{ObjDir}find0.cpp.o" <20>
"{ObjDir}find1.cpp.o" <20>
"{ObjDir}findif0.cpp.o" <20>
"{ObjDir}findif1.cpp.o" <20>
"{ObjDir}finsert1.cpp.o" <20>
"{ObjDir}finsert2.cpp.o" <20>
"{ObjDir}foreach0.cpp.o" <20>
"{ObjDir}foreach1.cpp.o" <20>
"{ObjDir}func1.cpp.o" <20>
"{ObjDir}func2.cpp.o" <20>
"{ObjDir}func3.cpp.o" <20>
"{ObjDir}gener1.cpp.o" <20>
"{ObjDir}gener2.cpp.o" <20>
"{ObjDir}genern1.cpp.o" <20>
"{ObjDir}genern2.cpp.o" <20>
"{ObjDir}greateq.cpp.o" <20>
"{ObjDir}greater.cpp.o" <20>
"{ObjDir}hmap1.cpp.o" <20>
"{ObjDir}hmmap1.cpp.o" <20>
"{ObjDir}hmset1.cpp.o" <20>
"{ObjDir}hset2.cpp.o" <20>
"{ObjDir}incl0.cpp.o" <20>
"{ObjDir}incl1.cpp.o" <20>
"{ObjDir}incl2.cpp.o" <20>
"{ObjDir}inplmrg1.cpp.o" <20>
"{ObjDir}inplmrg2.cpp.o" <20>
"{ObjDir}inrprod0.cpp.o" <20>
"{ObjDir}inrprod1.cpp.o" <20>
"{ObjDir}inrprod2.cpp.o" <20>
"{ObjDir}insert1.cpp.o" <20>
"{ObjDir}insert2.cpp.o" <20>
"{ObjDir}iota1.cpp.o" <20>
"{ObjDir}istmit1.cpp.o" <20>
"{ObjDir}iter1.cpp.o" <20>
"{ObjDir}iter2.cpp.o" <20>
"{ObjDir}iter3.cpp.o" <20>
"{ObjDir}iter4.cpp.o" <20>
"{ObjDir}iterswp0.cpp.o" <20>
"{ObjDir}iterswp1.cpp.o" <20>
"{ObjDir}less.cpp.o" <20>
"{ObjDir}lesseq.cpp.o" <20>
"{ObjDir}lexcmp1.cpp.o" <20>
"{ObjDir}lexcmp2.cpp.o" <20>
"{ObjDir}list1.cpp.o" <20>
"{ObjDir}list2.cpp.o" <20>
"{ObjDir}list3.cpp.o" <20>
"{ObjDir}list4.cpp.o" <20>
"{ObjDir}logicand.cpp.o" <20>
"{ObjDir}logicnot.cpp.o" <20>
"{ObjDir}logicor.cpp.o" <20>
"{ObjDir}lwrbnd1.cpp.o" <20>
"{ObjDir}lwrbnd2.cpp.o" <20>
"{ObjDir}map1.cpp.o" <20>
"{ObjDir}max1.cpp.o" <20>
"{ObjDir}max2.cpp.o" <20>
"{ObjDir}maxelem1.cpp.o" <20>
"{ObjDir}maxelem2.cpp.o" <20>
"{ObjDir}memfunptr.cpp.o" <20>
"{ObjDir}merge0.cpp.o" <20>
"{ObjDir}merge1.cpp.o" <20>
"{ObjDir}merge2.cpp.o" <20>
"{ObjDir}min1.cpp.o" <20>
"{ObjDir}min2.cpp.o" <20>
"{ObjDir}minelem1.cpp.o" <20>
"{ObjDir}minelem2.cpp.o" <20>
"{ObjDir}minus.cpp.o" <20>
"{ObjDir}mismtch0.cpp.o" <20>
"{ObjDir}mismtch1.cpp.o" <20>
"{ObjDir}mismtch2.cpp.o" <20>
"{ObjDir}mkheap0.cpp.o" <20>
"{ObjDir}mkheap1.cpp.o" <20>
"{ObjDir}mmap1.cpp.o" <20>
"{ObjDir}mmap2.cpp.o" <20>
"{ObjDir}modulus.cpp.o" <20>
"{ObjDir}mset1.cpp.o" <20>
"{ObjDir}mset3.cpp.o" <20>
"{ObjDir}mset4.cpp.o" <20>
"{ObjDir}mset5.cpp.o" <20>
"{ObjDir}negate.cpp.o" <20>
"{ObjDir}nequal.cpp.o" <20>
"{ObjDir}nextprm0.cpp.o" <20>
"{ObjDir}nextprm1.cpp.o" <20>
"{ObjDir}nextprm2.cpp.o" <20>
"{ObjDir}nthelem0.cpp.o" <20>
"{ObjDir}nthelem1.cpp.o" <20>
"{ObjDir}nthelem2.cpp.o" <20>
"{ObjDir}ostmit.cpp.o" <20>
"{ObjDir}pair0.cpp.o" <20>
"{ObjDir}pair1.cpp.o" <20>
"{ObjDir}pair2.cpp.o" <20>
"{ObjDir}parsrt0.cpp.o" <20>
"{ObjDir}parsrt1.cpp.o" <20>
"{ObjDir}parsrt2.cpp.o" <20>
"{ObjDir}parsrtc0.cpp.o" <20>
"{ObjDir}parsrtc1.cpp.o" <20>
"{ObjDir}parsrtc2.cpp.o" <20>
"{ObjDir}partsrt0.cpp.o" <20>
"{ObjDir}partsum0.cpp.o" <20>
"{ObjDir}partsum1.cpp.o" <20>
"{ObjDir}partsum2.cpp.o" <20>
"{ObjDir}pheap1.cpp.o" <20>
"{ObjDir}pheap2.cpp.o" <20>
"{ObjDir}plus.cpp.o" <20>
"{ObjDir}pqueue1.cpp.o" <20>
"{ObjDir}prevprm0.cpp.o" <20>
"{ObjDir}prevprm1.cpp.o" <20>
"{ObjDir}prevprm2.cpp.o" <20>
"{ObjDir}ptition0.cpp.o" <20>
"{ObjDir}ptition1.cpp.o" <20>
"{ObjDir}ptrbinf1.cpp.o" <20>
"{ObjDir}ptrbinf2.cpp.o" <20>
"{ObjDir}ptrunf1.cpp.o" <20>
"{ObjDir}ptrunf2.cpp.o" <20>
"{ObjDir}queue1.cpp.o" <20>
"{ObjDir}rawiter.cpp.o" <20>
"{ObjDir}remcopy1.cpp.o" <20>
"{ObjDir}remcpif1.cpp.o" <20>
"{ObjDir}remif1.cpp.o" <20>
"{ObjDir}remove1.cpp.o" <20>
"{ObjDir}repcpif1.cpp.o" <20>
"{ObjDir}replace0.cpp.o" <20>
"{ObjDir}replace1.cpp.o" <20>
"{ObjDir}replcpy1.cpp.o" <20>
"{ObjDir}replif1.cpp.o" <20>
"{ObjDir}revbit1.cpp.o" <20>
"{ObjDir}revbit2.cpp.o" <20>
"{ObjDir}revcopy1.cpp.o" <20>
"{ObjDir}reverse1.cpp.o" <20>
"{ObjDir}reviter1.cpp.o" <20>
"{ObjDir}reviter2.cpp.o" <20>
"{ObjDir}rndshuf0.cpp.o" <20>
"{ObjDir}rndshuf1.cpp.o" <20>
"{ObjDir}rndshuf2.cpp.o" <20>
"{ObjDir}rotate0.cpp.o" <20>
"{ObjDir}rotate1.cpp.o" <20>
"{ObjDir}rotcopy0.cpp.o" <20>
"{ObjDir}rotcopy1.cpp.o" <20>
"{ObjDir}search0.cpp.o" <20>
"{ObjDir}search1.cpp.o" <20>
"{ObjDir}search2.cpp.o" <20>
"{ObjDir}set1.cpp.o" <20>
"{ObjDir}set2.cpp.o" <20>
"{ObjDir}setdiff0.cpp.o" <20>
"{ObjDir}setdiff1.cpp.o" <20>
"{ObjDir}setdiff2.cpp.o" <20>
"{ObjDir}setintr0.cpp.o" <20>
"{ObjDir}setintr1.cpp.o" <20>
"{ObjDir}setintr2.cpp.o" <20>
"{ObjDir}setsymd0.cpp.o" <20>
"{ObjDir}setsymd1.cpp.o" <20>
"{ObjDir}setsymd2.cpp.o" <20>
"{ObjDir}setunon0.cpp.o" <20>
"{ObjDir}setunon1.cpp.o" <20>
"{ObjDir}setunon2.cpp.o" <20>
# "{ObjDir}single.cpp.o" <20>
"{ObjDir}slist1.cpp.o" <20>
"{ObjDir}sort1.cpp.o" <20>
"{ObjDir}sort2.cpp.o" <20>
"{ObjDir}stack1.cpp.o" <20>
"{ObjDir}stack2.cpp.o" <20>
# "{ObjDir}stat.cpp.o" <20>
"{ObjDir}stblptn0.cpp.o" <20>
"{ObjDir}stblptn1.cpp.o" <20>
"{ObjDir}stblsrt1.cpp.o" <20>
"{ObjDir}stblsrt2.cpp.o" <20>
# "{ObjDir}stl_single.cpp.o" <20>
"{ObjDir}stl_test.cpp.o" <20>
"{ObjDir}string1.cpp.o" <20>
"{ObjDir}swap1.cpp.o" <20>
"{ObjDir}swprnge1.cpp.o" <20>
"{ObjDir}times.cpp.o" <20>
"{ObjDir}trnsfrm1.cpp.o" <20>
"{ObjDir}trnsfrm2.cpp.o" <20>
"{ObjDir}ucompos1.cpp.o" <20>
"{ObjDir}ucompos2.cpp.o" <20>
"{ObjDir}unegate1.cpp.o" <20>
"{ObjDir}unegate2.cpp.o" <20>
"{ObjDir}uniqcpy1.cpp.o" <20>
"{ObjDir}uniqcpy2.cpp.o" <20>
"{ObjDir}unique1.cpp.o" <20>
"{ObjDir}unique2.cpp.o" <20>
"{ObjDir}uprbnd1.cpp.o" <20>
"{ObjDir}uprbnd2.cpp.o" <20>
"{ObjDir}vec1.cpp.o" <20>
"{ObjDir}vec2.cpp.o" <20>
"{ObjDir}vec3.cpp.o" <20>
"{ObjDir}vec4.cpp.o" <20>
"{ObjDir}vec5.cpp.o" <20>
"{ObjDir}vec6.cpp.o" <20>
"{ObjDir}vec7.cpp.o" <20>
"{ObjDir}vec8.cpp.o" <20>
# end
Regression_test <EFBFBD><EFBFBD> setup
Regression_test <EFBFBD><EFBFBD> "{ObjDir}"Regression_test.68K
echo "<22>n'{ObjDir}Regression_test.68K' < '{stl}:test:regression:stdin' # execute it"
"{ObjDir}"Regression_test.68K <EFBFBD><EFBFBD> {<EFBFBD>MondoBuild<EFBFBD>} {Regression_Objects_68K} {Needed_SysLibs}
###########
if "{compile_status}"
echo "### LINK NOT PERFORMED DUE TO COMPILE ERROR"
exit "{compile_status}"
end
echo <20>n<EFBFBD>nLinking: "{Targ}"
ILink <20>
#Link <20>
-t 'MPST' <20>
-o {Targ} <20>
{Regression_Objects_68K} <20>
{Link_options} <20>
{Needed_SysLibs} <20>
# end
##################################################################################
# test:eh: build rule
##################################################################################
eh_Objects_68K = <20>
"{ObjDir}main.cpp.o" <20>
"{ObjDir}nc_alloc.cpp.o" <20>
"{ObjDir}random_number.cpp.o" <20>
"{ObjDir}test_algo.cpp.o" <20>
"{ObjDir}test_algobase.cpp.o" <20>
"{ObjDir}test_bit_vector.cpp.o" <20>
"{ObjDir}test_bitset.cpp.o" <20>
"{ObjDir}test_deque.cpp.o" <20>
"{ObjDir}test_hash_map.cpp.o" <20>
"{ObjDir}test_hash_set.cpp.o" <20>
"{ObjDir}test_list.cpp.o" <20>
"{ObjDir}test_map.cpp.o" <20>
"{ObjDir}test_rope.cpp.o" <20>
"{ObjDir}test_set.cpp.o" <20>
"{ObjDir}test_slist.cpp.o" <20>
"{ObjDir}test_string.cpp.o" <20>
"{ObjDir}test_valarray.cpp.o" <20>
"{ObjDir}test_vector.cpp.o" <20>
"{ObjDir}TestClass.cpp.o" <20>
#end
EH_test <EFBFBD><EFBFBD> setup
EH_test <EFBFBD><EFBFBD> "{ObjDir}"EH_test.68K
echo "<22>n'{ObjDir}EH_test.68K' # execute it"
"{ObjDir}"EH_test.68K <20><> "{stl}:test:regression:{<7B>MondoBuild<EFBFBD>}" {eh_Objects_68K} {Needed_SysLibs}
###########
if "{compile_status}"
echo "### LINK NOT PERFORMED DUE TO COMPILE TIME ERROR"
exit "{compile_status}"
end
echo <20>n<EFBFBD>nLinking: "{Targ}"
ILink <20>
#Link <20>
-t 'MPST' <20>
-o {Targ} <20>
{eh_Objects_68K} <20>
{Link_options} <20>
{Needed_SysLibs} <20>
# end

View File

@@ -0,0 +1,26 @@
// STLport regression testsuite component.
// To compile as a separate example, please #define MAIN.
#include <vector>
#include <numeric>
#include <iostream>
#ifdef MAIN
#define accum1_test main
#endif
#if !defined (STLPORT) || defined(_STLP_USE_NAMESPACES)
using namespace std;
#endif
int accum1_test(int, char**)
{
cout<<"Results of accum1_test:"<<endl;
vector <int> v(5);
for(int i = 0; i < v.size(); i++)
v[i] = i + 1;
int sum = accumulate(v.begin(), v.end(), 0);
cout << "sum = " << sum << endl;
return 0;
}

View File

@@ -0,0 +1,30 @@
// STLport regression testsuite component.
// To compile as a separate example, please #define MAIN.
#include <vector>
#include <numeric>
#include <iostream>
#ifdef MAIN
#define accum2_test main
#endif
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
using namespace std;
#endif
static int mult(int initial_, int element_)
{
return initial_ * element_;
}
int accum2_test(int, char**)
{
cout<<"Results of accum2_test:"<<endl;
vector <int> v(5);
for(int i = 0; i < v.size(); i++)
v[i] = i + 1;
int prod = accumulate(v.begin(), v.end(), 1, mult);
cout << "prod = " << prod << endl;
return 0;
}

View File

@@ -0,0 +1,31 @@
// STLport regression testsuite component.
// To compile as a separate example, please #define MAIN.
#include <numeric>
#include <iostream>
#ifdef MAIN
#define adjdiff0_test main
#endif
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
using namespace std;
#endif
int adjdiff0_test(int, char**)
{
cout<<"Results of adjdiff0_test:"<<endl;
int numbers[5] = { 1, 2, 4, 8, 16 };
int difference[5];
adjacent_difference(numbers, numbers + 5, (int*)difference);
int i;
for(i = 0; i < 5; i++)
cout << numbers[i] << ' ';
cout << endl;
for(i = 0; i < 5; i++)
cout << difference[i] << ' ';
cout << endl;
return 0;
}

View File

@@ -0,0 +1,31 @@
// STLport regression testsuite component.
// To compile as a separate example, please #define MAIN.
#include <vector>
#include <numeric>
#include <iterator>
#include <iostream>
#ifdef MAIN
#define adjdiff1_test main
#endif
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
using namespace std;
#endif
int adjdiff1_test(int, char**)
{
cout<<"Results of adjdiff1_test:"<<endl;
vector <int> v(10);
for(int i = 0; i < v.size(); i++)
v[i] = i * i;
vector <int> result(v.size());
adjacent_difference(v.begin(), v.end(), result.begin());
ostream_iterator<int> iter(cout, " ");
// vector<int>::iterator iter;
copy(v.begin(), v.end(), iter);
cout << endl;
copy(result.begin(), result.end(), iter);
cout << endl;
return 0;
}

View File

@@ -0,0 +1,35 @@
// STLport regression testsuite component.
// To compile as a separate example, please #define MAIN.
#include <vector>
#include <numeric>
#include <iterator>
#include <iostream>
#ifdef MAIN
#define adjdiff2_test main
#endif
static int mult(int a_, int b_)
{
return a_ * b_;
}
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
using namespace std;
#endif
int adjdiff2_test(int, char**)
{
cout<<"Results of adjdiff2_test:"<<endl;
vector <int> v(10);
for(int i = 0; i < v.size(); i++)
v[i] = i + 1;
vector <int> rslt(v.size());
adjacent_difference(v.begin(), v.end(), rslt.begin(), mult);
ostream_iterator<int> iter(cout, " ");
copy(v.begin(), v.end(), iter);
cout << endl;
copy(rslt.begin(), rslt.end(), iter);
cout << endl;
return 0;
}

View File

@@ -0,0 +1,43 @@
// STLport regression testsuite component.
// To compile as a separate example, please #define MAIN.
#include <algorithm>
#include <iostream>
#ifdef MAIN
#define adjfind0_test main
#endif
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
using namespace std;
#endif
int adjfind0_test(int, char**)
{
cout<<"Results of adjfind0_test:"<<endl;
int numbers1 [5] = { 1, 2, 4, 8, 16 };
int numbers2 [5] = { 5, 3, 2, 1, 1 };
int* location = adjacent_find((int*)numbers1, (int*)numbers1 + 5);
if(location != numbers1 + 5)
cout
<< "Found adjacent pair of: "
<< *location
<< " at offset "
<<(location - numbers1)
<< endl;
else
cout << "No adjacent pairs" << endl;
location = adjacent_find((int*)numbers2, (int*)numbers2 + 5);
if(location != numbers2 + 5)
cout
<< "Found adjacent pair of: "
<< *location
<< " at offset "
<<(location - numbers2)
<< endl;
else
cout << "No adjacent pairs" << endl;
return 0;
}

View File

@@ -0,0 +1,35 @@
// STLport regression testsuite component.
// To compile as a separate example, please #define MAIN.
#include <vector>
#include <algorithm>
#include <iostream>
#ifdef MAIN
#define adjfind1_test main
#endif
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
using namespace std;
#endif
int adjfind1_test(int, char**)
{
cout<<"Results of adjfind1_test:"<<endl;
typedef vector<int> IntVector;
IntVector v(10);
for(int i = 0; i < v.size(); i++)
v[i] = i;
IntVector::iterator location;
location = adjacent_find(v.begin(), v.end());
if(location != v.end())
cout << "Found adjacent pair of: " << *location << endl;
else
cout << "No adjacent pairs" << endl;
v[6] = 7;
location = adjacent_find(v.begin(), v.end());
if(location != v.end())
cout << "Found adjacent pair of: " << *location << endl;
else
cout << "No adjacent pairs" << endl;
return 0;
}

View File

@@ -0,0 +1,43 @@
// STLport regression testsuite component.
// To compile as a separate example, please #define MAIN.
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#ifdef MAIN
#define adjfind2_test main
#endif
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
using namespace std;
#endif
static int equal_length(const char* v1_, const char* v2_)
{
return ::strlen(v1_) == ::strlen(v2_);
}
int adjfind2_test(int, char**)
{
cout<<"Results of adjfind2_test:"<<endl;
typedef vector <char*> CStrVector;
char* names[] = { "Brett", "Graham", "Jack", "Mike", "Todd" };
const int nameCount = sizeof(names)/sizeof(names[0]);
CStrVector v(nameCount);
for(int i = 0; i < nameCount; i++)
v[i] = names[i];
CStrVector::iterator location;
location = adjacent_find(v.begin(), v.end(), equal_length);
if(location != v.end())
cout
<< "Found two adjacent strings of equal length: "
<< *location
<< " -and- "
<< *(location + 1)
<< endl;
else
cout << "Didn't find two adjacent strings of equal length.";
return 0;
}

View File

@@ -0,0 +1,27 @@
// STLport regression testsuite component.
// To compile as a separate example, please #define MAIN.
#include <vector>
#include <algorithm>
#include <iostream>
#ifdef MAIN
#define advance_test main
#endif
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
using namespace std;
#endif
int advance_test(int, char**)
{
cout<<"Results of advance_test:"<<endl;
typedef vector <int> IntVector;
IntVector v(10);
for(int i = 0; i < v.size(); i++)
v[i] = i;
IntVector::iterator location = v.begin();
cout << "At Beginning: " << *location << endl;
advance(location, 5);
cout << "At Beginning + 5: " << *location << endl;
return 0;
}

View File

@@ -0,0 +1,23 @@
// STLport regression testsuite component.
// To compile as a separate example, please #define MAIN.
#include <algorithm>
#include <iostream>
#ifdef MAIN
#define alg1_test main
#endif
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
using namespace std;
#endif
int alg1_test(int, char**)
{
cout<<"Results of alg1_test:"<<endl;
int i = min(4, 7);
cout << "min(4, 7) = " << i << endl;
char c = max('a', 'z');
cout << "max('a', 'z') = " << c << endl;
return 0;
}

View File

@@ -0,0 +1,23 @@
// STLport regression testsuite component.
// To compile as a separate example, please #define MAIN.
#include <algorithm>
#include <iostream>
#ifdef MAIN
#define alg2_test main
#endif
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
using namespace std;
#endif
int alg2_test(int, char**)
{
cout<<"Results of alg2_test:"<<endl;
int n = 0;
int i [] = { 1, 4, 2, 8, 2, 2 };
count(i, i + 6, 2, n);
cout << "Count of 2s = " << n << endl;
return 0;
}

View File

@@ -0,0 +1,30 @@
// STLport regression testsuite component.
// To compile as a separate example, please #define MAIN.
#include <vector>
#include <algorithm>
#include <iostream>
#ifdef MAIN
#define alg3_test main
#endif
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
using namespace std;
#endif
int alg3_test(int, char**)
{
cout<<"Results of alg3_test:"<<endl;
int n=0;
vector<int> i;
i.push_back(1);
i.push_back(4);
i.push_back(2);
i.push_back(8);
i.push_back(2);
i.push_back(2);
count(i.begin(), i.end(), 2, n);
cout << "Count of 2s = " << n << endl;
return 0;
}

View File

@@ -0,0 +1,28 @@
// STLport regression testsuite component.
// To compile as a separate example, please #define MAIN.
#include <vector>
#include <algorithm>
#include <iostream>
#ifdef MAIN
#define alg4_test main
#endif
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
using namespace std;
#endif
int alg4_test(int, char**)
{
cout<<"Results of alg4_test:"<<endl;
vector<int> years;
years.push_back(1962);
years.push_back(1992);
years.push_back(2001);
years.push_back(1999);
sort(years.begin(), years.end());
vector<int>::const_iterator i;
for(i = years.begin(); i != years.end(); i++)
cout << *i << endl;
return 0;
}

View File

@@ -0,0 +1,27 @@
// STLport regression testsuite component.
// To compile as a separate example, please #define MAIN.
#include <iostream>
#include <deque>
#include <algorithm>
#ifdef MAIN
#define alg5_test main
#endif
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
using namespace std;
#endif
int alg5_test(int, char**)
{
cout<<"Results of alg5_test:"<<endl;
deque<int> years;
years.push_back(1962);
years.push_back(1992);
years.push_back(2001);
years.push_back(1999);
deque<int>::iterator i;
for(i = years.begin(); i != years.end(); i++)
cout << *i << endl;
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,279 @@
# ---------------------------------------------------------------------------
!if !$d(BCB)
BCB = $(MAKEDIR)\..
!endif
BCC32=bcc32
CPP32=cpp32
# ---------------------------------------------------------------------------
PROJECT = stl_test.exe
OBJFILES = \
vec2.obj\
vec7.obj\
vec6.obj\
vec5.obj\
vec4.obj\
vec3.obj\
vec8.obj\
stat.obj\
uprbnd2.obj\
uprbnd1.obj\
unique2.obj\
unique1.obj\
uniqcpy2.obj\
uniqcpy1.obj\
unegate2.obj\
unegate1.obj\
ucompos2.obj\
ucompos1.obj\
trnsfrm2.obj\
trnsfrm1.obj\
times.obj\
swprnge1.obj\
swap1.obj\
stl_test.obj\
stblsrt2.obj\
stblsrt1.obj\
stblptn1.obj\
stblptn0.obj\
vec1.obj\
rotcopy0.obj\
stack1.obj\
sort2.obj\
sort1.obj\
setunon2.obj\
setunon1.obj\
setunon0.obj\
setsymd2.obj\
setsymd1.obj\
setsymd0.obj\
setintr2.obj\
setintr1.obj\
setintr0.obj\
setdiff2.obj\
setdiff1.obj\
setdiff0.obj\
set2.obj\
set1.obj\
search2.obj\
search1.obj\
search0.obj\
rotcopy1.obj\
stack2.obj\
ptrunf1.obj\
rotate0.obj\
rndshuf2.obj\
rndshuf1.obj\
rndshuf0.obj\
reviter2.obj\
reviter1.obj\
reverse1.obj\
revcopy1.obj\
revbit2.obj\
revbit1.obj\
replif1.obj\
replcpy1.obj\
replace1.obj\
replace0.obj\
repcpif1.obj\
remove1.obj\
remif1.obj\
remcpif1.obj\
remcopy1.obj\
rawiter.obj\
queue1.obj\
ptrunf2.obj\
rotate1.obj\
pair0.obj\
ptrbinf1.obj\
ptition1.obj\
ptition0.obj\
prevprm2.obj\
prevprm1.obj\
prevprm0.obj\
pqueue1.obj\
plus.obj\
pheap2.obj\
pheap1.obj\
partsum2.obj\
partsum1.obj\
partsum0.obj\
partsrt0.obj\
parsrtc2.obj\
parsrtc1.obj\
parsrtc0.obj\
parsrt2.obj\
parsrt1.obj\
parsrt0.obj\
pair2.obj\
pair1.obj\
ptrbinf2.obj\
minelem1.obj\
nthelem2.obj\
nthelem1.obj\
nthelem0.obj\
nextprm2.obj\
nextprm1.obj\
nextprm0.obj\
nequal.obj\
negate.obj\
mset5.obj\
mset4.obj\
mset3.obj\
mset1.obj\
modulus.obj\
mmap2.obj\
mmap1.obj\
mkheap1.obj\
mkheap0.obj\
mismtch2.obj\
mismtch1.obj\
mismtch0.obj\
minus.obj\
minelem2.obj\
ostmit.obj\
iterswp1.obj\
min1.obj\
memfunptr.obj \
merge2.obj\
merge1.obj\
merge0.obj\
maxelem2.obj\
maxelem1.obj\
max2.obj\
max1.obj\
map1.obj\
lwrbnd2.obj\
lwrbnd1.obj\
logicor.obj\
logicnot.obj\
logicand.obj\
list4.obj\
list3.obj\
list2.obj\
list1.obj\
lexcmp2.obj\
lexcmp1.obj\
lesseq.obj\
less.obj\
min2.obj\
greater.obj\
iter4.obj\
iter3.obj\
iter2.obj\
iter1.obj\
istmit1.obj\
iota1.obj\
insert2.obj\
insert1.obj\
inrprod2.obj\
inrprod1.obj\
inrprod0.obj\
inplmrg2.obj\
inplmrg1.obj\
incl2.obj\
incl1.obj\
incl0.obj\
iterswp0.obj\
eqlrnge2.obj\
genern2.obj\
genern1.obj\
gener2.obj\
gener1.obj\
func3.obj\
func2.obj\
func1.obj\
foreach1.obj\
foreach0.obj\
finsert2.obj\
finsert1.obj\
findif1.obj\
findif0.obj\
find1.obj\
find0.obj\
filln1.obj\
fill1.obj\
equalto.obj\
equal2.obj\
equal1.obj\
equal0.obj\
greateq.obj\
binsrch1.obj\
eqlrnge0.obj\
divides.obj\
deque1.obj\
countif1.obj\
count1.obj\
count0.obj\
copyb0.obj\
copyb.obj\
copy4.obj\
copy3.obj\
copy2.obj\
copy1.obj\
bvec1.obj\
bnegate2.obj\
bnegate1.obj\
binsrch2.obj\
eqlrnge1.obj\
accum1.obj\
binsert1.obj\
bind2nd2.obj\
bind2nd1.obj\
bind1st1.obj\
bind1st2.obj\
bcompos2.obj\
bcompos1.obj\
alg5.obj\
alg4.obj\
alg3.obj\
alg2.obj\
alg1.obj\
advance.obj\
adjfind2.obj\
adjfind1.obj\
adjfind0.obj\
adjdiff2.obj\
adjdiff1.obj\
adjdiff0.obj\
accum2.obj\
binsert2.obj\
hmap1.obj hmmap1.obj hset2.obj hmset1.obj \
slist1.cpp string1.cpp bitset1.cpp
# ---------------------------------------------------------------------------
PATHCPP = .;
PATHPAS = .;
PATHASM = .;
PATHRC = .;
# USERDEFINES = _STLP_NO_OWN_IOSTREAMS
SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES;_DEBUG
# ---------------------------------------------------------------------------
CFLAG1 = -w- -j1 -I.;..\..\stlport\BC50;..\..\stlport;$(BCB)\include; -Od -v -N -x -xp -tWC -D$(SYSDEFINES);$(USERDEFINES) -L..\..\lib
# CFLAG1 = -w- -jb -j1 -I.;..\..\stlport;$(BCB)\include; -tWC -D$(SYSDEFINES);$(USERDEFINES) -L..\..\lib
.autodepend
# ---------------------------------------------------------------------------
all : $(PROJECT)
$(PROJECT) : $(OBJFILES)
$(BCB)\BIN\$(BCC32) -e$(PROJECT) $(CFLAG1) $(OBJFILES)
clean:
del *.obj *.exe *.core *.tds
# ---------------------------------------------------------------------------
.cpp.obj:
$(BCB)\BIN\$(BCC32) $(CFLAG1) -n$(@D) -c $<
.cpp.exe:
$(BCB)\BIN\$(BCC32) $(CFLAG1) -DMAIN -n$(@D) $<
.cpp.i:
$(BCB)\BIN\$(CPP32) $(CFLAG1) -n. -Sd {$< }
# ---------------------------------------------------------------------------

View File

@@ -0,0 +1,284 @@
# ---------------------------------------------------------------------------
!if !$d(BCB)
BCB = $(MAKEDIR)\..
!endif
BCC32=bcc32
CPP32=cpp32
# ---------------------------------------------------------------------------
PROJECT = stl_test.exe
OBJFILES = \
vec2.obj\
vec7.obj\
vec6.obj\
vec5.obj\
vec4.obj\
vec3.obj\
vec8.obj\
stat.obj\
uprbnd2.obj\
uprbnd1.obj\
unique2.obj\
unique1.obj\
uniqcpy2.obj\
uniqcpy1.obj\
unegate2.obj\
unegate1.obj\
ucompos2.obj\
ucompos1.obj\
trnsfrm2.obj\
trnsfrm1.obj\
times.obj\
swprnge1.obj\
swap1.obj\
stl_test.obj\
stblsrt2.obj\
stblsrt1.obj\
stblptn1.obj\
stblptn0.obj\
vec1.obj\
rotcopy0.obj\
stack1.obj\
sort2.obj\
sort1.obj\
setunon2.obj\
setunon1.obj\
setunon0.obj\
setsymd2.obj\
setsymd1.obj\
setsymd0.obj\
setintr2.obj\
setintr1.obj\
setintr0.obj\
setdiff2.obj\
setdiff1.obj\
setdiff0.obj\
set2.obj\
set1.obj\
search2.obj\
search1.obj\
search0.obj\
rotcopy1.obj\
stack2.obj\
ptrunf1.obj\
rotate0.obj\
rndshuf2.obj\
rndshuf1.obj\
rndshuf0.obj\
reviter2.obj\
reviter1.obj\
reverse1.obj\
revcopy1.obj\
revbit2.obj\
revbit1.obj\
replif1.obj\
replcpy1.obj\
replace1.obj\
replace0.obj\
repcpif1.obj\
remove1.obj\
remif1.obj\
remcpif1.obj\
remcopy1.obj\
rawiter.obj\
queue1.obj\
ptrunf2.obj\
rotate1.obj\
pair0.obj\
ptrbinf1.obj\
ptition1.obj\
ptition0.obj\
prevprm2.obj\
prevprm1.obj\
prevprm0.obj\
pqueue1.obj\
plus.obj\
pheap2.obj\
pheap1.obj\
partsum2.obj\
partsum1.obj\
partsum0.obj\
partsrt0.obj\
parsrtc2.obj\
parsrtc1.obj\
parsrtc0.obj\
parsrt2.obj\
parsrt1.obj\
parsrt0.obj\
pair2.obj\
pair1.obj\
ptrbinf2.obj\
minelem1.obj\
nthelem2.obj\
nthelem1.obj\
nthelem0.obj\
nextprm2.obj\
nextprm1.obj\
nextprm0.obj\
nequal.obj\
negate.obj\
mset5.obj\
mset4.obj\
mset3.obj\
mset1.obj\
modulus.obj\
mmap2.obj\
mmap1.obj\
mkheap1.obj\
mkheap0.obj\
mismtch2.obj\
mismtch1.obj\
mismtch0.obj\
minus.obj\
minelem2.obj\
ostmit.obj\
iterswp1.obj\
min1.obj\
memfunptr.obj \
merge2.obj\
merge1.obj\
merge0.obj\
maxelem2.obj\
maxelem1.obj\
max2.obj\
max1.obj\
map1.obj\
lwrbnd2.obj\
lwrbnd1.obj\
logicor.obj\
logicnot.obj\
logicand.obj\
list4.obj\
list3.obj\
list2.obj\
list1.obj\
lexcmp2.obj\
lexcmp1.obj\
lesseq.obj\
less.obj\
min2.obj\
greater.obj\
iter4.obj\
iter3.obj\
iter2.obj\
iter1.obj\
istmit1.obj\
iota1.obj\
insert2.obj\
insert1.obj\
inrprod2.obj\
inrprod1.obj\
inrprod0.obj\
inplmrg2.obj\
inplmrg1.obj\
incl2.obj\
incl1.obj\
incl0.obj\
iterswp0.obj\
eqlrnge2.obj\
genern2.obj\
genern1.obj\
gener2.obj\
gener1.obj\
func3.obj\
func2.obj\
func1.obj\
foreach1.obj\
foreach0.obj\
finsert2.obj\
finsert1.obj\
findif1.obj\
findif0.obj\
find1.obj\
find0.obj\
filln1.obj\
fill1.obj\
equalto.obj\
equal2.obj\
equal1.obj\
equal0.obj\
greateq.obj\
binsrch1.obj\
eqlrnge0.obj\
divides.obj\
deque1.obj\
countif1.obj\
count1.obj\
count0.obj\
copyb0.obj\
copyb.obj\
copy4.obj\
copy3.obj\
copy2.obj\
copy1.obj\
bvec1.obj\
bnegate2.obj\
bnegate1.obj\
binsrch2.obj\
eqlrnge1.obj\
accum1.obj\
binsert1.obj\
bind2nd2.obj\
bind2nd1.obj\
bind1st1.obj\
bind1st2.obj\
bcompos2.obj\
bcompos1.obj\
alg5.obj\
alg4.obj\
alg3.obj\
alg2.obj\
alg1.obj\
advance.obj\
adjfind2.obj\
adjfind1.obj\
adjfind0.obj\
adjdiff2.obj\
adjdiff1.obj\
adjdiff0.obj\
accum2.obj\
binsert2.obj\
hmap1.obj hmmap1.obj hset2.obj hmset1.obj \
slist1.cpp string1.cpp bitset1.cpp
# ---------------------------------------------------------------------------
PATHCPP = .;
PATHPAS = .;
PATHASM = .;
PATHRC = .;
USERDEFINES = _DEBUG
SYSDEFINES = NO_STRICT;USEPACKAGES
# ---------------------------------------------------------------------------
# CFLAG1 = -w- -jb -j1 -I.;..\..\stlport;$(BCB)\include; -Od -v -N -x -xp -tWCR -D$(SYSDEFINES);$(USERDEFINES) -L..\..\lib
# CFLAG1 = -w- -jb -j1 -I.;..\..\stlport;$(BCB)\include; -tWCR -w-par -w-inl -w-stl -D$(SYSDEFINES);$(USERDEFINES)
CFLAG1 = -w- -jb -j1 -I.;..\..\stlport;$(BCB)\include; -Od -v -N -x -xp -tWC -D$(SYSDEFINES);$(USERDEFINES) -L..\..\lib
LDFLAGS = -L..\..\lib;$(BCB)\..\lib stlpst.lib
.autodepend
# ---------------------------------------------------------------------------
all : $(PROJECT)
$(PROJECT) : $(OBJFILES)
$(BCB)\BIN\$(BCC32) -e$(PROJECT) $(CFLAG1) $(LDFLAGS) $(OBJFILES)
clean:
del *.obj *.exe *.core *.tds
# ---------------------------------------------------------------------------
.cpp.obj:
$(BCC32) $(CFLAG1) -n$(@D) -c $<
.cpp.exe:
$(BCC32) $(CFLAG1) -DMAIN -n$(@D) $<
.cpp.i:
$(CPP32) $(CFLAG1) -n. -Sr -Ss -Sd {$< }
# ---------------------------------------------------------------------------

View File

@@ -0,0 +1,31 @@
// STLport regression testsuite component.
// To compile as a separate example, please #define MAIN.
#include <algorithm>
#include <iostream>
#include "unary.h"
#ifdef MAIN
#define bcompos1_test main
#endif
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
using namespace std;
#endif
int bcompos1_test(int, char**)
{
cout<<"Results of bcompos1_test:"<<endl;
int array [6] = { -2, -1, 0, 1, 2, 3 };
binary_compose<logical_and<bool>, odd, positive>
b = binary_compose<logical_and<bool>, odd, positive>
(logical_and<bool>(), odd(), positive());
int* p = find_if((int*)array, (int*)array + 6, b);
if(p != array + 6)
cout << *p << " is odd and positive" << endl;
return 0;
}

View File

@@ -0,0 +1,28 @@
// STLport regression testsuite component.
// To compile as a separate example, please #define MAIN.
#include <algorithm>
#include <iostream>
#include "unary.h"
#ifdef MAIN
#define bcompos2_test main
#endif
#if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
using namespace std;
#endif
int bcompos2_test(int, char**)
{
cout<<"Results of bcompos2_test:"<<endl;
int array [6] = { -2, -1 , 0, 1, 2, 3 };
int* p = find_if((int*)array, (int*)array + 6,
compose2(logical_and<bool>(), odd(), positive()));
if(p != array + 6)
cout << *p << " is odd and positive" << endl;
return 0;
}

Some files were not shown because too many files have changed in this diff Show More