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

/test/language/unclassified/test_overload01.e

http://github.com/tybor/Liberty
Specman e | 74 lines | 42 code | 10 blank | 22 comment | 0 complexity | 6667547b37670e4e162fcf589556e372 MD5 | raw file
 1-- This file is part of SmartEiffel The GNU Eiffel Compiler Tools and Libraries.
 2-- See the Copyright notice at the end of this file.
 3--
 4class TEST_OVERLOAD01
 5   -- C++ operator overloading
 6
 7inherit
 8   EIFFELTEST_TOOLS
 9      redefine default_create
10      end
11
12create {}
13   default_create
14
15feature {ANY} -- Creation
16   default_create
17      do
18         external_object := cpp_new
19         set_value(25)
20         assert(value = 25)
21      end
22
23   set_value (v: INTEGER)
24      do
25         cpp_set_value(external_object, v)
26      end
27
28   value: INTEGER
29      do
30         Result := cpp_value(external_object)
31      end
32
33feature {} -- Implementation
34   external_object: POINTER
35
36   cpp_value (instance: POINTER): INTEGER
37      external "[
38                  C++ [Overload "aux_overload01.h"](): int
39                ]"
40      alias "value"
41      end
42
43   cpp_set_value (instance: POINTER; v: INTEGER)
44      external "[
45                  C++ [Overload "aux_overload01.h"](int)
46                ]"
47      alias "value"
48      end
49
50   cpp_new: POINTER
51      external "[
52                  C++ [new Overload "aux_overload01.h"]()
53                ]"
54      end
55
56end -- class TEST_OVERLOAD01
57--
58-- ------------------------------------------------------------------------------------------------------------------------------
59-- Copyright notice below. Please read.
60--
61-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
62-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
63-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
64-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
65-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
66-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
67--
68-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
69-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
70--
71-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
72--
73-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
74-- ------------------------------------------------------------------------------------------------------------------------------