Commit 62bccb3f authored by Mathias Hasselmann's avatar Mathias Hasselmann Committed by Mathias Hasselmann
Browse files

Add test for prefix increments in while loops: do { } while (++i < x);

2007-08-20  Mathias Hasselmann  <mathias.hasselmann@gmx.de>

	* tests/test-027.*: Add test for prefix increments
	in while loops: do { } while (++i < x);

svn path=/trunk/; revision=490
parent 078c5edd
2007-08-20 Mathias Hasselmann <mathias.hasselmann@gmx.de>
* tests/test-027.*: Add test for prefix increments
in while loops: do { } while (++i < x);
2007-08-20 Mathias Hasselmann <mathias.hasselmann@gmx.de>
* vala/valacastexpression.vala, gobject/valacodegenerator.vala,
......
Postfix and Prefix Expression Test: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Prefix Increment in Loop Test: 0 1 2 3 4 5 6 7 8 9 10
......@@ -47,14 +47,32 @@ class Maman.Bar {
stdout.printf (" %d", foo + 2);
}
static int main (string[] args) {
static void test_postfix_and_prefix_expressions () {
stdout.printf ("Postfix and Prefix Expression Test: 1");
var bar = new Bar ();
bar.run ();
stdout.printf (" 18\n");
}
static void test_prefix_increment_in_loop () {
stdout.printf ("Prefix Increment in Loop Test: ");
int i = 0, j = 0;
do {
stdout.printf (" %d", i);
j = j + 1;
} while (++i < 10 && j < 15);
stdout.printf (" %d\n", i);
}
static int main (string[] args) {
test_postfix_and_prefix_expressions ();
test_prefix_increment_in_loop ();
return 0;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment