/test/lib/numeric/integer/test_integer5.e
Specman e | 78 lines | 51 code | 5 blank | 22 comment | 1 complexity | a3fb72c770bf590d814ee6d815395bd2 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_INTEGER5 5 6create {} 7 make 8 9feature {ANY} 10 make 11 local 12 a32, b32: INTEGER_32; a64, b64: INTEGER_64 13 do 14 a32 := 0xFFFFF000 15 b32 := a32.bit_shift_left(4) 16 assert(b32 = 0xFFFF0000) 17 a32 := 0xFFFFF000 18 b32 := a32.bit_shift_left(8) 19 assert(b32 = 0xFFF00000) 20 a32 := 0xFFFFF000 21 b32 := a32.bit_shift_left(12) 22 assert(b32 = 0xFF000000) 23 a32 := 0xFFFFF000 24 b32 := a32.bit_shift_left(16) 25 assert(b32 = 0xF0000000) 26 a64 := 0xFFFFF000FFFFF000 27 b64 := a64.bit_shift_left(4) 28 assert(b64 = 0xFFFF000FFFFF0000) 29 a64 := 0xFFFFF000FFFFF000 30 b64 := a64.bit_shift_left(8) 31 assert(b64 = 0xFFF000FFFFF00000) 32 a64 := 0xFFFFF000FFFFF000 33 b64 := a64.bit_shift_left(12) 34 assert(b64 = 0xFF000FFFFF000000) 35 a64 := 0xFFFFF000FFFFF000 36 b64 := a64.bit_shift_left(16) 37 assert(b64 = 0xF000FFFFF0000000) 38 a64 := 0xFFFFF000FFFFF000 39 b64 := a64.bit_shift_left(24) 40 assert(b64 = 0x00FFFFF000000000) 41 a64 := 0xFFFFF000FFFFF000 42 b64 := a64.bit_shift_left(32) 43 assert(b64 = 0xFFFFF00000000000) 44 -- ----------------------------------------------------- 45 end 46 47 assert (b: BOOLEAN) 48 do 49 cpt := cpt + 1 50 if not b then 51 sedb_breakpoint 52 std_output.put_string("TEST_INTEGER5: ERROR Test # ") 53 std_output.put_integer(cpt) 54 std_output.put_string("%N") 55 end 56 end 57 58 cpt: INTEGER 59 60end -- class TEST_INTEGER5 61-- 62-- ------------------------------------------------------------------------------------------------------------------------------ 63-- Copyright notice below. Please read. 64-- 65-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, 66-- as published by the Free Software Foundation; either version 2, or (at your option) any later version. 67-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty 68-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have 69-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free 70-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 71-- 72-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE 73-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE 74-- 75-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN 76-- 77-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr 78-- ------------------------------------------------------------------------------------------------------------------------------