Modules/Containers/tests/Tests.cpp
IlushaShurupov ec2a71ccdb Buffer
2023-07-05 08:02:13 +03:00

42 lines
744 B
C++

#include "Tests.hpp"
#include "Testing.hpp"
#include <cstdlib>
static bool init(const tp::ModuleManifest* self) {
tp::gTesting.setRootName(self->getName());
return true;
}
void* TestAllocator::allocate(tp::ualni size) {
nAllocations++;
return malloc(size);
}
void TestAllocator::deallocate(void* p) {
nAllocations--;
free(p);
}
tp::ualni TestAllocator::getAllocationsCount() const {
return nAllocations;
}
int main() {
tp::ModuleManifest* deps[] = { &tp::gModuleUtils, nullptr };
tp::ModuleManifest testModule("ContainersTest", init, nullptr, deps);
if (!testModule.initialize()) {
return 1;
}
testList();
testMap();
testAvl();
testBuffer();
testModule.deinitialize();
}