PageRenderTime 37ms CodeModel.GetById 30ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/octave/cpp_namespace_runme.m

#
Objective C | 55 lines | 40 code | 15 blank | 0 comment | 13 complexity | 091e3ad09e6dff5bfced20e1f5df8847 MD5 | raw file
 1# Note: This example assumes that namespaces are flattened
 2cpp_namespace
 3
 4n = cpp_namespace.fact(4);
 5if (n != 24)
 6    error("Bad return value!")
 7endif
 8
 9if (cpp_namespace.cvar.Foo != 42)
10    error("Bad variable value!")
11endif
12
13t = cpp_namespace.Test();
14if (!strcmp(t.method(),"Test::method"))
15    error("Bad method return value!")
16endif
17
18if (!strcmp(cpp_namespace.do_method(t),"Test::method"))
19    error("Bad return value!")
20endif
21
22if (!strcmp(cpp_namespace.do_method2(t),"Test::method"))
23    error("Bad return value!")
24endif
25    
26cpp_namespace.weird("hello", 4);
27
28clear t;
29
30t2 = cpp_namespace.Test2();
31t3 = cpp_namespace.Test3();
32t4 = cpp_namespace.Test4();
33t5 = cpp_namespace.Test5();
34
35if (cpp_namespace.foo3(42) != 42)
36    error("Bad return value!")
37endif
38
39if (!strcmp(cpp_namespace.do_method3(t2,40),"Test2::method"))
40    error("Bad return value!")
41endif
42
43if (!strcmp(cpp_namespace.do_method3(t3,40),"Test3::method"))
44    error("Bad return value!")
45endif
46
47if (!strcmp(cpp_namespace.do_method3(t4,40),"Test4::method"))
48    error("Bad return value!")
49endif
50
51if (!strcmp(cpp_namespace.do_method3(t5,40),"Test5::method"))
52    error("Bad return value!")
53endif
54
55