summaryrefslogtreecommitdiff
path: root/Examples/test-suite/ruby_naming.i
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2008-11-26 21:35:15 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2008-11-26 21:35:15 +0000
commitdb83e514419ac153574f46935ffee69145ba7b05 (patch)
treee83b2170db3af4f28a5d2e317620976ece23b299 /Examples/test-suite/ruby_naming.i
parent53f786e5a684c3525be67cbbd480f8582155b943 (diff)
downloadswig-db83e514419ac153574f46935ffee69145ba7b05.tar.gz
modify test-suite (barring python atm) to not rely on the -I path to find the input .i file - removes the new warning 125 and sets up the test-suite for testing with ccache. This change required the use of -outcurrentdir and moving the .i files from the language subdirectories to the directory above along with some .i file name changes.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10949 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/test-suite/ruby_naming.i')
-rw-r--r--Examples/test-suite/ruby_naming.i107
1 files changed, 107 insertions, 0 deletions
diff --git a/Examples/test-suite/ruby_naming.i b/Examples/test-suite/ruby_naming.i
new file mode 100644
index 000000000..d8ef50ad3
--- /dev/null
+++ b/Examples/test-suite/ruby_naming.i
@@ -0,0 +1,107 @@
+%module ruby_naming
+
+%predicate predicateMethod();
+%bang bangMethod();
+
+/* This gets mapped to a constant */
+%constant int constant1 = 1;
+
+/* This gets mapped to a constant */
+#define constant2 2
+
+%immutable TestConstants::constant8;
+
+%inline %{
+
+/* ============ Test Constants Names ============== */
+
+/* This gets mapped to a constant */
+#define constant3 3
+
+/* These are all singleton methods */
+const int constant4[2] = {10, 20};
+const int constant5 = 5;
+static const int constant6 = 6;
+
+
+class TestConstants {
+public:
+ TestConstants() : constant7(7) {}
+
+ /* This gets mapped to a method */
+ const int constant7;
+
+ /* This gets mapped to a singleton method, but this is not legal C++ */
+ static const int constant8;
+
+ /* This gets mapped to a method, but this it not legal C++ */
+ /*const int constant9 = 9;*/
+
+ /* This gets mapped to a constant */
+ static const int constant10 = 10;
+};
+
+const int TestConstants::constant8 = 8;
+
+const TestConstants * constant11[5];
+
+
+/* ============ Test Enum ============== */
+typedef enum {Red, Green, Blue} Colors;
+
+
+/* ============ Test Method Names ============== */
+class my_class {
+public:
+ int methodOne()
+ {
+ return 1;
+ }
+
+ int MethodTwo()
+ {
+ return 2;
+ }
+
+ int Method_THREE()
+ {
+ return 3;
+ }
+
+ int Method44_4()
+ {
+ return 4;
+ }
+
+ bool predicateMethod()
+ {
+ return true;
+ }
+
+ bool bangMethod()
+ {
+ return true;
+ }
+ int begin()
+ {
+ return 1;
+ }
+
+ int end()
+ {
+ return 1;
+ }
+
+};
+
+%}
+
+%inline
+{
+ template <class _Type>
+ struct A
+ {
+ };
+}
+
+%template(A_i) A<int>;