File: dtcTest1.cxx

package info (click to toggle)
dart 0.20061109-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 5,668 kB
  • ctags: 247
  • sloc: tcl: 5,652; perl: 256; python: 141; cpp: 79; makefile: 68; sh: 36
file content (32 lines) | stat: -rw-r--r-- 554 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <dtcFoo.h>

#ifdef DT_EXISTS_IOSTREAM
#  include <iostream>
using std::cerr;
using std::endl;
#else
# ifdef DT_EXISTS_IOSTREAM_H
# include <iostream.h>
# else
error Can not find a copy of iostream
# endif
#endif

int main( const int argc, const char** argv ) {
  dtcFoo foo;
  char t = 19;
  cerr << "BadChar:" << t << endl;
  cerr << "Found an error!!!" << endl;

// Cause a deliberate dodgy memory access.
  int *a  = new int[40];
  delete a;

  if (*a)
  {
    cerr << "Uninitialised value turned out to be true" << endl;
  }

  return 0;

}