tests: fix IPC test set

- use one single library instead of loose library files
- we don't have ftime() anymore
- shmat(non-NULL) is currently broken, fix shmt test set to bypass this
- some other small issues
This commit is contained in:
David van Moolenbroek
2012-09-10 19:20:03 +02:00
parent c9f644bd68
commit df3975243b
21 changed files with 56 additions and 185 deletions
+2 -2
View File
@@ -16,11 +16,11 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
SRCS = libipc.c
SRCS = libipc.c rmobj.c parse_opts.c tst_res.c tst_sig.c tst_tmpdir.c
OBJS = $(SRCS:.c=.o)
LIBIPC = ../libipc.a
CFLAGS += -I../../../../../include -Wall
CFLAGS += -I../../../../../include -Wall -D_NETBSD_SOURCE=1
all: $(LIBIPC)
+6 -6
View File
@@ -42,7 +42,7 @@
#include "ipcsem.h"
#include <pwd.h>
#include <sys/timeb.h>
#include <sys/time.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/sem.h>
@@ -61,7 +61,7 @@ getipckey()
char curdira[PATH_MAX];
size_t size = sizeof(curdira);
key_t ipc_key;
struct timeb time_info;
struct timeval tv;
if (NULL == (curdir = getcwd(curdira, size))) {
tst_brkm(TBROK, cleanup, "Can't get current directory "
@@ -77,11 +77,11 @@ getipckey()
* project identifier is a "random character" produced by
* generating a random number between 0 and 25 and then adding
* that to the ascii value of 'a'. The "seed" for the random
* number is the millisecond value that is set in the timeb
* structure after calling ftime().
* number is the microsecond value that is set in the timeval
* structure after calling gettimeofday().
*/
(void)ftime(&time_info);
srandom((unsigned int)time_info.millitm);
(void) gettimeofday(&tv, NULL);
srandom((unsigned int)tv.tv_usec);
if ((ipc_key = ftok(curdir, ascii_a + random()%26)) == -1) {
tst_brkm(TBROK, cleanup, "Can't get msgkey from ftok()");
+1 -1
View File
@@ -577,7 +577,7 @@ STD_opts_help(void)
for(i = 0; std_options[i].optstr; ++i) {
if (std_options[i].help)
printf(std_options[i].help);
fputs(std_options[i].help, stdout);
}
}