| 229 | /////////////////////////////////////////////////////////////////////////////// |
| 230 | template<typename T> |
| 231 | void approx1ArgsTest(string pTestFile, const af_interp_type method, |
| 232 | const af_err err) { |
| 233 | SUPPORTED_TYPE_CHECK(T); |
| 234 | typedef typename dtype_traits<T>::base_type BT; |
| 235 | vector<dim4> numDims; |
| 236 | vector<vector<BT>> in; |
| 237 | vector<vector<T>> tests; |
| 238 | readTests<BT, T, float>(pTestFile, numDims, in, tests); |
| 239 | |
| 240 | dim4 idims = numDims[0]; |
| 241 | dim4 pdims = numDims[1]; |
| 242 | |
| 243 | af_array inArray = 0; |
| 244 | af_array posArray = 0; |
| 245 | af_array outArray = 0; |
| 246 | |
| 247 | vector<T> input(in[0].begin(), in[0].end()); |
| 248 | |
| 249 | ASSERT_SUCCESS(af_create_array(&inArray, &(input.front()), idims.ndims(), |
| 250 | idims.get(), |
| 251 | (af_dtype)dtype_traits<T>::af_type)); |
| 252 | |
| 253 | ASSERT_SUCCESS(af_create_array(&posArray, &(in[1].front()), pdims.ndims(), |
| 254 | pdims.get(), |
| 255 | (af_dtype)dtype_traits<BT>::af_type)); |
| 256 | |
| 257 | ASSERT_EQ(err, af_approx1(&outArray, inArray, posArray, method, 0)); |
| 258 | |
| 259 | if (inArray != 0) af_release_array(inArray); |
| 260 | if (posArray != 0) af_release_array(posArray); |
| 261 | if (outArray != 0) af_release_array(outArray); |
| 262 | } |
| 263 | |
| 264 | TYPED_TEST(Approx1, Approx1NearestArgsPos2D) { |
| 265 | approx1ArgsTest<TypeParam>(string(TEST_DIR "/approx/approx1_pos2d.test"), |
nothing calls this directly
no test coverage detected