[vala] Add test for accessing class/static fields from class methods



commit ef3613b5dabd4eae0ad02c73c6e5e0da2d93fdb0
Author: Sebastian Dröge <sebastian droege collabora co uk>
Date:   Tue Sep 1 10:10:48 2009 +0200

    Add test for accessing class/static fields from class methods

 tests/objects/fields.test |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/tests/objects/fields.test b/tests/objects/fields.test
index 7690b6e..855cfad 100644
--- a/tests/objects/fields.test
+++ b/tests/objects/fields.test
@@ -52,11 +52,31 @@ class Maman.Bar : Foo {
 					   private_class_field, public_class_field);
 	}
 
+	class void do_action_class () {
+		stdout.printf (" %d %d %d %d", private_static_field, public_static_field, 
+					   private_class_field, public_class_field);
+		lock (private_static_field) {
+			private_static_field = 12;
+		}
+		lock (public_static_field) {
+			public_static_field = 13;
+		}
+		lock (private_class_field) {
+			private_class_field = 14;
+		}
+		lock (public_class_field) {
+			public_class_field = 15;
+		}
+		stdout.printf (" %d %d %d %d", private_static_field, public_static_field, 
+					   private_class_field, public_class_field);
+	}
+
 	static int main (string[] args) {
 		stdout.printf ("Field Test: 1");
 		
 		var bar = new Bar ();
 		bar.do_action ();
+		bar.do_action_class ();
 
 		bar.public_base_field = 16;
 		bar.public_field = 17;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]