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

Function moddimsMismatchTest

test/moddims.cpp:162–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160
161template<typename T>
162void moddimsMismatchTest(string pTestFile) {
163 SUPPORTED_TYPE_CHECK(T);
164
165 vector<dim4> numDims;
166
167 vector<vector<T>> in;
168 vector<vector<T>> tests;
169 readTests<T, T, int>(pTestFile, numDims, in, tests);
170 dim4 dims = numDims[0];
171
172 af_array inArray = 0;
173 af_array outArray = 0;
174 ASSERT_SUCCESS(af_create_array(&inArray, &(in[0].front()), dims.ndims(),
175 dims.get(),
176 (af_dtype)dtype_traits<T>::af_type));
177
178 dim4 newDims(1);
179 newDims[0] = dims[1] - 1;
180 newDims[1] = (dims[0] - 1) * dims[2];
181 ASSERT_EQ(AF_ERR_SIZE,
182 af_moddims(&outArray, inArray, newDims.ndims(), newDims.get()));
183
184 ASSERT_SUCCESS(af_release_array(inArray));
185}
186
187TYPED_TEST(Moddims, Mismatch) {
188 moddimsMismatchTest<TypeParam>(string(TEST_DIR "/moddims/basic.test"));

Callers

nothing calls this directly

Calls 5

af_create_arrayFunction · 0.50
af_moddimsFunction · 0.50
af_release_arrayFunction · 0.50
ndimsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected