[ 0:01] compiling /home/xrockai/src/divine/nightly/test/libcxx/strings/iter_iter_pointer.pass.cpp [ 0:01] In file included from /home/xrockai/src/divine/nightly/test/libcxx/strings/iter_iter_pointer.pass.cpp:17: [ 0:01] In file included from /dios/libcxx/include/stdio.h:107: [ 0:01] In file included from /dios/include/stdio.h:10: [ 0:01] In file included from /dios/include/_PDCLIB/int.h:16: [ 0:01] /dios/include/_PDCLIB/cdefs.h:69:10: warning: Unsupported _ _cplusplus (__cplusplus) (too new) (supported: ISO/IEC 14882:1997, ISO/IEC 14882:2011). [ 0:01] #warning Unsupported _ _cplusplus (__cplusplus) (too new) (supported: ISO/IEC 14882:1997, ISO/IEC 14882:2011). [ 0:01] ^ [ 0:01] 1 warning generated. [ 0:02] compiling /dios/lib/config/seqklee.bc [ 0:02] setting up pass: functionmeta, options = [ 0:04] setting up pass: fuse-ctors, options = [ 0:04] KLEE: output directory is "/var/obj/divine-nightly/semidbg/test/__test_work_dir.22/_klee_out" [ 0:09] KLEE: Using Z3 solver backend [ 0:09] WARNING: this target does not support the llvm.stacksave intrinsic. [ 0:09] warning: Linking two modules of different target triples: klee_div_zero_check.bc' is 'x86_64-unknown-linux-gnu' whereas 'klee.bc' is 'x86_64-unknown-none-elf' [ 0:09] [ 0:09] KLEE: WARNING: undefined reference to function: _Z10klee_abortv [ 0:16] KLEE: WARNING: undefined reference to function: __dios_tainted_init [ 0:16] KLEE: WARNING: undefined reference to function: klee_free [ 0:16] KLEE: WARNING: undefined reference to function: klee_malloc [ 0:16] KLEE: WARNING ONCE: Using zero size array fix for landingpad instruction filter [ 0:16] i:1 [ 0:16] KLEE: WARNING ONCE: Alignment of memory from call "klee_malloc" is not modelled. Using alignment of 8. [ 0:16] about to __boot:0 [ 0:16] about to run the scheduler:0 [ 0:16] KLEE: WARNING ONCE: calling external: __dios_tainted_init() at /dios/libc/sys/start.cpp:49 5 [ 0:16] KLEE: ERROR: /dios/libc/sys/start.cpp:87: failed external call: __dios_tainted_init [ 0:16] KLEE: NOTE: now ignoring this error at this location [ 0:16] KLEE: ERROR: EXITING ON ERROR: [ 0:17] Error: failed external call: __dios_tainted_init [ 0:17] File: /dios/libc/sys/start.cpp [ 0:17] Line: 87 [ 0:17] assembly.ll line: 117559 [ 0:17] Stack: [ 0:17] #000117559 in __dios_start (l=2, argc=1, argv=94154400949256, envp=94154401001992) at /dios/libc/sys/start.cpp:87 [ 0:17] #100065561 in _ZN6__dios10sched_nullINS_5ClockINS_10NondetKleeINS_4BaseEEEEEE13run_schedulerINS_7ContextEEEvv () at /dios/sys/sched_null.hpp:163 [ 0:17] #200126139 in klee_boot (argc=2, argv=94154354040320) at /dios/arch/klee/boot.c:41 [ 0:17] [ 0:17] [ 0:17] 1 /* TAGS: c++ fin */ [ 0:17] 2 /* CC_OPTS: -std=c++2a */ [ 0:17] 3 /* VERIFY_OPTS: -o nofail:malloc */ [ 0:17] 4 //===----------------------------------------------------------------------===// [ 0:17] 5 // [ 0:17] 6 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. [ 0:17] 7 // See https://llvm.org/LICENSE.txt for license information. [ 0:17] 8 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception [ 0:17] 9 // [ 0:17] 10 //===----------------------------------------------------------------------===// [ 0:17] 11 [ 0:17] 12 // [ 0:17] 13 [ 0:17] 14 // basic_string& [ 0:17] 15 // replace(const_iterator i1, const_iterator i2, const charT* s); [ 0:17] 16 [ 0:17] 17 #include [ 0:17] 18 [ 0:17] 19 #include [ 0:17] 20 #include [ 0:17] 21 #include [ 0:17] 22 [ 0:17] 23 #include "test_macros.h" [ 0:17] 24 #include "min_allocator.h" [ 0:17] 25 [ 0:17] 26 template [ 0:17] 27 void [ 0:17] 28 test(S s, typename S::size_type pos1, typename S::size_type n1, const typename S::value_type* str, S expected) [ 0:17] 29 { [ 0:17] 30 typename S::size_type old_size = s.size(); [ 0:17] 31 typename S::const_iterator first = s.begin() + pos1; [ 0:17] 32 typename S::const_iterator last = s.begin() + pos1 + n1; [ 0:17] 33 typename S::size_type xlen = last - first; [ 0:17] 34 s.replace(first, last, str); [ 0:17] 35 LIBCPP_ASSERT(s.__invariants()); [ 0:17] 36 assert(s == expected); [ 0:17] 37 typename S::size_type rlen = S::traits_type::length(str); [ 0:17] 38 assert(s.size() == old_size - xlen + rlen); [ 0:17] 39 } [ 0:17] 40 [ 0:17] 41 template [ 0:17] 42 void test0() [ 0:17] 43 { [ 0:17] 44 test(S(""), 0, 0, "", S("")); [ 0:17] 45 test(S(""), 0, 0, "12345", S("12345")); [ 0:17] 46 test(S(""), 0, 0, "1234567890", S("1234567890")); [ 0:17] 47 test(S(""), 0, 0, "12345678901234567890", S("12345678901234567890")); [ 0:17] 48 test(S("abcde"), 0, 0, "", S("abcde")); [ 0:17] 49 test(S("abcde"), 0, 0, "12345", S("12345abcde")); [ 0:17] 50 test(S("abcde"), 0, 0, "1234567890", S("1234567890abcde")); [ 0:17] 51 test(S("abcde"), 0, 0, "12345678901234567890", S("12345678901234567890abcde")); [ 0:17] 52 test(S("abcde"), 0, 1, "", S("bcde")); [ 0:17] 53 test(S("abcde"), 0, 1, "12345", S("12345bcde")); [ 0:17] 54 test(S("abcde"), 0, 1, "1234567890", S("1234567890bcde")); [ 0:17] 55 test(S("abcde"), 0, 1, "12345678901234567890", S("12345678901234567890bcde")); [ 0:17] 56 test(S("abcde"), 0, 2, "", S("cde")); [ 0:17] 57 test(S("abcde"), 0, 2, "12345", S("12345cde")); [ 0:17] 58 test(S("abcde"), 0, 2, "1234567890", S("1234567890cde")); [ 0:17] 59 test(S("abcde"), 0, 2, "12345678901234567890", S("12345678901234567890cde")); [ 0:17] 60 test(S("abcde"), 0, 4, "", S("e")); [ 0:17] 61 test(S("abcde"), 0, 4, "12345", S("12345e")); [ 0:17] 62 test(S("abcde"), 0, 4, "1234567890", S("1234567890e")); [ 0:17] 63 test(S("abcde"), 0, 4, "12345678901234567890", S("12345678901234567890e")); [ 0:17] 64 test(S("abcde"), 0, 5, "", S("")); [ 0:17] 65 test(S("abcde"), 0, 5, "12345", S("12345")); [ 0:17] 66 test(S("abcde"), 0, 5, "1234567890", S("1234567890")); [ 0:17] 67 test(S("abcde"), 0, 5, "12345678901234567890", S("12345678901234567890")); [ 0:17] 68 test(S("abcde"), 1, 0, "", S("abcde")); [ 0:17] 69 test(S("abcde"), 1, 0, "12345", S("a12345bcde")); [ 0:17] 70 test(S("abcde"), 1, 0, "1234567890", S("a1234567890bcde")); [ 0:17] 71 test(S("abcde"), 1, 0, "12345678901234567890", S("a12345678901234567890bcde")); [ 0:17] 72 test(S("abcde"), 1, 1, "", S("acde")); [ 0:17] 73 test(S("abcde"), 1, 1, "12345", S("a12345cde")); [ 0:17] 74 test(S("abcde"), 1, 1, "1234567890", S("a1234567890cde")); [ 0:17] 75 test(S("abcde"), 1, 1, "12345678901234567890", S("a12345678901234567890cde")); [ 0:17] 76 test(S("abcde"), 1, 2, "", S("ade")); [ 0:17] 77 test(S("abcde"), 1, 2, "12345", S("a12345de")); [ 0:17] 78 test(S("abcde"), 1, 2, "1234567890", S("a1234567890de")); [ 0:17] 79 test(S("abcde"), 1, 2, "12345678901234567890", S("a12345678901234567890de")); [ 0:17] 80 test(S("abcde"), 1, 3, "", S("ae")); [ 0:17] 81 test(S("abcde"), 1, 3, "12345", S("a12345e")); [ 0:17] 82 test(S("abcde"), 1, 3, "1234567890", S("a1234567890e")); [ 0:17] 83 test(S("abcde"), 1, 3, "12345678901234567890", S("a12345678901234567890e")); [ 0:17] 84 test(S("abcde"), 1, 4, "", S("a")); [ 0:17] 85 test(S("abcde"), 1, 4, "12345", S("a12345")); [ 0:17] 86 test(S("abcde"), 1, 4, "1234567890", S("a1234567890")); [ 0:17] 87 test(S("abcde"), 1, 4, "12345678901234567890", S("a12345678901234567890")); [ 0:17] 88 test(S("abcde"), 2, 0, "", S("abcde")); [ 0:17] 89 test(S("abcde"), 2, 0, "12345", S("ab12345cde")); [ 0:17] 90 test(S("abcde"), 2, 0, "1234567890", S("ab1234567890cde")); [ 0:17] 91 test(S("abcde"), 2, 0, "12345678901234567890", S("ab12345678901234567890cde")); [ 0:17] 92 test(S("abcde"), 2, 1, "", S("abde")); [ 0:17] 93 test(S("abcde"), 2, 1, "12345", S("ab12345de")); [ 0:17] 94 test(S("abcde"), 2, 1, "1234567890", S("ab1234567890de")); [ 0:17] 95 test(S("abcde"), 2, 1, "12345678901234567890", S("ab12345678901234567890de")); [ 0:17] 96 test(S("abcde"), 2, 2, "", S("abe")); [ 0:17] 97 test(S("abcde"), 2, 2, "12345", S("ab12345e")); [ 0:17] 98 test(S("abcde"), 2, 2, "1234567890", S("ab1234567890e")); [ 0:17] 99 test(S("abcde"), 2, 2, "12345678901234567890", S("ab12345678901234567890e")); [ 0:17] 100 test(S("abcde"), 2, 3, "", S("ab")); [ 0:17] 101 test(S("abcde"), 2, 3, "12345", S("ab12345")); [ 0:17] 102 test(S("abcde"), 2, 3, "1234567890", S("ab1234567890")); [ 0:17] 103 test(S("abcde"), 2, 3, "12345678901234567890", S("ab12345678901234567890")); [ 0:17] 104 test(S("abcde"), 4, 0, "", S("abcde")); [ 0:17] 105 test(S("abcde"), 4, 0, "12345", S("abcd12345e")); [ 0:17] 106 test(S("abcde"), 4, 0, "1234567890", S("abcd1234567890e")); [ 0:17] 107 test(S("abcde"), 4, 0, "12345678901234567890", S("abcd12345678901234567890e")); [ 0:17] 108 test(S("abcde"), 4, 1, "", S("abcd")); [ 0:17] 109 test(S("abcde"), 4, 1, "12345", S("abcd12345")); [ 0:17] 110 test(S("abcde"), 4, 1, "1234567890", S("abcd1234567890")); [ 0:17] 111 test(S("abcde"), 4, 1, "12345678901234567890", S("abcd12345678901234567890")); [ 0:17] 112 test(S("abcde"), 5, 0, "", S("abcde")); [ 0:17] 113 test(S("abcde"), 5, 0, "12345", S("abcde12345")); [ 0:17] 114 test(S("abcde"), 5, 0, "1234567890", S("abcde1234567890")); [ 0:17] 115 test(S("abcde"), 5, 0, "12345678901234567890", S("abcde12345678901234567890")); [ 0:17] 116 test(S("abcdefghij"), 0, 0, "", S("abcdefghij")); [ 0:17] 117 test(S("abcdefghij"), 0, 0, "12345", S("12345abcdefghij")); [ 0:17] 118 test(S("abcdefghij"), 0, 0, "1234567890", S("1234567890abcdefghij")); [ 0:17] 119 test(S("abcdefghij"), 0, 0, "12345678901234567890", S("12345678901234567890abcdefghij")); [ 0:17] 120 test(S("abcdefghij"), 0, 1, "", S("bcdefghij")); [ 0:17] 121 test(S("abcdefghij"), 0, 1, "12345", S("12345bcdefghij")); [ 0:17] 122 test(S("abcdefghij"), 0, 1, "1234567890", S("1234567890bcdefghij")); [ 0:17] 123 test(S("abcdefghij"), 0, 1, "12345678901234567890", S("12345678901234567890bcdefghij")); [ 0:17] 124 test(S("abcdefghij"), 0, 5, "", S("fghij")); [ 0:17] 125 test(S("abcdefghij"), 0, 5, "12345", S("12345fghij")); [ 0:17] 126 test(S("abcdefghij"), 0, 5, "1234567890", S("1234567890fghij")); [ 0:17] 127 test(S("abcdefghij"), 0, 5, "12345678901234567890", S("12345678901234567890fghij")); [ 0:17] 128 test(S("abcdefghij"), 0, 9, "", S("j")); [ 0:17] 129 test(S("abcdefghij"), 0, 9, "12345", S("12345j")); [ 0:17] 130 test(S("abcdefghij"), 0, 9, "1234567890", S("1234567890j")); [ 0:17] 131 test(S("abcdefghij"), 0, 9, "12345678901234567890", S("12345678901234567890j")); [ 0:17] 132 test(S("abcdefghij"), 0, 10, "", S("")); [ 0:17] 133 test(S("abcdefghij"), 0, 10, "12345", S("12345")); [ 0:17] 134 test(S("abcdefghij"), 0, 10, "1234567890", S("1234567890")); [ 0:17] 135 test(S("abcdefghij"), 0, 10, "12345678901234567890", S("12345678901234567890")); [ 0:17] 136 test(S("abcdefghij"), 1, 0, "", S("abcdefghij")); [ 0:17] 137 test(S("abcdefghij"), 1, 0, "12345", S("a12345bcdefghij")); [ 0:17] 138 test(S("abcdefghij"), 1, 0, "1234567890", S("a1234567890bcdefghij")); [ 0:17] 139 test(S("abcdefghij"), 1, 0, "12345678901234567890", S("a12345678901234567890bcdefghij")); [ 0:17] 140 test(S("abcdefghij"), 1, 1, "", S("acdefghij")); [ 0:17] 141 test(S("abcdefghij"), 1, 1, "12345", S("a12345cdefghij")); [ 0:17] 142 test(S("abcdefghij"), 1, 1, "1234567890", S("a1234567890cdefghij")); [ 0:17] 143 test(S("abcdefghij"), 1, 1, "12345678901234567890", S("a12345678901234567890cdefghij")); [ 0:17] 144 } [ 0:17] 145 [ 0:17] 146 template [ 0:17] 147 void test1() [ 0:17] 148 { [ 0:17] 149 test(S("abcdefghij"), 1, 4, "", S("afghij")); [ 0:17] 150 test(S("abcdefghij"), 1, 4, "12345", S("a12345fghij")); [ 0:17] 151 test(S("abcdefghij"), 1, 4, "1234567890", S("a1234567890fghij")); [ 0:17] 152 test(S("abcdefghij"), 1, 4, "12345678901234567890", S("a12345678901234567890fghij")); [ 0:17] 153 test(S("abcdefghij"), 1, 8, "", S("aj")); [ 0:17] 154 test(S("abcdefghij"), 1, 8, "12345", S("a12345j")); [ 0:17] 155 test(S("abcdefghij"), 1, 8, "1234567890", S("a1234567890j")); [ 0:17] 156 test(S("abcdefghij"), 1, 8, "12345678901234567890", S("a12345678901234567890j")); [ 0:17] 157 test(S("abcdefghij"), 1, 9, "", S("a")); [ 0:17] 158 test(S("abcdefghij"), 1, 9, "12345", S("a12345")); [ 0:17] 159 test(S("abcdefghij"), 1, 9, "1234567890", S("a1234567890")); [ 0:17] 160 test(S("abcdefghij"), 1, 9, "12345678901234567890", S("a12345678901234567890")); [ 0:17] 161 test(S("abcdefghij"), 5, 0, "", S("abcdefghij")); [ 0:17] 162 test(S("abcdefghij"), 5, 0, "12345", S("abcde12345fghij")); [ 0:17] 163 test(S("abcdefghij"), 5, 0, "1234567890", S("abcde1234567890fghij")); [ 0:17] 164 test(S("abcdefghij"), 5, 0, "12345678901234567890", S("abcde12345678901234567890fghij")); [ 0:17] 165 test(S("abcdefghij"), 5, 1, "", S("abcdeghij")); [ 0:17] 166 test(S("abcdefghij"), 5, 1, "12345", S("abcde12345ghij")); [ 0:17] 167 test(S("abcdefghij"), 5, 1, "1234567890", S("abcde1234567890ghij")); [ 0:17] 168 test(S("abcdefghij"), 5, 1, "12345678901234567890", S("abcde12345678901234567890ghij")); [ 0:17] 169 test(S("abcdefghij"), 5, 2, "", S("abcdehij")); [ 0:17] 170 test(S("abcdefghij"), 5, 2, "12345", S("abcde12345hij")); [ 0:17] 171 test(S("abcdefghij"), 5, 2, "1234567890", S("abcde1234567890hij")); [ 0:17] 172 test(S("abcdefghij"), 5, 2, "12345678901234567890", S("abcde12345678901234567890hij")); [ 0:17] 173 test(S("abcdefghij"), 5, 4, "", S("abcdej")); [ 0:17] 174 test(S("abcdefghij"), 5, 4, "12345", S("abcde12345j")); [ 0:17] 175 test(S("abcdefghij"), 5, 4, "1234567890", S("abcde1234567890j")); [ 0:17] 176 test(S("abcdefghij"), 5, 4, "12345678901234567890", S("abcde12345678901234567890j")); [ 0:17] 177 test(S("abcdefghij"), 5, 5, "", S("abcde")); [ 0:17] 178 test(S("abcdefghij"), 5, 5, "12345", S("abcde12345")); [ 0:17] 179 test(S("abcdefghij"), 5, 5, "1234567890", S("abcde1234567890")); [ 0:17] 180 test(S("abcdefghij"), 5, 5, "12345678901234567890", S("abcde12345678901234567890")); [ 0:17] 181 test(S("abcdefghij"), 9, 0, "", S("abcdefghij")); [ 0:17] 182 test(S("abcdefghij"), 9, 0, "12345", S("abcdefghi12345j")); [ 0:17] 183 test(S("abcdefghij"), 9, 0, "1234567890", S("abcdefghi1234567890j")); [ 0:17] 184 test(S("abcdefghij"), 9, 0, "12345678901234567890", S("abcdefghi12345678901234567890j")); [ 0:17] 185 test(S("abcdefghij"), 9, 1, "", S("abcdefghi")); [ 0:17] 186 test(S("abcdefghij"), 9, 1, "12345", S("abcdefghi12345")); [ 0:17] 187 test(S("abcdefghij"), 9, 1, "1234567890", S("abcdefghi1234567890")); [ 0:17] 188 test(S("abcdefghij"), 9, 1, "12345678901234567890", S("abcdefghi12345678901234567890")); [ 0:17] 189 test(S("abcdefghij"), 10, 0, "", S("abcdefghij")); [ 0:17] 190 test(S("abcdefghij"), 10, 0, "12345", S("abcdefghij12345")); [ 0:17] 191 test(S("abcdefghij"), 10, 0, "1234567890", S("abcdefghij1234567890")); [ 0:17] 192 test(S("abcdefghij"), 10, 0, "12345678901234567890", S("abcdefghij12345678901234567890")); [ 0:17] 193 test(S("abcdefghijklmnopqrst"), 0, 0, "", S("abcdefghijklmnopqrst")); [ 0:17] 194 test(S("abcdefghijklmnopqrst"), 0, 0, "12345", S("12345abcdefghijklmnopqrst")); [ 0:17] 195 test(S("abcdefghijklmnopqrst"), 0, 0, "1234567890", S("1234567890abcdefghijklmnopqrst")); [ 0:17] 196 test(S("abcdefghijklmnopqrst"), 0, 0, "12345678901234567890", S("12345678901234567890abcdefghijklmnopqrst")); [ 0:17] 197 test(S("abcdefghijklmnopqrst"), 0, 1, "", S("bcdefghijklmnopqrst")); [ 0:17] 198 test(S("abcdefghijklmnopqrst"), 0, 1, "12345", S("12345bcdefghijklmnopqrst")); [ 0:17] 199 test(S("abcdefghijklmnopqrst"), 0, 1, "1234567890", S("1234567890bcdefghijklmnopqrst")); [ 0:17] 200 test(S("abcdefghijklmnopqrst"), 0, 1, "12345678901234567890", S("12345678901234567890bcdefghijklmnopqrst")); [ 0:17] 201 test(S("abcdefghijklmnopqrst"), 0, 10, "", S("klmnopqrst")); [ 0:17] 202 test(S("abcdefghijklmnopqrst"), 0, 10, "12345", S("12345klmnopqrst")); [ 0:17] 203 test(S("abcdefghijklmnopqrst"), 0, 10, "1234567890", S("1234567890klmnopqrst")); [ 0:17] 204 test(S("abcdefghijklmnopqrst"), 0, 10, "12345678901234567890", S("12345678901234567890klmnopqrst")); [ 0:17] 205 test(S("abcdefghijklmnopqrst"), 0, 19, "", S("t")); [ 0:17] 206 test(S("abcdefghijklmnopqrst"), 0, 19, "12345", S("12345t")); [ 0:17] 207 test(S("abcdefghijklmnopqrst"), 0, 19, "1234567890", S("1234567890t")); [ 0:17] 208 test(S("abcdefghijklmnopqrst"), 0, 19, "12345678901234567890", S("12345678901234567890t")); [ 0:17] 209 test(S("abcdefghijklmnopqrst"), 0, 20, "", S("")); [ 0:17] 210 test(S("abcdefghijklmnopqrst"), 0, 20, "12345", S("12345")); [ 0:17] 211 test(S("abcdefghijklmnopqrst"), 0, 20, "1234567890", S("1234567890")); [ 0:17] 212 test(S("abcdefghijklmnopqrst"), 0, 20, "12345678901234567890", S("12345678901234567890")); [ 0:17] 213 test(S("abcdefghijklmnopqrst"), 1, 0, "", S("abcdefghijklmnopqrst")); [ 0:17] 214 test(S("abcdefghijklmnopqrst"), 1, 0, "12345", S("a12345bcdefghijklmnopqrst")); [ 0:17] 215 test(S("abcdefghijklmnopqrst"), 1, 0, "1234567890", S("a1234567890bcdefghijklmnopqrst")); [ 0:17] 216 test(S("abcdefghijklmnopqrst"), 1, 0, "12345678901234567890", S("a12345678901234567890bcdefghijklmnopqrst")); [ 0:17] 217 test(S("abcdefghijklmnopqrst"), 1, 1, "", S("acdefghijklmnopqrst")); [ 0:17] 218 test(S("abcdefghijklmnopqrst"), 1, 1, "12345", S("a12345cdefghijklmnopqrst")); [ 0:17] 219 test(S("abcdefghijklmnopqrst"), 1, 1, "1234567890", S("a1234567890cdefghijklmnopqrst")); [ 0:17] 220 test(S("abcdefghijklmnopqrst"), 1, 1, "12345678901234567890", S("a12345678901234567890cdefghijklmnopqrst")); [ 0:17] 221 test(S("abcdefghijklmnopqrst"), 1, 9, "", S("aklmnopqrst")); [ 0:17] 222 test(S("abcdefghijklmnopqrst"), 1, 9, "12345", S("a12345klmnopqrst")); [ 0:17] 223 test(S("abcdefghijklmnopqrst"), 1, 9, "1234567890", S("a1234567890klmnopqrst")); [ 0:17] 224 test(S("abcdefghijklmnopqrst"), 1, 9, "12345678901234567890", S("a12345678901234567890klmnopqrst")); [ 0:17] 225 test(S("abcdefghijklmnopqrst"), 1, 18, "", S("at")); [ 0:17] 226 test(S("abcdefghijklmnopqrst"), 1, 18, "12345", S("a12345t")); [ 0:17] 227 test(S("abcdefghijklmnopqrst"), 1, 18, "1234567890", S("a1234567890t")); [ 0:17] 228 test(S("abcdefghijklmnopqrst"), 1, 18, "12345678901234567890", S("a12345678901234567890t")); [ 0:17] 229 test(S("abcdefghijklmnopqrst"), 1, 19, "", S("a")); [ 0:17] 230 test(S("abcdefghijklmnopqrst"), 1, 19, "12345", S("a12345")); [ 0:17] 231 test(S("abcdefghijklmnopqrst"), 1, 19, "1234567890", S("a1234567890")); [ 0:17] 232 test(S("abcdefghijklmnopqrst"), 1, 19, "12345678901234567890", S("a12345678901234567890")); [ 0:17] 233 test(S("abcdefghijklmnopqrst"), 10, 0, "", S("abcdefghijklmnopqrst")); [ 0:17] 234 test(S("abcdefghijklmnopqrst"), 10, 0, "12345", S("abcdefghij12345klmnopqrst")); [ 0:17] 235 test(S("abcdefghijklmnopqrst"), 10, 0, "1234567890", S("abcdefghij1234567890klmnopqrst")); [ 0:17] 236 test(S("abcdefghijklmnopqrst"), 10, 0, "12345678901234567890", S("abcdefghij12345678901234567890klmnopqrst")); [ 0:17] 237 test(S("abcdefghijklmnopqrst"), 10, 1, "", S("abcdefghijlmnopqrst")); [ 0:17] 238 test(S("abcdefghijklmnopqrst"), 10, 1, "12345", S("abcdefghij12345lmnopqrst")); [ 0:17] 239 test(S("abcdefghijklmnopqrst"), 10, 1, "1234567890", S("abcdefghij1234567890lmnopqrst")); [ 0:17] 240 test(S("abcdefghijklmnopqrst"), 10, 1, "12345678901234567890", S("abcdefghij12345678901234567890lmnopqrst")); [ 0:17] 241 test(S("abcdefghijklmnopqrst"), 10, 5, "", S("abcdefghijpqrst")); [ 0:17] 242 test(S("abcdefghijklmnopqrst"), 10, 5, "12345", S("abcdefghij12345pqrst")); [ 0:17] 243 test(S("abcdefghijklmnopqrst"), 10, 5, "1234567890", S("abcdefghij1234567890pqrst")); [ 0:17] 244 test(S("abcdefghijklmnopqrst"), 10, 5, "12345678901234567890", S("abcdefghij12345678901234567890pqrst")); [ 0:17] 245 test(S("abcdefghijklmnopqrst"), 10, 9, "", S("abcdefghijt")); [ 0:17] 246 test(S("abcdefghijklmnopqrst"), 10, 9, "12345", S("abcdefghij12345t")); [ 0:17] 247 test(S("abcdefghijklmnopqrst"), 10, 9, "1234567890", S("abcdefghij1234567890t")); [ 0:17] 248 test(S("abcdefghijklmnopqrst"), 10, 9, "12345678901234567890", S("abcdefghij12345678901234567890t")); [ 0:17] 249 } [ 0:17] 250 [ 0:17] 251 template [ 0:17] 252 void test2() [ 0:17] 253 { [ 0:17] 254 test(S("abcdefghijklmnopqrst"), 10, 10, "", S("abcdefghij")); [ 0:17] 255 test(S("abcdefghijklmnopqrst"), 10, 10, "12345", S("abcdefghij12345")); [ 0:17] 256 test(S("abcdefghijklmnopqrst"), 10, 10, "1234567890", S("abcdefghij1234567890")); [ 0:17] 257 test(S("abcdefghijklmnopqrst"), 10, 10, "12345678901234567890", S("abcdefghij12345678901234567890")); [ 0:17] 258 test(S("abcdefghijklmnopqrst"), 19, 0, "", S("abcdefghijklmnopqrst")); [ 0:17] 259 test(S("abcdefghijklmnopqrst"), 19, 0, "12345", S("abcdefghijklmnopqrs12345t")); [ 0:17] 260 test(S("abcdefghijklmnopqrst"), 19, 0, "1234567890", S("abcdefghijklmnopqrs1234567890t")); [ 0:17] 261 test(S("abcdefghijklmnopqrst"), 19, 0, "12345678901234567890", S("abcdefghijklmnopqrs12345678901234567890t")); [ 0:17] 262 test(S("abcdefghijklmnopqrst"), 19, 1, "", S("abcdefghijklmnopqrs")); [ 0:17] 263 test(S("abcdefghijklmnopqrst"), 19, 1, "12345", S("abcdefghijklmnopqrs12345")); [ 0:17] 264 test(S("abcdefghijklmnopqrst"), 19, 1, "1234567890", S("abcdefghijklmnopqrs1234567890")); [ 0:17] 265 test(S("abcdefghijklmnopqrst"), 19, 1, "12345678901234567890", S("abcdefghijklmnopqrs12345678901234567890")); [ 0:17] 266 test(S("abcdefghijklmnopqrst"), 20, 0, "", S("abcdefghijklmnopqrst")); [ 0:17] 267 test(S("abcdefghijklmnopqrst"), 20, 0, "12345", S("abcdefghijklmnopqrst12345")); [ 0:17] 268 test(S("abcdefghijklmnopqrst"), 20, 0, "1234567890", S("abcdefghijklmnopqrst1234567890")); [ 0:17] 269 test(S("abcdefghijklmnopqrst"), 20, 0, "12345678901234567890", S("abcdefghijklmnopqrst12345678901234567890")); [ 0:17] 270 } [ 0:17] 271 [ 0:17] 272 int main(int, char**) [ 0:17] 273 { [ 0:17] 274 { [ 0:17] 275 typedef std::string S; [ 0:17] 276 test0(); [ 0:17] 277 test1(); [ 0:17] 278 test2(); [ 0:17] 279 } [ 0:17] 280 #if TEST_STD_VER >= 11 [ 0:17] 281 { [ 0:17] 282 typedef std::basic_string, min_allocator> S; [ 0:17] 283 test0(); [ 0:17] 284 test1(); [ 0:17] 285 test2(); [ 0:17] 286 } [ 0:17] 287 #endif [ 0:17] 288 [ 0:17] 289 { // test replacing into self [ 0:17] 290 typedef std::string S; [ 0:17] 291 S s_short = "123/"; [ 0:17] 292 S s_long = "Lorem ipsum dolor sit amet, consectetur/"; [ 0:17] 293 [ 0:17] 294 s_short.replace(s_short.begin(), s_short.begin(), s_short.c_str()); [ 0:17] 295 assert(s_short == "123/123/"); [ 0:17] 296 s_short.replace(s_short.begin(), s_short.begin(), s_short.c_str()); [ 0:17] 297 assert(s_short == "123/123/123/123/"); [ 0:17] 298 s_short.replace(s_short.begin(), s_short.begin(), s_short.c_str()); [ 0:17] 299 assert(s_short == "123/123/123/123/123/123/123/123/"); [ 0:17] 300 [ 0:17] 301 s_long.replace(s_long.begin(), s_long.begin(), s_long.c_str()); [ 0:17] 302 assert(s_long == "Lorem ipsum dolor sit amet, consectetur/Lorem ipsum dolor sit amet, consectetur/"); [ 0:17] 303 } [ 0:17] 304 [ 0:17] 305 return 0; [ 0:17] 306 } [ 0:17] # no errors were expected but one was found anyway