Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/tls-earlyentropy]: src/tests/kernel Fix t_subr_prf.c -- such as is possi...



details:   https://anonhg.NetBSD.org/src/rev/46edc617a0a3
branches:  tls-earlyentropy
changeset: 795269:46edc617a0a3
user:      tls <tls%NetBSD.org@localhost>
date:      Mon Apr 07 19:32:15 2014 +0000

description:
Fix t_subr_prf.c -- such as is possible.  I am not so sure about the idea of
tearing apart a source file with a script in order to "test" pieces of it...

diffstat:

 tests/kernel/Makefile       |  3 ++-
 tests/kernel/gen_t_subr_prf |  8 ++++++++
 2 files changed, 10 insertions(+), 1 deletions(-)

diffs (53 lines):

diff -r 89a4f080cadd -r 46edc617a0a3 tests/kernel/Makefile
--- a/tests/kernel/Makefile     Mon Apr 07 03:37:29 2014 +0000
+++ b/tests/kernel/Makefile     Mon Apr 07 19:32:15 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.33 2013/04/16 22:05:44 mlelstv Exp $
+# $NetBSD: Makefile,v 1.33.4.1 2014/04/07 19:32:15 tls Exp $
 
 NOMAN=         # defined
 
@@ -47,6 +47,7 @@
 
 t_subr_prf.c: gen_t_subr_prf ${NETBSDSRCDIR}/sys/kern/subr_prf.c
        ${HOST_SH} ${.ALLSRC} ${.TARGET}
+CPPFLAGS.t_subr_prf.c= -Wno-pointer-sign       # XXX platform vs kernel SHA2
 
 CLEANFILES+=   t_subr_prf.c
 
diff -r 89a4f080cadd -r 46edc617a0a3 tests/kernel/gen_t_subr_prf
--- a/tests/kernel/gen_t_subr_prf       Mon Apr 07 03:37:29 2014 +0000
+++ b/tests/kernel/gen_t_subr_prf       Mon Apr 07 19:32:15 2014 +0000
@@ -2,10 +2,12 @@
 
 cat << _EOF > $2
 #include <sys/types.h>
+#include <sys/time.h>
 #include <stdio.h>
 #include <stdarg.h>
 #include <stdint.h>
 #include <string.h>
+#include <sha2.h>
 
 #include <atf-c.h>
 
@@ -18,6 +20,7 @@
 #define KPRINTF_BUFSIZE 1024
 #undef putchar
 #define putchar xputchar
+
 static int putchar(char c, int foo, void *b)
 {
        return fputc(c, stderr);
@@ -29,6 +32,11 @@
 
 typedef int device_t;
 
+static SHA512_CTX kprnd_sha;
+
+#define timespec timeval
+#define nanotime(ts) gettimeofday(ts, NULL)
+
 #define device_xname(a) ""
 int kprintf(const char *, int, void *, char *, va_list) __printflike(1, 0);
 void device_printf(device_t, const char *, ...) __printflike(2, 3);



Home | Main Index | Thread Index | Old Index