This commit is contained in:
IlushaShurupov 2023-07-16 18:28:24 +03:00
parent fabceb52d3
commit bc892da992
24 changed files with 116 additions and 110 deletions

View file

@ -1,32 +1,15 @@
#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::gModuleContainers, &tp::gModuleUtils, nullptr };
tp::ModuleManifest* deps[] = { &tp::gModuleUtils, &tp::gModuleAllocators, nullptr };
tp::ModuleManifest testModule("ContainersTest", init, nullptr, deps);
if (!testModule.initialize()) {
@ -36,7 +19,7 @@ int main() {
testList();
testMap();
testAvl();
testBuffer();
testBuffer();
testBuffer2d();
testModule.deinitialize();