mirror of
https://github.com/davatorium/rofi.git
synced 2025-01-27 15:25:24 -05:00
Remove duplicate test, use tempnam instead of hardcoded path.
Issue: #543
This commit is contained in:
parent
5c5665efca
commit
6efd73ff92
2 changed files with 2 additions and 17 deletions
|
@ -71,7 +71,7 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char ** argv )
|
|||
// 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";
|
||||
char *path = tempnam(NULL, "rofi-pid");
|
||||
TASSERT( create_pid_file ( NULL ) == -1 );
|
||||
int fd = create_pid_file ( path );
|
||||
TASSERT( fd >= 0 );
|
||||
|
@ -82,5 +82,6 @@ int main ( G_GNUC_UNUSED int argc, G_GNUC_UNUSED char ** argv )
|
|||
fd = create_pid_file ( path );
|
||||
TASSERT( fd >= 0 );
|
||||
remove_pid_file ( fd );
|
||||
free ( path );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -137,22 +137,6 @@ int main ( int argc, char ** argv )
|
|||
TASSERT ( g_utf8_collate ( str, "Valid utf8 until <20>( 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 );
|
||||
}
|
||||
{
|
||||
TASSERT ( utf8_strncmp ( "aapno", "aap€",3) == 0 );
|
||||
TASSERT ( utf8_strncmp ( "aapno", "aap€",4) != 0 );
|
||||
|
|
Loading…
Add table
Reference in a new issue