added some more tests
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17535 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
b82aa52811
commit
c003d47a54
@ -1,3 +1,6 @@
|
||||
SubDir HAIKU_TOP src tests system libroot posix posixtestsuite conformance interfaces ;
|
||||
|
||||
SubInclude HAIKU_TOP src tests system libroot posix posixtestsuite conformance interfaces difftime ;
|
||||
SubInclude HAIKU_TOP src tests system libroot posix posixtestsuite conformance interfaces kill ;
|
||||
SubInclude HAIKU_TOP src tests system libroot posix posixtestsuite conformance interfaces sigprocmask ;
|
||||
SubInclude HAIKU_TOP src tests system libroot posix posixtestsuite conformance interfaces sigsuspend ;
|
||||
|
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (c) 2002-3, Intel Corporation. All rights reserved.
|
||||
* Created by: salwan.searty REMOVE-THIS AT intel DOT com
|
||||
* This file is licensed under the GPL license. For the full content
|
||||
* of this license, see the COPYING file at the top level of this
|
||||
* source tree.
|
||||
|
||||
Test that the difftime function shall return the difference between
|
||||
two calendar times.
|
||||
*/
|
||||
|
||||
#define WAIT_DURATION 1
|
||||
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include "posixtest.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
time_t time1, time0;
|
||||
|
||||
double time_diff;
|
||||
time_diff = 0;
|
||||
time0 = time(NULL);
|
||||
sleep(WAIT_DURATION);
|
||||
time1 = time(NULL);
|
||||
time_diff = difftime(time1, time0);
|
||||
|
||||
if (time_diff != WAIT_DURATION) {
|
||||
perror("Test FAILED: difftime did not return the correct value\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
|
||||
printf("Test PASSED\n");
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -0,0 +1,6 @@
|
||||
SubDir HAIKU_TOP src tests system libroot posix posixtestsuite conformance interfaces difftime ;
|
||||
|
||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) $(DOTDOT) $(DOTDOT) include ] ;
|
||||
|
||||
SimpleTest 1-1.test : 1-1.c ;
|
||||
|
@ -0,0 +1,30 @@
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include "posixtest.h"
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002, Intel Corporation. All rights reserved.
|
||||
* Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com
|
||||
* This file is licensed under the GPL license. For the full content
|
||||
* of this license, see the COPYING file at the top level of this
|
||||
* source tree.
|
||||
|
||||
* Test that if the signal is the null signal (0), no signal is sent.
|
||||
* 1) Call kill on the current process with the null signal.
|
||||
* 2) If process is still functional after kill() is called, consider
|
||||
* the test a pass (most likely no signal was sent).
|
||||
*/
|
||||
|
||||
int main()
|
||||
{
|
||||
if (kill(getpid(), 0) != 0) {
|
||||
printf("Could not call kill with sig = 0\n");
|
||||
return PTS_FAIL;
|
||||
}
|
||||
|
||||
printf("Test PASSED\n");
|
||||
return PTS_PASS;
|
||||
}
|
||||
|
@ -0,0 +1,6 @@
|
||||
SubDir HAIKU_TOP src tests system libroot posix posixtestsuite conformance interfaces kill ;
|
||||
|
||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) $(DOTDOT) $(DOTDOT) include ] ;
|
||||
|
||||
SimpleTest 2-1.test : 2-1.c ;
|
||||
|
Loading…
Reference in New Issue
Block a user