Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
8a916db3
Commit
8a916db3
authored
Apr 12, 2014
by
John Chodera (MSKCC)
Browse files
Added assertion utility to compare containers.
parent
f8c52d1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
openmmapi/include/openmm/internal/AssertionUtilities.h
openmmapi/include/openmm/internal/AssertionUtilities.h
+2
-0
No files found.
openmmapi/include/openmm/internal/AssertionUtilities.h
View file @
8a916db3
...
...
@@ -49,6 +49,8 @@ void OPENMM_EXPORT throwException(const char* file, int line, const std::string&
#define ASSERT(cond) {if (!(cond)) throwException(__FILE__, __LINE__, "");};
#define ASSERT_EQUAL(expected, found) {if (!((expected) == (found))) {std::stringstream details; details << "Expected "<<(expected)<<", found "<<(found); throwException(__FILE__, __LINE__, details.str());}};
#define ASSERT_EQUAL_CONTAINERS(expected, found) {if (!((expected) == (found))) {std::stringstream details; details << "Containers not equal"; throwException(__FILE__, __LINE__, details.str());}};
#define ASSERT_EQUAL_TOL(expected, found, tol) {double _scale_ = std::abs(expected) > 1.0 ? std::abs(expected) : 1.0; if (!(std::abs((expected)-(found))/_scale_ <= (tol))) {std::stringstream details; details << "Expected "<<(expected)<<", found "<<(found); throwException(__FILE__, __LINE__, details.str());}};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment