summaryrefslogtreecommitdiff
path: root/tests/core
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-01-12 23:06:39 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2019-05-19 11:10:08 +0100
commit02683b20c0775dab28d72727cc97a96ec77cb20c (patch)
treeaf4fc1c23a5ca20b94ebdf6b0603b88fff686670 /tests/core
parentc9f116f148c9eb64988eb36ec83d1a653dc81ee0 (diff)
downloadlibgit2-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/core')
-rw-r--r--tests/core/posix.c16
1 files changed, 8 insertions, 8 deletions
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);
}
}