summaryrefslogtreecommitdiffstats
path: root/test/helper-test.c
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-10-20 19:34:03 +0200
committerDave Davenport <qball@gmpclient.org>2016-10-20 19:34:03 +0200
commitc8d206909874d986ea6640e917e49c67322915e4 (patch)
tree32e04116d12781d61b467c518f7a58521aa4421d /test/helper-test.c
parent881056ea9b1a606d1d979be631795a3a07d5621e (diff)
Add more tests and re-add textbox_test to normal check set.
Diffstat (limited to 'test/helper-test.c')
-rw-r--r--test/helper-test.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/helper-test.c b/test/helper-test.c
index 4ae5694a..4ed00128 100644
--- a/test/helper-test.c
+++ b/test/helper-test.c
@@ -98,4 +98,20 @@ int main ( int argc, char ** argv )
TASSERT ( g_utf8_collate ( str, "Valid utf8 until �( we continue here") == 0 );
g_free(str);
}
+ // Pid test.
+ // Tests basic functionality of writing it, locking, seeing if I can write same again
+ // And close/reopen it again.
+ {
+ const char *path = "/tmp/rofi-test.pid";
+ TASSERT( create_pid_file ( NULL ) == -1 );
+ int fd = create_pid_file ( path );
+ TASSERT( fd >= 0 );
+ int fd2 = create_pid_file ( path );
+ TASSERT ( fd2 < 0 );
+
+ remove_pid_file ( fd );
+ fd = create_pid_file ( path );
+ TASSERT( fd >= 0 );
+ remove_pid_file ( fd );
+ }
}