+#include "wx/wxprec.h"
+
#include "wx/longlong.h"
#include <time.h>
#include <Events.h>
#endif
-static const unsigned long long NumberOfTests = 100000ll;
+static const unsigned wxLongLong_t NumberOfTests = 100000l;
//using namespace std;
int oddbits(unsigned int number);
int shifttest()
{
- std::cout << std::endl << "Starting shift tests." << endl;
+ cout << endl << "Starting shift tests." << endl;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
- std::cerr << "+";
+ cerr << "+";
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if ((memcmp(oneb, twob, 8) != 0) || (memcmp(onec, twoc, 8) != 0) || (memcmp(oneb, onec, 8) != 0))
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
+ cout << endl << "After " << wxLongLongNative(counter) << " successful trials: " << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
if (leftshift)
- std::cout << "<< ";
+ cout << "<< ";
else
- std::cout << ">> ";
- std::cout << shift << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
- std::cout << l1c << std::endl;
- std::cout << l2c << std::endl;
+ cout << ">> ";
+ cout << shift << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
+ cout << l1c << endl;
+ cout << l2c << endl;
return 0;
}
counter++;
}
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << wxLongLongNative(counter) << " successful trial" << (counter == 1 ? "." : "s.") << endl;
return 1;
}
int add1test()
{
- std::cout << std::endl << "Starting first addition tests." << endl;
+ cout << endl << "Starting first addition tests." << endl;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
- std::cerr << "+";
+ cerr << "+";
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if ((memcmp(onec, twoc, 8) != 0) || (memcmp(oned, twod, 8) != 0) || (memcmp(onec, oned, 8) != 0))
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
- std::cout << l1c << std::endl;
- std::cout << l2c << std::endl;
+ cout << endl << "After " << wxLongLongNative(counter) << " successful trials: " << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
+ cout << l1c << endl;
+ cout << l2c << endl;
return 0;
}
counter++;
}
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << wxLongLongNative(counter) << " successful trial" << (counter == 1 ? "." : "s.") << endl;
return 1;
}
int add2test()
{
- std::cout << std::endl << "Starting second addition tests." << endl;
+ cout << endl << "Starting second addition tests." << endl;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
- std::cerr << "+";
+ cerr << "+";
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if (memcmp(one, two, 8) != 0)
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1c << std::endl;
- std::cout << l2c << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
+ cout << endl << "After " << counter << " successful trials: " << endl;
+ cout << l1c << endl;
+ cout << l2c << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
return 0;
}
counter++;
}
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << endl;
return 1;
}
int sub1test()
{
- std::cout << std::endl << "Starting first subtraction tests." << endl;
+ cout << endl << "Starting first subtraction tests." << endl;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
- std::cerr << "+";
+ cerr << "+";
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if ((memcmp(onec, twoc, 8) != 0) || (memcmp(oned, twod, 8) != 0) || (memcmp(onec, oned, 8) != 0))
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
- std::cout << l1c << std::endl;
- std::cout << l2c << std::endl;
- std::cout << l1d << std::endl;
- std::cout << l2d << std::endl;
+ cout << endl << "After " << wxLongLongNative(counter) << " successful trials: " << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
+ cout << l1c << endl;
+ cout << l2c << endl;
+ cout << l1d << endl;
+ cout << l2d << endl;
return 0;
}
counter++;
}
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << wxLongLongNative(counter) << " successful trial" << (counter == 1 ? "." : "s.") << endl;
return 1;
}
int sub2test()
{
- std::cout << std::endl << "Starting second subtraction tests." << endl;
+ cout << endl << "Starting second subtraction tests." << endl;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
- std::cerr << "+";
+ cerr << "+";
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if (memcmp(one, two, 8) != 0)
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1c << std::endl;
- std::cout << l2c << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
+ cout << endl << "After " << counter << " successful trials: " << endl;
+ cout << l1c << endl;
+ cout << l2c << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
return 0;
}
counter++;
}
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << endl;
return 1;
}
int incdectest()
{
- std::cout << std::endl << "Starting pre/post increment/decrement tests." << endl;
+ cout << endl << "Starting pre/post increment/decrement tests." << endl;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
- std::cerr << "+";
+ cerr << "+";
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if (memcmp(one, two, 8) != 0)
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
- std::cout << (pre ? "pre" : "post") << (increment ? "increment" : "decrement") << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
+ cout << endl << "After " << wxLongLongNative(counter) << " successful trials: " << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
+ cout << (pre ? "pre" : "post") << (increment ? "increment" : "decrement") << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
return 0;
}
counter++;
}
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << wxLongLongNative(counter) << " successful trial" << (counter == 1 ? "." : "s.") << endl;
return 1;
}
int negationtest()
{
- std::cout << std::endl << "Starting negation tests." << endl;
+ cout << endl << "Starting negation tests." << endl;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
- std::cerr << "+";
+ cerr << "+";
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if (memcmp(one, two, 8) != 0)
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
+ cout << endl << "After " << wxLongLongNative(counter) << " successful trials: " << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
return 0;
}
counter++;
}
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << wxLongLongNative(counter) << " successful trial" << (counter == 1 ? "." : "s.") << endl;
return 1;
}
int multiplicationtest()
{
- std::cout << std::endl << "Starting multiplication tests." << endl;
+ cout << endl << "Starting multiplication tests." << endl;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
- std::cerr << "+";
+ cerr << "+";
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if ((memcmp(onec, twoc, 8) != 0) || (memcmp(oned, twod, 8) != 0) || (memcmp(onec, oned, 8) != 0))
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
- std::cout << l1c << std::endl;
- std::cout << l2c << std::endl;
- std::cout << l1d << std::endl;
- std::cout << l2d << std::endl;
+ cout << endl << "After " << wxLongLongNative(counter) << " successful trials: " << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
+ cout << l1c << endl;
+ cout << l2c << endl;
+ cout << l1d << endl;
+ cout << l2d << endl;
return 0;
}
counter++;
}
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << wxLongLongNative(counter) << " successful trial" << (counter == 1 ? "." : "s.") << endl;
return 1;
}
int bitwisetest()
{
- std::cout << std::endl << "Starting bitwise tests." << endl;
+ cout << endl << "Starting bitwise tests." << endl;
long hi = 0;
unsigned long lo = 0;
{
if ((counter % 1000) == 999)
{
- std::cerr << "+";
+ cerr << "+";
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
#endif
if ((memcmp(onec, twoc, 8) != 0) || (memcmp(oned, twod, 8) != 0) || (memcmp(onec, oned, 8) != 0))
{
- std::cout << std::endl << "After " << counter << " successful trials: " << std::endl;
- std::cout << l1a << std::endl;
- std::cout << l2a << std::endl;
- std::cout << l1b << std::endl;
- std::cout << l2b << std::endl;
- std::cout << l1c << std::endl;
- std::cout << l2c << std::endl;
- std::cout << l1d << std::endl;
- std::cout << l2d << std::endl;
+ cout << endl << "After " << wxLongLongNative(counter) << " successful trials: " << endl;
+ cout << l1a << endl;
+ cout << l2a << endl;
+ cout << l1b << endl;
+ cout << l2b << endl;
+ cout << l1c << endl;
+ cout << l2c << endl;
+ cout << l1d << endl;
+ cout << l2d << endl;
return 0;
}
counter++;
}
- std::cout << std::endl << counter << " successful trial" << (counter == 1 ? "." : "s.") << std::endl;
+ cout << endl << wxLongLongNative(counter) << " successful trial" << (counter == 1 ? "." : "s.") << endl;
return 1;
}
SIOUXSettings.autocloseonquit = 0;
#endif
- std::cout << "Starting tests." << endl;
+ cout << "Starting tests." << endl;
#if defined(__MWERKS__) && macintosh
GetNextEvent(0, NULL);
if (!negationtest())
return 1;
- std::cout << std::endl << "The tests are finished." << std::endl;
+ cout << endl << "The tests are finished." << endl;
return 0;
}