wibble  1.1
posix.test.h
Go to the documentation of this file.
1 /* -*- C++ -*- (c) 2008 Petr Rockai <me@mornfall.net>
2  (c) 2008 Enrico Zini <enrico@enricozini.org> */
3 
4 #include <wibble/test.h>
5 #include <wibble/stream/posix.h>
6 #include <sys/types.h>
7 #include <sys/stat.h>
8 #include <fcntl.h>
9 
10 namespace {
11 
12 using namespace std;
13 using namespace wibble;
14 using namespace wibble::stream;
15 
16 struct TestStreamPosix {
17 
18  Test basicMatch() {
19 #ifdef POSIX // no /dev/null otherwise
20  int fd = open("/dev/null", O_WRONLY);
21  assert(fd != -1);
22 
23  PosixBuf buf(fd);
24  ostream os(&buf);
25 
26  os << "Foo";
27  os << "Bar";
28  os << endl;
29 #endif
30  }
31 
32 };
33 
34 }
35 
36 // vim:set ts=4 sw=4:
Definition: posix.h:16
Definition: posix.h:13
Definition: amorph.h:17
void Test
Definition: test.h:178
#define assert(x)
Definition: test.h:30