combine array tests in one file
authorJuerg Billeter <j@bitron.ch>
Mon, 21 Jan 2008 20:07:03 +0000 (20:07 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Mon, 21 Jan 2008 20:07:03 +0000 (20:07 +0000)
2008-01-21  Juerg Billeter  <j@bitron.ch>

* tests/Makefile.am, tests/arrays.exp, tests/arrays.vala: combine array
  tests in one file

svn path=/trunk/; revision=877

ChangeLog
tests/Makefile.am
tests/arrays.exp [moved from tests/test-022.exp with 75% similarity]
tests/arrays.vala [moved from tests/test-022.vala with 72% similarity]
tests/test-032.exp [deleted file]
tests/test-032.vala [deleted file]
tests/test-037.exp [deleted file]
tests/test-037.vala [deleted file]

index fbcbdbd..bbce275 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-01-21  Jürg Billeter  <j@bitron.ch>
 
+       * tests/Makefile.am, tests/arrays.exp, tests/arrays.vala: combine array
+         tests in one file
+
+2008-01-21  Jürg Billeter  <j@bitron.ch>
+
        * vala/valasemanticanalyzer.vala: set base_method also in VAPI classes
          for virtual and abstract methods, fixes `base´ access
 
index 4bbfcae..508bb3e 100644 (file)
@@ -31,13 +31,13 @@ TESTS = \
        interfaces.vala \
        interfaces-properties.vala \
        enums.vala \
+       arrays.vala \
        delegates.vala \
        exceptions.vala \
        \
        test-015.vala \
        test-019.vala \
        test-021.vala \
-       test-022.vala \
        test-023.vala \
        test-025.vala \
        test-026.vala \
@@ -45,11 +45,9 @@ TESTS = \
        test-029.vala \
        test-030.vala \
        test-031.vala \
-       test-032.vala \
        test-034.vala \
        test-035.vala \
        test-036.vala \
-       test-037.vala \
        $(NULL)
 
 EXTRA_DIST = \
@@ -72,13 +70,13 @@ EXTRA_DIST = \
        interfaces.exp \
        interfaces-properties.exp \
        enums.exp \
+       arrays.exp \
        delegates.exp \
        exceptions.exp \
        \
        test-015.exp \
        test-019.exp \
        test-021.exp \
-       test-022.exp \
        test-023.exp \
        test-025.exp \
        test-026.exp \
@@ -86,10 +84,8 @@ EXTRA_DIST = \
        test-029.exp \
        test-030.exp \
        test-031.exp \
-       test-032.exp \
        test-034.exp \
        test-035.exp \
        test-036.exp \
-       test-037.exp \
        $(NULL)
 
similarity index 75%
rename from tests/test-022.exp
rename to tests/arrays.exp
index a67af99..a2ee285 100644 (file)
@@ -1,3 +1,5 @@
 One dimensional array creation and assignment: 1 2 3 4 5 6 7 8 9 10 11
 String array creation and assignment: 1 2 3 4 5 6 7 8 9 10 11
 Object array creation and assignment: 1 2 3 4 5 6 7 8 9 10 11
+Array Test: 1 2 3 4 5
+testing switch on strings: 1 2 3 4 5 6 7
similarity index 72%
rename from tests/test-022.vala
rename to tests/arrays.vala
index 6f7a5cc..ce5f715 100644 (file)
@@ -128,5 +128,64 @@ class Maman.Foo : Object {
                test_integer_array ();
                test_string_array ();
                test_object_array ();
+
+               stdout.printf ("Array Test: 1");
+               
+               var bar = new Bar ();
+               bar.run ();
+
+               stdout.printf (" 5\n");
+
+               var tokens = new string[] { "Hello", "World", "this", "is", "Vala", "GNOME", null };
+               var t4 = " 5";
+
+               stdout.printf ("testing switch on strings:");
+
+               foreach (weak string t in tokens) {
+                       switch (t) {
+                               case "Hello":
+                                       stdout.printf (" 1");
+                                       break;
+
+                               case "World":
+                                       stdout.printf (" 2");
+                                       break;
+
+                               case "this":
+                                       stdout.printf (" 3");
+                                       break;
+
+                               case ("is"):
+                                       stdout.printf (" 4");
+                                       break;
+
+                               case tokens[4]:
+                                       stdout.printf (t4);
+                                       tokens[4] = "GNOME";
+                                       t4 = " 6";
+                                       break;
+
+                               default:
+                                       stdout.printf (" 7");
+                                       break;
+                       }
+               }
+
+               tokens[4] = null;
+
+               stdout.printf ("\n");
        }
 }
+
+class Maman.Bar : Object {
+       public int[] foo_numbers () {
+               return new int[3] { 2, 3, 4 };
+       }
+
+       public void run () {
+               foreach (int i in foo_numbers ()) {
+                       stdout.printf (" %d", i);
+               }
+       }
+}
+
diff --git a/tests/test-032.exp b/tests/test-032.exp
deleted file mode 100644 (file)
index 3c6fbf1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Array Test: 1 2 3 4 5
diff --git a/tests/test-032.vala b/tests/test-032.vala
deleted file mode 100644 (file)
index 17d6bd7..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-using GLib;
-
-class Maman.Bar : Object {
-       public int[] foo_numbers () {
-               return new int[3] { 2, 3, 4 };
-       }
-
-       public void run () {
-               foreach (int i in foo_numbers ()) {
-                       stdout.printf (" %d", i);
-               }
-       }
-
-       static int main (string[] args) {
-               stdout.printf ("Array Test: 1");
-               
-               var bar = new Bar ();
-               bar.run ();
-
-               stdout.printf (" 5\n");
-               
-               return 0;
-       }
-}
diff --git a/tests/test-037.exp b/tests/test-037.exp
deleted file mode 100644 (file)
index b0296a3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-testing switch on strings: 1 2 3 4 5 6 7
diff --git a/tests/test-037.vala b/tests/test-037.vala
deleted file mode 100644 (file)
index af3940d..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-using GLib;
-
-class Maman.Bar : Object {
-       static void main () {
-                // FIXME: figure out why "new string[]" is needed (again?)
-               var tokens = new string[] { "Hello", "World", "this", "is", "Vala", "GNOME", null };
-               var t4 = " 5";
-
-               stdout.printf ("testing switch on strings:");
-
-               foreach(weak string t in tokens) {
-                       switch (t) {
-                               case "Hello":
-                                       stdout.printf (" 1");
-                                       break;
-
-                               case "World":
-                                       stdout.printf (" 2");
-                                       break;
-
-                               case "this":
-                                       stdout.printf (" 3");
-                                       break;
-
-                               case ("is"):
-                                       stdout.printf (" 4");
-                                       break;
-
-                               case tokens[4]:
-                                       stdout.printf (t4);
-                                       tokens[4] = "GNOME";
-                                       t4 = " 6";
-                                       break;
-
-                               default:
-                                       stdout.printf (" 7");
-                                       break;
-                       }
-               }
-
-               tokens[4] = null; // FIXME: element access on array takes ownership
-
-               stdout.printf ("\n");
-       }
-}
-