PageRenderTime 40ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/csharp/pointer_reference_runme.cs

#
C# | 21 lines | 13 code | 7 blank | 1 comment | 8 complexity | e0ea3f5e300e749c36fdaa7096892c28 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. // This test tests all the methods in the C# collection wrapper
  2. using System;
  3. using pointer_referenceNamespace;
  4. public class pointer_reference_runme {
  5. public static void Main() {
  6. Struct s = pointer_reference.get();
  7. if (s.value != 10) throw new Exception("get test failed");
  8. Struct ss = new Struct(20);
  9. pointer_reference.set(ss);
  10. if (Struct.instance.value != 20) throw new Exception("set test failed");
  11. if (pointer_reference.overloading(1) != 111) throw new Exception("overload test 1 failed");
  12. if (pointer_reference.overloading(ss) != 222) throw new Exception("overload test 2 failed");
  13. }
  14. }