Source-Changes-HG archive

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

[src/trunk]: src/tests/kernel Print integers as hex with %#x rather than with...



details:   https://anonhg.NetBSD.org/src/rev/929c156f3bff
branches:  trunk
changeset: 819303:929c156f3bff
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sat Nov 26 02:34:49 2016 +0000

description:
Print integers as hex with %#x rather than with plain %x

# if used with o, x or X specifiers the value is preceeded with 0, 0x or 0X
respectively for values different than zero.

Noted by <christos>

Sponsored by <The NetBSD Foundation>

diffstat:

 tests/kernel/t_ptrace_wait.c |  48 ++++++++++++++++++++++----------------------
 1 files changed, 24 insertions(+), 24 deletions(-)

diffs (216 lines):

diff -r db58d56eda76 -r 929c156f3bff tests/kernel/t_ptrace_wait.c
--- a/tests/kernel/t_ptrace_wait.c      Sat Nov 26 02:12:18 2016 +0000
+++ b/tests/kernel/t_ptrace_wait.c      Sat Nov 26 02:34:49 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_ptrace_wait.c,v 1.31 2016/11/25 20:01:05 kamil Exp $ */
+/*     $NetBSD: t_ptrace_wait.c,v 1.32 2016/11/26 02:34:49 kamil Exp $ */
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_ptrace_wait.c,v 1.31 2016/11/25 20:01:05 kamil Exp $");
+__RCSID("$NetBSD: t_ptrace_wait.c,v 1.32 2016/11/26 02:34:49 kamil Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -2593,7 +2593,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me, magic,
-           "got value %x != expected %x", lookup_me, magic);
+           "got value %#x != expected %#x", lookup_me, magic);
 
        printf("Before resuming the child process where it left off and "
            "without signal to be sent\n");
@@ -2657,7 +2657,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me1, magic1,
-           "got value %x != expected %x", lookup_me1, magic1);
+           "got value %#x != expected %#x", lookup_me1, magic1);
 
        printf("Read new lookup_me2 from tracee (PID=%d) by tracer (PID=%d)\n",
            child, getpid());
@@ -2666,7 +2666,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me2, magic2,
-           "got value %x != expected %x", lookup_me2, magic2);
+           "got value %#x != expected %#x", lookup_me2, magic2);
 
        printf("Before resuming the child process where it left off and "
            "without signal to be sent\n");
@@ -2733,7 +2733,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me1, magic1,
-           "got value %x != expected %x", lookup_me1, magic1);
+           "got value %#x != expected %#x", lookup_me1, magic1);
 
        printf("Read new lookup_me2 from tracee (PID=%d) by tracer (PID=%d)\n",
            child, getpid());
@@ -2742,7 +2742,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me2, magic2,
-           "got value %x != expected %x", lookup_me2, magic2);
+           "got value %#x != expected %#x", lookup_me2, magic2);
 
        printf("Read new lookup_me3 from tracee (PID=%d) by tracer (PID=%d)\n",
            child, getpid());
@@ -2751,7 +2751,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me3, magic3,
-           "got value %x != expected %x", lookup_me3, magic3);
+           "got value %#x != expected %#x", lookup_me3, magic3);
 
        printf("Before resuming the child process where it left off and "
            "without signal to be sent\n");
@@ -2821,7 +2821,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me1, magic1,
-           "got value %x != expected %x", lookup_me1, magic1);
+           "got value %#x != expected %#x", lookup_me1, magic1);
 
        printf("Read new lookup_me2 from tracee (PID=%d) by tracer (PID=%d)\n",
            child, getpid());
@@ -2830,7 +2830,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me2, magic2,
-           "got value %x != expected %x", lookup_me2, magic2);
+           "got value %#x != expected %#x", lookup_me2, magic2);
 
        printf("Read new lookup_me3 from tracee (PID=%d) by tracer (PID=%d)\n",
            child, getpid());
@@ -2839,7 +2839,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me3, magic3,
-           "got value %x != expected %x", lookup_me3, magic3);
+           "got value %#x != expected %#x", lookup_me3, magic3);
 
        printf("Read new lookup_me4 from tracee (PID=%d) by tracer (PID=%d)\n",
            child, getpid());
