File: testsafeptr.cc

package info (click to toggle)
mlview 0.9.0-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 6,028 kB
  • ctags: 3,957
  • sloc: cpp: 49,090; sh: 8,393; ansic: 3,262; xml: 361; makefile: 329
file content (32 lines) | stat: -rw-r--r-- 479 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 "mlview-safe-ptr-utils.h"

int
main (int argc, char ** argv)
{
	mlview::SafePtr<int> int_ptr = NULL ;

	if (int_ptr == NULL) {
		cout << "OK" << endl ;
	} else {
		cout << "KO" << endl ;
	}

	if (int_ptr) {
		cout << "KO" << endl ;
	} else {
		cout << "OK" << endl ;
	}

	if (!int_ptr) {
		cout << "OK" << endl ;
	} else {
		cout << "KO" << endl ;
	}

	int_ptr = new int () ;
	 if (int_ptr == NULL) {
		 cout << "KO" << endl ;
	 } else {
		 cout << "OK" << endl ;
	 }
}