summaryrefslogtreecommitdiff
path: root/regress/lib
diff options
context:
space:
mode:
authorrob <rob@cvs.openbsd.org>2019-03-27 16:22:34 +0000
committerrob <rob@cvs.openbsd.org>2019-03-27 16:22:34 +0000
commitff25e2adc9125d9bf0e25b0cc98d0697ca51e070 (patch)
treeb4fc1efd19cbcd5f8106160971a7eb1516a77e7b /regress/lib
parent7529d4e3eec078742ac288a69066bba23bcda9bb (diff)
Check errno on expected failures. Also fix some output wording.
Diffstat (limited to 'regress/lib')
-rw-r--r--regress/lib/libutil/ber/ber_test.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/regress/lib/libutil/ber/ber_test.c b/regress/lib/libutil/ber/ber_test.c
index 7ef98ddafce..806230ed97e 100644
--- a/regress/lib/libutil/ber/ber_test.c
+++ b/regress/lib/libutil/ber/ber_test.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ber_test.c,v 1.4 2019/03/27 13:28:13 rob Exp $
+/* $OpenBSD: ber_test.c,v 1.5 2019/03/27 16:22:33 rob Exp $
*/
/*
* Copyright (c) Rob Pierce <rob@openbsd.org>
@@ -224,10 +224,11 @@ test(int i)
ber_set_readbuf(&ber, test_vectors[i].input, test_vectors[i].length);
elm = ber_read_elements(&ber, elm);
- if (elm == NULL && test_vectors[i].fail)
+ if (elm == NULL && test_vectors[i].fail &&
+ (errno == EINVAL || errno == ERANGE || errno == ECANCELED))
return 0;
else if (elm != NULL && test_vectors[i].fail) {
- printf("expected failure of ber_read_elements succeeded\n");
+ printf("expected failure of ber_read_elements did not occur\n");
return 1;
} else if (elm == NULL) {
printf("failed ber_read_elements\n");