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

Function readImageTests

test/arrayfire_test.cpp:924–964  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

922
923template<typename outType>
924void readImageTests(const std::string &pFileName,
925 std::vector<af::dim4> &pInputDims,
926 std::vector<std::string> &pTestInputs,
927 std::vector<std::vector<outType>> &pTestOutputs) {
928 using std::vector;
929
930 std::ifstream testFile(pFileName.c_str());
931 if (testFile.good()) {
932 unsigned inputCount;
933 testFile >> inputCount;
934 for (unsigned i = 0; i < inputCount; i++) {
935 af::dim4 temp(1);
936 testFile >> temp;
937 pInputDims.push_back(temp);
938 }
939
940 unsigned testCount;
941 testFile >> testCount;
942 pTestOutputs.resize(testCount);
943
944 vector<unsigned> testSizes(testCount);
945 for (unsigned i = 0; i < testCount; i++) { testFile >> testSizes[i]; }
946
947 pTestInputs.resize(inputCount, "");
948 for (unsigned k = 0; k < inputCount; k++) {
949 pTestInputs[k] = readNextNonEmptyLine(testFile);
950 }
951
952 pTestOutputs.resize(testCount, vector<outType>(0));
953 for (unsigned i = 0; i < testCount; i++) {
954 pTestOutputs[i].resize(testSizes[i]);
955 outType tmp;
956 for (unsigned j = 0; j < testSizes[i]; j++) {
957 testFile >> tmp;
958 pTestOutputs[i][j] = tmp;
959 }
960 }
961 } else {
962 FAIL() << "TEST FILE NOT FOUND";
963 }
964}
965
966#define INSTANTIATE(To) \
967 template void readImageTests<To>( \

Callers 15

iterDeconvImageTestFunction · 0.85
homographyTestFunction · 0.85
TESTFunction · 0.85
bilateralTestFunction · 0.85
invDeconvImageTestFunction · 0.85
harrisTestFunction · 0.85
TESTFunction · 0.85
TESTFunction · 0.85
cannyImageOtsuTestFunction · 0.85
cannyImageOtsuBatchTestFunction · 0.85
medfiltImageTestFunction · 0.85
meanshiftTestFunction · 0.85

Calls 1

readNextNonEmptyLineFunction · 0.85

Tested by

no test coverage detected