diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-02-04 14:09:54 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-02-04 14:09:54 +0100 |
commit | bd82d030011cd8b9655e5ded6b6df9343b42a6bd (patch) | |
tree | de82d886dfea0cb7dbb6e80436218a25cb211bc3 /src/tc-strchr2.c |
Imported Upstream version 3.22upstream/3.22
Diffstat (limited to 'src/tc-strchr2.c')
-rw-r--r-- | src/tc-strchr2.c | 26 |
1 files changed, 26 insertions, 0 deletions
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 <libHX/string.h> + +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; +} |