diff options
author | Noah Goldstein <goldstein.w.n@gmail.com> | 2021-10-21 15:07:18 -0500 |
---|---|---|
committer | Noah Goldstein <goldstein.w.n@gmail.com> | 2021-10-26 16:51:29 -0500 |
commit | d9283b71ac1eaba53d9fff504a5272570f8ea01e (patch) | |
tree | 9d185da766dc4d5694bb469cc20a9d2ac35a4bd3 /string/test-memcmpeq.c | |
parent | 9894127d202d8c0c821d852658057a03ba3cc3d2 (diff) | |
download | glibc-d9283b71ac1eaba53d9fff504a5272570f8ea01e.tar.gz glibc-d9283b71ac1eaba53d9fff504a5272570f8ea01e.tar.xz glibc-d9283b71ac1eaba53d9fff504a5272570f8ea01e.zip |
String: Add tests for __memcmpeq
No bug. This commit adds tests for the new function __memcmpeq. The new tests use the existing tests in 'test-memcmp.c' but relax the result requirement to only check for zero or non-zero returns. All string tests include test-memcmpeq are passing.
Diffstat (limited to 'string/test-memcmpeq.c')
-rw-r--r-- | string/test-memcmpeq.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/string/test-memcmpeq.c b/string/test-memcmpeq.c new file mode 100644 index 0000000000..8889117868 --- /dev/null +++ b/string/test-memcmpeq.c @@ -0,0 +1,21 @@ +/* Test and measure __memcmpeq functions. + Copyright (C) 2012-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <https://www.gnu.org/licenses/>. */ + +#define BAD_RESULT(result, expec) ((!(result)) != (!(expec))) +#define TEST_MEMCMPEQ 1 +#include "test-memcmp.c" |