PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/test/lib/numeric/integer/test_integer7.e

http://github.com/tybor/Liberty
Specman e | 131 lines | 102 code | 5 blank | 24 comment | 1 complexity | 2cbd340bfcd73a38c310d8b366c5ac61 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_INTEGER7
  5   --
  6   -- Test of bit_test.
  7   --
  8
  9create {}
 10   make
 11
 12feature {ANY}
 13   make
 14      local
 15         a8: INTEGER_8
 16      do
 17         assert((0xFF).bit_test(0))
 18         assert((0xFF).bit_test(1))
 19         assert((0xFF).bit_test(2))
 20         assert((0xFF).bit_test(3))
 21         assert((0xFF).bit_test(4))
 22         assert((0xFF).bit_test(5))
 23         assert((0xFF).bit_test(6))
 24         assert((0xFF).bit_test(7))
 25         a8 := 0xff
 26         assert(a8.bit_test(0))
 27         assert(a8.bit_test(1))
 28         assert(a8.bit_test(2))
 29         assert(a8.bit_test(3))
 30         assert(a8.bit_test(4))
 31         assert(a8.bit_test(5))
 32         assert(a8.bit_test(6))
 33         assert(a8.bit_test(7))
 34         assert((0x01).bit_test(0))
 35         assert((0x01).bit_test(1) = False)
 36         assert((0x01).bit_test(2) = False)
 37         assert((0x01).bit_test(3) = False)
 38         assert((0x01).bit_test(4) = False)
 39         assert((0x01).bit_test(5) = False)
 40         assert((0x01).bit_test(6) = False)
 41         assert((0x01).bit_test(7) = False)
 42         assert((0x02).bit_test(0) = False)
 43         assert((0x02).bit_test(1))
 44         assert((0x02).bit_test(2) = False)
 45         assert((0x02).bit_test(3) = False)
 46         assert((0x02).bit_test(4) = False)
 47         assert((0x02).bit_test(5) = False)
 48         assert((0x02).bit_test(6) = False)
 49         assert((0x02).bit_test(7) = False)
 50         assert((0x0002).bit_test(0) = False)
 51         assert((0x0002).bit_test(1))
 52         assert((0x0002).bit_test(2) = False)
 53         assert((0x0002).bit_test(3) = False)
 54         assert((0x0002).bit_test(4) = False)
 55         assert((0x0002).bit_test(5) = False)
 56         assert((0x0002).bit_test(6) = False)
 57         assert((0x0002).bit_test(7) = False)
 58         assert((0x0002).bit_test(8) = False)
 59         assert((0x0002).bit_test(9) = False)
 60         assert((0x0002).bit_test(10) = False)
 61         assert((0x0002).bit_test(11) = False)
 62         assert((0x0002).bit_test(12) = False)
 63         assert((0x0002).bit_test(13) = False)
 64         assert((0x0002).bit_test(14) = False)
 65         assert((0x0002).bit_test(15) = False)
 66         assert((0x0080).bit_test(0) = False)
 67         assert((0x0080).bit_test(1) = False)
 68         assert((0x0080).bit_test(2) = False)
 69         assert((0x0080).bit_test(3) = False)
 70         assert((0x0080).bit_test(4) = False)
 71         assert((0x0080).bit_test(5) = False)
 72         assert((0x0080).bit_test(6) = False)
 73         assert((0x0080).bit_test(7))
 74         assert((0x0080).bit_test(8) = False)
 75         assert((0x0080).bit_test(9) = False)
 76         assert((0x0080).bit_test(10) = False)
 77         assert((0x0080).bit_test(11) = False)
 78         assert((0x0080).bit_test(12) = False)
 79         assert((0x0080).bit_test(13) = False)
 80         assert((0x0080).bit_test(14) = False)
 81         assert((0x0080).bit_test(15) = False)
 82         assert((0x8000).bit_test(0) = False)
 83         assert((0x8000).bit_test(1) = False)
 84         assert((0x8000).bit_test(2) = False)
 85         assert((0x8000).bit_test(3) = False)
 86         assert((0x8000).bit_test(4) = False)
 87         assert((0x8000).bit_test(5) = False)
 88         assert((0x8000).bit_test(6) = False)
 89         assert((0x8000).bit_test(7) = False)
 90         assert((0x8000).bit_test(8) = False)
 91         assert((0x8000).bit_test(9) = False)
 92         assert((0x8000).bit_test(10) = False)
 93         assert((0x8000).bit_test(11) = False)
 94         assert((0x8000).bit_test(12) = False)
 95         assert((0x8000).bit_test(13) = False)
 96         assert((0x8000).bit_test(14) = False)
 97         assert((0x8000).bit_test(15))
 98      end
 99
100   assert (b: BOOLEAN)
101      do
102         cpt := cpt + 1
103         if not b then
104            sedb_breakpoint
105            std_output.put_string("TEST_INTEGER7: ERROR Test # ")
106            std_output.put_integer(cpt)
107            std_output.put_string("%N")
108         end
109      end
110
111   cpt: INTEGER
112
113end -- class TEST_INTEGER7
114--
115-- ------------------------------------------------------------------------------------------------------------------------------
116-- Copyright notice below. Please read.
117--
118-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
119-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
120-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
121-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
122-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
123-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
124--
125-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
126-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
127--
128-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
129--
130-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
131-- ------------------------------------------------------------------------------------------------------------------------------