@@ -74,7 +74,7 @@ TEST(ReadMatrixTests, RoundTripViaString)
7474TEST (ReadMatrixAlgorithmTest, TestFromRealTextFile)
7575{
7676 ReadMatrixAlgorithm algo;
77- auto filename = TestResources::rootDir () / " matrix1.txt" ;
77+ auto filename = TestResources::rootDir () / " Matrices " / " matrix1.txt" ;
7878 if (boost::filesystem::exists (filename))
7979 {
8080 DenseMatrixConstHandle matrix = matrix_cast::as_dense (algo.run (filename.string ()));
@@ -95,7 +95,7 @@ TEST(ReadMatrixAlgorithmTest, ThrowsForFileNotFound)
9595TEST (ReadMatrixAlgorithmTest, TestSparseFromRealASCIIMatFile)
9696{
9797 ReadMatrixAlgorithm algo;
98- auto filename = TestResources::rootDir () / " sp2.mat" ;
98+ auto filename = TestResources::rootDir () / " Matrices " / " sp2.mat" ;
9999 if (boost::filesystem::exists (filename))
100100 {
101101 auto matrix = algo.run (filename.string ());
@@ -114,13 +114,13 @@ TEST(ReadMatrixAlgorithmTest, TestSparseFromRealASCIIMatFile)
114114#endif
115115 }
116116 else
117- FAIL () << " file does not exist, skipping test." << std::endl;
117+ FAIL () << " file " << filename. string () << " does not exist, skipping test." << std::endl;
118118}
119119
120120TEST (ReadMatrixAlgorithmTest, TestDenseFromRealASCIIMatFile)
121121{
122122 ReadMatrixAlgorithm algo;
123- auto filename = TestResources::rootDir () / " CGDarrell" / " xScirun.mat" ;
123+ auto filename = TestResources::rootDir () / " Matrices " / " CGDarrell" / " xScirun.mat" ;
124124 if (boost::filesystem::exists (filename))
125125 {
126126 auto matrix = algo.run (filename.string ());
@@ -135,13 +135,13 @@ TEST(ReadMatrixAlgorithmTest, TestDenseFromRealASCIIMatFile)
135135 EXPECT_DOUBLE_EQ (-0.346299309398506 , (*dense)(0 ,0 ));
136136 }
137137 else
138- FAIL () << " file does not exist, skipping test." << std::endl;
138+ FAIL () << " file " << filename. string () << " does not exist, skipping test." << std::endl;
139139}
140140
141141TEST (ReadMatrixAlgorithmTest, TestColumnFromRealASCIIMatFile)
142142{
143143 ReadMatrixAlgorithm algo;
144- auto filename = TestResources::rootDir () / " CGDarrell" / " xScirunColumn.mat" ;
144+ auto filename = TestResources::rootDir () / " Matrices " / " CGDarrell" / " xScirunColumn.mat" ;
145145 if (boost::filesystem::exists (filename))
146146 {
147147 auto matrix = algo.run (filename.string ());
@@ -156,13 +156,13 @@ TEST(ReadMatrixAlgorithmTest, TestColumnFromRealASCIIMatFile)
156156 EXPECT_DOUBLE_EQ (-0.346299309398506 , (*col)(0 ,0 ));
157157 }
158158 else
159- FAIL () << " file does not exist, skipping test." << std::endl;
159+ FAIL () << " file " << filename. string () << " does not exist, skipping test." << std::endl;
160160}
161161
162162TEST (ReadMatrixAlgorithmTest, DISABLED_TestLargeSparseFromRealASCIIMatFile)
163163{
164164 ReadMatrixAlgorithm algo;
165- auto AFile = TestResources::rootDir () / " CGDarrell" / " A_txt.mat" ;
165+ auto AFile = TestResources::rootDir () / " Matrices " / " CGDarrell" / " A_txt.mat" ;
166166 if (boost::filesystem::exists (AFile))
167167 {
168168 auto matrix = algo.run (AFile.string ());
@@ -176,32 +176,32 @@ TEST(ReadMatrixAlgorithmTest, DISABLED_TestLargeSparseFromRealASCIIMatFile)
176176 EXPECT_EQ (5540569 , sp->nonZeros ());
177177 }
178178 else
179- std::cout << " file does not exist, skipping test." << std::endl;
179+ FAIL () << " file " << AFile. string () << " does not exist, skipping test." << std::endl;
180180}
181181
182182TEST (ReadMatrixAlgorithmTest, UnknownFileFormatThrows)
183183{
184184 ReadMatrixAlgorithm algo;
185- auto notAMatrixFile = TestResources::rootDir () / " scirun5demo.srn" ;
185+ auto notAMatrixFile = TestResources::rootDir () / " scirun5demo.srn" ;
186186 if (boost::filesystem::exists (notAMatrixFile))
187187 {
188188 EXPECT_THROW (algo.run (notAMatrixFile.string ()), Core::Algorithms::AlgorithmInputException);
189189 }
190190 else
191- FAIL () << " file does not exist, skipping test." << std::endl;
191+ FAIL () << " file " << notAMatrixFile. string () << " does not exist, skipping test." << std::endl;
192192}
193193
194194TEST (ReadMatrixAlgorithmTest, DISABLED_ThrowsForMatlabFilesICantThemReadYet)
195195{
196196 // / @todo: will hook up Matlab readers soon.
197197 ReadMatrixAlgorithm algo;
198- auto matlabFile = TestResources::rootDir () / " CGDarrell" / " RHS.mat" ;
198+ auto matlabFile = TestResources::rootDir () / " Matrices " / " CGDarrell" / " RHS.mat" ;
199199 if (boost::filesystem::exists (matlabFile))
200200 {
201201 EXPECT_THROW (algo.run (matlabFile.string ()), Core::Algorithms::AlgorithmInputException);
202202 }
203203 else
204- FAIL () << " file does not exist, skipping test." << std::endl;
204+ FAIL () << " file " << matlabFile. string () << " does not exist, skipping test." << std::endl;
205205}
206206
207207TEST (ReadMatrixAlgorithmTest, DISABLED_NonMatrixTextFile)
@@ -214,13 +214,13 @@ TEST(ReadMatrixAlgorithmTest, DISABLED_NonMatrixTextFile)
214214 EXPECT_THROW (algo.run (txt.string ()), Core::Algorithms::AlgorithmInputException);
215215 }
216216 else
217- FAIL () << " file does not exist, skipping test." << std::endl;
217+ FAIL () << " file " << txt. string () << " does not exist, skipping test." << std::endl;
218218}
219219
220220TEST (ReadMatrixAlgorithmTest, TestSparseFromRealBinaryMatFile)
221221{
222222 ReadMatrixAlgorithm algo;
223- auto filename = TestResources::rootDir () / " CGDarrell " / " eye3x3sparse_bin.mat" ;
223+ auto filename = TestResources::rootDir () / " Matrices " / " eye3x3sparse_bin.mat" ;
224224 if (boost::filesystem::exists (filename))
225225 {
226226 auto matrix = algo.run (filename.string ());
@@ -237,13 +237,13 @@ TEST(ReadMatrixAlgorithmTest, TestSparseFromRealBinaryMatFile)
237237#endif
238238 }
239239 else
240- FAIL () << " file does not exist, skipping test." << std::endl;
240+ FAIL () << " file " << filename. string () << " does not exist, skipping test." << std::endl;
241241}
242242
243243TEST (ReadMatrixAlgorithmTest, TestDenseFromRealBinaryMatFile)
244244{
245245 ReadMatrixAlgorithm algo;
246- auto filename = TestResources::rootDir () / " CGDarrell " / " eye3x3dense_bin.mat" ;
246+ auto filename = TestResources::rootDir () / " Matrices " / " eye3x3dense_bin.mat" ;
247247 if (boost::filesystem::exists (filename))
248248 {
249249 auto matrix = algo.run (filename.string ());
@@ -257,13 +257,13 @@ TEST(ReadMatrixAlgorithmTest, TestDenseFromRealBinaryMatFile)
257257 EXPECT_EQ (to_string (a), to_string (*dense));
258258 }
259259 else
260- FAIL () << " file does not exist, skipping test." << std::endl;
260+ FAIL () << " file " << filename. string () << " does not exist, skipping test." << std::endl;
261261}
262262
263263TEST (ReadMatrixAlgorithmTest, TestColumnFromRealBinaryMatFile)
264264{
265265 ReadMatrixAlgorithm algo;
266- auto filename = TestResources::rootDir () / " CGDarrell " / " columnBinMat.mat" ;
266+ auto filename = TestResources::rootDir () / " Matrices " / " columnBinMat.mat" ;
267267 if (boost::filesystem::exists (filename))
268268 {
269269 auto matrix = algo.run (filename.string ());
@@ -276,18 +276,18 @@ TEST(ReadMatrixAlgorithmTest, TestColumnFromRealBinaryMatFile)
276276 EXPECT_EQ (to_string (*col), to_string (expected));
277277 }
278278 else
279- FAIL () << " file does not exist, skipping test." << std::endl;
279+ FAIL () << " file " << filename. string () << " does not exist, skipping test." << std::endl;
280280}
281281
282282TEST (ReadMatrixAlgorithmTest, TestColumnFromRealBinaryMatFile2)
283283{
284284 ReadMatrixAlgorithm algo;
285- auto filename = TestResources::rootDir () / " columnBin2.mat" ;
285+ auto filename = TestResources::rootDir () / " Matrices " / " columnBin2.mat" ;
286286 if (boost::filesystem::exists (filename))
287287 {
288288 auto matrix = algo.run (filename.string ());
289289 ASSERT_TRUE (matrix.get () != nullptr );
290- ASSERT_TRUE (matrix_is::column (matrix));
290+ ASSERT_TRUE (matrix_is::column (matrix));
291291
292292 auto col = matrix_cast::as_column (matrix);
293293 DenseColumnMatrix expected (5 );
@@ -323,15 +323,15 @@ void CallLegacyPio(const boost::filesystem::path& filename, const DenseMatrix& e
323323#endif
324324 }
325325 else
326- FAIL () << " file does not exist, skipping test." << std::endl;
326+ FAIL () << " file " << filename. string () << " does not exist, skipping test." << std::endl;
327327}
328328
329329TEST (ReadMatrixAlgorithmTest, CallLegacyPioDense)
330330{
331- CallLegacyPio (TestResources::rootDir () / " CGDarrell " / " eye3x3dense_bin.mat" );
331+ CallLegacyPio (TestResources::rootDir () / " Matrices " / " eye3x3dense_bin.mat" );
332332}
333333
334334TEST (ReadMatrixAlgorithmTest, CallLegacyPioSparse)
335335{
336- CallLegacyPio (TestResources::rootDir () / " CGDarrell " / " eye3x3sparse_bin.mat" );
337- }
336+ CallLegacyPio (TestResources::rootDir () / " Matrices " / " eye3x3sparse_bin.mat" );
337+ }
0 commit comments