Apply formating to all files. CLeanup
This commit is contained in:
parent
43e374f269
commit
744c01c5d0
928 changed files with 14515 additions and 21480 deletions
|
|
@ -1,8 +1,8 @@
|
|||
#include "NewPlacement.hpp"
|
||||
|
||||
#include "Tests.hpp"
|
||||
#include "Testing.hpp"
|
||||
#include "Buffer2D.hpp"
|
||||
#include "Testing.hpp"
|
||||
#include "Tests.hpp"
|
||||
|
||||
using namespace tp;
|
||||
|
||||
|
|
@ -11,8 +11,8 @@ const ualni size = 1000;
|
|||
TEST_DEF_STATIC(Simple1) {
|
||||
Buffer2D<int, HeapAlloc> buff;
|
||||
buff.reserve({ 4, 4 });
|
||||
buff.set( { 2, 2 }, 5);
|
||||
TEST(buff.get( { 2, 2 } ) == 5);
|
||||
buff.set({ 2, 2 }, 5);
|
||||
TEST(buff.get({ 2, 2 }) == 5);
|
||||
}
|
||||
|
||||
TEST_DEF_STATIC(Simple2) {
|
||||
|
|
@ -20,6 +20,6 @@ TEST_DEF_STATIC(Simple2) {
|
|||
}
|
||||
|
||||
TEST_DEF(Buffer2d) {
|
||||
testSimple1();
|
||||
testSimple2();
|
||||
testSimple1();
|
||||
testSimple2();
|
||||
}
|
||||
|
|
@ -1,34 +1,37 @@
|
|||
#include "NewPlacement.hpp"
|
||||
|
||||
#include "Tests.hpp"
|
||||
#include "Buffer.hpp"
|
||||
#include "Testing.hpp"
|
||||
#include "Tests.hpp"
|
||||
|
||||
using namespace tp;
|
||||
|
||||
const ualni size = 1000;
|
||||
|
||||
TEST_DEF_STATIC(Simple1) {
|
||||
Buffer<TestClass, HeapAlloc> buff;
|
||||
TEST(buff.size() == 0);
|
||||
for (auto i : Range(size * 10)) {
|
||||
buff.append(TestClass(i));
|
||||
}
|
||||
TEST(buff.size() == size * 10);
|
||||
while (buff.size()) buff.pop();
|
||||
TEST(buff.size() == 0);
|
||||
Buffer<TestClass, HeapAlloc> buff;
|
||||
TEST(buff.size() == 0);
|
||||
for (auto i : Range(size * 10)) {
|
||||
buff.append(TestClass(i));
|
||||
}
|
||||
TEST(buff.size() == size * 10);
|
||||
while (buff.size())
|
||||
buff.pop();
|
||||
TEST(buff.size() == 0);
|
||||
}
|
||||
|
||||
TEST_DEF_STATIC(Simple2) {
|
||||
Buffer<TestClass, HeapAlloc> buff(size);
|
||||
TEST(buff.size() == 0);
|
||||
for (auto i : Range(size * 10)) buff.append(TestClass(i));
|
||||
TEST(buff.size() == size * 10);
|
||||
while (buff.size()) buff.pop();
|
||||
TEST(buff.size() == 0);
|
||||
Buffer<TestClass, HeapAlloc> buff(size);
|
||||
TEST(buff.size() == 0);
|
||||
for (auto i : Range(size * 10))
|
||||
buff.append(TestClass(i));
|
||||
TEST(buff.size() == size * 10);
|
||||
while (buff.size())
|
||||
buff.pop();
|
||||
TEST(buff.size() == 0);
|
||||
}
|
||||
|
||||
TEST_DEF(Buffer) {
|
||||
testSimple1();
|
||||
testSimple2();
|
||||
testSimple1();
|
||||
testSimple2();
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
#include "NewPlacement.hpp"
|
||||
|
||||
#include "Tests.hpp"
|
||||
#include "Testing.hpp"
|
||||
#include "Archiver.hpp"
|
||||
#include "Testing.hpp"
|
||||
#include "Tests.hpp"
|
||||
|
||||
using namespace tp;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#include "NewPlacement.hpp"
|
||||
|
||||
#include "Tests.hpp"
|
||||
#include "Testing.hpp"
|
||||
#include "Map.hpp"
|
||||
#include "Archiver.hpp"
|
||||
#include "Map.hpp"
|
||||
#include "Testing.hpp"
|
||||
#include "Tests.hpp"
|
||||
|
||||
using namespace tp;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,26 +1,26 @@
|
|||
|
||||
#include "Tests.hpp"
|
||||
#include "Testing.hpp"
|
||||
|
||||
static bool init(const tp::ModuleManifest* self) {
|
||||
tp::gTesting.setRootName(self->getName());
|
||||
return true;
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
tp::ModuleManifest* deps[] = { &tp::gModuleUtils, &tp::gModuleAllocators, nullptr };
|
||||
tp::ModuleManifest testModule("ContainersTest", init, nullptr, deps);
|
||||
|
||||
if (!testModule.initialize()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
testList();
|
||||
testMap();
|
||||
testAvl();
|
||||
testBuffer();
|
||||
testBuffer2d();
|
||||
|
||||
testModule.deinitialize();
|
||||
}
|
||||
|
||||
#include "Tests.hpp"
|
||||
#include "Testing.hpp"
|
||||
|
||||
static bool init(const tp::ModuleManifest* self) {
|
||||
tp::gTesting.setRootName(self->getName());
|
||||
return true;
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
tp::ModuleManifest* deps[] = { &tp::gModuleUtils, &tp::gModuleAllocators, nullptr };
|
||||
tp::ModuleManifest testModule("ContainersTest", init, nullptr, deps);
|
||||
|
||||
if (!testModule.initialize()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
testList();
|
||||
testMap();
|
||||
testAvl();
|
||||
testBuffer();
|
||||
testBuffer2d();
|
||||
|
||||
testModule.deinitialize();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +1,32 @@
|
|||
#pragma once
|
||||
|
||||
#include "Utils.hpp"
|
||||
#include "Allocators.hpp"
|
||||
#include "Utils.hpp"
|
||||
|
||||
class TestClass {
|
||||
tp::ualni val2 = 0;
|
||||
tp::ualni val1;
|
||||
|
||||
public:
|
||||
explicit TestClass(tp::ualni val) :
|
||||
val1(val) {}
|
||||
|
||||
explicit TestClass(tp::ualni val) : val1(val) {}
|
||||
|
||||
template<class Saver>
|
||||
template <class Saver>
|
||||
void write(Saver& file) const {
|
||||
file.write(val1);
|
||||
}
|
||||
|
||||
template<class Loader>
|
||||
template <class Loader>
|
||||
void read(Loader& file) {
|
||||
file.read(val1);
|
||||
}
|
||||
|
||||
[[nodiscard]] bool operator==(const TestClass& in) const {
|
||||
return in.val1 == val1;
|
||||
}
|
||||
[[nodiscard]] bool operator==(const TestClass& in) const { return in.val1 == val1; }
|
||||
|
||||
[[nodiscard]] tp::ualni getVal() const { return val1; }
|
||||
void setVal(tp::ualni val) { val1 = val; }
|
||||
};
|
||||
|
||||
|
||||
void testList();
|
||||
void testMap();
|
||||
void testAvl();
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#include "NewPlacement.hpp"
|
||||
|
||||
#include "Testing.hpp"
|
||||
#include "Tests.hpp"
|
||||
#include "Tree.hpp"
|
||||
#include "Testing.hpp"
|
||||
|
||||
using namespace tp;
|
||||
|
||||
|
|
@ -29,7 +29,8 @@ TEST_DEF_STATIC(Persistance) {
|
|||
const auto size = 1000;
|
||||
|
||||
struct Item {
|
||||
Item() : data(0) {}
|
||||
Item() :
|
||||
data(0) {}
|
||||
bool presents = false;
|
||||
TestClass data;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue