forked from DOI-USGS/ISIS3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added LineEqationTests.cpp * Added FileListTests.cpp Implemented an istream constructor in FileList.cpp to help with testing. * added FileList tests. implemented istream constructor for FileList.cpp to help with testing. * fixed whitespace issues in FileListTests.cpp * Update FileListTests.cpp
- Loading branch information
1 parent
02c6858
commit 6647b29
Showing
5 changed files
with
56 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include <gtest/gtest.h> | ||
#include <iostream> | ||
#include "FileList.h" | ||
#include "IException.h" | ||
|
||
TEST(FileList, NonExistantFileConstructor) | ||
{ | ||
try | ||
{ | ||
Isis::FileList fl1(Isis::FileName("FakeFile")); | ||
} | ||
catch(Isis::IException &e) | ||
{ | ||
EXPECT_TRUE(e.toString().toLatin1().contains("Unable to open [FakeFile].")) | ||
<< e.toString().toStdString(); | ||
} | ||
catch(...) | ||
{ | ||
FAIL() << "Expected an IException\"Unable to open [FakeFile].\""; | ||
} | ||
} | ||
|
||
TEST(FileList, FileNameConstructor) | ||
{ | ||
std::istringstream input( | ||
"/usgs/pkgs/isis3/isis/src/base/objs/FileList/FileList.cpp\n" | ||
"/usgs/pkgs/isis3/isis/src/base/objs/FileList/FileList.h\n" | ||
"#Comment\n" | ||
"unitTest.cpp\n" | ||
">This will not be comment ignored\n" | ||
"\n" | ||
"^is a blank line, this line will not be ignored as a comment\n" | ||
" Makefile\n" | ||
" //Testing comment with prepended spaces\n" | ||
"\n" | ||
"#Above and below are for testing multiple blank lines\n" | ||
"\n" | ||
"\n" | ||
"FileList.h\n"); | ||
std::ostringstream output; | ||
std::string expectedOutput = "/usgs/pkgs/isis3/isis/src/base/objs/FileList/FileList.cpp\n" | ||
"/usgs/pkgs/isis3/isis/src/base/objs/FileList/FileList.h\n" | ||
"unitTest.cpp\n>This\n^is\nMakefile\nFileList.h\n"; | ||
Isis::FileList fl1(input); | ||
fl1.write(output); | ||
EXPECT_STREQ(expectedOutput.c_str(), output.str().c_str()); | ||
} |