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

Function medfiltInputTest

test/medfilt.cpp:216–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214
215template<typename T>
216void medfiltInputTest(void) {
217 SUPPORTED_TYPE_CHECK(T);
218
219 af_array inArray = 0;
220 af_array outArray = 0;
221
222 vector<T> in(100, 1);
223
224 // Check for 1D inputs -> medfilt1
225 dim4 dims = dim4(100, 1, 1, 1);
226
227 ASSERT_SUCCESS(af_create_array(&inArray, &in.front(), dims.ndims(),
228 dims.get(),
229 (af_dtype)dtype_traits<T>::af_type));
230
231 ASSERT_SUCCESS(af_medfilt2(&outArray, inArray, 1, 1, AF_PAD_ZERO));
232
233 bool medfilt1;
234 ASSERT_SUCCESS(af_is_vector(&medfilt1, outArray));
235
236 ASSERT_EQ(true, medfilt1);
237
238 ASSERT_SUCCESS(af_release_array(inArray));
239 ASSERT_SUCCESS(af_release_array(outArray));
240}
241
242TYPED_TEST(MedianFilter, InvalidArray) { medfiltInputTest<TypeParam>(); }
243

Callers

nothing calls this directly

Calls 6

dim4Class · 0.50
af_create_arrayFunction · 0.50
af_medfilt2Function · 0.50
af_release_arrayFunction · 0.50
ndimsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected