add logger and some tests

This commit is contained in:
chatlanin
2025-01-03 11:53:18 +03:00
parent 67eab0a97f
commit 4fc81c4c04
8 changed files with 83 additions and 55 deletions

View File

@@ -1,7 +1,7 @@
#include <iostream>
#include <vector>
#include <forward_list>
#include <iostream>
#include "hack/logger/logger.hpp"
#include "hack/mt/algorithms/sort.hpp"
#include "hack/mt/algorithms/max.hpp"
@@ -14,7 +14,7 @@ auto main(int argc, char *argv[]) -> int
{
hack::patterns::ring_buffer<int, 10> rb;
for (int i = 1; i < 12; ++i) rb.put(i);
while(!rb.empty()) std::cout << rb.get().value() << std::endl;
hack::log()(rb);
}
// mt::sort
@@ -25,20 +25,15 @@ auto main(int argc, char *argv[]) -> int
hack::mt::algorithms::sort(v);
hack::mt::algorithms::sort(l);
for (auto d : v)
std::cout << d << " ";
std::cout << std::endl;
for (auto d : l)
std::cout << d << " ";
std::cout << std::endl;
hack::log()(v);
hack::log()(l);
}
// mt::max
{
int a = 4, b = 5;
int& c = a;
std::cout << hack::mt::algorithms::max(4, 5) << std::endl;
std::cout << hack::mt::algorithms::max(c, b) << std::endl;
hack::log()(hack::mt::algorithms::max(4, 5));
hack::log()(hack::mt::algorithms::max(c, b));
}
}