You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

uoCSVReaderTest.cpp 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  1. /*********************************************************************
  2. * Software License Agreement (AGPL-3 License)
  3. *
  4. * OpenViBE SDK Test Software
  5. * Based on OpenViBE V1.1.0, Copyright (C) Inria, 2006-2015
  6. * Copyright (C) Inria, 2015-2017,V1.0
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Affero General Public License version 3,
  10. * as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License
  18. * along with this program.
  19. * If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. #include <tuple>
  22. #include <numeric>
  23. #include "gtest/gtest.h"
  24. #include "csv/ovICSV.h"
  25. struct SSignalFile
  26. {
  27. std::vector<std::string> m_ChannelNames;
  28. size_t m_Sampling;
  29. size_t m_nSamplePerBuffer;
  30. std::vector<std::pair<std::pair<double, double>, std::vector<double>>> m_data;
  31. };
  32. namespace {
  33. std::string dataDirectory = "";
  34. const struct SSignalFile SIMPLE_SIGNAL_FILE = {
  35. { "Time Signal" },
  36. 32,
  37. 8,
  38. {
  39. {
  40. { 0.00000, 0.25000 },
  41. { 0.00000, 0.03125, 0.06250, 0.09375, 0.125, 0.15625, 0.1875, 0.21875 }
  42. },
  43. {
  44. { 0.250000, 0.500000 },
  45. { 0.250000, 0.281250, 0.312500, 0.343750, 0.375000, 0.406250, 0.437500, 0.468750 }
  46. },
  47. {
  48. { 0.500000, 0.750000 },
  49. { 0.500000, 0.531250, 0.562500, 0.593750, 0.625000, 0.656250, 0.687500, 0.718750 }
  50. },
  51. }
  52. };
  53. void compareChunks(const std::pair<std::pair<double, double>, std::vector<double>>& expected, const OpenViBE::CSV::SMatrixChunk& actual)
  54. {
  55. ASSERT_EQ(expected.first.first, actual.startTime);
  56. ASSERT_EQ(expected.first.second, actual.endTime);
  57. ASSERT_EQ(expected.second.size(), actual.matrix.size());
  58. for (size_t sample = 0; sample < expected.second.size(); ++sample) { ASSERT_EQ(expected.second[sample], actual.matrix[sample]); }
  59. }
  60. } // namespace
  61. TEST(CSV_Reader_Test_Case, signalReaderUNIXEndlines)
  62. {
  63. OpenViBE::CSV::ICSVHandler* csv = OpenViBE::CSV::createCSVHandler();
  64. const std::string filepath = dataDirectory + "/testCSVSignalUNIXEndlines.csv";
  65. ASSERT_TRUE(csv->openFile(filepath, OpenViBE::CSV::EFileAccessMode::Read));
  66. csv->setFormatType(OpenViBE::CSV::EStreamType::Signal);
  67. std::vector<std::string> channelNames;
  68. size_t sampling;
  69. size_t nSamplePerBuffer;
  70. std::vector<OpenViBE::CSV::SMatrixChunk> chunks;
  71. std::vector<OpenViBE::CSV::SStimulationChunk> stimulations;
  72. ASSERT_TRUE(csv->getSignalInformation(channelNames, sampling, nSamplePerBuffer));
  73. ASSERT_TRUE(csv->readSamplesAndEventsFromFile(1, chunks, stimulations));
  74. ASSERT_EQ(1, chunks.size());
  75. compareChunks(SIMPLE_SIGNAL_FILE.m_data[0], chunks[0]);
  76. ASSERT_TRUE(csv->readSamplesAndEventsFromFile(2, chunks, stimulations));
  77. ASSERT_EQ(2, chunks.size());
  78. compareChunks(SIMPLE_SIGNAL_FILE.m_data[1], chunks[0]);
  79. compareChunks(SIMPLE_SIGNAL_FILE.m_data[2], chunks[1]);
  80. ASSERT_TRUE(csv->closeFile());
  81. releaseCSVHandler(csv);
  82. }
  83. TEST(CSV_Reader_Test_Case, signalReaderWindowsEndlines)
  84. {
  85. OpenViBE::CSV::ICSVHandler* csv = OpenViBE::CSV::createCSVHandler();
  86. const std::string filepath = dataDirectory + "/testCSVSignalWindowsEndlines.csv";
  87. ASSERT_TRUE(csv->openFile(filepath, OpenViBE::CSV::EFileAccessMode::Read));
  88. csv->setFormatType(OpenViBE::CSV::EStreamType::Signal);
  89. std::vector<std::string> channelNames;
  90. size_t sampling;
  91. size_t nSamplePerBuffer;
  92. std::vector<OpenViBE::CSV::SMatrixChunk> chunks;
  93. std::vector<OpenViBE::CSV::SStimulationChunk> stimulations;
  94. ASSERT_TRUE(csv->getSignalInformation(channelNames, sampling, nSamplePerBuffer));
  95. ASSERT_TRUE(csv->readSamplesAndEventsFromFile(1, chunks, stimulations));
  96. ASSERT_EQ(1, chunks.size());
  97. compareChunks(SIMPLE_SIGNAL_FILE.m_data[0], chunks[0]);
  98. ASSERT_TRUE(csv->readSamplesAndEventsFromFile(2, chunks, stimulations));
  99. ASSERT_EQ(2, chunks.size());
  100. compareChunks(SIMPLE_SIGNAL_FILE.m_data[1], chunks[0]);
  101. compareChunks(SIMPLE_SIGNAL_FILE.m_data[2], chunks[1]);
  102. ASSERT_TRUE(csv->closeFile());
  103. releaseCSVHandler(csv);
  104. }
  105. TEST(CSV_Reader_Test_Case, signalReaderNormalGoodSignal)
  106. {
  107. OpenViBE::CSV::ICSVHandler* signalReaderTest = OpenViBE::CSV::createCSVHandler();
  108. const std::string filepath = dataDirectory + "testCSVSignalReader01.csv";
  109. ASSERT_TRUE(signalReaderTest->openFile(filepath, OpenViBE::CSV::EFileAccessMode::Read));
  110. signalReaderTest->setFormatType(OpenViBE::CSV::EStreamType::Signal);
  111. std::vector<OpenViBE::CSV::SMatrixChunk> chunks;
  112. std::vector<OpenViBE::CSV::SStimulationChunk> stimulations;
  113. std::vector<std::string> channelNames;
  114. const std::vector<std::string> expectedChannels = { "O1", "O2", "Pz", "P1", "P2" };
  115. size_t sampling;
  116. size_t nSamplePerBuffer;
  117. ASSERT_TRUE(signalReaderTest->getSignalInformation(channelNames, sampling, nSamplePerBuffer));
  118. ASSERT_TRUE(signalReaderTest->readSamplesAndEventsFromFile(3, chunks, stimulations));
  119. ASSERT_EQ(chunks.size(), 3);
  120. ASSERT_TRUE(!chunks.empty());
  121. ASSERT_TRUE(!stimulations.empty());
  122. ASSERT_EQ(channelNames, expectedChannels);
  123. ASSERT_EQ(sampling, 8U);
  124. ASSERT_EQ(nSamplePerBuffer, 4);
  125. ASSERT_TRUE(signalReaderTest->closeFile());
  126. releaseCSVHandler(signalReaderTest);
  127. }
  128. TEST(CSV_Reader_Test_Case, signalReaderNotEnoughChunk)
  129. {
  130. OpenViBE::CSV::ICSVHandler* signalReaderTest = OpenViBE::CSV::createCSVHandler();
  131. const std::string filepath = dataDirectory + "testCSVSignalReader01.csv";
  132. ASSERT_TRUE(signalReaderTest->openFile(filepath, OpenViBE::CSV::EFileAccessMode::Read));
  133. signalReaderTest->setFormatType(OpenViBE::CSV::EStreamType::Signal);
  134. std::vector<OpenViBE::CSV::SMatrixChunk> chunks;
  135. std::vector<OpenViBE::CSV::SStimulationChunk> stimulations;
  136. std::vector<std::string> channelNames;
  137. const std::vector<std::string> expectedChannels = { "O1", "O2", "Pz", "P1", "P2" };
  138. size_t sampling;
  139. size_t nSamplePerBuffer;
  140. ASSERT_TRUE(signalReaderTest->getSignalInformation(channelNames, sampling, nSamplePerBuffer));
  141. ASSERT_TRUE(signalReaderTest->readSamplesAndEventsFromFile(3, chunks, stimulations));
  142. ASSERT_EQ(chunks.size(), size_t(3));
  143. ASSERT_EQ(stimulations.size(), size_t(3));
  144. ASSERT_EQ(channelNames, expectedChannels);
  145. ASSERT_EQ(sampling, 8U);
  146. ASSERT_EQ(nSamplePerBuffer, 4);
  147. ASSERT_TRUE(signalReaderTest->closeFile());
  148. releaseCSVHandler(signalReaderTest);
  149. }
  150. TEST(CSV_Reader_Test_Case, SignalReaderEmptyFile)
  151. {
  152. OpenViBE::CSV::ICSVHandler* signalReaderTest = OpenViBE::CSV::createCSVHandler();
  153. const std::string filepath = dataDirectory + "testCSVSignalEmptyFile.csv";
  154. ASSERT_TRUE(signalReaderTest->openFile(filepath, OpenViBE::CSV::EFileAccessMode::Read));
  155. releaseCSVHandler(signalReaderTest);
  156. }
  157. TEST(CSV_Reader_Test_Case, SignalReaderWrongHeader)
  158. {
  159. OpenViBE::CSV::ICSVHandler* signalReaderTest = OpenViBE::CSV::createCSVHandler();
  160. const std::string filepath = dataDirectory + "testCSVSignalWrongHeader.csv";
  161. ASSERT_TRUE(signalReaderTest->openFile(filepath, OpenViBE::CSV::EFileAccessMode::Read));
  162. signalReaderTest->setFormatType(OpenViBE::CSV::EStreamType::Signal);
  163. std::vector<std::string> channelNames;
  164. size_t sampling;
  165. size_t nSamplePerBuffer;
  166. ASSERT_FALSE(signalReaderTest->getSignalInformation(channelNames, sampling, nSamplePerBuffer));
  167. ASSERT_TRUE(signalReaderTest->closeFile());
  168. releaseCSVHandler(signalReaderTest);
  169. }
  170. TEST(CSV_Reader_Test_Case, spectrumReaderNormalGoodSignal)
  171. {
  172. OpenViBE::CSV::ICSVHandler* spectrumReaderTest = OpenViBE::CSV::createCSVHandler();
  173. std::string filepath = dataDirectory + "testCSVSpectrumReader01.csv";
  174. ASSERT_TRUE(spectrumReaderTest->openFile(filepath, OpenViBE::CSV::EFileAccessMode::Read));
  175. spectrumReaderTest->setFormatType(OpenViBE::CSV::EStreamType::Spectrum);
  176. std::vector<OpenViBE::CSV::SMatrixChunk> chunks;
  177. std::vector<OpenViBE::CSV::SStimulationChunk> stimulations;
  178. std::vector<std::string> channelNames;
  179. std::vector<std::string> expectedChannels = { "O1", "O2" };
  180. std::vector<double> expectedData(128);
  181. std::iota(expectedData.begin(), expectedData.begin() + 64, 0);
  182. std::iota(expectedData.begin() + 64, expectedData.end(), 0);
  183. std::vector<double> frequencyAbscissa;
  184. size_t originalSampling;
  185. ASSERT_TRUE(spectrumReaderTest->getSpectrumInformation(channelNames, frequencyAbscissa, originalSampling));
  186. ASSERT_TRUE(spectrumReaderTest->readSamplesAndEventsFromFile(3, chunks, stimulations));
  187. ASSERT_EQ(chunks.size(), 3);
  188. ASSERT_EQ(chunks[0].matrix, expectedData);
  189. ASSERT_EQ(chunks[1].matrix, expectedData);
  190. ASSERT_EQ(chunks[2].matrix, expectedData);
  191. ASSERT_EQ(chunks[0].startTime, 0);
  192. ASSERT_EQ(chunks[0].endTime, 1);
  193. ASSERT_EQ(chunks[1].startTime, 0.125);
  194. ASSERT_EQ(chunks[1].endTime, 1.125);
  195. ASSERT_EQ(chunks[2].startTime, 0.25);
  196. ASSERT_EQ(chunks[2].endTime, 1.25);
  197. ASSERT_TRUE(!chunks.empty());
  198. ASSERT_EQ(channelNames, expectedChannels);
  199. ASSERT_EQ(originalSampling, 128);
  200. ASSERT_TRUE(spectrumReaderTest->closeFile());
  201. releaseCSVHandler(spectrumReaderTest);
  202. }
  203. TEST(CSV_Reader_Test_Case, spectrumReaderNotEnoughChunk)
  204. {
  205. OpenViBE::CSV::ICSVHandler* spectrumReaderTest = OpenViBE::CSV::createCSVHandler();
  206. const std::string filepath = dataDirectory + "testCSVSpectrumReader01.csv";
  207. ASSERT_TRUE(spectrumReaderTest->openFile(filepath, OpenViBE::CSV::EFileAccessMode::Read));
  208. spectrumReaderTest->setFormatType(OpenViBE::CSV::EStreamType::Spectrum);
  209. std::vector<OpenViBE::CSV::SMatrixChunk> chunks;
  210. std::vector<OpenViBE::CSV::SStimulationChunk> stimulations;
  211. std::vector<std::string> channelNames;
  212. const std::vector<std::string> expectedChannels = { "O1", "O2" };
  213. std::vector<double> frequencyAbscissa;
  214. size_t originalSampling;
  215. ASSERT_TRUE(spectrumReaderTest->getSpectrumInformation(channelNames, frequencyAbscissa, originalSampling));
  216. ASSERT_TRUE(spectrumReaderTest->readSamplesAndEventsFromFile(13, chunks, stimulations));
  217. ASSERT_NE(chunks.size(), 13);
  218. ASSERT_TRUE(!chunks.empty());
  219. ASSERT_EQ(channelNames, expectedChannels);
  220. ASSERT_EQ(originalSampling, 128);
  221. ASSERT_NE(4, chunks.size());
  222. ASSERT_TRUE(spectrumReaderTest->closeFile());
  223. releaseCSVHandler(spectrumReaderTest);
  224. }
  225. TEST(CSV_Reader_Test_Case, spectrumReaderWrongHeader)
  226. {
  227. OpenViBE::CSV::ICSVHandler* spectrumReaderTest = OpenViBE::CSV::createCSVHandler();
  228. const std::string filepath = dataDirectory + "testCSVSpectrumWrongHeader.csv";
  229. ASSERT_TRUE(spectrumReaderTest->openFile(filepath, OpenViBE::CSV::EFileAccessMode::Read));
  230. spectrumReaderTest->setFormatType(OpenViBE::CSV::EStreamType::Spectrum);
  231. std::vector<std::string> channelNames;
  232. std::vector<double> frequencyAbscissa;
  233. size_t originalSampling;
  234. ASSERT_FALSE(spectrumReaderTest->getSpectrumInformation(channelNames, frequencyAbscissa, originalSampling));
  235. ASSERT_TRUE(spectrumReaderTest->closeFile());
  236. releaseCSVHandler(spectrumReaderTest);
  237. }
  238. TEST(CSV_Reader_Test_Case, matrixReaderNormalGoodSignal)
  239. {
  240. OpenViBE::CSV::ICSVHandler* matrixReaderTest = OpenViBE::CSV::createCSVHandler();
  241. const std::string filepath = dataDirectory + "testCSVMatrixReader01.csv";
  242. ASSERT_TRUE(matrixReaderTest->openFile(filepath, OpenViBE::CSV::EFileAccessMode::Read));
  243. matrixReaderTest->setFormatType(OpenViBE::CSV::EStreamType::StreamedMatrix);
  244. std::vector<OpenViBE::CSV::SMatrixChunk> chunks;
  245. std::vector<OpenViBE::CSV::SStimulationChunk> stimulations;
  246. std::vector<size_t> dimensionSizes;
  247. std::vector<std::string> labels;
  248. const std::vector<std::string> expectedLabels = { "", "", "", "", "", "" };
  249. const std::vector<size_t> goodDimensionsSizes = { 2, 2, 2 };
  250. ASSERT_TRUE(matrixReaderTest->getStreamedMatrixInformation(dimensionSizes, labels));
  251. ASSERT_TRUE(matrixReaderTest->readSamplesAndEventsFromFile(10, chunks, stimulations));
  252. ASSERT_EQ(chunks.size(), 10);
  253. ASSERT_EQ(dimensionSizes, goodDimensionsSizes);
  254. ASSERT_EQ(labels, expectedLabels);
  255. ASSERT_TRUE(matrixReaderTest->closeFile());
  256. releaseCSVHandler(matrixReaderTest);
  257. }
  258. TEST(CSV_Reader_Test_Case, matrixReaderWrongHeader)
  259. {
  260. OpenViBE::CSV::ICSVHandler* matrixReaderTest = OpenViBE::CSV::createCSVHandler();
  261. const std::string filepath = dataDirectory + "testCSVMatrixWrongHeader.csv";
  262. ASSERT_TRUE(matrixReaderTest->openFile(filepath, OpenViBE::CSV::EFileAccessMode::Read));
  263. matrixReaderTest->setFormatType(OpenViBE::CSV::EStreamType::StreamedMatrix);
  264. std::vector<size_t> dimensionSizes;
  265. std::vector<std::string> labels;
  266. ASSERT_FALSE(matrixReaderTest->getStreamedMatrixInformation(dimensionSizes, labels));
  267. ASSERT_TRUE(matrixReaderTest->closeFile());
  268. releaseCSVHandler(matrixReaderTest);
  269. }
  270. TEST(CSV_Reader_Test_Case, matrixReaderTooManyLabels)
  271. {
  272. OpenViBE::CSV::ICSVHandler* matrixReaderTest = OpenViBE::CSV::createCSVHandler();
  273. const std::string filepath = dataDirectory + "testCSVMatrixTooManyLabels.csv";
  274. ASSERT_TRUE(matrixReaderTest->openFile(filepath, OpenViBE::CSV::EFileAccessMode::Read));
  275. matrixReaderTest->setFormatType(OpenViBE::CSV::EStreamType::StreamedMatrix);
  276. std::vector<size_t> dimensionSizes;
  277. std::vector<std::string> labels;
  278. ASSERT_FALSE(matrixReaderTest->getStreamedMatrixInformation(dimensionSizes, labels));
  279. ASSERT_TRUE(matrixReaderTest->closeFile());
  280. releaseCSVHandler(matrixReaderTest);
  281. }
  282. TEST(CSV_Reader_Test_Case, matrixReaderWrongStimulation)
  283. {
  284. OpenViBE::CSV::ICSVHandler* matrixReaderTest = OpenViBE::CSV::createCSVHandler();
  285. const std::string filepath = dataDirectory + "testCSVMatrixWrongStimulation.csv";
  286. ASSERT_TRUE(matrixReaderTest->openFile(filepath, OpenViBE::CSV::EFileAccessMode::Read));
  287. matrixReaderTest->setFormatType(OpenViBE::CSV::EStreamType::StreamedMatrix);
  288. std::vector<size_t> dimensionSizes;
  289. std::vector<std::string> labels;
  290. ASSERT_TRUE(matrixReaderTest->getStreamedMatrixInformation(dimensionSizes, labels));
  291. std::vector<OpenViBE::CSV::SMatrixChunk> chunks;
  292. std::vector<OpenViBE::CSV::SStimulationChunk> stimulations;
  293. ASSERT_FALSE(matrixReaderTest->readSamplesAndEventsFromFile(1, chunks, stimulations));
  294. ASSERT_TRUE(matrixReaderTest->closeFile());
  295. releaseCSVHandler(matrixReaderTest);
  296. }
  297. TEST(CSV_Reader_Test_Case, covarianceMatrixReaderNormalGoodSignal)
  298. {
  299. OpenViBE::CSV::ICSVHandler* matrixReaderTest = OpenViBE::CSV::createCSVHandler();
  300. const std::string filepath = dataDirectory + "testCSVCovarMatrixReader01.csv";
  301. ASSERT_TRUE(matrixReaderTest->openFile(filepath, OpenViBE::CSV::EFileAccessMode::Read));
  302. matrixReaderTest->setFormatType(OpenViBE::CSV::EStreamType::CovarianceMatrix);
  303. std::vector<OpenViBE::CSV::SMatrixChunk> chunks;
  304. std::vector<OpenViBE::CSV::SStimulationChunk> stimulations;
  305. std::vector<size_t> dimensionSizes;
  306. std::vector<std::string> labels;
  307. const std::vector<std::string> expectedLabels = { "X", "Y", "X", "Y", "Z1", "Z2", "Z3", "Z4", "Z5" };
  308. const std::vector<size_t> goodDimensionsSizes = { 2, 2, 5 };
  309. ASSERT_TRUE(matrixReaderTest->getStreamedMatrixInformation(dimensionSizes, labels));
  310. ASSERT_TRUE(matrixReaderTest->readSamplesAndEventsFromFile(3, chunks, stimulations)) << matrixReaderTest->getLastLogError() << ".Details: " <<
  311. matrixReaderTest->getLastErrorString();
  312. ASSERT_EQ(chunks.size(), 3);
  313. ASSERT_EQ(dimensionSizes, goodDimensionsSizes);
  314. ASSERT_EQ(labels, expectedLabels);
  315. ASSERT_TRUE(matrixReaderTest->closeFile());
  316. releaseCSVHandler(matrixReaderTest);
  317. }
  318. TEST(CSV_Reader_Test_Case, covarianceMatrixReaderWrongHeader)
  319. {
  320. OpenViBE::CSV::ICSVHandler* matrixReaderTest = OpenViBE::CSV::createCSVHandler();
  321. const std::string filepath = dataDirectory + "testCSVCovarMatrixWrongHeader.csv";
  322. ASSERT_TRUE(matrixReaderTest->openFile(filepath, OpenViBE::CSV::EFileAccessMode::Read));
  323. matrixReaderTest->setFormatType(OpenViBE::CSV::EStreamType::CovarianceMatrix);
  324. std::vector<size_t> dimensionSizes;
  325. std::vector<std::string> labels;
  326. ASSERT_FALSE(matrixReaderTest->getStreamedMatrixInformation(dimensionSizes, labels));
  327. ASSERT_TRUE(matrixReaderTest->closeFile());
  328. releaseCSVHandler(matrixReaderTest);
  329. }
  330. TEST(CSV_Reader_Test_Case, covarianceMatrixReaderTooManyLabels)
  331. {
  332. OpenViBE::CSV::ICSVHandler* matrixReaderTest = OpenViBE::CSV::createCSVHandler();
  333. const std::string filepath = dataDirectory + "testCSVCovarMatrixTooManyLabels.csv";
  334. ASSERT_TRUE(matrixReaderTest->openFile(filepath, OpenViBE::CSV::EFileAccessMode::Read));
  335. matrixReaderTest->setFormatType(OpenViBE::CSV::EStreamType::CovarianceMatrix);
  336. std::vector<size_t> dimensionSizes;
  337. std::vector<std::string> labels;
  338. ASSERT_FALSE(matrixReaderTest->getStreamedMatrixInformation(dimensionSizes, labels));
  339. ASSERT_TRUE(matrixReaderTest->closeFile());
  340. releaseCSVHandler(matrixReaderTest);
  341. }
  342. int uoCSVReaderTest(int argc, char* argv[])
  343. {
  344. if (argv[1] != nullptr) { dataDirectory = argv[1]; }
  345. testing::InitGoogleTest(&argc, argv);
  346. ::testing::GTEST_FLAG(filter) = "CSV_Reader_Test_Case.*";
  347. return RUN_ALL_TESTS();
  348. }