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