#include "test/Test.h"
#include "tests/ArrayListTests.h"
#include "tests/ArrayStringTests.h"
#include "tests/ArrayTests.h"
#include "tests/BitArrayTests.h"
#include "tests/BoxTests.h"
#include "tests/BufferTests.h"
#include "tests/BufferedValueTests.h"
#include "tests/ClockTests.h"
#include "tests/ColorTests.h"
#include "tests/ComponentsTests.h"
#include "tests/FrustumTests.h"
#include "tests/HashMapTests.h"
#include "tests/LinkedListTests.h"
#include "tests/ListTests.h"
#include "tests/MathTests.h"
#include "tests/MatrixStackTests.h"
#include "tests/MatrixTests.h"
#include "tests/PlaneTests.h"
#include "tests/ProbingHashMapTests.h"
#include "tests/QuaternionTests.h"
#include "tests/RandomTests.h"
#include "tests/RingBufferTests.h"
#include "tests/StackTests.h"
#include "tests/ThreadTests.h"
#include "tests/UniquePointerTests.h"
#include "tests/UtilityTests.h"
#include "tests/VectorTests.h"
#include "tests/ViewTests.h"
#include "utils/ArrayString.h"
#include "utils/Utility.h"

static void onExit(int code, void* data) {
    unsigned int i = *static_cast<unsigned int*>(data);
    Core::String32<1024> s;
    CORE_TEST_ERROR(s.append("Hello from exit #: #"));
    CORE_TEST_ERROR(s.format(code, i));
    CORE_TEST_ERROR(s.printLine());
    Core::Test::finalize();
}

int main() {
    Core::ArrayListTests::test();
    Core::ArrayStringTests::test();
    Core::ArrayTests::test();
    Core::BitArrayTests::test();
    Core::BoxTests::test();
    Core::BufferTests::test();
    Core::BufferedValueTests::test();
    Core::ClockTests::test();
    Core::ColorTests::test();
    Core::ComponentsTests::test();
    Core::FrustumTests::test();
    Core::HashMapTests::test();
    Core::LinkedListTests::test();
    Core::ListTests::test();
    Core::MathTests::test();
    Core::MatrixStackTests::test();
    Core::MatrixTests::test();
    Core::PlaneTests::test();
    Core::ProbingHashMapTests::test();
    Core::QuaternionTests::test();
    Core::RandomTests::test();
    Core::RingBufferTests::test();
    Core::StackTests::test();
    Core::ThreadTests::test();
    Core::UniquePointerTests::test();
    Core::UtilityTests::test();
    Core::VectorTests::test();
    Core::ViewTests::test();

    unsigned int data = 123456789;
    Core::setExitHandler(onExit, &data);
    CORE_EXIT(1);

    return 0;
}