reverse merge last commit - 11348

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11349 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2009-07-02 22:40:49 +00:00
commit 9fe205d0f1
8 changed files with 27 additions and 28 deletions

View file

@ -9,8 +9,7 @@
# then builds the object code for use by the language. # then builds the object code for use by the language.
# To complete a test in a language follow these guidelines: # To complete a test in a language follow these guidelines:
# 1) Add testcases to CPP_TEST_CASES (c++) or C_TEST_CASES (c) or # 1) Add testcases to CPP_TEST_CASES (c++) or C_TEST_CASES (c) or
# MULTI_CPP_TEST_CASES (multi-module c++ tests) or # MULTI_CPP_TEST_CASES (multi-module c++ tests)
# CUSTOM_TEST_CASES (mainly for customised SWIG comandline options)
# 2) If not already done, create a makefile which: # 2) If not already done, create a makefile which:
# a) Defines LANGUAGE matching a language rule in Examples/Makefile, # a) Defines LANGUAGE matching a language rule in Examples/Makefile,
# for example LANGUAGE = java # for example LANGUAGE = java
@ -472,8 +471,8 @@ MULTI_CPP_TEST_CASES += \
# Non standard testcases, usually using custom commandline options # Non standard testcases, usually using custom commandline options
# Testcase names are prefixed with custom_ and can be run individually using make testcase.customtest # Testcase names are prefixed with custom_ and can be run individually using make testcase.customtest
CUSTOM_TEST_CASES += \ CUSTOM_TEST_CASES = \
custom_wallkw \ custom_allkw \
# individual custom tests - any kind of customisation allowed here # individual custom tests - any kind of customisation allowed here
# Note: $(basename $@) strips everything after and including the . in the target name # Note: $(basename $@) strips everything after and including the . in the target name

View file

@ -22,8 +22,8 @@ CPP_TEST_CASES = \
exception_partial_info exception_partial_info
CUSTOM_TEST_CASES = \ CUSTOM_TEST_CASES = \
custom_csharp_lib_arrays \ csharp_lib_arrays \
custom_intermediary_classname intermediary_classname
include $(srcdir)/../common.mk include $(srcdir)/../common.mk
@ -50,9 +50,9 @@ CSHARPFLAGSSPECIAL =
+$(run_testcase) +$(run_testcase)
# Rules for custom tests # Rules for custom tests
custom_intermediary_classname.customtest: intermediary_classname.customtest:
$(MAKE) $(basename $@).cpptest SWIGOPTCUSTOM="-dllimport custom_intermediary_classname" $(MAKE) $(basename $@).cpptest SWIGOPTCUSTOM="-dllimport intermediary_classname"
custom_csharp_lib_arrays.customtest: csharp_lib_arrays.customtest:
$(MAKE) $(basename $@).cpptest CSHARPFLAGSSPECIAL="-unsafe" $(MAKE) $(basename $@).cpptest CSHARPFLAGSSPECIAL="-unsafe"
# Makes a directory for the testcase if it does not exist # Makes a directory for the testcase if it does not exist

View file

@ -1,5 +1,5 @@
using System; using System;
using custom_csharp_lib_arraysNamespace; using csharp_lib_arraysNamespace;
public class runme public class runme
{ {
@ -9,7 +9,7 @@ public class runme
int[] source = { 1, 2, 3, 4, 5 }; int[] source = { 1, 2, 3, 4, 5 };
int[] target = new int[ source.Length ]; int[] target = new int[ source.Length ];
custom_csharp_lib_arrays.myArrayCopy( source, target, target.Length ); csharp_lib_arrays.myArrayCopy( source, target, target.Length );
CompareArrays(source, target); CompareArrays(source, target);
} }
@ -17,7 +17,7 @@ public class runme
int[] source = { 1, 2, 3, 4, 5 }; int[] source = { 1, 2, 3, 4, 5 };
int[] target = new int[ source.Length ]; int[] target = new int[ source.Length ];
custom_csharp_lib_arrays.myArrayCopyUsingFixedArrays( source, target, target.Length ); csharp_lib_arrays.myArrayCopyUsingFixedArrays( source, target, target.Length );
CompareArrays(source, target); CompareArrays(source, target);
} }
@ -25,7 +25,7 @@ public class runme
int[] source = { 1, 2, 3, 4, 5 }; int[] source = { 1, 2, 3, 4, 5 };
int[] target = new int[] { 6, 7, 8, 9, 10 }; int[] target = new int[] { 6, 7, 8, 9, 10 };
custom_csharp_lib_arrays.myArraySwap( source, target, target.Length ); csharp_lib_arrays.myArraySwap( source, target, target.Length );
for (int i=0; i<target.Length; ++i) for (int i=0; i<target.Length; ++i)
target[i] += 5; target[i] += 5;
@ -36,7 +36,7 @@ public class runme
int[] source = { 1, 2, 3, 4, 5 }; int[] source = { 1, 2, 3, 4, 5 };
int[] target = new int[] { 6, 7, 8, 9, 10 }; int[] target = new int[] { 6, 7, 8, 9, 10 };
custom_csharp_lib_arrays.myArraySwapUsingFixedArrays( source, target, target.Length ); csharp_lib_arrays.myArraySwapUsingFixedArrays( source, target, target.Length );
for (int i=0; i<target.Length; ++i) for (int i=0; i<target.Length; ++i)
target[i] += 5; target[i] += 5;