@@ -2848,7 +2848,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me4, magic4,
-           "got value %x != expected %x", lookup_me4, magic4);
+           "got value %#x != expected %#x", lookup_me4, magic4);
 
        printf("Before resuming the child process where it left off and "
            "without signal to be sent\n");
@@ -3352,7 +3352,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me_fromtracee, magic_fromtracee,
-           "got value %x != expected %x", lookup_me_fromtracee,
+           "got value %#x != expected %#x", lookup_me_fromtracee,
            magic_fromtracee);
 
        printf("Write new lookup_me_totracee to PID=%d from tracer (PID=%d)\n",
@@ -3431,7 +3431,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me_fromtracee, magic_fromtracee,
-           "got value %x != expected %x", lookup_me_fromtracee,
+           "got value %#x != expected %#x", lookup_me_fromtracee,
            magic_fromtracee);
 
        printf("Before resuming the child process where it left off and "
@@ -3797,7 +3797,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me, magic,
-           "got value %x != expected %x", lookup_me, magic);
+           "got value %#x != expected %#x", lookup_me, magic);
 
        printf("Before resuming the child process where it left off and "
            "without signal to be sent\n");
@@ -3860,7 +3860,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me1, magic1,
-           "got value %x != expected %x", lookup_me1, magic1);
+           "got value %#x != expected %#x", lookup_me1, magic1);
 
        printf("Read new lookup_me2 from tracee (PID=%d) by tracer (PID=%d)\n",
            child, getpid());
@@ -3869,7 +3869,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me2, magic2,
-           "got value %x != expected %x", lookup_me2, magic2);
+           "got value %#x != expected %#x", lookup_me2, magic2);
 
        printf("Before resuming the child process where it left off and "
            "without signal to be sent\n");
@@ -3935,7 +3935,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me1, magic1,
-           "got value %x != expected %x", lookup_me1, magic1);
+           "got value %#x != expected %#x", lookup_me1, magic1);
 
        printf("Read new lookup_me2 from tracee (PID=%d) by tracer (PID=%d)\n",
            child, getpid());
@@ -3944,7 +3944,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me2, magic2,
-           "got value %x != expected %x", lookup_me2, magic2);
+           "got value %#x != expected %#x", lookup_me2, magic2);
 
        printf("Read new lookup_me3 from tracee (PID=%d) by tracer (PID=%d)\n",
            child, getpid());
@@ -3953,7 +3953,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me3, magic3,
-           "got value %x != expected %x", lookup_me3, magic3);
+           "got value %#x != expected %#x", lookup_me3, magic3);
 
        printf("Before resuming the child process where it left off and "
            "without signal to be sent\n");
@@ -4022,7 +4022,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me1, magic1,
-           "got value %x != expected %x", lookup_me1, magic1);
+           "got value %#x != expected %#x", lookup_me1, magic1);
 
        printf("Read new lookup_me2 from tracee (PID=%d) by tracer (PID=%d)\n",
            child, getpid());
@@ -4031,7 +4031,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me2, magic2,
-           "got value %x != expected %x", lookup_me2, magic2);
+           "got value %#x != expected %#x", lookup_me2, magic2);
 
        printf("Read new lookup_me3 from tracee (PID=%d) by tracer (PID=%d)\n",
            child, getpid());
@@ -4040,7 +4040,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me3, magic3,
-           "got value %x != expected %x", lookup_me3, magic3);
+           "got value %#x != expected %#x", lookup_me3, magic3);
 
        printf("Read new lookup_me4 from tracee (PID=%d) by tracer (PID=%d)\n",
            child, getpid());
@@ -4049,7 +4049,7 @@
        ATF_REQUIRE_EQ(errno, 0);
 
        ATF_REQUIRE_EQ_MSG(lookup_me4, magic4,
-           "got value %x != expected %x", lookup_me4, magic4);
+           "got value %#x != expected %#x", lookup_me4, magic4);
 
        printf("Before resuming the child process where it left off and "
            "without signal to be sent\n");



Home | Main Index | Thread Index | Old Index