File: NullPtrGuards.h

package info (click to toggle)
cxxtest 4.4%2Bgit230824-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 2,836 kB
  • sloc: cpp: 9,570; python: 9,553; xml: 435; sh: 258; ruby: 229; makefile: 86; ansic: 68; perl: 16
file content (19 lines) | stat: -rw-r--r-- 703 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <cxxtest/TestSuite.h>

static char const* const file = "filename";
static int line = 1;
//
// A test for issue #115: Defensive guards in ErrorFormatter to deal with
// (char*) nullptr being passed as an error message.
class NullPtrFormatterTest : public CxxTest::TestSuite {

  public:
  void testTsAssert()
  {
    CxxTest::doFailAssert(file, line, (char const*)NULL, (char const*)NULL);
  }
  void testTsFail() { CxxTest::doFailTest(file, line, (char const*)NULL); }
  void testTsWarn() { CxxTest::doWarn(file, line, (char const*)NULL); }
  void testTsSkip() { CxxTest::doSkipTest(file, line, (char const*)NULL); }
  void testTsTrace() { CxxTest::doTrace(file, line, (char const*)NULL); }
};