buffer_array_test.hxx 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef BUFFER_ARRAY_TEST_H
  2. #define BUFFER_ARRAY_TEST_H
  3. #include "tester.hxx"
  4. #include "libbinom/include/variables/buffer_array.hxx"
  5. #include "print_variable.hxx"
  6. void testBufferArray() {
  7. RAIIPerfomanceTest test_perf("Bits test: ");
  8. SEPARATOR;
  9. TEST_ANNOUNCE(Test BufferArray);
  10. GRP_PUSH;
  11. using namespace binom;
  12. using namespace binom::literals;
  13. using namespace binom::utils;
  14. LOG("(bug in [r]): BufferArray ui8_array = ui8arr{0,1,255};");
  15. BufferArray ui8_array = ui8arr{0,1,255};
  16. PRINT_RUN(printVariable(ui8_array));
  17. LOG("(bug in [r]): BufferArray i8_array = i8arr{0,1,255};");
  18. BufferArray i8_array = i8arr{0,1,127,-128,-1};
  19. PRINT_RUN(printVariable(i8_array));
  20. LOG("(bug in [r]): BufferArray ui16_array = ui16arr{0,1,65535};");
  21. BufferArray ui16_array = ui16arr{0,1,65535};
  22. PRINT_RUN(printVariable(ui16_array));
  23. LOG("(bug in [r]): BufferArray i16_array = i16arr{0,1,32767,-32768,-1};");
  24. BufferArray i16_array = i16arr{0,1,32767,-32768,-1};
  25. PRINT_RUN(printVariable(i16_array));
  26. LOG("(bug in [r]): BufferArray ui32_array = ui32arr{0,1,4294967295};");
  27. BufferArray ui32_array = ui32arr{0,1,4294967295};
  28. PRINT_RUN(printVariable(ui32_array));
  29. LOG("(bug in [r]): BufferArray i32_array = i32arr{0,1,2147483647,-2147483648,-1};");
  30. BufferArray i32_array = i32arr{0,1,2147483647,-2147483648,-1};
  31. PRINT_RUN(printVariable(i32_array));
  32. LOG("(bug in [r]): BufferArray f32_array = f32arr{0,3.4E-38,-3.4E-38};");
  33. BufferArray f32_array = f32arr{0,3.4E-38,-3.4E-38};
  34. PRINT_RUN(printVariable(f32_array));
  35. LOG("(bug in [r]): BufferArray ui64_array = ui64arr{0,1,18446744073709551615ull};");
  36. BufferArray ui64_array = ui64arr{0,1,18446744073709551615ull};
  37. PRINT_RUN(printVariable(ui64_array));
  38. LOG("(bug in [r]): BufferArray i64_array = i64arr{0,1,9223372036854775807,-9223372036854775808_i64,-1};");
  39. BufferArray i64_array = i64arr{0,1,9223372036854775807,9223372036854775808_ni64,-1};
  40. PRINT_RUN(printVariable(i64_array));
  41. LOG("(bug in [r]): BufferArray f64_array = f64arr{0,1.7E-308,-1.7E-308};");
  42. BufferArray f64_array = f64arr{0,1.7E-308,-1.7E-308};
  43. PRINT_RUN(printVariable(f64_array));
  44. GRP_POP;
  45. }
  46. #endif // BUFFER_ARRAY_TEST_H