Prefer testcase code over build system code for C testcases

This commit is contained in:
William S Fulton 2025-07-26 10:24:23 +01:00
parent a5576af6d1
commit 07ce064814
3 changed files with 7 additions and 1 deletions

View File

@ -99,7 +99,7 @@ FAILING_CPP_TESTS := \
# Ignore warnings about failing to apply typemaps because none are defined:
# usually there is no need for special typemaps in C.
char_binary.cpptest director_binary_string.cpptest li_typemaps.cpptest li_typemaps_apply.cpptest long_long_apply.cpptest: SWIGOPT += -w453
li_typemaps.cpptest li_typemaps_apply.cpptest long_long_apply.cpptest: SWIGOPT += -w453
include $(srcdir)/../common.mk

View File

@ -4,8 +4,11 @@ A test case for testing non null terminated char pointers.
%module char_binary
#if !defined(SWIGC)
/* There is no concept of a higher level binary string in C */
%apply (char *STRING, size_t LENGTH) { (const char *str, size_t len) }
%apply (char *STRING, size_t LENGTH) { (const unsigned char *str, size_t len) }
#endif
%inline %{
struct Test {

View File

@ -2,9 +2,12 @@
%feature("director") Callback;
#if !defined(SWIGC)
/* There is no concept of a higher level binary string in C */
%apply (char *STRING, size_t LENGTH) { (char *dataBufferAA, int sizeAA) };
%apply (char *STRING, size_t LENGTH) { (char *dataBufferBB, int sizeBB) };
%apply (const char *STRING, size_t LENGTH) { (const char *data, size_t datalen) };
#endif
%inline %{
#include <stdlib.h>