General Purpose library for Freestanding C++ and POSIX systems
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

44 rindas
1.1 KiB

pirms 5 gadiem
pirms 5 gadiem
pirms 4 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 4 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
  1. #include "gp_config.hpp"
  2. #include "test_scaffold.h"
  3. #include "allocator.hpp"
  4. #include "meta_test.cpp"
  5. #include "gp_test.cpp"
  6. #include "bloomfilter.cpp"
  7. #include "quotient_filter.cpp"
  8. #include "math.cpp"
  9. #include "pair_test.cpp"
  10. #include <iostream>
  11. alignas(2048) gp::array<char, 4096> static_mapper::store;
  12. gp::buddy<> static_mapper::impl = gp::buddy<>{store.begin().data, store.size()};
  13. int main()
  14. {
  15. uint failed = 0;
  16. uint runned = 0;
  17. for(auto& test : tests)
  18. {
  19. ++runned;
  20. int value;
  21. try{
  22. value = test->run();
  23. if(value)
  24. {
  25. std::cout << std::dec << test->name << " failed with "<< value << std::endl;
  26. }
  27. } catch (gp::runtime_error err) {
  28. std::cout << test->name << " failed with an exception: " << err.what() << std::endl;
  29. value = -1;
  30. } catch (gp_config::assert_failure err) {
  31. std::cout << test->name << " failed with an assertion failure: " << err.what() << std::endl;
  32. value = -1;
  33. } catch (...) {
  34. std::cout << test->name << " failed with an exception" << std::endl;
  35. value = -1;
  36. }
  37. failed += (value != 0);
  38. }
  39. std::cout << std::dec << "Runned "<<runned<<" tests with "<<failed<<" failures" << std::endl;
  40. return 0;
  41. }