summaryrefslogtreecommitdiff
path: root/vendor/bandit/bandit/assertion_frameworks/snowhouse/example/tests.h
blob: 9dd1d28c347b903fbf33dbc920e4a840e983bdd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef SNOWHOUSE_EXAMPLES_TEST_H
#define SNOWHOUSE_EXAMPLES_TEST_H

#define AssertTestFails(assertion, expected_error_text) \
  std::string IGLOO_INTERNAL_expected_error = "Test did not fail"; \
  try \
  { \
    assertion; \
  }  \
  catch(const AssertionException& exception_from_igloo_assertion)  \
  {  \
  IGLOO_INTERNAL_expected_error = exception_from_igloo_assertion.GetMessage();  \
  }  \
  Assert::That(IGLOO_INTERNAL_expected_error, Is().Containing(expected_error_text));

#endif