Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
Howard Hinnant | f5256e1 | 2010-05-11 21:36:01 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | // <string> |
| 11 | |
Howard Hinnant | 6e0a1f4 | 2010-08-22 00:47:54 +0000 | [diff] [blame^] | 12 | // basic_string<charT,traits,Allocator>& |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 13 | // replace(iterator i1, iterator i2, const charT* s); |
| 14 | |
| 15 | #include <stdio.h> |
| 16 | |
| 17 | #include <string> |
| 18 | #include <algorithm> |
| 19 | #include <cassert> |
| 20 | |
| 21 | typedef std::string S; |
| 22 | |
| 23 | void |
| 24 | test(S s, S::size_type pos1, S::size_type n1, const S::value_type* str, S expected) |
| 25 | { |
| 26 | S::size_type old_size = s.size(); |
| 27 | S::iterator first = s.begin() + pos1; |
| 28 | S::iterator last = s.begin() + pos1 + n1; |
| 29 | s.replace(first, last, str); |
| 30 | assert(s.__invariants()); |
| 31 | assert(s == expected); |
| 32 | S::size_type xlen = last - first; |
| 33 | S::size_type rlen = S::traits_type::length(str); |
| 34 | assert(s.size() == old_size - xlen + rlen); |
| 35 | } |
| 36 | |
| 37 | void test0() |
| 38 | { |
| 39 | test(S(""), 0, 0, "", S("")); |
| 40 | test(S(""), 0, 0, "12345", S("12345")); |
| 41 | test(S(""), 0, 0, "1234567890", S("1234567890")); |
| 42 | test(S(""), 0, 0, "12345678901234567890", S("12345678901234567890")); |
| 43 | test(S("abcde"), 0, 0, "", S("abcde")); |
| 44 | test(S("abcde"), 0, 0, "12345", S("12345abcde")); |
| 45 | test(S("abcde"), 0, 0, "1234567890", S("1234567890abcde")); |
| 46 | test(S("abcde"), 0, 0, "12345678901234567890", S("12345678901234567890abcde")); |
| 47 | test(S("abcde"), 0, 1, "", S("bcde")); |
| 48 | test(S("abcde"), 0, 1, "12345", S("12345bcde")); |
| 49 | test(S("abcde"), 0, 1, "1234567890", S("1234567890bcde")); |
| 50 | test(S("abcde"), 0, 1, "12345678901234567890", S("12345678901234567890bcde")); |
| 51 | test(S("abcde"), 0, 2, "", S("cde")); |
| 52 | test(S("abcde"), 0, 2, "12345", S("12345cde")); |
| 53 | test(S("abcde"), 0, 2, "1234567890", S("1234567890cde")); |
| 54 | test(S("abcde"), 0, 2, "12345678901234567890", S("12345678901234567890cde")); |
| 55 | test(S("abcde"), 0, 4, "", S("e")); |
| 56 | test(S("abcde"), 0, 4, "12345", S("12345e")); |
| 57 | test(S("abcde"), 0, 4, "1234567890", S("1234567890e")); |
| 58 | test(S("abcde"), 0, 4, "12345678901234567890", S("12345678901234567890e")); |
| 59 | test(S("abcde"), 0, 5, "", S("")); |
| 60 | test(S("abcde"), 0, 5, "12345", S("12345")); |
| 61 | test(S("abcde"), 0, 5, "1234567890", S("1234567890")); |
| 62 | test(S("abcde"), 0, 5, "12345678901234567890", S("12345678901234567890")); |
| 63 | test(S("abcde"), 1, 0, "", S("abcde")); |
| 64 | test(S("abcde"), 1, 0, "12345", S("a12345bcde")); |
| 65 | test(S("abcde"), 1, 0, "1234567890", S("a1234567890bcde")); |
| 66 | test(S("abcde"), 1, 0, "12345678901234567890", S("a12345678901234567890bcde")); |
| 67 | test(S("abcde"), 1, 1, "", S("acde")); |
| 68 | test(S("abcde"), 1, 1, "12345", S("a12345cde")); |
| 69 | test(S("abcde"), 1, 1, "1234567890", S("a1234567890cde")); |
| 70 | test(S("abcde"), 1, 1, "12345678901234567890", S("a12345678901234567890cde")); |
| 71 | test(S("abcde"), 1, 2, "", S("ade")); |
| 72 | test(S("abcde"), 1, 2, "12345", S("a12345de")); |
| 73 | test(S("abcde"), 1, 2, "1234567890", S("a1234567890de")); |
| 74 | test(S("abcde"), 1, 2, "12345678901234567890", S("a12345678901234567890de")); |
| 75 | test(S("abcde"), 1, 3, "", S("ae")); |
| 76 | test(S("abcde"), 1, 3, "12345", S("a12345e")); |
| 77 | test(S("abcde"), 1, 3, "1234567890", S("a1234567890e")); |
| 78 | test(S("abcde"), 1, 3, "12345678901234567890", S("a12345678901234567890e")); |
| 79 | test(S("abcde"), 1, 4, "", S("a")); |
| 80 | test(S("abcde"), 1, 4, "12345", S("a12345")); |
| 81 | test(S("abcde"), 1, 4, "1234567890", S("a1234567890")); |
| 82 | test(S("abcde"), 1, 4, "12345678901234567890", S("a12345678901234567890")); |
| 83 | test(S("abcde"), 2, 0, "", S("abcde")); |
| 84 | test(S("abcde"), 2, 0, "12345", S("ab12345cde")); |
| 85 | test(S("abcde"), 2, 0, "1234567890", S("ab1234567890cde")); |
| 86 | test(S("abcde"), 2, 0, "12345678901234567890", S("ab12345678901234567890cde")); |
| 87 | test(S("abcde"), 2, 1, "", S("abde")); |
| 88 | test(S("abcde"), 2, 1, "12345", S("ab12345de")); |
| 89 | test(S("abcde"), 2, 1, "1234567890", S("ab1234567890de")); |
| 90 | test(S("abcde"), 2, 1, "12345678901234567890", S("ab12345678901234567890de")); |
| 91 | test(S("abcde"), 2, 2, "", S("abe")); |
| 92 | test(S("abcde"), 2, 2, "12345", S("ab12345e")); |
| 93 | test(S("abcde"), 2, 2, "1234567890", S("ab1234567890e")); |
| 94 | test(S("abcde"), 2, 2, "12345678901234567890", S("ab12345678901234567890e")); |
| 95 | test(S("abcde"), 2, 3, "", S("ab")); |
| 96 | test(S("abcde"), 2, 3, "12345", S("ab12345")); |
| 97 | test(S("abcde"), 2, 3, "1234567890", S("ab1234567890")); |
| 98 | test(S("abcde"), 2, 3, "12345678901234567890", S("ab12345678901234567890")); |
| 99 | test(S("abcde"), 4, 0, "", S("abcde")); |
| 100 | test(S("abcde"), 4, 0, "12345", S("abcd12345e")); |
| 101 | test(S("abcde"), 4, 0, "1234567890", S("abcd1234567890e")); |
| 102 | test(S("abcde"), 4, 0, "12345678901234567890", S("abcd12345678901234567890e")); |
| 103 | test(S("abcde"), 4, 1, "", S("abcd")); |
| 104 | test(S("abcde"), 4, 1, "12345", S("abcd12345")); |
| 105 | test(S("abcde"), 4, 1, "1234567890", S("abcd1234567890")); |
| 106 | test(S("abcde"), 4, 1, "12345678901234567890", S("abcd12345678901234567890")); |
| 107 | test(S("abcde"), 5, 0, "", S("abcde")); |
| 108 | test(S("abcde"), 5, 0, "12345", S("abcde12345")); |
| 109 | test(S("abcde"), 5, 0, "1234567890", S("abcde1234567890")); |
| 110 | test(S("abcde"), 5, 0, "12345678901234567890", S("abcde12345678901234567890")); |
| 111 | test(S("abcdefghij"), 0, 0, "", S("abcdefghij")); |
| 112 | test(S("abcdefghij"), 0, 0, "12345", S("12345abcdefghij")); |
| 113 | test(S("abcdefghij"), 0, 0, "1234567890", S("1234567890abcdefghij")); |
| 114 | test(S("abcdefghij"), 0, 0, "12345678901234567890", S("12345678901234567890abcdefghij")); |
| 115 | test(S("abcdefghij"), 0, 1, "", S("bcdefghij")); |
| 116 | test(S("abcdefghij"), 0, 1, "12345", S("12345bcdefghij")); |
| 117 | test(S("abcdefghij"), 0, 1, "1234567890", S("1234567890bcdefghij")); |
| 118 | test(S("abcdefghij"), 0, 1, "12345678901234567890", S("12345678901234567890bcdefghij")); |
| 119 | test(S("abcdefghij"), 0, 5, "", S("fghij")); |
| 120 | test(S("abcdefghij"), 0, 5, "12345", S("12345fghij")); |
| 121 | test(S("abcdefghij"), 0, 5, "1234567890", S("1234567890fghij")); |
| 122 | test(S("abcdefghij"), 0, 5, "12345678901234567890", S("12345678901234567890fghij")); |
| 123 | test(S("abcdefghij"), 0, 9, "", S("j")); |
| 124 | test(S("abcdefghij"), 0, 9, "12345", S("12345j")); |
| 125 | test(S("abcdefghij"), 0, 9, "1234567890", S("1234567890j")); |
| 126 | test(S("abcdefghij"), 0, 9, "12345678901234567890", S("12345678901234567890j")); |
| 127 | test(S("abcdefghij"), 0, 10, "", S("")); |
| 128 | test(S("abcdefghij"), 0, 10, "12345", S("12345")); |
| 129 | test(S("abcdefghij"), 0, 10, "1234567890", S("1234567890")); |
| 130 | test(S("abcdefghij"), 0, 10, "12345678901234567890", S("12345678901234567890")); |
| 131 | test(S("abcdefghij"), 1, 0, "", S("abcdefghij")); |
| 132 | test(S("abcdefghij"), 1, 0, "12345", S("a12345bcdefghij")); |
| 133 | test(S("abcdefghij"), 1, 0, "1234567890", S("a1234567890bcdefghij")); |
| 134 | test(S("abcdefghij"), 1, 0, "12345678901234567890", S("a12345678901234567890bcdefghij")); |
| 135 | test(S("abcdefghij"), 1, 1, "", S("acdefghij")); |
| 136 | test(S("abcdefghij"), 1, 1, "12345", S("a12345cdefghij")); |
| 137 | test(S("abcdefghij"), 1, 1, "1234567890", S("a1234567890cdefghij")); |
| 138 | test(S("abcdefghij"), 1, 1, "12345678901234567890", S("a12345678901234567890cdefghij")); |
| 139 | } |
| 140 | |
| 141 | void test1() |
| 142 | { |
| 143 | test(S("abcdefghij"), 1, 4, "", S("afghij")); |
| 144 | test(S("abcdefghij"), 1, 4, "12345", S("a12345fghij")); |
| 145 | test(S("abcdefghij"), 1, 4, "1234567890", S("a1234567890fghij")); |
| 146 | test(S("abcdefghij"), 1, 4, "12345678901234567890", S("a12345678901234567890fghij")); |
| 147 | test(S("abcdefghij"), 1, 8, "", S("aj")); |
| 148 | test(S("abcdefghij"), 1, 8, "12345", S("a12345j")); |
| 149 | test(S("abcdefghij"), 1, 8, "1234567890", S("a1234567890j")); |
| 150 | test(S("abcdefghij"), 1, 8, "12345678901234567890", S("a12345678901234567890j")); |
| 151 | test(S("abcdefghij"), 1, 9, "", S("a")); |
| 152 | test(S("abcdefghij"), 1, 9, "12345", S("a12345")); |
| 153 | test(S("abcdefghij"), 1, 9, "1234567890", S("a1234567890")); |
| 154 | test(S("abcdefghij"), 1, 9, "12345678901234567890", S("a12345678901234567890")); |
| 155 | test(S("abcdefghij"), 5, 0, "", S("abcdefghij")); |
| 156 | test(S("abcdefghij"), 5, 0, "12345", S("abcde12345fghij")); |
| 157 | test(S("abcdefghij"), 5, 0, "1234567890", S("abcde1234567890fghij")); |
| 158 | test(S("abcdefghij"), 5, 0, "12345678901234567890", S("abcde12345678901234567890fghij")); |
| 159 | test(S("abcdefghij"), 5, 1, "", S("abcdeghij")); |
| 160 | test(S("abcdefghij"), 5, 1, "12345", S("abcde12345ghij")); |
| 161 | test(S("abcdefghij"), 5, 1, "1234567890", S("abcde1234567890ghij")); |
| 162 | test(S("abcdefghij"), 5, 1, "12345678901234567890", S("abcde12345678901234567890ghij")); |
| 163 | test(S("abcdefghij"), 5, 2, "", S("abcdehij")); |
| 164 | test(S("abcdefghij"), 5, 2, "12345", S("abcde12345hij")); |
| 165 | test(S("abcdefghij"), 5, 2, "1234567890", S("abcde1234567890hij")); |
| 166 | test(S("abcdefghij"), 5, 2, "12345678901234567890", S("abcde12345678901234567890hij")); |
| 167 | test(S("abcdefghij"), 5, 4, "", S("abcdej")); |
| 168 | test(S("abcdefghij"), 5, 4, "12345", S("abcde12345j")); |
| 169 | test(S("abcdefghij"), 5, 4, "1234567890", S("abcde1234567890j")); |
| 170 | test(S("abcdefghij"), 5, 4, "12345678901234567890", S("abcde12345678901234567890j")); |
| 171 | test(S("abcdefghij"), 5, 5, "", S("abcde")); |
| 172 | test(S("abcdefghij"), 5, 5, "12345", S("abcde12345")); |
| 173 | test(S("abcdefghij"), 5, 5, "1234567890", S("abcde1234567890")); |
| 174 | test(S("abcdefghij"), 5, 5, "12345678901234567890", S("abcde12345678901234567890")); |
| 175 | test(S("abcdefghij"), 9, 0, "", S("abcdefghij")); |
| 176 | test(S("abcdefghij"), 9, 0, "12345", S("abcdefghi12345j")); |
| 177 | test(S("abcdefghij"), 9, 0, "1234567890", S("abcdefghi1234567890j")); |
| 178 | test(S("abcdefghij"), 9, 0, "12345678901234567890", S("abcdefghi12345678901234567890j")); |
| 179 | test(S("abcdefghij"), 9, 1, "", S("abcdefghi")); |
| 180 | test(S("abcdefghij"), 9, 1, "12345", S("abcdefghi12345")); |
| 181 | test(S("abcdefghij"), 9, 1, "1234567890", S("abcdefghi1234567890")); |
| 182 | test(S("abcdefghij"), 9, 1, "12345678901234567890", S("abcdefghi12345678901234567890")); |
| 183 | test(S("abcdefghij"), 10, 0, "", S("abcdefghij")); |
| 184 | test(S("abcdefghij"), 10, 0, "12345", S("abcdefghij12345")); |
| 185 | test(S("abcdefghij"), 10, 0, "1234567890", S("abcdefghij1234567890")); |
| 186 | test(S("abcdefghij"), 10, 0, "12345678901234567890", S("abcdefghij12345678901234567890")); |
| 187 | test(S("abcdefghijklmnopqrst"), 0, 0, "", S("abcdefghijklmnopqrst")); |
| 188 | test(S("abcdefghijklmnopqrst"), 0, 0, "12345", S("12345abcdefghijklmnopqrst")); |
| 189 | test(S("abcdefghijklmnopqrst"), 0, 0, "1234567890", S("1234567890abcdefghijklmnopqrst")); |
| 190 | test(S("abcdefghijklmnopqrst"), 0, 0, "12345678901234567890", S("12345678901234567890abcdefghijklmnopqrst")); |
| 191 | test(S("abcdefghijklmnopqrst"), 0, 1, "", S("bcdefghijklmnopqrst")); |
| 192 | test(S("abcdefghijklmnopqrst"), 0, 1, "12345", S("12345bcdefghijklmnopqrst")); |
| 193 | test(S("abcdefghijklmnopqrst"), 0, 1, "1234567890", S("1234567890bcdefghijklmnopqrst")); |
| 194 | test(S("abcdefghijklmnopqrst"), 0, 1, "12345678901234567890", S("12345678901234567890bcdefghijklmnopqrst")); |
| 195 | test(S("abcdefghijklmnopqrst"), 0, 10, "", S("klmnopqrst")); |
| 196 | test(S("abcdefghijklmnopqrst"), 0, 10, "12345", S("12345klmnopqrst")); |
| 197 | test(S("abcdefghijklmnopqrst"), 0, 10, "1234567890", S("1234567890klmnopqrst")); |
| 198 | test(S("abcdefghijklmnopqrst"), 0, 10, "12345678901234567890", S("12345678901234567890klmnopqrst")); |
| 199 | test(S("abcdefghijklmnopqrst"), 0, 19, "", S("t")); |
| 200 | test(S("abcdefghijklmnopqrst"), 0, 19, "12345", S("12345t")); |
| 201 | test(S("abcdefghijklmnopqrst"), 0, 19, "1234567890", S("1234567890t")); |
| 202 | test(S("abcdefghijklmnopqrst"), 0, 19, "12345678901234567890", S("12345678901234567890t")); |
| 203 | test(S("abcdefghijklmnopqrst"), 0, 20, "", S("")); |
| 204 | test(S("abcdefghijklmnopqrst"), 0, 20, "12345", S("12345")); |
| 205 | test(S("abcdefghijklmnopqrst"), 0, 20, "1234567890", S("1234567890")); |
| 206 | test(S("abcdefghijklmnopqrst"), 0, 20, "12345678901234567890", S("12345678901234567890")); |
| 207 | test(S("abcdefghijklmnopqrst"), 1, 0, "", S("abcdefghijklmnopqrst")); |
| 208 | test(S("abcdefghijklmnopqrst"), 1, 0, "12345", S("a12345bcdefghijklmnopqrst")); |
| 209 | test(S("abcdefghijklmnopqrst"), 1, 0, "1234567890", S("a1234567890bcdefghijklmnopqrst")); |
| 210 | test(S("abcdefghijklmnopqrst"), 1, 0, "12345678901234567890", S("a12345678901234567890bcdefghijklmnopqrst")); |
| 211 | test(S("abcdefghijklmnopqrst"), 1, 1, "", S("acdefghijklmnopqrst")); |
| 212 | test(S("abcdefghijklmnopqrst"), 1, 1, "12345", S("a12345cdefghijklmnopqrst")); |
| 213 | test(S("abcdefghijklmnopqrst"), 1, 1, "1234567890", S("a1234567890cdefghijklmnopqrst")); |
| 214 | test(S("abcdefghijklmnopqrst"), 1, 1, "12345678901234567890", S("a12345678901234567890cdefghijklmnopqrst")); |
| 215 | test(S("abcdefghijklmnopqrst"), 1, 9, "", S("aklmnopqrst")); |
| 216 | test(S("abcdefghijklmnopqrst"), 1, 9, "12345", S("a12345klmnopqrst")); |
| 217 | test(S("abcdefghijklmnopqrst"), 1, 9, "1234567890", S("a1234567890klmnopqrst")); |
| 218 | test(S("abcdefghijklmnopqrst"), 1, 9, "12345678901234567890", S("a12345678901234567890klmnopqrst")); |
| 219 | test(S("abcdefghijklmnopqrst"), 1, 18, "", S("at")); |
| 220 | test(S("abcdefghijklmnopqrst"), 1, 18, "12345", S("a12345t")); |
| 221 | test(S("abcdefghijklmnopqrst"), 1, 18, "1234567890", S("a1234567890t")); |
| 222 | test(S("abcdefghijklmnopqrst"), 1, 18, "12345678901234567890", S("a12345678901234567890t")); |
| 223 | test(S("abcdefghijklmnopqrst"), 1, 19, "", S("a")); |
| 224 | test(S("abcdefghijklmnopqrst"), 1, 19, "12345", S("a12345")); |
| 225 | test(S("abcdefghijklmnopqrst"), 1, 19, "1234567890", S("a1234567890")); |
| 226 | test(S("abcdefghijklmnopqrst"), 1, 19, "12345678901234567890", S("a12345678901234567890")); |
| 227 | test(S("abcdefghijklmnopqrst"), 10, 0, "", S("abcdefghijklmnopqrst")); |
| 228 | test(S("abcdefghijklmnopqrst"), 10, 0, "12345", S("abcdefghij12345klmnopqrst")); |
| 229 | test(S("abcdefghijklmnopqrst"), 10, 0, "1234567890", S("abcdefghij1234567890klmnopqrst")); |
| 230 | test(S("abcdefghijklmnopqrst"), 10, 0, "12345678901234567890", S("abcdefghij12345678901234567890klmnopqrst")); |
| 231 | test(S("abcdefghijklmnopqrst"), 10, 1, "", S("abcdefghijlmnopqrst")); |
| 232 | test(S("abcdefghijklmnopqrst"), 10, 1, "12345", S("abcdefghij12345lmnopqrst")); |
| 233 | test(S("abcdefghijklmnopqrst"), 10, 1, "1234567890", S("abcdefghij1234567890lmnopqrst")); |
| 234 | test(S("abcdefghijklmnopqrst"), 10, 1, "12345678901234567890", S("abcdefghij12345678901234567890lmnopqrst")); |
| 235 | test(S("abcdefghijklmnopqrst"), 10, 5, "", S("abcdefghijpqrst")); |
| 236 | test(S("abcdefghijklmnopqrst"), 10, 5, "12345", S("abcdefghij12345pqrst")); |
| 237 | test(S("abcdefghijklmnopqrst"), 10, 5, "1234567890", S("abcdefghij1234567890pqrst")); |
| 238 | test(S("abcdefghijklmnopqrst"), 10, 5, "12345678901234567890", S("abcdefghij12345678901234567890pqrst")); |
| 239 | test(S("abcdefghijklmnopqrst"), 10, 9, "", S("abcdefghijt")); |
| 240 | test(S("abcdefghijklmnopqrst"), 10, 9, "12345", S("abcdefghij12345t")); |
| 241 | test(S("abcdefghijklmnopqrst"), 10, 9, "1234567890", S("abcdefghij1234567890t")); |
| 242 | test(S("abcdefghijklmnopqrst"), 10, 9, "12345678901234567890", S("abcdefghij12345678901234567890t")); |
| 243 | } |
| 244 | |
| 245 | void test2() |
| 246 | { |
| 247 | test(S("abcdefghijklmnopqrst"), 10, 10, "", S("abcdefghij")); |
| 248 | test(S("abcdefghijklmnopqrst"), 10, 10, "12345", S("abcdefghij12345")); |
| 249 | test(S("abcdefghijklmnopqrst"), 10, 10, "1234567890", S("abcdefghij1234567890")); |
| 250 | test(S("abcdefghijklmnopqrst"), 10, 10, "12345678901234567890", S("abcdefghij12345678901234567890")); |
| 251 | test(S("abcdefghijklmnopqrst"), 19, 0, "", S("abcdefghijklmnopqrst")); |
| 252 | test(S("abcdefghijklmnopqrst"), 19, 0, "12345", S("abcdefghijklmnopqrs12345t")); |
| 253 | test(S("abcdefghijklmnopqrst"), 19, 0, "1234567890", S("abcdefghijklmnopqrs1234567890t")); |
| 254 | test(S("abcdefghijklmnopqrst"), 19, 0, "12345678901234567890", S("abcdefghijklmnopqrs12345678901234567890t")); |
| 255 | test(S("abcdefghijklmnopqrst"), 19, 1, "", S("abcdefghijklmnopqrs")); |
| 256 | test(S("abcdefghijklmnopqrst"), 19, 1, "12345", S("abcdefghijklmnopqrs12345")); |
| 257 | test(S("abcdefghijklmnopqrst"), 19, 1, "1234567890", S("abcdefghijklmnopqrs1234567890")); |
| 258 | test(S("abcdefghijklmnopqrst"), 19, 1, "12345678901234567890", S("abcdefghijklmnopqrs12345678901234567890")); |
| 259 | test(S("abcdefghijklmnopqrst"), 20, 0, "", S("abcdefghijklmnopqrst")); |
| 260 | test(S("abcdefghijklmnopqrst"), 20, 0, "12345", S("abcdefghijklmnopqrst12345")); |
| 261 | test(S("abcdefghijklmnopqrst"), 20, 0, "1234567890", S("abcdefghijklmnopqrst1234567890")); |
| 262 | test(S("abcdefghijklmnopqrst"), 20, 0, "12345678901234567890", S("abcdefghijklmnopqrst12345678901234567890")); |
| 263 | } |
| 264 | |
| 265 | int main() |
| 266 | { |
| 267 | test0(); |
| 268 | test1(); |
| 269 | test2(); |
| 270 | } |