diff options
author | Colin Watson <cjwatson@debian.org> | 2022-02-23 19:05:10 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2022-02-23 19:05:10 +0000 |
commit | 1e0e4e00cee14220a28d7b2bcf52c3a0f428dfc8 (patch) | |
tree | c5930307d7a1330bd6e25be5d303aadbdfd82fe1 /regress/unittests/test_helper | |
parent | 5b7efa842aa1f4dcb1463d1017f1c0d6f92aad66 (diff) | |
parent | 166456cedad3962b83b848b1e9caf80794831f0f (diff) |
Import openssh_8.9p1.orig.tar.gz
Diffstat (limited to 'regress/unittests/test_helper')
-rw-r--r-- | regress/unittests/test_helper/test_helper.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/regress/unittests/test_helper/test_helper.c b/regress/unittests/test_helper/test_helper.c index 9014ce8e4..6461d7ffc 100644 --- a/regress/unittests/test_helper/test_helper.c +++ b/regress/unittests/test_helper/test_helper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: test_helper.c,v 1.12 2019/08/02 01:41:24 djm Exp $ */ +/* $OpenBSD: test_helper.c,v 1.13 2021/12/14 21:25:27 deraadt Exp $ */ /* * Copyright (c) 2011 Damien Miller <djm@mindrot.org> * @@ -20,7 +20,6 @@ #include "includes.h" #include <sys/types.h> -#include <sys/param.h> #include <sys/uio.h> #include <stdarg.h> @@ -44,6 +43,8 @@ # include <vis.h> #endif +#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) + #include "entropy.h" #include "test_helper.h" #include "atomicio.h" @@ -415,8 +416,8 @@ assert_mem(const char *file, int line, const char *a1, const char *a2, r = memcmp(aa1, aa2, l); TEST_CHECK_INT(r, pred); test_header(file, line, a1, a2, "STRING", pred); - aa1_tohex = tohex(aa1, MIN(l, 256)); - aa2_tohex = tohex(aa2, MIN(l, 256)); + aa1_tohex = tohex(aa1, MINIMUM(l, 256)); + aa2_tohex = tohex(aa2, MINIMUM(l, 256)); fprintf(stderr, "%12s = %s (len %zu)\n", a1, aa1_tohex, l); fprintf(stderr, "%12s = %s (len %zu)\n", a2, aa2_tohex, l); free(aa1_tohex); @@ -455,7 +456,7 @@ assert_mem_filled(const char *file, int line, const char *a1, r = memvalcmp(aa1, v, l, &where); TEST_CHECK_INT(r, pred); test_header(file, line, a1, NULL, "MEM_ZERO", pred); - aa1_tohex = tohex(aa1, MIN(l, 20)); + aa1_tohex = tohex(aa1, MINIMUM(l, 20)); fprintf(stderr, "%20s = %s%s (len %zu)\n", a1, aa1_tohex, l > 20 ? "..." : "", l); free(aa1_tohex); |