[PATCH] Test tds_strl* routines on all platforms
"Craig A. Berry" <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <[email protected]> |
The src/replacements/unittests/strings.c failed to build for me on OS X. The test is explicitly using the routines with the tds_ prefix, which don’t exist when we aren’t using replacements. So this change makes them exist for test purposes only in the case where we wouldn’t normally get them. _______________________________________________ FreeTDS mailing list [email protected] http://lists.ibiblio.org/mailman/listinfo/freetds
0001-Test-tds_strl-routines-on-all-platforms.patch
(application/octet-stream, 1.2 KB)
From 11b48e4cc2d531595519f5084bbf65735cd82460 Mon Sep 17 00:00:00 2001 From: "Craig A. Berry" <[email protected]> Date: Fri, 22 Apr 2016 21:00:07 -0500 Subject: [PATCH] Test tds_strl* routines on all platforms. For platforms that have their own strlcat and strlcpy, we were getting link errors trying to build this test because the tds_ versions were undefined. In other words, what we need in the test is the opposite of what we do in replacements.h. --- src/replacements/unittests/strings.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/replacements/unittests/strings.c b/src/replacements/unittests/strings.c index 80faaf5..7bdb373 100644 --- a/src/replacements/unittests/strings.c +++ b/src/replacements/unittests/strings.c @@ -30,11 +30,16 @@ #include "replacements.h" -#if !HAVE_STRLCPY +/* If the system supplies these, we're going to simulate the situation + * where it doesn't so we're always testing our own versions. + */ +#if HAVE_STRLCPY +size_t tds_strlcpy(char *dest, const char *src, size_t len); #include "../strlcpy.c" #endif -#if !HAVE_STRLCAT +#if HAVE_STRLCAT +size_t tds_strlcat(char *dest, const char *src, size_t len); #include "../strlcat.c" #endif -- 2.2.1