scilab: fix tests having too long identifier names

This commit is contained in:
Simon Marchetto 2014-09-29 14:52:05 +02:00
parent 78360b4d1b
commit 7307d967d0
16 changed files with 97 additions and 45 deletions

View File

@ -4,6 +4,10 @@
%warnfilter(SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR) DirectorTest;
#if defined(SWIGSCILAB)
%rename(DirTest) DirectorTest;
#endif
%apply signed char {char, const char};
%apply const signed char & {const char &};

View File

@ -1,5 +1,5 @@
/* Test %apply for char *, signed char *, unsigned char *
This won't work in all situations, so does not necessarily have to be implemented. See
/* Test %apply for char *, signed char *, unsigned char *
This won't work in all situations, so does not necessarily have to be implemented. See
http://groups.google.com.ai/group/comp.lang.c++.moderated/browse_thread/thread/ad5873ce25d49324/0ae94552452366be?lnk=raot */
%module(directors="1") apply_strings
@ -7,6 +7,11 @@
%warnfilter(SWIGWARN_TYPEMAP_VARIN_UNDEF) DigitsGlobalB;
%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK) DigitsGlobalC;
#if defined(SWIGSCILAB)
%rename(TNum) TNumber;
%rename(DirTest) DirectorTest;
#endif
%apply char * {UCharPtr};
%apply char * {SCharPtr};
%apply const char * {CUCharPtr};
@ -53,12 +58,12 @@ typedef struct {
TAscii DigitsMemberA[20];
TAscii *DigitsMemberB;
} TNumber;
TAscii DigitsGlobalA[20];
TAscii DigitsGlobalB[] = {(unsigned char)'A', (unsigned char)'B', 0};
TAscii *DigitsGlobalC;
%}
%}
// Director test
%feature("director");

View File

@ -1,5 +1,9 @@
%module array_member
#if defined(SWIGSCILAB)
%rename(RayPkt) RayPacketData;
#endif
%inline %{
typedef struct Foo {

View File

@ -1,4 +1,9 @@
%module array_typedef_memberin
#if defined(SWIGSCILAB)
%rename(ExDetail) ExampleDetail;
#endif
%inline %{
typedef short Eight[8];
typedef const short ConstEight[8];

View File

@ -7,6 +7,10 @@ This test case tests that various types of arrays are working.
#include <stdlib.h>
%}
#if defined(SWIGSCILAB)
%rename(ArrSt) ArrayStruct;
#endif
%inline %{
#define ARRAY_LEN 2

View File

@ -2,16 +2,20 @@
%warnfilter(SWIGWARN_RUBY_WRONG_NAME) kMaxIOCTLSpaceParmsSize;
#define kMaxIOCTLSpaceParmsSize 128
#ifdef SWIGSCILAB
%rename(Parms) sm_channel_ix_dump_parms;
#endif
#define kMaxIOCTLSpaceParmsSize 128
%{
#define kMaxIOCTLSpaceParmsSize 128
#define kMaxIOCTLSpaceParmsSize 128
%}
%inline %{
typedef struct sm_channel_ix_dump_parms {
unsigned data[(kMaxIOCTLSpaceParmsSize - ((4*sizeof(int)) + (2*sizeof(unsigned))))/sizeof(unsigned)];
} SM_CHANNEL_IX_DUMP_PARMS;
typedef struct sm_channel_ix_dump_parms {
unsigned data[(kMaxIOCTLSpaceParmsSize - ((4*sizeof(int)) + (2*sizeof(unsigned))))/sizeof(unsigned)];
} SM_CHANNEL_IX_DUMP_PARMS;
%}

View File

@ -1,5 +1,10 @@
// bool typemaps check
%module bools
#if defined(SWIGSCILAB)
%rename(BoolSt) BoolStructure;
#endif
%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK); /* memory leak when setting a ptr/ref variable */
%warnfilter(SWIGWARN_RUBY_WRONG_NAME) constbool; /* Ruby, wrong class name */

View File

@ -4,6 +4,11 @@ This testcase primarily test constant pointers, eg int* const. Only a getter is
%module constant_pointers
#if defined(SWIGSCILAB)
%rename(MbrVar) MemberVariablesTest;
%rename(RetVal) ReturnValuesTest;
#endif
%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK); /* memory leak when setting a ptr/ref variable */
%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK_MSG); /* Setting a pointer/reference variable may leak memory. */

