| 160 | |
| 161 | template<typename T> |
| 162 | void 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 | |
| 187 | TYPED_TEST(Moddims, Mismatch) { |
| 188 | moddimsMismatchTest<TypeParam>(string(TEST_DIR "/moddims/basic.test")); |
nothing calls this directly
no test coverage detected