ImageReaderTests.c 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. #include "../Tests.h"
  2. /*static void testReadPNG(Test& test, const char* path, const char* name,
  3. unsigned int channels, unsigned int bitdepth) {
  4. ImageReader::Image image;
  5. Error error =
  6. ImageReader::load(image, String(path).append(name).append(".png"));
  7. if(error.has()) {
  8. test.checkEqual(false, true,
  9. String("read ").append(name).append(" error"));
  10. return;
  11. }
  12. test.checkEqual(32u, image.width, String(name).append(" width"));
  13. test.checkEqual(64u, image.height, String(name).append(" height"));
  14. test.checkEqual(channels, image.channels, String(name).append(" channels"));
  15. test.checkEqual(bitdepth, image.bitdepth, String(name).append(" bitdepth"));
  16. test.checkEqual(true, image.data != nullptr, String(name).append(" data"));
  17. }*/
  18. void coreTestImageReader(const char* path) {
  19. (void)path;
  20. // Test test("ImageReader");
  21. // testReadPNG(test, path, "rgb8", 3, 8);
  22. // testReadPNG(test, path, "rgb16", 3, 16);
  23. // testReadPNG(test, path, "rgba8", 4, 8);
  24. // testReadPNG(test, path, "rgba16", 4, 16);
  25. // testReadPNG(test, path, "gray8", 1, 8);
  26. // testReadPNG(test, path, "gray16", 1, 16);
  27. // testReadPNG(test, path, "graya8", 2, 8);
  28. // testReadPNG(test, path, "graya16", 2, 16);
  29. // test.finalize();
  30. }