/test/lib/io/test_binary_file_write.e
Specman e | 54 lines | 28 code | 5 blank | 21 comment | 0 complexity | bd140d3d38a213bf07148bc19ae62a3f 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_BINARY_FILE_WRITE 5 6insert 7 EIFFELTEST_TOOLS 8 9create {} 10 make 11 12feature {ANY} 13 file_tools: FILE_TOOLS 14 15 make 16 local 17 bfw: BINARY_FILE_WRITE; bfr: BINARY_FILE_READ 18 do 19 create bfw.connect_to("test_binary_file_write.dat") 20 assert(bfw.is_connected) 21 bfw.put_byte(1) 22 bfw.disconnect 23 assert(not bfw.is_connected) 24 create bfr.connect_to("test_binary_file_write.dat") 25 assert(bfr.is_connected) 26 bfr.read_byte 27 assert(bfr.last_byte = 1) 28 assert(not bfr.end_of_input) 29 bfr.read_byte 30 assert(bfr.end_of_input) 31 bfr.disconnect 32 assert(not bfr.is_connected) 33 file_tools.delete("test_binary_file_write.dat") 34 end 35 36end -- class TEST_BINARY_FILE_WRITE 37-- 38-- ------------------------------------------------------------------------------------------------------------------------------ 39-- Copyright notice below. Please read. 40-- 41-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, 42-- as published by the Free Software Foundation; either version 2, or (at your option) any later version. 43-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty 44-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have 45-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free 46-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 47-- 48-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE 49-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE 50-- 51-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN 52-- 53-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr 54-- ------------------------------------------------------------------------------------------------------------------------------