diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2019-01-12 23:06:39 +0000 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-05-19 11:10:08 +0100 |
| commit | 02683b20c0775dab28d72727cc97a96ec77cb20c (patch) | |
| tree | af4fc1c23a5ca20b94ebdf6b0603b88fff686670 /tests | |
| parent | c9f116f148c9eb64988eb36ec83d1a653dc81ee0 (diff) | |
| download | libgit2-02683b20c0775dab28d72727cc97a96ec77cb20c.tar.gz | |
regexec: prefix all regexec function calls with p_
Prefix all the calls to the the regexec family of functions with `p_`.
This allows us to swap out all the regular expression functions with our
own implementation. Move the declarations to `posix_regex.h` for
simpler inclusion.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/clar_libgit2.h | 2 | ||||
| -rw-r--r-- | tests/core/posix.c | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/tests/clar_libgit2.h b/tests/clar_libgit2.h index da6ff2974..5ea62e75e 100644 --- a/tests/clar_libgit2.h +++ b/tests/clar_libgit2.h @@ -3,8 +3,8 @@ #include "clar.h" #include <git2.h> -#include <posix.h> #include "common.h" +#include "posix.h" /** * Replace for `clar_must_pass` that passes the last library error as the diff --git a/tests/core/posix.c b/tests/core/posix.c index 529ee37f7..281285024 100644 --- a/tests/core/posix.c +++ b/tests/core/posix.c @@ -154,7 +154,7 @@ void test_core_posix__utimes(void) void test_core_posix__p_regcomp_ignores_global_locale_ctype(void) { - regex_t preg; + p_regex_t preg; int error = 0; const char* oldlocale = setlocale(LC_CTYPE, NULL); @@ -169,8 +169,8 @@ void test_core_posix__p_regcomp_ignores_global_locale_ctype(void) cl_fail("Expected locale to be switched to multibyte"); } - p_regcomp(&preg, "[\xc0-\xff][\x80-\xbf]", REG_EXTENDED); - regfree(&preg); + p_regcomp(&preg, "[\xc0-\xff][\x80-\xbf]", P_REG_EXTENDED); + p_regfree(&preg); setlocale(LC_CTYPE, oldlocale); @@ -184,14 +184,14 @@ void test_core_posix__p_regcomp_compile_userdiff_regexps(void) for (idx = 0; idx < ARRAY_SIZE(builtin_defs); ++idx) { git_diff_driver_definition ddef = builtin_defs[idx]; int error = 0; - regex_t preg; + p_regex_t preg; - error = p_regcomp(&preg, ddef.fns, REG_EXTENDED | ddef.flags); - regfree(&preg); + error = p_regcomp(&preg, ddef.fns, P_REG_EXTENDED | ddef.flags); + p_regfree(&preg); cl_must_pass(error); - error = p_regcomp(&preg, ddef.words, REG_EXTENDED); - regfree(&preg); + error = p_regcomp(&preg, ddef.words, P_REG_EXTENDED); + p_regfree(&preg); cl_must_pass(error); } } |
