PageRenderTime 36ms CodeModel.GetById 27ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
C# | 76 lines | 50 code | 26 blank | 0 comment | 32 complexity | 6bea6a30073f7fa02b449162d62dab7a MD5 | raw file
 1using System;
 2using li_std_wstringNamespace;
 3
 4public class runme
 5{
 6    static void Main() 
 7    {
 8      char y='h';
 9
10      if (li_std_wstring.test_wcvalue(y) != y)
11        throw new Exception("bad string mapping:" + li_std_wstring.test_wcvalue(y));
12
13      if (li_std_wstring.test_wcvalue_w() != 'W')
14        throw new Exception("bad string mapping:" + li_std_wstring.test_wcvalue_w());
15
16      string x="hello";
17
18      if (li_std_wstring.test_ccvalue(x) != x)
19        throw new Exception("bad string mapping");
20
21      if (li_std_wstring.test_cvalue(x) != x)
22        throw new Exception("bad string mapping");
23
24
25      if (li_std_wstring.test_value(x) != x)
26        throw new Exception("bad string mapping: " + x + li_std_wstring.test_value(x));
27
28      if (li_std_wstring.test_const_reference(x) != x)
29        throw new Exception("bad string mapping");
30
31
32      string s = "he";
33      s = s + "llo";
34
35      if (s != x)
36        throw new Exception("bad string mapping: " + s + x);
37
38      if (li_std_wstring.test_value(s) != x)
39        throw new Exception("bad string mapping");
40
41      if (li_std_wstring.test_const_reference(s) != x)
42        throw new Exception("bad string mapping");
43
44      string a = s;
45
46      if (li_std_wstring.test_value(a) != x)
47        throw new Exception("bad string mapping");
48
49      if (li_std_wstring.test_const_reference(a) != x)
50        throw new Exception("bad string mapping");
51
52      string b = " world";
53
54      if (a + b != "hello world")
55        throw new Exception("bad string mapping");
56
57      if (a + " world" != "hello world")
58        throw new Exception("bad string mapping");
59
60      if ("hello" + b != "hello world")
61        throw new Exception("bad string mapping");
62
63      s = "hello world";
64
65      B myB = new B("hi");
66
67      myB.name = "hello";
68      if (myB.name != "hello")
69        throw new Exception("bad string mapping");
70
71      myB.a = "hello";
72      if (myB.a != "hello")
73        throw new Exception("bad string mapping");
74    }
75}
76