File: test_process.cpp

package info (click to toggle)
libwibble 0.1.9
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 500 kB
  • ctags: 1,183
  • sloc: cpp: 5,760; sh: 113; makefile: 71
file content (32 lines) | stat: -rw-r--r-- 623 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 <wibble/config.h>
#include <wibble/sys/process.h>
using namespace std;
using namespace wibble::sys;

#include <wibble/tests/tut-wibble.h>

namespace tut {

struct sys_process_shar {};
TESTGRP( sys_process );

// Test chdir and getcwd
template<> template<>
void to::test< 1 >() {
	string cwd = process::getcwd();
	process::chdir("/");
	ensure_equals(process::getcwd(), string("/"));
	process::chdir(cwd);
	ensure_equals(process::getcwd(), cwd);
}

// Test umask
template<> template<>
void to::test< 2 >() {
	mode_t old = process::umask(0012);
	ensure_equals(process::umask(old), 0012u);
}

}

// vim:set ts=4 sw=4: