#include "nscore.h"
#include <iostream.h>
#include <string>
#include <iomanip>
#include "nsInt64.h"
#ifdef XP_MAC
#include <Timer.h>
#include "Profiler.h"
#else
#include "prtime.h"
#endif
#ifndef TEST_STD_STRING
#include "nsString.h"
#else
#include "nsStdStringWrapper.h"
#endif
static const int kTestSucceeded = 0;
static const size_t N = 100000;
template <class T>
inline
TotalLength( const T& s )
{
return s.Length();
}
inline
{
return s.length();
}
template <class T>
inline
{
}
inline
{
}
inline
GetTime()
{
#ifdef XP_MAC
Microseconds(&time);
#else
#endif
}
class TestTimer
{
public:
~TestTimer()
{
#ifdef HAVE_LONG_LONG
#else
#endif
}
private:
};
inline
int
{
return 1;
}
static
int
{
{
int total = 0;
for ( int i=0; i<N; ++i )
{
}
}
{
int total = 0;
for ( int i=0; i<N; ++i )
{
}
}
{
int total = 0;
for ( int i=0; i<N; ++i )
{
total += foo( nsCString("This is a reasonable length string with some text in it and it is good.") );
}
}
return kTestSucceeded;
}
static
int
{
//---------|---------|---------|---------|---------|---------|---------|
{
return kTestFailed;
}
{
for ( int i=0; i<N; ++i )
{
}
}
{
for ( int i=0; i<N; ++i )
}
{
for ( int i=0; i<N; ++i )
}
return kTestSucceeded;
}
static
int
{
//---------|---------|---------|---------|---------|---------|---------|
{
return kTestFailed;
}
{
for ( int i=0; i<N; ++i )
}
{
for ( int i=0; i<N; ++i )
}
return kTestSucceeded;
}
static
int
{
nsCString s1("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxThis is a reasonable length string with some text in it and it is good.");
nsCString s2("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxThis is a reasonable length string with some text in it and it is bad.");
int count = 0;
{
for ( int i=0; i<N; ++i )
++count;
}
{
for ( int i=0; i<N; ++i )
++count;
}
return kTestSucceeded;
}
static
int
{
{
return kTestFailed;
}
{
for ( int i=0; i<N; ++i )
}
return kTestSucceeded;
}
static
int
{
{
for ( int i=0; i<N; ++i )
{
}
}
return kTestSucceeded;
}
static
int
{
{
for ( int i=0; i<N; ++i )
{
for ( int j=0; j<100; ++j )
{
}
}
}
return kTestSucceeded;
}
static
int
{
{
for ( int i=0; i<N; ++i )
{
}
}
{
for ( int i=0; i<N; ++i )
{
}
}
return kTestSucceeded;
}
static
int
{
{
for ( int i=0; i<N; ++i )
{
for ( int j=0; j<1000; ++j )
{
}
}
}
return kTestSucceeded;
}
static
int
{
{
for ( int i=0; i<N; ++i )
{
}
}
return kTestSucceeded;
}
#ifndef TEST_STD_STRING
static
int
{
{
for ( int i=0; i<N; ++i )
}
return kTestSucceeded;
}
#endif
class Profiler
{
public:
Profiler()
{
#if 0
#endif
}
void
{
}
void
{
#if 0
#endif
}
~Profiler()
{
#if 0
ProfilerTerm();
#endif
}
};
int
main()
{
#ifdef TEST_STD_STRING
#else
#endif
int tests_failed = 0;
tests_failed += test_concat();
tests_failed += test_compare();
tests_failed += test_countchar();
tests_failed += test_append_char();
#ifndef TEST_STD_STRING
tests_failed += test_find_string();
#endif
#ifdef TEST_STD_STRING
#else
#endif
if ( tests_failed )
return 0;
}