PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Objective C | 39 lines | 30 code | 9 blank | 0 comment | 4 complexity | f64cbd8069264c3661947c899afc7b7c MD5 | raw file
 1director_nested
 2
 3A=@() subclass(FooBar_int(),
 4	       'do_step',@(self) "A::do_step;",
 5	       'get_value',@(self) "A::get_value");
 6
 7a = A();
 8if (!strcmp(a.step(),"Bar::step;Foo::advance;Bar::do_advance;A::do_step;"))
 9  error("Bad A virtual resolution")
10endif
11
12B=@() subclass(FooBar_int(),
13	       'do_advance',@(self) strcat("B::do_advance;",self.do_step()),
14	       'do_step',@(self) "B::do_step;",
15	       'get_value',@(self) 1);
16
17b = B();
18
19if (!strcmp(b.step(),"Bar::step;Foo::advance;B::do_advance;B::do_step;"))
20  error("Bad B virtual resolution")
21endif
22
23C=@() subclass(FooBar_int(),
24	       'do_advance',@(self) strcat("C::do_advance;",self.FooBar_int.do_advance()),
25	       'do_step',@(self) "C::do_step;",
26	       'get_value',@(self) 2,
27	       'get_name',@(self) strcat(self.FooBar_int.get_name()," hello"));
28
29cc = C();
30c = FooBar_int_get_self(cc);
31c.advance();
32
33if (!strcmp(c.get_name(),"FooBar::get_name hello"))
34  error
35endif
36
37if (!strcmp(c.name(),"FooBar::get_name hello"))
38  error
39endif