Duplicate tests that are run twice as both C and C++ tests to fix parallel make: li_cdata
This commit is contained in:
parent
9600c95234
commit
819bd9c97e
5 changed files with 55 additions and 1 deletions
|
|
@ -265,7 +265,7 @@ CPP_TEST_CASES += \
|
|||
li_boost_shared_ptr_template \
|
||||
li_boost_shared_ptr_attribute \
|
||||
li_carrays_cpp \
|
||||
li_cdata \
|
||||
li_cdata_cpp \
|
||||
li_cpointer \
|
||||
li_std_auto_ptr \
|
||||
li_stdint \
|
||||
|
|
|
|||
13
Examples/test-suite/go/li_cdata_cpp_runme.go
Normal file
13
Examples/test-suite/go/li_cdata_cpp_runme.go
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package main
|
||||
|
||||
import . "./li_cdata_cpp"
|
||||
|
||||
func main() {
|
||||
s := "ABC abc"
|
||||
m := Malloc(256)
|
||||
Memmove(m, s, len(s))
|
||||
ss := Cdata(m, 7)
|
||||
if string(ss) != "ABC abc" {
|
||||
panic("failed")
|
||||
}
|
||||
}
|
||||
24
Examples/test-suite/java/li_cdata_cpp_runme.java
Normal file
24
Examples/test-suite/java/li_cdata_cpp_runme.java
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import li_cdata_cpp.*;
|
||||
|
||||
public class li_cdata_cpp_runme {
|
||||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("li_cdata_cpp");
|
||||
} 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.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String argv[]) throws Throwable
|
||||
{
|
||||
byte[] s = "ABC abc".getBytes();
|
||||
SWIGTYPE_p_void m = li_cdata_cpp.malloc(256);
|
||||
li_cdata_cpp.memmove(m, s);
|
||||
byte[] ss = li_cdata_cpp.cdata(m, 7);
|
||||
String ss_string = new String(ss);
|
||||
if (!ss_string.equals("ABC abc"))
|
||||
throw new RuntimeException("failed got: " + ss_string);
|
||||
}
|
||||
}
|
||||
8
Examples/test-suite/li_cdata_cpp.i
Normal file
8
Examples/test-suite/li_cdata_cpp.i
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
%module li_cdata_cpp
|
||||
|
||||
%include <cdata.i>
|
||||
|
||||
%cdata(int);
|
||||
%cdata(double);
|
||||
|
||||
void *malloc(size_t size);
|
||||
9
Examples/test-suite/python/li_cdata_cpp_runme.py
Normal file
9
Examples/test-suite/python/li_cdata_cpp_runme.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
|
||||
from li_cdata_cpp import *
|
||||
|
||||
s = "ABC abc"
|
||||
m = malloc(256)
|
||||
memmove(m, s)
|
||||
ss = cdata(m, 7)
|
||||
if ss != "ABC abc":
|
||||
raise "failed"
|
||||
Loading…
Add table
Add a link
Reference in a new issue