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

Function diff2ArgsTest

test/diff2.cpp:151–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149
150template<typename T>
151void diff2ArgsTest(string pTestFile) {
152 SUPPORTED_TYPE_CHECK(T);
153
154 vector<dim4> numDims;
155
156 vector<vector<T>> in;
157 vector<vector<T>> tests;
158 readTests<T, T, int>(pTestFile, numDims, in, tests);
159 dim4 dims = numDims[0];
160
161 af_array inArray = 0;
162 af_array outArray = 0;
163
164 ASSERT_SUCCESS(af_create_array(&inArray, &(in[0].front()), dims.ndims(),
165 dims.get(),
166 (af_dtype)dtype_traits<T>::af_type));
167
168 ASSERT_EQ(AF_ERR_ARG, af_diff2(&outArray, inArray, -1));
169 ASSERT_EQ(AF_ERR_ARG, af_diff2(&outArray, inArray, 5));
170
171 if (inArray != 0) af_release_array(inArray);
172 if (outArray != 0) af_release_array(outArray);
173}
174
175TYPED_TEST(Diff2, InvalidArgs) {
176 diff2ArgsTest<TypeParam>(string(TEST_DIR "/diff2/basic0.test"));

Callers

nothing calls this directly

Calls 5

af_diff2Function · 0.85
af_create_arrayFunction · 0.50
af_release_arrayFunction · 0.50
ndimsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected