From bd82d030011cd8b9655e5ded6b6df9343b42a6bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 4 Feb 2015 14:09:54 +0100 Subject: Imported Upstream version 3.22 --- src/tc-strchr2.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/tc-strchr2.c (limited to 'src/tc-strchr2.c') diff --git a/src/tc-strchr2.c b/src/tc-strchr2.c new file mode 100644 index 0000000..6e0eaad --- /dev/null +++ b/src/tc-strchr2.c @@ -0,0 +1,26 @@ +/* + * Behavior Correctness Test for HX_strchr2 + * Copyright Jan Engelhardt, 2013 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the WTF Public License version 2 or + * (at your option) any later version. + */ +#include + +static const char alphabet[] = "abcdefghijklmnopqrstuvwxyz"; + +int main(void) +{ + char *z; + + z = HX_strchr2("qfm!bar", alphabet); + if (z == NULL || *z != '!') + return EXIT_FAILURE; + + z = HX_strchr2("qfmxbar", alphabet); + if (z != NULL) + return EXIT_FAILURE; + + return EXIT_SUCCESS; +} -- cgit v1.2.3