| 147 | |
| 148 | template<typename T> |
| 149 | void 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 | |
| 173 | TYPED_TEST(Diff1, InvalidArgs) { |
| 174 | diff1ArgsTest<TypeParam>(string(TEST_DIR "/diff1/basic0.test")); |
nothing calls this directly
no test coverage detected