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

Function diff1ArgsTest

test/diff1.cpp:149–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected