wibble
1.1
wibble
sys
process.test.h
Go to the documentation of this file.
1
/* -*- C++ -*- (c) 2007 Petr Rockai <me@mornfall.net>
2
(c) 2007 Enrico Zini <enrico@enricozini.org> */
3
4
#include <
wibble/sys/process.h
>
5
6
#include <
wibble/test.h
>
7
8
using namespace
std;
9
using namespace
wibble::sys
;
10
11
struct
TestProcess
{
12
Test
getcwdAndChdir
() {
13
#ifdef POSIX
14
string
cwd =
process::getcwd
();
15
process::chdir(
"/"
);
16
assert_eq
(
process::getcwd
(),
string
(
"/"
));
17
process::chdir(cwd);
18
assert_eq
(
process::getcwd
(), cwd);
19
#endif
20
}
21
22
Test
umask
() {
23
#ifdef POSIX
24
mode_t old = process::umask(0012);
25
assert_eq
(process::umask(old), 0012u);
26
#endif
27
}
28
29
};
30
31
// vim:set ts=4 sw=4:
TestProcess::getcwdAndChdir
Test getcwdAndChdir()
Definition:
process.test.h:12
wibble::sys
Definition:
buffer.cpp:28
TestProcess::umask
Test umask()
Definition:
process.test.h:22
process.h
wibble::sys::process::getcwd
std::string getcwd()
Get the absolute path of the current working directory.
test.h
assert_eq
#define assert_eq(x, y)
Definition:
test.h:33
Test
void Test
Definition:
test.h:178
TestProcess
Definition:
process.test.h:11
Generated by
1.8.17