View file

@ -1,21 +1,21 @@
/*********************************************************************************************** /***********************************************************************************************
NOTE: This is a custom testcase and should be run using make custom_intermediary_classname.customtest NOTE: This is a custom testcase and should be run using make intermediary_classname.customtest
***********************************************************************************************/ ***********************************************************************************************/
using System; using System;
using custom_intermediary_classnameNamespace; using intermediary_classnameNamespace;
public class runme public class runme
{ {
static void Main() static void Main()
{ {
// test the renamed module class is correctly named // test the renamed module class is correctly named
double d = custom_intermediary_classnameModule.maxdouble(10.0, 20.0); double d = intermediary_classnameModule.maxdouble(10.0, 20.0);
if (d!=20.0) throw new Exception("Test failed"); if (d!=20.0) throw new Exception("Test failed");
// test the renamed intermediary class is correctly named // test the renamed intermediary class is correctly named
IntPtr ptr = custom_intermediary_classname.new_vecdouble(10); IntPtr ptr = intermediary_classname.new_vecdouble(10);
custom_intermediary_classname.delete_vecdouble(new System.Runtime.InteropServices.HandleRef(null,ptr)); intermediary_classname.delete_vecdouble(new System.Runtime.InteropServices.HandleRef(null,ptr));
} }
} }

View file

@ -1,4 +1,4 @@
%module custom_csharp_lib_arrays %module csharp_lib_arrays
%include "arrays_csharp.i" %include "arrays_csharp.i"

View file

@ -1,6 +1,6 @@
// This test is to check the intermediary class name can be changed (C# and Java only use intermediary classes at time of writing) // This test is to check the intermediary class name can be changed (C# and Java only use intermediary classes at time of writing)
%module(directors="1", jniclassname="custom_intermediary_classname", imclassname="custom_intermediary_classname") "custom_intermediary_classname" %module(directors="1", jniclassname="intermediary_classname", imclassname="intermediary_classname") "intermediary_classname"
%warnfilter(SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR); %warnfilter(SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR);

View file

@ -19,7 +19,7 @@ CPP_TEST_CASES = \
enum_thorough_simple \ enum_thorough_simple \
enum_thorough_typeunsafe \ enum_thorough_typeunsafe \
exception_partial_info \ exception_partial_info \
custom_intermediary_classname \ intermediary_classname \
java_constants \ java_constants \
java_director \ java_director \
java_enums \ java_enums \

View file

@ -1,10 +1,10 @@
import custom_intermediary_classname.*; import intermediary_classname.*;
public class custom_intermediary_classname_runme { public class intermediary_classname_runme {
static { static {
try { try {
System.loadLibrary("custom_intermediary_classname"); System.loadLibrary("intermediary_classname");
} catch (UnsatisfiedLinkError e) { } catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e); System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
System.exit(1); System.exit(1);
@ -14,11 +14,11 @@ public class custom_intermediary_classname_runme {
public static void main(String argv[]) public static void main(String argv[])
{ {
// test the renamed module class is correctly named // test the renamed module class is correctly named
double d = custom_intermediary_classnameModule.maxdouble(10.0, 20.0); double d = intermediary_classnameModule.maxdouble(10.0, 20.0);
if (d!=20.0) throw new RuntimeException("Test failed"); if (d!=20.0) throw new RuntimeException("Test failed");
// test the renamed intermediary class is correctly named // test the renamed intermediary class is correctly named
long ptr = custom_intermediary_classname.new_vecdouble(10); long ptr = intermediary_classname.new_vecdouble(10);
custom_intermediary_classname.delete_vecdouble(ptr); intermediary_classname.delete_vecdouble(ptr);
} }
} }