| 362 | |
| 363 | template<typename T> |
| 364 | void saveLoadImageNativeCPPTest(dim4 dims) { |
| 365 | IMAGEIO_ENABLED_CHECK(); |
| 366 | |
| 367 | array input = randu(dims, (af_dtype)dtype_traits<T>::af_type); |
| 368 | |
| 369 | std::string imagename = getTestName() + "_" + getBackendName(true) + ".png"; |
| 370 | |
| 371 | saveImageNative(imagename.c_str(), input); |
| 372 | |
| 373 | array loaded = loadImageNative(imagename.c_str()); |
| 374 | ASSERT_EQ(loaded.type(), input.type()); |
| 375 | |
| 376 | ASSERT_FALSE(anyTrue<bool>(input - loaded)); |
| 377 | } |
| 378 | |
| 379 | TEST(ImageIONative, SaveLoadImageNative8CPP) { |
| 380 | saveLoadImageNativeCPPTest<uchar>(dim4(480, 720, 3, 1)); |
nothing calls this directly
no test coverage detected