File: lockfile.test.h

package info (click to toggle)
libwibble 1.1-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 1,040 kB
  • ctags: 2,721
  • sloc: cpp: 14,542; makefile: 196; perl: 87; sh: 26
file content (28 lines) | stat: -rw-r--r-- 613 bytes parent folder | download | duplicates (2)
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
/* -*- C++ -*- (c) 2007 Petr Rockai <me@mornfall.net>
               (c) 2007 Enrico Zini <enrico@enricozini.org> */
#include <wibble/sys/lockfile.h>
#include <cstdlib>
#include <set>

#include <wibble/test.h>

using namespace std;
using namespace wibble::sys::fs;

struct TestLockfile {
	// Cannot test the locks without forking, as reacquiring the lock from the
	// same process is just an update of the previous lock
    Test readlock() {
#ifdef POSIX
		Lockfile lk1("testlock", false);
#endif
    }

    Test writelock() {
#ifdef POSIX
		Lockfile lk1("testlock", true);
#endif
    }
};

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