MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / saveLoadImageNativeCPPTest

Function saveLoadImageNativeCPPTest

test/imageio.cpp:364–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362
363template<typename T>
364void 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
379TEST(ImageIONative, SaveLoadImageNative8CPP) {
380 saveLoadImageNativeCPPTest<uchar>(dim4(480, 720, 3, 1));

Callers

nothing calls this directly

Calls 6

randuFunction · 0.85
getTestNameFunction · 0.85
getBackendNameFunction · 0.85
saveImageNativeFunction · 0.85
loadImageNativeFunction · 0.85
typeMethod · 0.80

Tested by

no test coverage detected