wibble
1.1
wibble
stream
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:
wibble::stream::PosixBuf
Definition
posix.h:16
wibble::stream
Definition
posix.h:13
wibble
Definition
amorph.h:17
posix.h
wibble::SanitizeReturn
Definition
amorph.h:30
test.h
assert
#define assert(x)
Definition
test.h:30
Generated by
1.9.8