-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Utilities, clean up testing (#604)
* Update CMakeLists.txt with version 3.6.0 (patch 1) * Update cmake/CMakeLists.txt library version * Updated the Installation instructions based on user feedback. Also fixed a problem with the isis3VarInit.py script. * Updates made in accordance with requests made on this PR by other developers. * Fix tgo cassis unit test correctly * Fix tgo cassis unit test correctly (#544) * Fixed two bug with AutoReg. One occurs with one dimensional pattern cubes and the other causes the revious registration sample/line to be returned on sub-pixel registration failure. * Fix tgo cassis camera truth again (#554) * Update docsys Makefile to support wwwdoc (#559) The documentation is installed under `docs`, not `doc`, so this file has been updated. `setisis isis3.6.0` and running `make wwwdoc` in `$ISISROOT/../isis/src/docsys` will properly sync the documentation to our web server. * Update isis3VarInit.py Unnecessary 'touch'ing, the '>' redirect will create the file if it doesn't exist. Also, the first redirect should be the single '>'. Otherwise, multiple runs of this program will continue appending to these files. They still work, its just a lot of setting and unsetting for no good reason. * Fixed isis3Startup scripts * Removed unneeded LineEquation include * Make this program more pythonic (#589) * Updated documentation, user interaction, and made the file and directory handling more 'pythonic'. * Correcting for PR comments. * Fixed broken links in the Installation instructions due to the hyperlinks to our GitHub wiki changing. * Removed unused Parabola class * Removed old license, added new unlicense (#594) * Fixed issue with the License change (#599) * Removed old license, added new unlicense * Fixed cmake looking for license in the wrong place * Added TestUtilities and used in Color tests * Fixed an issue where app xmls were not being copied * Tweaked IException test failure messages
- Loading branch information
1 parent
1609f34
commit ec67013
Showing
4 changed files
with
96 additions
and
30 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 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 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 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,61 @@ | ||
#ifndef TestUtilities_h | ||
#define TestUtilities_h | ||
|
||
#include "gtest/gtest.h" | ||
|
||
#include <string> | ||
|
||
#include <QString> | ||
|
||
#include "IException.h" | ||
|
||
namespace Isis { | ||
|
||
/** | ||
* Custom IException assertion that checks the exception message contains | ||
* a substring and that the error type is correct. | ||
*/ | ||
::testing::AssertionResult AssertIException( | ||
const char* e_expr, | ||
const char* contents_expr, | ||
const char* errorCode_expr, | ||
IException &e, | ||
QString contents, | ||
int errorCode) { | ||
if ( !e.toString().contains(contents) ) { | ||
return ::testing::AssertionFailure() << "IException " << e_expr | ||
<< "\'s error message (" << e.toString().toStdString() | ||
<< ") does not contain " << contents_expr << " (" | ||
<< contents.toStdString() << ")."; | ||
} | ||
|
||
if( e.errorType()!=errorCode ) { | ||
return ::testing::AssertionFailure() << "IException " << e_expr | ||
<< "\'s error code (" << std::to_string(e.errorType()) | ||
<< ") does not equal " << errorCode_expr << " (" | ||
<< std::to_string(errorCode) << ")."; | ||
} | ||
|
||
return ::testing::AssertionSuccess(); | ||
} | ||
|
||
/** | ||
* Custom QString assertion that properly outputs them as string if they | ||
* are different. | ||
*/ | ||
::testing::AssertionResult AssertQStringsEqual( | ||
const char* string1_expr, | ||
const char* string2_expr, | ||
QString string1, | ||
QString string2) { | ||
if (string1 != string2) { | ||
return ::testing::AssertionFailure() << "QStrings " << string1_expr | ||
<< " (" << string1.toStdString() << ") and " << string2_expr | ||
<< " (" << string2.toStdString() << ") are not the same."; | ||
} | ||
|
||
return ::testing::AssertionSuccess(); | ||
} | ||
} | ||
|
||
#endif |