Modules
ADT Database GTK2 GUI IP PiJAX Public Sql Stdio Subversion System Tools Xosd lua v4l2 wx
Recent Changes
Public.Parser.XML2 1.50
Public.ZeroMQ 1.1
Public.Template.Mustache 1.0
Public.Protocols.XMPP 1.4
Sql.Provider.jdbc 1.0
Popular Downloads
Public.Parser.JSON2 1.0
Public.Parser.JSON 0.2
GTK2 2.23
Public.Web.FCGI 1.8
Public.Parser.XML2 1.48
|
Module Information
Public.System.Inotify
Viewing contents of Public_System_Inotify-0.1/testsuite.in
test_true(functionp(Public.System.Inotify.parse_event));
test_true(programp(Public.System.Inotify._Instance));
test_true(programp(Public.System.Inotify.Instance));
test_true(intp(Public.System.Inotify.IN_CREATE));
test_true(intp(Public.System.Inotify.IN_ATTRIB));
test_true(intp(Public.System.Inotify.IN_CLOSE_WRITE));
test_true(intp(Public.System.Inotify.IN_CLOSE_NOWRITE));
test_true(intp(Public.System.Inotify.IN_DELETE));
test_true(intp(Public.System.Inotify.IN_DELETE_SELF));
test_true(intp(Public.System.Inotify.IN_MODIFY));
test_true(intp(Public.System.Inotify.IN_MOVE_SELF));
test_true(intp(Public.System.Inotify.IN_MOVED_FROM));
test_true(intp(Public.System.Inotify.IN_MOVED_TO));
test_true(intp(Public.System.Inotify.IN_OPEN));
test_true(intp(Public.System.Inotify.IN_MOVE));
test_true(intp(Public.System.Inotify.IN_CLOSE));
test_true(intp(Public.System.Inotify.IN_DONT_FOLLOW));
test_true(intp(Public.System.Inotify.IN_ONESHOT));
test_true(intp(Public.System.Inotify.IN_ONLYDIR));
test_true(intp(Public.System.Inotify.IN_IGNORED));
test_true(intp(Public.System.Inotify.IN_ISDIR));
test_true(intp(Public.System.Inotify.IN_Q_OVERFLOW));
test_true(intp(Public.System.Inotify.IN_UNMOUNT));
test_any([[ // stole this from pikes Stdio.File testsuite.
Stdio.Stat st = file_stat("/tmp");
string prefix = (st && st->isdir)?"/tmp/":"";
int pid = getpid();
int i;
prefix += "conftest_pike_dir_";
for(i = 0; i < 32; i++) {
string testdir = prefix + i;
if (mkdir(testdir)) {
add_constant("testdir", testdir + "/");
add_constant("testfile", testdir + "/conftest");
return 1;
}
}
add_constant("testfile", "conftest");
return 0;
]], 1)
test_any([[
object i = Public.System.Inotify._Instance();
object file = Stdio.File(i->get_fd(), "r");
i->add_watch(testdir, Public.System.Inotify.IN_CREATE);
Stdio.write_file(testfile, "test");
array a = Public.System.Inotify.parse_event(file->read(4096, 1));
return a[3] == "conftest" && a[1] == Public.System.Inotify.IN_CREATE;
]], 1)
|
|
|