/src/wrappers/common/test/test_const_string.e
Specman e | 62 lines | 36 code | 11 blank | 15 comment | 0 complexity | 7c1eb2641ee5e64895e91add1c41033b MD5 | raw file
1class TEST_CONST_STRING 2 3inherit 4 EIFFELTEST_TOOLS 5 6create {ANY} 7 make 8 9feature {ANY} 10 make 11 local 12 cs: CONST_STRING; s: STRING 13 do 14 s := "teststring" 15 create cs.from_external(const_s_ptr) 16 17 assert(cs.count = 10) 18 assert(s.is_equal(cs)) 19 assert(s <= cs) 20 assert(s >= cs) 21 assert(cs > "test") 22 assert(cs >= "test") 23 assert(cs <= "teststring-long") 24 assert(cs < "teststring-long") 25 assert(cs.in_range(create {CONST_STRING}.from_external(short_const_s_ptr), create {CONST_STRING}.from_external(long_const_s_ptr))) 26 end 27 28feature {} -- externals 29 const_s_ptr: POINTER 30 external "C macro" 31 alias "%"teststring%"" 32 end 33 34 short_const_s_ptr: POINTER 35 external "C macro" 36 alias "%"test%"" 37 end 38 39 long_const_s_ptr: POINTER 40 external "C macro" 41 alias "%"teststring-long%"" 42 end 43 44end -- class TEST_CONST_STRING 45 46-- Copyright (C) 2009-2017: , 2013 Paolo Redaelli, 2013 Cyril Adrian 47 48-- This library is free software; you can redistribute it and/or 49-- modify it under the terms of the GNU Lesser General Public License 50-- as published by the Free Software Foundation; either version 2.1 of 51-- the License, or (at your option) any later version. 52-- 53-- This library is distributed in the hope that it will be useful, but 54-- WITHOUT ANY WARRANTY; without even the implied warranty of 55-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 56-- Lesser General Public License for more details. 57-- 58-- You should have received a copy of the GNU Lesser General Public 59-- License along with this library; if not, write to the Free Software 60-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 61-- 02110-1301 USA 62