View File

@ -1,5 +1,9 @@
%module enum_missing
#if defined(SWIGSCILAB)
%rename(AvCodecCtx) AVCodecContext;
#endif
// Test when SWIG does not parse the enum definition
%{
enum AVPixelFormat {

View File

@ -1,5 +1,11 @@
%module li_stdint
#if defined(SWIGSCILAB)
%rename(StdI) StdInts;
%rename(StdIf) StdIntFasts;
%rename(StdIl) StdIntLeasts;
#endif
%include <stdint.i>
%inline %{

View File

@ -3,6 +3,7 @@
#if defined(SWIGSCILAB)
%warnfilter(SWIGWARN_LANG_OVERLOAD_SHADOW) ovr_val;
%rename(TestDir) TestDirector;
#endif
%{

View File

@ -1,42 +1,41 @@
exec("swigtest.start", -1);
smallnum = int8(-127);
if CharValFunction(smallnum) <> smallnum then swigtesterror(); end
if CCharValFunction(smallnum) <> smallnum then swigtesterror(); end
if CCharRefFunction(smallnum) <> smallnum then swigtesterror(); end
smallnum = -127;
checkequal(CharValFunction(smallnum), smallnum, "CharValFunction(smallnum)");
checkequal(CCharValFunction(smallnum), smallnum, "CCharValFunction(smallnum)");
checkequal(CCharRefFunction(smallnum), smallnum, "CCharRefFunction(smallnum)");
try
globalchar_set(smallnum);
catch
swigtesterror();
end
if globalchar_get() <> smallnum then swigtesterror(); end
if globalconstchar_get() <> -110 then swigtesterror(); end
checkequal(globalchar_get(), smallnum, "globalchar_get()");
checkequal(globalconstchar_get(), -110, "globalconstchar_get()");
try
directorTest = new_DirectorTest();
dirTest = new_DirTest();
catch
swigtesterror();
end
if DirectorTest_CharValFunction(directorTest, smallnum) <> smallnum then swigtesterror(); end
if DirectorTest_CCharValFunction(directorTest, smallnum) <> smallnum then swigtesterror(); end
if DirectorTest_CCharRefFunction(directorTest, smallnum) <> smallnum then swigtesterror(); end
checkequal(DirTest_CharValFunction(dirTest, smallnum), smallnum, "DirTest_CharValFunction(dirTest, smallnum)");
checkequal(DirTest_CCharValFunction(dirTest, smallnum), smallnum, "DirTest_CCharValFunction(dirTest, smallnum)");
checkequal(DirTest_CCharRefFunction(dirTest, smallnum), smallnum, "DirTest_CCharRefFunction(dirTest, smallnum)");
// TODO Too long identifiers
//if DirectorTest_memberchar_get(directorTest) <> -111 then swigtesterror(); end
//if dirTest_memberchar_get(dirTest) <> -111 then swigtesterror(); end
//try
// DirectorTest_memberchar_set(directorTest, smallnum)
// dirTest_memberchar_set(dirTest, smallnum)
//catch
// swigtesterror();
//end
//if DirectorTest_memberchar_get(directorTest) <> smallnum then swigtesterror(); end
//if dirTest_memberchar_get(dirTest) <> smallnum then swigtesterror(); end
//if DirectorTest_memberconstchar_get(directorTest) <> -112 then swigtesterror(); end
//if dirTest_memberconstchar_get(dirTest) <> -112 then swigtesterror(); end
try
delete_DirectorTest(directorTest);
delete_DirTest(dirTest);
catch
swigtesterror();
end

View File

@ -2,15 +2,15 @@ exec("swigtest.start", -1);
testString = "Scilab test string";
if UCharFunction(testString) <> testString then swigtesterror(); end
if SCharFunction(testString) <> testString then swigtesterror(); end
if CUCharFunction(testString) <> testString then swigtesterror(); end
if CSCharFunction(testString) <> testString then swigtesterror(); end
//if CharFunction(testString) <> testString then swigtesterror(); end
//if CCharFunction(testString) <> testString then swigtesterror(); end
checkequal(UCharFunction(testString), testString, "UCharFunction(testString)");
checkequal(SCharFunction(testString), testString, "SCharFunction(testString)");
checkequal(CUCharFunction(testString), testString, "CUCharFunction(testString)");
checkequal(CSCharFunction(testString), testString, "CSCharFunction(testString)");
//checkequal(CharFunction(testString), testString, "CharFunction(testString)");
//checkequal(CCharFunction(testString), testString, "CCharFunction(testString)");
try
tNumber = new_TNumber()
tNum = new_TNum();
catch
swigtesterror();
end
@ -19,25 +19,25 @@ end
//TNumber_DigitsMemberB_get()
//TNumber_DigitsMemberB_set
try
delete_TNumber(tNumber)
delete_TNum(tNum);
catch
swigtesterror();
end
try
directorTest = new_DirectorTest();
dirTest = new_DirTest();
catch
swigtesterror();
end
if DirectorTest_UCharFunction(directorTest, testString) <> testString then swigtesterror(); end
if DirectorTest_SCharFunction(directorTest, testString) <> testString then swigtesterror(); end
if DirectorTest_CUCharFunction(directorTest, testString) <> testString then swigtesterror(); end
if DirectorTest_CSCharFunction(directorTest, testString) <> testString then swigtesterror(); end
//if DirectorTest_CharFunction(directorTest, testString) <> testString then swigtesterror(); end
//if DirectorTest_CCharFunction(directorTest, testString) <> testString then swigtesterror(); end
checkequal(DirTest_UCharFunction(dirTest, testString), testString, "DirTest_UCharFunction");
checkequal(DirTest_SCharFunction(dirTest, testString), testString, "DirTest_SCharFunction(dirTest, testString)");
checkequal(DirTest_CUCharFunction(dirTest, testString), testString, "DirTest_CUCharFunction(dirTest, testString)");
checkequal(DirTest_CSCharFunction(dirTest, testString), testString, "DirTest_CSharFunction(dirTest, testString)");
//checkequal(DirTest_CharFunction(dirTest, testString), testString, "DirTest_CharFunction(dirTest, testString)");
//checkequal(DirTest_CCharFunction(dirTest, testString), testString, "DirTest_CCharFunction(dirTest, testString)");
try
delete_DirectorTest(directorTest);
delete_DirTest(dirTest);
catch
swigtesterror();
end

View File

@ -13,8 +13,8 @@ checkBool(bool2_get(), %f);
checkBool(bo(%t), %t);
checkBool(bo(%f), %f);
bs = new_BoolStructure();
checkBool(BoolStructure_m_bool1_get(bs), %t);
checkBool(BoolStructure_m_bool2_get(bs), %f);
bs = new_BoolSt();
checkBool(BoolSt_m_bool1_get(bs), %t);
checkBool(BoolSt_m_bool2_get(bs), %f);
exec("swigtest.quit", -1);

View File

@ -39,7 +39,6 @@ int too_long_function_identifier_name_2() { return 22; };
struct st {
int m_identifier_name;
int too_long_member_identifier_name;
int too_long_member_function_name() { return 31; };
};
%}

View File

@ -4,6 +4,13 @@ This testcase tests whether the sizeof operator on a pointer is working.
%module sizeof_pointer
#if defined(SWIGSCILAB)
%rename(SizePtrTst) SizeofPointerTest;
#endif
%inline %{
#define NO_PROBLEM sizeof(char)