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.2 KiB

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