summaryrefslogtreecommitdiff
path: root/Examples/test-suite/arrays_global.i
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2009-08-18 20:56:02 +0000
committerLorry <lorry@roadtrain.codethink.co.uk>2012-09-25 16:59:08 +0000
commit9f8a09ed743cedd9547bf0661d518647966ab114 (patch)
tree9c7803d3b27a8ec22e91792ac7f7932efa128b20 /Examples/test-suite/arrays_global.i
downloadswig-tarball-master.tar.gz
Imported from /srv/lorry/lorry-area/swig-tarball/swig-1.3.40.tar.gz.HEADswig-1.3.40master
Diffstat (limited to 'Examples/test-suite/arrays_global.i')
-rw-r--r--Examples/test-suite/arrays_global.i95
1 files changed, 95 insertions, 0 deletions
diff --git a/Examples/test-suite/arrays_global.i b/Examples/test-suite/arrays_global.i
new file mode 100644
index 0000000..10d29b6
--- /dev/null
+++ b/Examples/test-suite/arrays_global.i
@@ -0,0 +1,95 @@
+/*
+This test case tests that various types of arrays are working.
+*/
+
+%warnfilter(SWIGWARN_TYPEMAP_CHARLEAK,SWIGWARN_TYPEMAP_VARIN_UNDEF);
+
+%module arrays_global
+
+%inline %{
+#define ARRAY_LEN 2
+
+typedef enum {One, Two, Three, Four, Five} finger;
+
+typedef struct {
+ double double_field;
+} SimpleStruct;
+
+char array_c [ARRAY_LEN];
+signed char array_sc[ARRAY_LEN];
+unsigned char array_uc[ARRAY_LEN];
+short array_s [ARRAY_LEN];
+unsigned short array_us[ARRAY_LEN];
+int array_i [ARRAY_LEN];
+unsigned int array_ui[ARRAY_LEN];
+long array_l [ARRAY_LEN];
+unsigned long array_ul[ARRAY_LEN];
+long long array_ll[ARRAY_LEN];
+float array_f [ARRAY_LEN];
+double array_d [ARRAY_LEN];
+SimpleStruct array_struct[ARRAY_LEN];
+SimpleStruct* array_structpointers[ARRAY_LEN];
+int* array_ipointers [ARRAY_LEN];
+finger array_enum[ARRAY_LEN];
+finger* array_enumpointers[ARRAY_LEN];
+const int array_const_i[ARRAY_LEN] = {10, 20};
+
+%}
+
+%inline %{
+
+const char BeginString_FIX44a[8] = "FIX.a.a";
+char BeginString_FIX44b[8] = "FIX.b.b";
+
+const char BeginString_FIX44c[] = "FIX.c.c";
+char BeginString_FIX44d[] = "FIX.d.d";
+
+const char* BeginString_FIX44e = "FIX.e.e";
+const char* const BeginString_FIX44f = "FIX.f.f";
+
+typedef char name[8];
+typedef char namea[];
+
+char* test_a(char hello[8],
+ char hi[],
+ const char chello[8],
+ const char chi[]) {
+ return hi;
+}
+
+char* test_b(name a, const namea b) {
+ return a;
+}
+
+#if 0
+int test_a(int a) {
+ return a;
+}
+
+int test_b(int a) {
+ return a;
+}
+
+#endif
+%}
+
+
+
+#ifdef __cplusplus
+%inline
+{
+
+ struct Material
+ {
+ };
+
+ enum {
+ Size = 32
+ };
+
+ const Material * chitMat[Size];
+ Material hitMat_val[Size];
+ Material *hitMat[Size];
+}
+
+#endif