General Purpose library for Freestanding C++ and POSIX systems
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

45 satır
1.2 KiB

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