aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/csharp/friends_runme.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/csharp/friends_runme.cs')
-rw-r--r--Examples/test-suite/csharp/friends_runme.cs23
1 files changed, 22 insertions, 1 deletions
diff --git a/Examples/test-suite/csharp/friends_runme.cs b/Examples/test-suite/csharp/friends_runme.cs
index ae3ffb64f..b2a204157 100644
--- a/Examples/test-suite/csharp/friends_runme.cs
+++ b/Examples/test-suite/csharp/friends_runme.cs
@@ -2,6 +2,11 @@ using System;
using friendsNamespace;
public class friends_runme {
+ private static void check_equal(int a, int b) {
+ if (a != b)
+ throw new Exception("Not equal " + a + " != " + b);
+ }
+
public static void Main() {
A a = new A(2);
@@ -22,7 +27,7 @@ public class friends_runme {
if (friends.mix(a,b) != 5)
throw new Exception("failed");
- D_d di = new D_d(2);
+ D_i di = new D_i(2);
D_d dd = new D_d(3.3);
// incredible template overloading working just fine
@@ -38,6 +43,22 @@ public class friends_runme {
throw new Exception("failed");
if (friends.get_val1(dd) != 1.3)
throw new Exception("failed");
+
+ if (friends.chum_blah() != 1234)
+ throw new Exception("failed");
+ if (friends.mate_blah() != 4321)
+ throw new Exception("failed");
+
+ Foe foe = new Foe(111);
+ check_equal(friends.friend_definition(), 10);
+ check_equal(friends.friend_declaration(), 11);
+ check_equal(friends.friend_args_definition(foe), 111);
+ check_equal(friends.friend_args_declaration(foe), 111);
+
+ check_equal(friends.friend_definition_compiler(), 20);
+ check_equal(friends.friend_declaration_compiler(), 21);
+ check_equal(friends.friend_args_definition_compiler(foe), 111);
+ check_equal(friends.friend_args_declaration_compiler(foe), 111);
}
}