Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@gnome.org>2001-12-18 05:27:47 +0300
committerMiguel de Icaza <miguel@gnome.org>2001-12-18 05:27:47 +0300
commitc09ef084369270b124cce890cf359bafb009f319 (patch)
treed1aa52abc393d679bb76f9001fb4499233386135 /mcs/tests/test-51.cs
parentf3ba3ed51ea5b950c966a15bb2e836136f8fe791 (diff)
Make test-51 part of the default tests
svn path=/trunk/mcs/; revision=1616
Diffstat (limited to 'mcs/tests/test-51.cs')
-rwxr-xr-xmcs/tests/test-51.cs54
1 files changed, 44 insertions, 10 deletions
diff --git a/mcs/tests/test-51.cs b/mcs/tests/test-51.cs
index 25dfd36c950..3a6257747b6 100755
--- a/mcs/tests/test-51.cs
+++ b/mcs/tests/test-51.cs
@@ -5,11 +5,11 @@ using System;
class Base {
public int b_int_field;
- string b_string_field;
+ public string b_string_field;
- const int b_const_three = 3;
+ public const int b_const_three = 3;
- int b_int_property {
+ public int b_int_property {
get {
return b_int_field;
}
@@ -19,7 +19,7 @@ class Base {
}
}
- string b_get_id ()
+ public string b_get_id ()
{
return "Base";
}
@@ -27,22 +27,56 @@ class Base {
public Base ()
{
b_int_field = 1;
- b_string_field = "string";
+ b_string_field = "base";
}
}
class Derived : Base {
- int b_int_field;
+ new int b_int_field;
+ new string b_string_field;
+ new const int b_const_three = 4;
+ new int b_int_property {
+ get {
+ return b_int_field;
+ }
+
+
+ set {
+ b_int_field = value;
+ }
+
+ }
+
public Derived ()
{
b_int_field = 10;
+ b_string_field = "derived";
}
- void Test ()
+ public int Test ()
{
- Console.WriteLine (" int field: " + b_int_field);
- Console.WriteLine ("base int field: " + base.b_int_field);
+ if (b_int_field != 10)
+ return 1;
+ if (base.b_int_field != 1)
+ return 2;
+ if (base.b_string_field != "base")
+ return 3;
+ if (b_string_field != "derived")
+ return 4;
+ base.b_int_property = 4;
+ if (b_int_property != 10)
+ return 5;
+ if (b_int_property != 10)
+ return 6;
+ if (base.b_int_property != 4)
+ return 7;
+ if (b_const_three != 4)
+ return 8;
+ if (Base.b_const_three != 3)
+ return 9;
+ System.Console.WriteLine ("All tests pass");
+ return 0;
}
}
@@ -50,6 +84,6 @@ class boot {
static int Main ()
{
Derived d = new Derived ();
- return 0;
+ return d.Test ();
}
}