1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_sal.hxx" 26 27 // ----------------------------------------------------------------------------- 28 #include <rtl/string.hxx> 29 #include <rtl_String_Const.h> 30 #include <rtl_String_Utils.hxx> 31 32 #include <rtl/strbuf.hxx> 33 34 #include "gtest/gtest.h" 35 36 #include <string.h> 37 38 using namespace rtl; 39 40 //------------------------------------------------------------------------ 41 // test classes 42 //------------------------------------------------------------------------ 43 // const MAXBUFLENGTH = 255; 44 //------------------------------------------------------------------------ 45 // helper functions 46 //------------------------------------------------------------------------ 47 48 //------------------------------------------------------------------------ 49 // testing constructors 50 //------------------------------------------------------------------------ 51 52 // LLA: there exist some #if WITH_CORE #endif envelopes, which contain test code, which will core dump 53 // due to the fact, that we can't handle MAXINT32 right. 54 55 namespace rtl_OStringBuffer 56 { 57 class ctors : public ::testing::Test 58 { 59 public: 60 }; 61 62 TEST_F(ctors, ctor_001) 63 { 64 ::rtl::OStringBuffer aStrBuf; 65 const sal_Char* pStr = aStrBuf.getStr(); 66 67 ASSERT_TRUE(aStrBuf.getLength() == 0 && 68 *pStr == '\0' && aStrBuf.getCapacity() == 16) << "New OStringBuffer containing no characters"; 69 } 70 71 TEST_F(ctors, ctor_002) 72 { 73 ::rtl::OString aStrtmp( kTestStr1 ); 74 ::rtl::OStringBuffer aStrBuftmp( aStrtmp ); 75 ::rtl::OStringBuffer aStrBuf( aStrBuftmp ); 76 // sal_Bool res = cmpstr(aStrBuftmp.getStr(),aStrBuf.getStr()); 77 78 sal_Int32 nLenStrBuftmp = aStrBuftmp.getLength(); 79 80 rtl::OString sStr(aStrBuftmp.getStr()); 81 sal_Bool res = aStrtmp.equals( sStr ); 82 83 ASSERT_TRUE(aStrBuf.getLength() == nLenStrBuftmp && 84 aStrBuf.getCapacity() == aStrBuftmp.getCapacity() && 85 res) << "New OStringBuffer from another OStringBuffer"; 86 87 } 88 89 TEST_F(ctors, ctor_003) 90 { 91 ::rtl::OStringBuffer aStrBuf1(kTestStr2Len); 92 #ifdef WITH_CORE 93 ::rtl::OStringBuffer aStrBuf2(kSInt32Max); //will core dump 94 // LLA: will core, due to the fact, that ksint32max is too big, the max length can't 95 // use, because there are some internal bytes, which we can't calculate. 96 97 #else 98 ::rtl::OStringBuffer aStrBuf2(0); 99 #endif 100 101 const sal_Char* pStr1 = aStrBuf1.getStr(); 102 const sal_Char* pStr2 = aStrBuf2.getStr(); 103 104 #ifdef WITH_CORE 105 ASSERT_TRUE(aStrBuf1.getLength() == 0 && 106 ! *(aStrBuf1.getStr()) && aStrBuf1.getCapacity() == kTestStr2Len && 107 aStrBuf2.getLength() == 0 && 108 ! *(aStrBuf2.getStr()) && aStrBuf2.getCapacity() == kSInt32Max) << "New OStringBuffer containing no characters and contain assigned capacity"; 109 #else 110 ASSERT_TRUE(aStrBuf1.getLength() == 0 && 111 *pStr1 == '\0' && 112 aStrBuf1.getCapacity() == kTestStr2Len && 113 aStrBuf2.getLength() == 0 && 114 *pStr2 == '\0' && 115 aStrBuf2.getCapacity() == 0) << "New OStringBuffer containing no characters and contain assigned capacity"; 116 #endif 117 118 } 119 120 TEST_F(ctors, ctor_003_1) 121 { 122 // LLA: StringBuffer with created negativ size are the same as empty StringBuffers 123 ::rtl::OStringBuffer aStrBuf3(kNonSInt32Max); 124 125 const sal_Char* pStr = aStrBuf3.getStr(); 126 127 ASSERT_TRUE(aStrBuf3.getLength() == 0 && 128 *pStr == '\0' && 129 aStrBuf3.getCapacity() == kNonSInt32Max) << "New OStringBuffer containing no characters and contain assigned capacity"; 130 } 131 132 TEST_F(ctors, ctor_004) 133 { 134 ::rtl::OString aStrtmp( kTestStr1 ); 135 ::rtl::OStringBuffer aStrBuf( aStrtmp ); 136 sal_Int32 leg = aStrBuf.getLength(); 137 138 ASSERT_TRUE(aStrBuf.getStr() == aStrtmp && 139 leg == aStrtmp.pData->length && 140 aStrBuf.getCapacity() == leg+16) << "New OStringBuffer from Ostring"; 141 } 142 143 TEST_F(ctors, ctor_005) { 144 rtl::OStringBuffer b1; 145 b1.makeStringAndClear(); 146 rtl::OStringBuffer b2(b1); 147 } 148 149 // ----------------------------------------------------------------------------- 150 151 class makeStringAndClear : public ::testing::Test 152 { 153 protected: 154 OString* arrOUS[6]; 155 156 public: 157 void SetUp() 158 { 159 arrOUS[0] = new OString( kTestStr1 ); 160 arrOUS[1] = new OString( kTestStr14 ); 161 arrOUS[2] = new OString( kTestStr25 ); 162 arrOUS[3] = new OString( kTestStr27 ); 163 arrOUS[4] = new OString( kTestStr29 ); 164 arrOUS[5] = new OString( "\0" ); 165 166 } 167 168 void TearDown() 169 { 170 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 171 delete arrOUS[3]; delete arrOUS[4]; delete arrOUS[5]; 172 } 173 }; 174 175 TEST_F(makeStringAndClear, makeStringAndClear_001) 176 { 177 ::rtl::OStringBuffer aStrBuf1; 178 ::rtl::OString aStr1; 179 180 sal_Bool lastRes = (aStrBuf1.makeStringAndClear() == aStr1 ); 181 182 ASSERT_TRUE(lastRes && ( aStrBuf1.getCapacity() == 0 ) && 183 ( *(aStrBuf1.getStr()) == '\0' )) << "two empty strings(def. constructor)"; 184 185 } 186 187 TEST_F(makeStringAndClear, makeStringAndClear_002) 188 { 189 ::rtl::OStringBuffer aStrBuf2(26); 190 ::rtl::OString aStr2; 191 192 sal_Bool lastRes = (aStrBuf2.makeStringAndClear() == aStr2 ); 193 194 ASSERT_TRUE(lastRes && ( aStrBuf2.getCapacity() == 0 ) && 195 ( *(aStrBuf2.getStr()) == '\0' )) << "two empty strings(with a argu)"; 196 197 } 198 199 TEST_F(makeStringAndClear, makeStringAndClear_003) 200 { 201 ::rtl::OStringBuffer aStrBuf3(*arrOUS[0]); 202 ::rtl::OString aStr3(*arrOUS[0]); 203 204 sal_Bool lastRes = (aStrBuf3.makeStringAndClear() == aStr3 ); 205 206 ASSERT_TRUE(lastRes && ( aStrBuf3.getCapacity() == 0 ) && 207 ( *(aStrBuf3.getStr()) == '\0' )) << "normal string"; 208 209 } 210 211 TEST_F(makeStringAndClear, makeStringAndClear_004) 212 { 213 ::rtl::OStringBuffer aStrBuf4(*arrOUS[1]); 214 ::rtl::OString aStr4(*arrOUS[1]); 215 216 sal_Bool lastRes = (aStrBuf4.makeStringAndClear() == aStr4 ); 217 218 ASSERT_TRUE(lastRes && ( aStrBuf4.getCapacity() == 0 ) && 219 ( *(aStrBuf4.getStr()) == '\0' )) << "string with space "; 220 } 221 222 TEST_F(makeStringAndClear, makeStringAndClear_005) 223 { 224 ::rtl::OStringBuffer aStrBuf5(*arrOUS[2]); 225 ::rtl::OString aStr5(*arrOUS[2]); 226 227 sal_Bool lastRes = (aStrBuf5.makeStringAndClear() == aStr5 ); 228 229 ASSERT_TRUE(lastRes && ( aStrBuf5.getCapacity() == 0 ) && 230 ( *(aStrBuf5.getStr()) == '\0' )) << "empty string"; 231 } 232 233 TEST_F(makeStringAndClear, makeStringAndClear_006) 234 { 235 ::rtl::OStringBuffer aStrBuf6(*arrOUS[3]); 236 ::rtl::OString aStr6(*arrOUS[3]); 237 238 sal_Bool lastRes = (aStrBuf6.makeStringAndClear() == aStr6 ); 239 240 ASSERT_TRUE(lastRes && ( aStrBuf6.getCapacity() == 0 ) && 241 ( *(aStrBuf6.getStr()) == '\0' )) << "string with a character"; 242 } 243 244 TEST_F(makeStringAndClear, makeStringAndClear_007) 245 { 246 ::rtl::OStringBuffer aStrBuf7(*arrOUS[4]); 247 ::rtl::OString aStr7(*arrOUS[4]); 248 249 sal_Bool lastRes = (aStrBuf7.makeStringAndClear() == aStr7 ); 250 251 ASSERT_TRUE(lastRes && ( aStrBuf7.getCapacity() == 0 ) && 252 ( *(aStrBuf7.getStr()) == '\0' )) << "string with special characters"; 253 } 254 255 TEST_F(makeStringAndClear, makeStringAndClear_008) 256 { 257 ::rtl::OStringBuffer aStrBuf8(*arrOUS[5]); 258 ::rtl::OString aStr8(*arrOUS[5]); 259 260 sal_Bool lastRes = (aStrBuf8.makeStringAndClear() == aStr8 ); 261 262 ASSERT_TRUE(lastRes && ( aStrBuf8.getCapacity() == 0 ) && 263 ( *(aStrBuf8.getStr()) == '\0' )) << "string only with (\0)"; 264 } 265 266 // ----------------------------------------------------------------------------- 267 268 class getLength : public ::testing::Test 269 { 270 protected: 271 OString* arrOUS[6]; 272 273 public: 274 void SetUp() 275 { 276 arrOUS[0] = new OString( kTestStr1 ); 277 arrOUS[1] = new OString( "1" ); 278 arrOUS[2] = new OString( ); 279 arrOUS[3] = new OString( "" ); 280 arrOUS[4] = new OString( "\0" ); 281 arrOUS[5] = new OString( kTestStr2 ); 282 283 } 284 285 void TearDown() 286 { 287 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 288 delete arrOUS[3]; delete arrOUS[4]; delete arrOUS[5]; 289 } 290 }; 291 292 TEST_F(getLength, getLength_001) 293 { 294 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 295 sal_Int32 expVal = kTestStr1Len; 296 297 ASSERT_TRUE(aStrBuf.getLength() == expVal) << "length of ascii string"; 298 299 } 300 301 TEST_F(getLength, getLength_002) 302 { 303 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 304 sal_Int32 expVal = 1; 305 306 ASSERT_TRUE(aStrBuf.getLength() == expVal) << "length of ascci string of size 1"; 307 } 308 309 TEST_F(getLength, getLength_003) 310 { 311 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 312 sal_Int32 expVal = 0; 313 314 ASSERT_TRUE(aStrBuf.getLength() == expVal) << "length of empty string"; 315 } 316 317 TEST_F(getLength, getLength_004) 318 { 319 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 320 sal_Int32 expVal = 0; 321 322 ASSERT_TRUE(aStrBuf.getLength() == expVal) << "length of empty string (empty ascii string arg)"; 323 } 324 325 TEST_F(getLength, getLength_005) 326 { 327 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 328 sal_Int32 expVal = 0; 329 330 ASSERT_TRUE(aStrBuf.getLength() == expVal) << "length of empty string (string arg = '\\0')"; 331 } 332 333 TEST_F(getLength, getLength_006) 334 { 335 ::rtl::OStringBuffer aStrBuf( *arrOUS[5] ); 336 sal_Int32 expVal = kTestStr2Len; 337 338 ASSERT_TRUE(aStrBuf.getLength() == expVal) << "length(>16) of ascii string"; 339 } 340 341 TEST_F(getLength, getLength_007) 342 { 343 ::rtl::OStringBuffer aStrBuf; 344 sal_Int32 expVal = 0; 345 346 ASSERT_TRUE(aStrBuf.getLength()== expVal) << "length of empty string (default constructor)"; 347 } 348 349 TEST_F(getLength, getLength_008) 350 { 351 ::rtl::OStringBuffer aStrBuf( 26 ); 352 sal_Int32 expVal = 0; 353 354 ASSERT_TRUE(aStrBuf.getLength()== expVal) << "length of empty string (with capacity)"; 355 } 356 357 // ----------------------------------------------------------------------------- 358 359 class getCapacity : public ::testing::Test 360 { 361 protected: 362 OString* arrOUS[6]; 363 364 public: 365 void SetUp() 366 { 367 arrOUS[0] = new OString( kTestStr1 ); 368 arrOUS[1] = new OString( "1" ); 369 arrOUS[2] = new OString( ); 370 arrOUS[3] = new OString( "" ); 371 arrOUS[4] = new OString( "\0" ); 372 arrOUS[5] = new OString( kTestStr2 ); 373 374 } 375 376 void TearDown() 377 { 378 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 379 delete arrOUS[3]; delete arrOUS[4]; delete arrOUS[5]; 380 } 381 }; 382 383 TEST_F(getCapacity, getCapacity_001) 384 { 385 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 386 sal_Int32 expVal = kTestStr1Len+16; 387 388 ASSERT_TRUE(aStrBuf.getCapacity()== expVal) << "capacity of ascii string"; 389 390 } 391 392 TEST_F(getCapacity, getCapacity_002) 393 { 394 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 395 sal_Int32 expVal = 1+16; 396 397 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity of ascci string of size 1"; 398 } 399 400 TEST_F(getCapacity, getCapacity_003) 401 { 402 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 403 sal_Int32 expVal = 0+16; 404 405 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity of empty string"; 406 } 407 408 TEST_F(getCapacity, getCapacity_004) 409 { 410 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 411 sal_Int32 expVal = 0+16; 412 413 ASSERT_TRUE(aStrBuf.getCapacity()== expVal) << "capacity of empty string (empty ascii string arg)"; 414 } 415 416 TEST_F(getCapacity, getCapacity_005) 417 { 418 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 419 sal_Int32 expVal = 0+16; 420 421 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity of empty string (string arg = '\\0')"; 422 } 423 424 TEST_F(getCapacity, getCapacity_006) 425 { 426 ::rtl::OStringBuffer aStrBuf( *arrOUS[5] ); 427 sal_Int32 expVal = kTestStr2Len+16; 428 429 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity(>16) of ascii string"; 430 } 431 432 TEST_F(getCapacity, getCapacity_007) 433 { 434 ::rtl::OStringBuffer aStrBuf; 435 sal_Int32 expVal = 16; 436 437 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity of empty string (default constructor)"; 438 } 439 #ifdef WITH_CORE 440 TEST_F(getCapacity, getCapacity_008) 441 { 442 ::rtl::OStringBuffer aStrBuf ( kSInt32Max ); 443 sal_Int32 expVal = kSInt32Max; 444 445 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity of empty string (with capacity 2147483647)(code will core dump)"; 446 } 447 #endif 448 TEST_F(getCapacity, getCapacity_009) 449 { 450 ::rtl::OStringBuffer aStrBuf( kNonSInt32Max ); 451 sal_Int32 expVal = kNonSInt32Max; 452 453 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity of empty string (with capacity -2147483648)"; 454 } 455 456 TEST_F(getCapacity, getCapacity_010) 457 { 458 ::rtl::OStringBuffer aStrBuf( 16 ); 459 sal_Int32 expVal = 16; 460 461 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity of empty string (with capacity 16)"; 462 } 463 464 TEST_F(getCapacity, getCapacity_011) 465 { 466 ::rtl::OStringBuffer aStrBuf( 6 ); 467 sal_Int32 expVal = 6; 468 469 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity of empty string (with capacity 6)"; 470 } 471 472 TEST_F(getCapacity, getCapacity_012) 473 { 474 ::rtl::OStringBuffer aStrBuf( 0 ); 475 sal_Int32 expVal = 0; 476 477 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity of empty string (with capacity 0)"; 478 } 479 480 TEST_F(getCapacity, getCapacity_013) 481 { 482 ::rtl::OStringBuffer aStrBuf( -2 ); 483 sal_Int32 expVal = -2; 484 485 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity of empty string (with capacity -2)"; 486 } 487 488 // ----------------------------------------------------------------------------- 489 490 class ensureCapacity : public ::testing::Test 491 { 492 }; 493 494 TEST_F(ensureCapacity, ensureCapacity_001) 495 { 496 sal_Int32 expVal = 16; 497 ::rtl::OStringBuffer aStrBuf; 498 sal_Int32 input = 5; 499 500 aStrBuf.ensureCapacity( input ); 501 502 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to 16, minimum is 5"; 503 504 } 505 506 TEST_F(ensureCapacity, ensureCapacity_002) 507 { 508 sal_Int32 expVal = 16; 509 ::rtl::OStringBuffer aStrBuf; 510 sal_Int32 input = -5; 511 512 aStrBuf.ensureCapacity( input ); 513 514 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to 16, minimum is -5"; 515 516 } 517 518 TEST_F(ensureCapacity, ensureCapacity_003) 519 { 520 sal_Int32 expVal = 16; 521 ::rtl::OStringBuffer aStrBuf; 522 sal_Int32 input = 0; 523 524 aStrBuf.ensureCapacity( input ); 525 526 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to 16, minimum is 0"; 527 528 } 529 530 TEST_F(ensureCapacity, ensureCapacity_004) //the testcase is based on comments 531 { 532 sal_Int32 expVal = 20; 533 ::rtl::OStringBuffer aStrBuf; 534 sal_Int32 input = 20; 535 536 aStrBuf.ensureCapacity( input ); 537 538 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to 16, minimum is 20"; 539 540 } 541 542 TEST_F(ensureCapacity, ensureCapacity_005) 543 { 544 sal_Int32 expVal = 50; 545 ::rtl::OStringBuffer aStrBuf; 546 sal_Int32 input = 50; 547 548 aStrBuf.ensureCapacity( input ); 549 550 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to 16, minimum is 50"; 551 552 } 553 554 TEST_F(ensureCapacity, ensureCapacity_006) 555 { 556 sal_Int32 expVal = 20; 557 ::rtl::OStringBuffer aStrBuf( 6 ); 558 sal_Int32 input = 20; 559 560 aStrBuf.ensureCapacity( input ); 561 562 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to 6, minimum is 20"; 563 564 } 565 566 TEST_F(ensureCapacity, ensureCapacity_007) 567 { 568 sal_Int32 expVal = 6; 569 ::rtl::OStringBuffer aStrBuf( 6 ); 570 sal_Int32 input = 2; 571 572 aStrBuf.ensureCapacity( input ); 573 574 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to 6, minimum is 2"; 575 576 } 577 578 TEST_F(ensureCapacity, ensureCapacity_008) 579 { 580 sal_Int32 expVal = 6; 581 ::rtl::OStringBuffer aStrBuf( 6 ); 582 sal_Int32 input = -6; 583 584 aStrBuf.ensureCapacity( input ); 585 586 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to 6, minimum is -6"; 587 588 } 589 590 TEST_F(ensureCapacity, ensureCapacity_009) //the testcase is based on comments 591 { 592 sal_Int32 expVal = 10; 593 ::rtl::OStringBuffer aStrBuf( 6 ); 594 sal_Int32 input = 10; 595 596 aStrBuf.ensureCapacity( input ); 597 598 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to 6, minimum is -6"; 599 600 } 601 602 TEST_F(ensureCapacity, ensureCapacity_010) 603 { 604 sal_Int32 expVal = 6; 605 ::rtl::OStringBuffer aStrBuf( 0 ); 606 sal_Int32 input = 6; 607 608 aStrBuf.ensureCapacity( input ); 609 610 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to 0, minimum is 6"; 611 612 } 613 614 TEST_F(ensureCapacity, ensureCapacity_011) //the testcase is based on comments 615 { 616 sal_Int32 expVal = 2; // capacity is x = (str->length + 1) * 2; minimum < x ? x : minimum 617 ::rtl::OStringBuffer aStrBuf( 0 ); 618 sal_Int32 input = 1; 619 620 aStrBuf.ensureCapacity( input ); 621 622 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to 0, minimum is 1"; 623 624 } 625 626 TEST_F(ensureCapacity, ensureCapacity_012) 627 { 628 sal_Int32 expVal = 0; 629 ::rtl::OStringBuffer aStrBuf( 0 ); 630 sal_Int32 input = -1; 631 632 aStrBuf.ensureCapacity( input ); 633 634 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to 0, minimum is -1"; 635 636 } 637 #ifdef WITH_CORE 638 TEST_F(ensureCapacity, ensureCapacity_013) //will core dump 639 { 640 sal_Int32 expVal = kSInt32Max; 641 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 642 sal_Int32 input = 65535; 643 644 aStrBuf.ensureCapacity( input ); 645 646 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to 2147483647, minimum is 65535"; 647 648 } 649 650 TEST_F(ensureCapacity, ensureCapacity_014) //will core dump 651 { 652 sal_Int32 expVal = kSInt32Max; 653 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 654 sal_Int32 input = kSInt32Max; 655 656 aStrBuf.ensureCapacity( input ); 657 658 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to 2147483647, minimum is 2147483647"; 659 660 } 661 662 TEST_F(ensureCapacity, ensureCapacity_015) //will core dump 663 { 664 sal_Int32 expVal = kSInt32Max; 665 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 666 sal_Int32 input = -1; 667 668 aStrBuf.ensureCapacity( input ); 669 670 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to 2147483647, minimum is -1"; 671 672 } 673 674 TEST_F(ensureCapacity, ensureCapacity_016) //will core dump 675 { 676 sal_Int32 expVal = kSInt32Max; 677 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 678 sal_Int32 input = 0; 679 680 aStrBuf.ensureCapacity( input ); 681 682 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to 2147483647, minimum is 0"; 683 684 } 685 686 TEST_F(ensureCapacity, ensureCapacity_017) //will core dump 687 { 688 sal_Int32 expVal = kSInt32Max; 689 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 690 sal_Int32 input = kNonSInt32Max; 691 692 aStrBuf.ensureCapacity( input ); 693 694 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to 2147483647, minimum is -2147483648"; 695 696 } 697 #endif 698 TEST_F(ensureCapacity, ensureCapacity_018) 699 { 700 sal_Int32 expVal = 65535; 701 ::rtl::OStringBuffer aStrBuf( kNonSInt32Max ); 702 sal_Int32 input = 65535; 703 704 aStrBuf.ensureCapacity( input ); 705 706 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to -2147483648, minimum is 65535"; 707 708 } 709 #ifdef WITH_CORE 710 TEST_F(ensureCapacity, ensureCapacity_019) //will core dump 711 { 712 sal_Int32 expVal = 2147483647; 713 ::rtl::OStringBuffer aStrBuf( kNonSInt32Max ); 714 sal_Int32 input = 2147483647; 715 716 aStrBuf.ensureCapacity( input ); 717 718 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to -2147483648, minimum is 2147483647"; 719 720 } 721 #endif 722 TEST_F(ensureCapacity, ensureCapacity_020) 723 { 724 sal_Int32 expVal = 2; 725 ::rtl::OStringBuffer aStrBuf( kNonSInt32Max ); 726 sal_Int32 input = -1; 727 728 aStrBuf.ensureCapacity( input ); 729 730 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to -2147483648, minimum is -1"; 731 732 } 733 734 TEST_F(ensureCapacity, ensureCapacity_021) 735 { 736 sal_Int32 expVal = 2; 737 ::rtl::OStringBuffer aStrBuf( kNonSInt32Max ); 738 sal_Int32 input = 0; 739 740 aStrBuf.ensureCapacity( input ); 741 742 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to -2147483648, minimum is 0"; 743 744 } 745 746 TEST_F(ensureCapacity, ensureCapacity_022) 747 { 748 sal_Int32 expVal = kNonSInt32Max; 749 ::rtl::OStringBuffer aStrBuf( kNonSInt32Max ); 750 sal_Int32 input = kNonSInt32Max; 751 752 aStrBuf.ensureCapacity( input ); 753 754 ASSERT_TRUE(aStrBuf.getCapacity() == expVal) << "capacity equal to -2147483648, minimum is -2147483648"; 755 756 } 757 758 // ----------------------------------------------------------------------------- 759 760 class setLength : public ::testing::Test 761 { 762 protected: 763 OString* arrOUS[6]; 764 765 public: 766 void SetUp() 767 { 768 arrOUS[0] = new OString( kTestStr1 ); 769 arrOUS[1] = new OString( "1" ); 770 arrOUS[2] = new OString( ); 771 arrOUS[3] = new OString( "" ); 772 arrOUS[4] = new OString( "\0" ); 773 arrOUS[5] = new OString( kTestStr2 ); 774 775 } 776 777 void TearDown() 778 { 779 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 780 delete arrOUS[3]; delete arrOUS[4]; delete arrOUS[5]; 781 } 782 }; 783 784 TEST_F(setLength, setLength_001) 785 { 786 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 787 sal_Int32 expVal1 = 50; 788 ::rtl::OString expVal2( kTestStr1 ); 789 sal_Int32 expVal3 = 50; 790 sal_Int32 input = 50; 791 792 aStrBuf.setLength( input ); 793 794 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 795 aStrBuf.getLength() == expVal1 && 796 aStrBuf.getCapacity() == expVal3) << "newLength more than the capacity of OStringBuffer(kTestStr1)"; 797 798 } 799 800 TEST_F(setLength, setLength_002) 801 { 802 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 803 sal_Int32 expVal1 = kTestStr13Len; 804 ::rtl::OString expVal2( kTestStr1 ); 805 sal_Int32 expVal3 = 32; 806 sal_Int32 input = kTestStr13Len; 807 808 aStrBuf.setLength( input ); 809 810 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 811 aStrBuf.getLength() == expVal1 && 812 aStrBuf.getCapacity() == expVal3) << "newLength more than the length of OStringBuffer(kTestStr1)"; 813 814 } 815 816 TEST_F(setLength, setLength_003) 817 { 818 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 819 sal_Int32 expVal1 = kTestStr1Len; 820 ::rtl::OString expVal2( kTestStr1 ); 821 sal_Int32 expVal3 = 32; 822 sal_Int32 input = kTestStr1Len; 823 824 aStrBuf.setLength( input ); 825 826 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 827 aStrBuf.getLength() == expVal1 && 828 aStrBuf.getCapacity() == expVal3) << "newLength equal to the length of OStringBuffer(kTestStr1)"; 829 830 } 831 832 TEST_F(setLength, setLength_004) 833 { 834 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 835 sal_Int32 expVal1 = kTestStr7Len; 836 ::rtl::OString expVal2( kTestStr7 ); 837 sal_Int32 expVal3 = 32; 838 sal_Int32 input = kTestStr7Len; 839 840 aStrBuf.setLength( input ); 841 842 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 843 aStrBuf.getLength() == expVal1 && 844 aStrBuf.getCapacity() == expVal3) << "newLength less than the length of OStringBuffer(kTestStr1)"; 845 846 } 847 848 TEST_F(setLength, setLength_005) 849 { 850 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 851 sal_Int32 expVal1 = 0; 852 ::rtl::OString expVal2; 853 sal_Int32 expVal3 = 32; 854 sal_Int32 input = 0; 855 856 aStrBuf.setLength( input ); 857 858 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 859 aStrBuf.getLength() == expVal1 && 860 aStrBuf.getCapacity() == expVal3) << "newLength equal to 0"; 861 862 } 863 864 TEST_F(setLength, setLength_006) 865 { 866 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 867 sal_Int32 expVal1 = 25; 868 ::rtl::OString expVal2( *arrOUS[1] ); 869 sal_Int32 expVal3 = 25; 870 sal_Int32 input = 25; 871 872 aStrBuf.setLength( input ); 873 874 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 875 aStrBuf.getLength() == expVal1 && 876 aStrBuf.getCapacity() == expVal3) << "newLength more than the capacity of OStringBuffer(1)"; 877 878 } 879 880 TEST_F(setLength, setLength_007) 881 { 882 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 883 sal_Int32 expVal1 = kTestStr27Len; 884 ::rtl::OString expVal2( *arrOUS[1] ); 885 sal_Int32 expVal3 = 17; 886 sal_Int32 input = kTestStr27Len; 887 888 aStrBuf.setLength( input ); 889 890 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 891 aStrBuf.getLength() == expVal1 && 892 aStrBuf.getCapacity() == expVal3) << "newLength equal to the length of OStringBuffer(1)"; 893 894 } 895 896 TEST_F(setLength, setLength_008) 897 { 898 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 899 sal_Int32 expVal1 = 0; 900 ::rtl::OString expVal2; 901 sal_Int32 expVal3 = 17; 902 sal_Int32 input = 0; 903 904 aStrBuf.setLength( input ); 905 906 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 907 aStrBuf.getLength() == expVal1 && 908 aStrBuf.getCapacity() == expVal3) << "newLength less than the length of OUStringBuffer(1)"; 909 910 } 911 912 TEST_F(setLength, setLength_009) 913 { 914 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 915 sal_Int32 expVal1 = 20; 916 ::rtl::OString expVal2; 917 sal_Int32 expVal3 = 20; 918 sal_Int32 input = 20; 919 920 aStrBuf.setLength( input ); 921 922 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 923 aStrBuf.getLength() == expVal1 && 924 aStrBuf.getCapacity() == expVal3) << "newLength more than the capacity of OStringBuffer()"; 925 926 } 927 928 TEST_F(setLength, setLength_010) 929 { 930 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 931 sal_Int32 expVal1 = 3; 932 ::rtl::OString expVal2; 933 sal_Int32 expVal3 = 16; 934 sal_Int32 input = 3; 935 936 aStrBuf.setLength( input ); 937 938 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 939 aStrBuf.getLength() == expVal1 && 940 aStrBuf.getCapacity() == expVal3) << "newLength more than the length of OStringBuffer()"; 941 942 } 943 944 TEST_F(setLength, setLength_011) 945 { 946 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 947 sal_Int32 expVal1 = 0; 948 ::rtl::OString expVal2; 949 sal_Int32 expVal3 = 16; 950 sal_Int32 input = 0; 951 952 aStrBuf.setLength( input ); 953 954 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 955 aStrBuf.getLength() == expVal1 && 956 aStrBuf.getCapacity() == expVal3) << "newLength more than the length of OStringBuffer()"; 957 958 } 959 960 TEST_F(setLength, setLength_012) 961 { 962 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 963 sal_Int32 expVal1 = 20; 964 ::rtl::OString expVal2; 965 sal_Int32 expVal3 = 20; 966 sal_Int32 input = 20; 967 968 aStrBuf.setLength( input ); 969 970 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 971 aStrBuf.getLength() == expVal1 && 972 aStrBuf.getCapacity() == expVal3) << "newLength more than the capacity of OStringBuffer("")"; 973 974 } 975 976 TEST_F(setLength, setLength_013) 977 { 978 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 979 sal_Int32 expVal1 = 5; 980 ::rtl::OString expVal2; 981 sal_Int32 expVal3 = 16; 982 sal_Int32 input = 5; 983 984 aStrBuf.setLength( input ); 985 986 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 987 aStrBuf.getLength() == expVal1 && 988 aStrBuf.getCapacity() == expVal3) << "newLength more than the length of OStringBuffer("")"; 989 990 } 991 992 TEST_F(setLength, setLength_014) 993 { 994 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 995 sal_Int32 expVal1 = 0; 996 ::rtl::OString expVal2; 997 sal_Int32 expVal3 = 16; 998 sal_Int32 input = 0; 999 1000 aStrBuf.setLength( input ); 1001 1002 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 1003 aStrBuf.getLength() == expVal1 && 1004 aStrBuf.getCapacity() == expVal3) << "newLength less than the length of OStringBuffer("")"; 1005 1006 } 1007 1008 TEST_F(setLength, setLength_015) 1009 { 1010 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 1011 sal_Int32 expVal1 = 20; 1012 ::rtl::OString expVal2; 1013 sal_Int32 expVal3 = 20; 1014 sal_Int32 input = 20; 1015 1016 aStrBuf.setLength( input ); 1017 1018 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 1019 aStrBuf.getLength() == expVal1 && 1020 aStrBuf.getCapacity() == expVal3) << "newLength more than the length of OStringBuffer(\0)"; 1021 1022 } 1023 1024 TEST_F(setLength, setLength_016) 1025 { 1026 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 1027 sal_Int32 expVal1 = 5; 1028 ::rtl::OString expVal2; 1029 sal_Int32 expVal3 = 16; 1030 sal_Int32 input = 5; 1031 1032 aStrBuf.setLength( input ); 1033 1034 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 1035 aStrBuf.getLength() == expVal1 && 1036 aStrBuf.getCapacity() == expVal3) << "newLength more than the length of OStringBuffer(\0)"; 1037 1038 } 1039 1040 TEST_F(setLength, setLength_017) 1041 { 1042 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 1043 sal_Int32 expVal1 = 0; 1044 ::rtl::OString expVal2; 1045 sal_Int32 expVal3 = 16; 1046 sal_Int32 input = 0; 1047 1048 aStrBuf.setLength( input ); 1049 1050 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 1051 aStrBuf.getLength() == expVal1 && 1052 aStrBuf.getCapacity() == expVal3) << "newLength less than the length of OStringBuffer(\0)"; 1053 1054 } 1055 1056 TEST_F(setLength, setLength_018) 1057 { 1058 ::rtl::OStringBuffer aStrBuf( *arrOUS[5] ); 1059 sal_Int32 expVal1 = 50; 1060 ::rtl::OString expVal2( kTestStr2 ); 1061 sal_Int32 expVal3 = 66; 1062 sal_Int32 input = 50; 1063 1064 aStrBuf.setLength( input ); 1065 1066 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 1067 aStrBuf.getLength() == expVal1 && 1068 aStrBuf.getCapacity() == expVal3) << "newLength more than the capacity of OStringBuffer(kTestStr2)"; 1069 1070 } 1071 1072 TEST_F(setLength, setLength_019) 1073 { 1074 ::rtl::OStringBuffer aStrBuf( *arrOUS[5] ); 1075 sal_Int32 expVal1 = 40; 1076 ::rtl::OString expVal2(kTestStr2); 1077 sal_Int32 expVal3 = 48; 1078 sal_Int32 input = 40; 1079 1080 aStrBuf.setLength( input ); 1081 1082 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 1083 aStrBuf.getLength() == expVal1 && 1084 aStrBuf.getCapacity() == expVal3) << "newLength more than the length of OStringBuffer(kTestStr2)"; 1085 1086 } 1087 1088 TEST_F(setLength, setLength_020) 1089 { 1090 ::rtl::OStringBuffer aStrBuf( *arrOUS[5] ); 1091 sal_Int32 expVal1 = kTestStr2Len; 1092 ::rtl::OString expVal2(kTestStr2); 1093 sal_Int32 expVal3 = 48; 1094 sal_Int32 input = kTestStr2Len; 1095 1096 aStrBuf.setLength( input ); 1097 1098 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 1099 aStrBuf.getLength() == expVal1 && 1100 aStrBuf.getCapacity() == expVal3) << "newLength equal to the length of OUStringBuffer(kTestStr2)"; 1101 1102 } 1103 1104 TEST_F(setLength, setLength_021) 1105 { 1106 ::rtl::OStringBuffer aStrBuf( *arrOUS[5] ); 1107 sal_Int32 expVal1 = kTestStr7Len; 1108 ::rtl::OString expVal2(kTestStr7); 1109 sal_Int32 expVal3 = 48; 1110 sal_Int32 input = kTestStr7Len; 1111 1112 aStrBuf.setLength( input ); 1113 1114 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 1115 aStrBuf.getLength() == expVal1 && 1116 aStrBuf.getCapacity() == expVal3) << "newLength less than the length of OUStringBuffer(TestStr2)"; 1117 1118 } 1119 1120 TEST_F(setLength, setLength_022) 1121 { 1122 ::rtl::OStringBuffer aStrBuf( *arrOUS[5] ); 1123 sal_Int32 expVal1 = 0; 1124 ::rtl::OString expVal2; 1125 sal_Int32 expVal3 = 48; 1126 sal_Int32 input = 0; 1127 1128 aStrBuf.setLength( input ); 1129 1130 ASSERT_TRUE(aStrBuf.getStr() == expVal2 && 1131 aStrBuf.getLength() == expVal1 && 1132 aStrBuf.getCapacity() == expVal3) << "newLength equal to 0"; 1133 1134 } 1135 1136 // ----------------------------------------------------------------------------- 1137 1138 class charAt : public ::testing::Test 1139 { 1140 protected: 1141 OString* arrOUS[4]; 1142 1143 public: 1144 void SetUp() 1145 { 1146 arrOUS[0] = new OString( kTestStr1 ); 1147 arrOUS[1] = new OString( kTestStr27 ); 1148 arrOUS[2] = new OString( kTestStr28 ); 1149 arrOUS[3] = new OString( ); 1150 1151 } 1152 1153 void TearDown() 1154 { 1155 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 1156 delete arrOUS[3]; 1157 } 1158 }; 1159 1160 TEST_F(charAt, charAt_001) 1161 { 1162 sal_Unicode expVal = 83; 1163 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 1164 sal_Int32 input = 0; 1165 1166 ASSERT_TRUE(aStrBuf.charAt(input) == expVal) << "return the first character of OStringBuffer(kTestStr1)"; 1167 1168 } 1169 1170 TEST_F(charAt, charAt_002) 1171 { 1172 sal_Unicode expVal = 32; 1173 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 1174 sal_Int32 input = 3; 1175 1176 ASSERT_TRUE(aStrBuf.charAt(input) == expVal) << "return the middle character of OStringBuffer(kTestStr1)"; 1177 1178 } 1179 1180 TEST_F(charAt, charAt_003) 1181 { 1182 sal_Unicode expVal = 115; 1183 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 1184 sal_Int32 input = 15; 1185 1186 ASSERT_TRUE(aStrBuf.charAt(input) == expVal) << "return the last character of OStringBuffer(kTestStr1)"; 1187 1188 } 1189 1190 TEST_F(charAt, charAt_004) 1191 { 1192 sal_Unicode expVal = 115; 1193 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 1194 sal_Int32 input = 0; 1195 1196 ASSERT_TRUE(aStrBuf.charAt(input) == expVal) << "return the only character of OStringBuffer(kTestStr27)"; 1197 1198 } 1199 1200 TEST_F(charAt, charAt_005) 1201 { 1202 sal_Unicode expVal = 40; 1203 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 1204 sal_Int32 input = 0; 1205 1206 ASSERT_TRUE(aStrBuf.charAt(input) == expVal) << "return the first of OStringBuffer(kTestStr28) with special character"; 1207 1208 } 1209 1210 TEST_F(charAt, charAt_006) 1211 { 1212 sal_Unicode expVal = 11; 1213 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 1214 sal_Int32 input = 5; 1215 1216 ASSERT_TRUE(aStrBuf.charAt(input) == expVal) << "return the mid of OStringBuffer(kTestStr28) with special character"; 1217 1218 } 1219 1220 TEST_F(charAt, charAt_007) 1221 { 1222 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 1223 1224 ASSERT_TRUE(sal_True) << "invalid character of OStringBuffer()"; 1225 1226 } 1227 1228 TEST_F(charAt, charAt_008) 1229 { 1230 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 1231 1232 ASSERT_TRUE(sal_True) << "invalid character of OStringBuffer()"; 1233 1234 } 1235 1236 // ----------------------------------------------------------------------------- 1237 1238 1239 class csuc : public ::testing::Test 1240 { 1241 }; 1242 1243 TEST_F(csuc, csuc_001) 1244 { 1245 const sal_Char* expVal = kTestStr1; 1246 ::rtl::OStringBuffer aStrBuf( kTestStr1 ); 1247 sal_Int32 cmpLen = kTestStr1Len; 1248 1249 // LLA: wrong access! const sal_Char* pstr = *&aStrBuf; 1250 const sal_Char* pstr = aStrBuf.getStr(); 1251 int nEqual = strncmp(pstr, expVal, cmpLen); 1252 1253 ASSERT_TRUE(/* cmpstr( pstr, expVal, cmpLen ) */ 1254 nEqual == 0) << "test normal string"; 1255 1256 } 1257 1258 TEST_F(csuc, csuc_002) 1259 { 1260 ::rtl::OStringBuffer aStrBuf; 1261 1262 // LLA: wrong access! const sal_Char* pstr = *&aStrBuf; 1263 const sal_Char* pstr = aStrBuf.getStr(); 1264 sal_Int32 nLen = strlen(pstr); 1265 1266 ASSERT_TRUE(// cmpstr( pstr, &expVal, cmpLen ) 1267 nLen == 0) << "test empty string"; 1268 1269 } 1270 1271 // ----------------------------------------------------------------------------- 1272 1273 class getStr : public ::testing::Test 1274 { 1275 }; 1276 1277 TEST_F(getStr, getStr_001) 1278 { 1279 const sal_Char* expVal = kTestStr1; 1280 ::rtl::OStringBuffer aStrBuf( kTestStr1 ); 1281 sal_Int32 cmpLen = kTestStr1Len; 1282 1283 const sal_Char* pstr = aStrBuf.getStr(); 1284 int nEqual = strncmp(pstr, expVal, cmpLen); 1285 1286 ASSERT_TRUE(nEqual == 0) << "test normal string"; 1287 1288 } 1289 1290 TEST_F(getStr, getStr_002) 1291 { 1292 // const sal_Char tmpUC=0x0; 1293 // const sal_Char* expVal=&tmpUC; 1294 ::rtl::OStringBuffer aStrBuf; 1295 // sal_Int32 cmpLen = 1; 1296 1297 const sal_Char* pstr = aStrBuf.getStr(); 1298 sal_Int32 nLen = strlen(pstr); 1299 1300 ASSERT_TRUE(pstr != 0 && 1301 nLen == 0) << "test empty string"; 1302 1303 } 1304 1305 // ----------------------------------------------------------------------------- 1306 1307 class setCharAt : public ::testing::Test 1308 { 1309 protected: 1310 OString* arrOUS[4]; 1311 1312 public: 1313 void SetUp() 1314 { 1315 arrOUS[0] = new OString( kTestStr1 ); 1316 arrOUS[1] = new OString( kTestStr27 ); 1317 arrOUS[2] = new OString( kTestStr28 ); 1318 arrOUS[3] = new OString( ); 1319 1320 } 1321 1322 void TearDown() 1323 { 1324 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 1325 delete arrOUS[3]; 1326 } 1327 }; 1328 1329 TEST_F(setCharAt, setCharAt_001) 1330 { 1331 OString expVal( kTestStr31 ); 1332 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 1333 sal_Int32 input1 = 0; 1334 sal_Char input2 = 's'; 1335 1336 ASSERT_TRUE((aStrBuf.setCharAt(input1, input2)).getStr() == expVal) << "set the first character of OStringBuffer(kTestStr1) with s"; 1337 1338 } 1339 1340 TEST_F(setCharAt, setCharAt_002) 1341 { 1342 OString expVal( kTestStr3 ); 1343 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 1344 sal_Int32 input1 = 4; 1345 sal_Char input2 = 'm'; 1346 1347 ASSERT_TRUE((aStrBuf.setCharAt(input1, input2)).getStr() == expVal) << "set the middle character of OStringBuffer(kTestStr1) with m"; 1348 1349 } 1350 1351 TEST_F(setCharAt, setCharAt_003) 1352 { 1353 OString expVal( kTestStr32 ); 1354 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 1355 sal_Int32 input1 = 15; 1356 sal_Char input2 = ' '; 1357 1358 ASSERT_TRUE((aStrBuf.setCharAt(input1, input2)).getStr() == expVal) << "set the last character of OStringBuffer(kTestStr1) with ' '"; 1359 1360 } 1361 1362 1363 TEST_F(setCharAt, setCharAt_004) 1364 { 1365 OString expVal( kTestStr33 ); 1366 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 1367 sal_Int32 input1 = 0; 1368 sal_Char input2 = ' '; 1369 1370 ASSERT_TRUE((aStrBuf.setCharAt(input1, input2)).getStr() == expVal) << "set the only character of OStringBuffer(kTestStr27) with ' '"; 1371 1372 } 1373 1374 1375 TEST_F(setCharAt, setCharAt_005) 1376 { 1377 OString expVal( kTestStr34 ); 1378 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 1379 sal_Int32 input1 = 1; 1380 sal_Char input2 = (sal_Char)5; 1381 1382 ASSERT_TRUE((aStrBuf.setCharAt(input1, input2)).getStr() == expVal) << "set the only of OStringBuffer(kTestStr28) with special character"; 1383 1384 } 1385 1386 TEST_F(setCharAt, setCharAt_006) 1387 { 1388 OString expVal( kTestStr35 ); 1389 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 1390 sal_Int32 input1 = 1; 1391 sal_Char input2 = (sal_Char)-5; 1392 1393 ASSERT_TRUE((aStrBuf.setCharAt(input1, input2)).getStr() == expVal) << "set the only of OStringBuffer(kTestStr28) with special character"; 1394 1395 } 1396 #ifdef WITH_CORE 1397 TEST_F(setCharAt, setCharAt_007) 1398 { 1399 OString* expVal = 0; 1400 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 1401 sal_Int32 input1 = 0; 1402 sal_Char input2 = (sal_Char)5; 1403 1404 ASSERT_TRUE(sal_True) << "invalid character of OStringBuffer()"; 1405 1406 delete expVal; 1407 1408 } 1409 1410 TEST_F(setCharAt, setCharAt_008) 1411 { 1412 OString* expVal = 0; 1413 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 1414 sal_Int32 input1 = -2; 1415 sal_Char input2 = (sal_Char)5; 1416 1417 ASSERT_TRUE(sal_True) << "invalid character of OStringBuffer()"; 1418 1419 delete expVal; 1420 1421 } 1422 1423 TEST_F(setCharAt, setCharAt_009) 1424 { 1425 OString* expVal = 0; 1426 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 1427 sal_Int32 input1 = 3; 1428 sal_Char input2 = (sal_Char)5; 1429 1430 ASSERT_TRUE(sal_True) << "invalid character of OStringBuffer()"; 1431 1432 delete expVal; 1433 1434 } 1435 #endif 1436 1437 // ----------------------------------------------------------------------------- 1438 1439 class append_001 : public ::testing::Test 1440 { 1441 protected: 1442 OString* arrOUS[5]; 1443 1444 public: 1445 void SetUp() 1446 { 1447 arrOUS[0] = new OString( kTestStr7 ); 1448 arrOUS[1] = new OString( ); 1449 arrOUS[2] = new OString( kTestStr25 ); 1450 arrOUS[3] = new OString( "\0" ); 1451 arrOUS[4] = new OString( kTestStr28 ); 1452 1453 } 1454 1455 void TearDown() 1456 { 1457 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 1458 delete arrOUS[3]; delete arrOUS[4]; 1459 } 1460 }; 1461 1462 TEST_F(append_001, append_001_001) 1463 { 1464 OString expVal( kTestStr1 ); 1465 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 1466 OString input2( kTestStr8 ); 1467 1468 aStrBuf.append( input2 ); 1469 1470 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length less than 16) to the string buffer arrOUS[0]"; 1471 1472 } 1473 1474 TEST_F(append_001, append_001_002) 1475 { 1476 OString expVal( kTestStr2 ); 1477 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 1478 OString input2( kTestStr36 ); 1479 1480 aStrBuf.append( input2 ); 1481 1482 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1483 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length more than 16) to the string buffer arrOUS[0]"; 1484 1485 } 1486 1487 TEST_F(append_001, append_001_003) 1488 { 1489 OString expVal( kTestStr37 ); 1490 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 1491 OString input2( kTestStr23 ); 1492 1493 aStrBuf.append( input2 ); 1494 1495 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1496 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length equal to 16) to the string buffer arrOUS[0]"; 1497 1498 } 1499 1500 TEST_F(append_001, append_001_004) 1501 { 1502 OString expVal( kTestStr7 ); 1503 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 1504 OString input2; 1505 1506 aStrBuf.append( input2 ); 1507 1508 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1509 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length equal to 0) to the string buffer arrOUS[0]"; 1510 1511 } 1512 1513 TEST_F(append_001, append_001_005) 1514 { 1515 OString expVal( kTestStr7 ); 1516 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 1517 OString input2( kTestStr7 ); 1518 1519 aStrBuf.append( input2 ); 1520 1521 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1522 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length less than 16) to the string buffer arrOUS[1]"; 1523 1524 } 1525 1526 TEST_F(append_001, append_001_006) 1527 { 1528 OString expVal( kTestStr2 ); 1529 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 1530 OString input2( kTestStr2 ); 1531 1532 aStrBuf.append( input2 ); 1533 1534 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1535 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length more than 16) to the string buffer arrOUS[1]"; 1536 1537 } 1538 1539 TEST_F(append_001, append_001_007) 1540 { 1541 OString expVal( kTestStr1 ); 1542 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 1543 OString input2( kTestStr1 ); 1544 1545 aStrBuf.append( input2 ); 1546 1547 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1548 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length equal to 16) to the string buffer arrOUS[1]"; 1549 1550 } 1551 1552 TEST_F(append_001, append_001_008) 1553 { 1554 OString expVal; 1555 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 1556 OString input2; 1557 1558 aStrBuf.append( input2 ); 1559 1560 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1561 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length equal to 0) to the string buffer arrOUS[1]"; 1562 1563 } 1564 1565 TEST_F(append_001, append_001_009) 1566 { 1567 OString expVal( kTestStr7 ); 1568 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 1569 OString input2( kTestStr7 ); 1570 1571 aStrBuf.append( input2 ); 1572 1573 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1574 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length less than 16) to the string buffer arrOUS[2]"; 1575 1576 } 1577 1578 TEST_F(append_001, append_001_010) 1579 { 1580 OString expVal( kTestStr2 ); 1581 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 1582 OString input2( kTestStr2 ); 1583 1584 aStrBuf.append( input2 ); 1585 1586 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1587 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length more than 16) to the string buffer arrOUS[2]"; 1588 1589 } 1590 1591 TEST_F(append_001, append_001_011) 1592 { 1593 OString expVal( kTestStr1 ); 1594 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 1595 OString input2( kTestStr1 ); 1596 1597 aStrBuf.append( input2 ); 1598 1599 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1600 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length equal to 16) to the string buffer arrOUS[2]"; 1601 1602 } 1603 1604 TEST_F(append_001, append_001_012) 1605 { 1606 OString expVal; 1607 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 1608 OString input2; 1609 1610 aStrBuf.append( input2 ); 1611 1612 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1613 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length equal to 0) to the string buffer arrOUS[2]"; 1614 1615 } 1616 1617 TEST_F(append_001, append_001_013) 1618 { 1619 OString expVal( kTestStr7 ); 1620 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 1621 OString input2( kTestStr7 ); 1622 1623 aStrBuf.append( input2 ); 1624 1625 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1626 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length less than 16) to the string buffer arrOUS[3]"; 1627 1628 } 1629 1630 TEST_F(append_001, append_001_014) 1631 { 1632 OString expVal( kTestStr2 ); 1633 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 1634 OString input2( kTestStr2 ); 1635 1636 aStrBuf.append( input2 ); 1637 1638 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1639 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length more than 16) to the string buffer arrOUS[3]"; 1640 1641 } 1642 1643 TEST_F(append_001, append_001_015) 1644 { 1645 OString expVal( kTestStr1 ); 1646 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 1647 OString input2( kTestStr1 ); 1648 1649 aStrBuf.append( input2 ); 1650 1651 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1652 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length equal to 16) to the string buffer arrOUS[3]"; 1653 1654 } 1655 1656 TEST_F(append_001, append_001_016) 1657 { 1658 OString expVal; 1659 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 1660 OString input2; 1661 1662 aStrBuf.append( input2 ); 1663 1664 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1665 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length equal to 0) to the string buffer arrOUS[3]"; 1666 1667 } 1668 1669 TEST_F(append_001, append_001_017) 1670 { 1671 OString expVal( kTestStr29 ); 1672 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 1673 OString input2( kTestStr38 ); 1674 1675 aStrBuf.append( input2 ); 1676 1677 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1678 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length less than 16) to the string buffer arrOUS[4]"; 1679 1680 } 1681 1682 TEST_F(append_001, append_001_018) 1683 { 1684 OString expVal( kTestStr39 ); 1685 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 1686 OString input2( kTestStr17 ); 1687 1688 aStrBuf.append( input2 ); 1689 1690 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1691 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length more than 16) to the string buffer arrOUS[4]"; 1692 1693 } 1694 1695 TEST_F(append_001, append_001_019) 1696 { 1697 OString expVal( kTestStr40 ); 1698 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 1699 OString input2( kTestStr31 ); 1700 1701 aStrBuf.append( input2 ); 1702 1703 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1704 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length equal to 16) to the string buffer arrOUS[4]"; 1705 1706 } 1707 1708 TEST_F(append_001, append_001_020) 1709 { 1710 OString expVal( kTestStr28 ); 1711 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 1712 OString input2; 1713 1714 aStrBuf.append( input2 ); 1715 1716 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1717 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length equal to 0) to the string buffer arrOUS[4]"; 1718 1719 } 1720 1721 #ifdef WITH_CORE 1722 TEST_F(append_001, append_001_021) 1723 { 1724 OString expVal; 1725 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 1726 OString input2; 1727 1728 aStrBuf.append( input2 ); 1729 1730 ASSERT_TRUE(aStrBuf.getStr()== expVal && 1731 aStrBuf.getLength() == expVal.getLength()) << "Appends the string(length equal to 0) to the string buffer arrOUS[4]"; 1732 1733 } 1734 #endif 1735 1736 // ----------------------------------------------------------------------------- 1737 1738 class append_002 : public ::testing::Test 1739 { 1740 protected: 1741 OString* arrOUS[5]; 1742 1743 public: 1744 void SetUp() 1745 { 1746 arrOUS[0] = new OString( kTestStr7 ); 1747 arrOUS[1] = new OString( ); 1748 arrOUS[2] = new OString( kTestStr25 ); 1749 arrOUS[3] = new OString( "\0" ); 1750 arrOUS[4] = new OString( kTestStr28 ); 1751 1752 } 1753 1754 void TearDown() 1755 { 1756 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 1757 delete arrOUS[3]; delete arrOUS[4]; 1758 } 1759 }; 1760 1761 TEST_F(append_002, append_002_001) 1762 { 1763 OString expVal( kTestStr1 ); 1764 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 1765 const sal_Char* input = kTestStr8; 1766 1767 aStrBuf.append( input ); 1768 1769 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length less than 16) to the string buffer arrOUS[0]"; 1770 1771 } 1772 1773 TEST_F(append_002, append_002_002) 1774 { 1775 OString expVal( kTestStr2 ); 1776 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 1777 const sal_Char* input = kTestStr36; 1778 1779 aStrBuf.append( input ); 1780 1781 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length more than 16) to the string buffer arrOUS[0]"; 1782 1783 } 1784 1785 TEST_F(append_002, append_002_003) 1786 { 1787 OString expVal( kTestStr37 ); 1788 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 1789 const sal_Char* input = kTestStr23; 1790 1791 aStrBuf.append( input ); 1792 1793 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 16) to the string buffer arrOUS[0]"; 1794 1795 } 1796 1797 TEST_F(append_002, append_002_004) 1798 { 1799 OString expVal( kTestStr7 ); 1800 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 1801 const sal_Char* input = kTestStr25; 1802 1803 aStrBuf.append( input ); 1804 1805 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 0) to the string buffer arrOUS[0]"; 1806 1807 } 1808 1809 TEST_F(append_002, append_002_005) 1810 { 1811 OString expVal( kTestStr7 ); 1812 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 1813 const sal_Char* input = kTestStr7; 1814 1815 aStrBuf.append( input ); 1816 1817 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length less than 16) to the string buffer arrOUS[1]"; 1818 1819 } 1820 1821 TEST_F(append_002, append_002_006) 1822 { 1823 OString expVal( kTestStr2 ); 1824 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 1825 const sal_Char* input = kTestStr2; 1826 1827 aStrBuf.append( input ); 1828 1829 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length more than 16) to the string buffer arrOUS[1]"; 1830 1831 } 1832 1833 TEST_F(append_002, append_002_007) 1834 { 1835 OString expVal( kTestStr1 ); 1836 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 1837 const sal_Char* input = kTestStr1; 1838 1839 aStrBuf.append( input ); 1840 1841 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 16) to the string buffer arrOUS[1]"; 1842 1843 } 1844 1845 TEST_F(append_002, append_002_008) 1846 { 1847 OString expVal; 1848 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 1849 const sal_Char* input = kTestStr25; 1850 1851 aStrBuf.append( input ); 1852 1853 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 0) to the string buffer arrOUS[1]"; 1854 1855 } 1856 1857 TEST_F(append_002, append_002_009) 1858 { 1859 OString expVal( kTestStr7 ); 1860 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 1861 const sal_Char* input = kTestStr7; 1862 1863 aStrBuf.append( input ); 1864 1865 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length less than 16) to the string buffer arrOUS[2]"; 1866 1867 } 1868 1869 TEST_F(append_002, append_002_010) 1870 { 1871 OString expVal( kTestStr2 ); 1872 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 1873 const sal_Char* input = kTestStr2; 1874 1875 aStrBuf.append( input ); 1876 1877 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length more than 16) to the string buffer arrOUS[2]"; 1878 1879 } 1880 1881 TEST_F(append_002, append_002_011) 1882 { 1883 OString expVal( kTestStr1 ); 1884 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 1885 const sal_Char* input = kTestStr1; 1886 1887 aStrBuf.append( input ); 1888 1889 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 16) to the string buffer arrOUS[2]"; 1890 1891 } 1892 1893 TEST_F(append_002, append_002_012) 1894 { 1895 OString expVal; 1896 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 1897 const sal_Char* input = kTestStr25; 1898 1899 aStrBuf.append( input ); 1900 1901 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 0) to the string buffer arrOUS[2]"; 1902 1903 } 1904 1905 TEST_F(append_002, append_002_013) 1906 { 1907 OString expVal( kTestStr7 ); 1908 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 1909 const sal_Char* input = kTestStr7; 1910 1911 aStrBuf.append( input ); 1912 1913 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length less than 16) to the string buffer arrOUS[3]"; 1914 1915 } 1916 1917 TEST_F(append_002, append_002_014) 1918 { 1919 OString expVal( kTestStr2 ); 1920 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 1921 const sal_Char* input = kTestStr2; 1922 1923 aStrBuf.append( input ); 1924 1925 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length more than 16) to the string buffer arrOUS[3]"; 1926 1927 } 1928 1929 TEST_F(append_002, append_002_015) 1930 { 1931 OString expVal( kTestStr1 ); 1932 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 1933 const sal_Char* input = kTestStr1; 1934 1935 aStrBuf.append( input ); 1936 1937 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 16) to the string buffer arrOUS[3]"; 1938 1939 } 1940 1941 TEST_F(append_002, append_002_016) 1942 { 1943 OString expVal; 1944 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 1945 const sal_Char* input = kTestStr25; 1946 1947 aStrBuf.append( input ); 1948 1949 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 0) to the string buffer arrOUS[3]"; 1950 1951 } 1952 1953 TEST_F(append_002, append_002_017) 1954 { 1955 OString expVal( kTestStr29 ); 1956 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 1957 const sal_Char* input = kTestStr38; 1958 1959 aStrBuf.append( input ); 1960 1961 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length less than 16) to the string buffer arrOUS[4]"; 1962 1963 } 1964 1965 TEST_F(append_002, append_002_018) 1966 { 1967 OString expVal( kTestStr39 ); 1968 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 1969 const sal_Char* input = kTestStr17; 1970 1971 aStrBuf.append( input ); 1972 1973 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length more than 16) to the string buffer arrOUS[4]"; 1974 1975 } 1976 1977 TEST_F(append_002, append_002_019) 1978 { 1979 OString expVal( kTestStr40 ); 1980 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 1981 const sal_Char* input = kTestStr31; 1982 1983 aStrBuf.append( input ); 1984 1985 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 16) to the string buffer arrOUS[4]"; 1986 1987 } 1988 1989 TEST_F(append_002, append_002_020) 1990 { 1991 OString expVal( kTestStr28 ); 1992 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 1993 const sal_Char* input = kTestStr25; 1994 1995 aStrBuf.append( input ); 1996 1997 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 0) to the string buffer arrOUS[4]"; 1998 1999 } 2000 2001 #ifdef WITH_CORE 2002 TEST_F(append_002, append_002_021) 2003 { 2004 OString expVal; 2005 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 2006 const sal_Char* input = kTestStr25; 2007 2008 aStrBuf.append( input ); 2009 2010 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 0) to the string buffer(with INT_MAX)"; 2011 2012 } 2013 #endif 2014 2015 // ----------------------------------------------------------------------------- 2016 2017 class append_003 : public ::testing::Test 2018 { 2019 protected: 2020 OString* arrOUS[5]; 2021 2022 public: 2023 void SetUp() 2024 { 2025 arrOUS[0] = new OString( kTestStr7 ); 2026 arrOUS[1] = new OString( ); 2027 arrOUS[2] = new OString( kTestStr25 ); 2028 arrOUS[3] = new OString( "\0" ); 2029 arrOUS[4] = new OString( kTestStr28 ); 2030 2031 } 2032 2033 void TearDown() 2034 { 2035 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 2036 delete arrOUS[3]; delete arrOUS[4]; 2037 } 2038 }; 2039 2040 TEST_F(append_003, append_003_001) 2041 { 2042 OString expVal( kTestStr1 ); 2043 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2044 const sal_Char* input1 = kTestStr36; 2045 sal_Int32 input2 = 12; 2046 2047 aStrBuf.append( input1, input2 ); 2048 2049 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length less than 16) to the string buffer arrOUS[0]"; 2050 2051 } 2052 2053 TEST_F(append_003, append_003_002) 2054 { 2055 OString expVal( kTestStr2 ); 2056 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2057 const sal_Char* input1 = kTestStr36; 2058 sal_Int32 input2 = 28; 2059 2060 aStrBuf.append( input1, input2 ); 2061 2062 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length more than 16) to the string buffer arrOUS[0]"; 2063 2064 } 2065 2066 TEST_F(append_003, append_003_003) 2067 { 2068 OString expVal( kTestStr37 ); 2069 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2070 const sal_Char* input1 = kTestStr23; 2071 sal_Int32 input2 = 16; 2072 2073 aStrBuf.append( input1, input2 ); 2074 2075 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 16) to the string buffer arrOUS[0]"; 2076 2077 } 2078 2079 TEST_F(append_003, append_003_004) 2080 { 2081 OString expVal( kTestStr7 ); 2082 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2083 const sal_Char* input1 = kTestStr2; 2084 sal_Int32 input2 = 0; 2085 2086 aStrBuf.append( input1, input2 ); 2087 2088 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 0) to the string buffer arrOUS[0]"; 2089 2090 } 2091 2092 TEST_F(append_003, append_003_005) 2093 { 2094 // LLA: this is an illegal test, the input2 value must non-negative 2095 // LLA: OString expVal( kTestStr41 ); 2096 // LLA: ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2097 // LLA: const sal_Char* input1 = kTestStr2; 2098 // LLA: sal_Int32 input2 = -1; 2099 // LLA: 2100 // LLA: aStrBuf.append( input1, input2 ); 2101 // LLA: 2102 // LLA: ASSERT_TRUE(// LLA: ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) 2103 // LLA:) << // LLA: "Appends the string(length less than 0) to the string buffer arrOUS[0]"; 2104 2105 } 2106 2107 TEST_F(append_003, append_003_006) 2108 { 2109 OString expVal( kTestStr7 ); 2110 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 2111 const sal_Char* input1 = kTestStr2; 2112 sal_Int32 input2 = 4; 2113 2114 aStrBuf.append( input1, input2 ); 2115 2116 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length less than 16) to the string buffer arrOUS[1]"; 2117 2118 } 2119 2120 TEST_F(append_003, append_003_007) 2121 { 2122 OString expVal( kTestStr2 ); 2123 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 2124 const sal_Char* input1 = kTestStr2; 2125 sal_Int32 input2 = 32; 2126 2127 aStrBuf.append( input1, input2 ); 2128 2129 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length more than 16) to the string buffer arrOUS[1]"; 2130 2131 } 2132 2133 TEST_F(append_003, append_003_008) 2134 { 2135 OString expVal( kTestStr1 ); 2136 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 2137 const sal_Char* input1 = kTestStr2; 2138 sal_Int32 input2 = 16; 2139 2140 aStrBuf.append( input1, input2 ); 2141 2142 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 16) to the string buffer arrOUS[1]"; 2143 2144 } 2145 2146 TEST_F(append_003, append_003_009) 2147 { 2148 OString expVal; 2149 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 2150 const sal_Char* input1 = kTestStr2; 2151 sal_Int32 input2 = 0; 2152 2153 aStrBuf.append( input1, input2 ); 2154 2155 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 0) to the string buffer arrOUS[1]"; 2156 2157 } 2158 2159 TEST_F(append_003, append_003_010) 2160 { 2161 // LLA: this is an illegal test, the input2 value must non-negative 2162 // LLA: OString expVal; 2163 // LLA: ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 2164 // LLA: const sal_Char* input1 = kTestStr2; 2165 // LLA: sal_Int32 input2 = -1; 2166 // LLA: 2167 // LLA: aStrBuf.append( input1, input2 ); 2168 // LLA: 2169 // LLA: ASSERT_TRUE(// LLA: ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) 2170 // LLA:) << // LLA: "Appends the string(length less than 0) to the string buffer arrOUS[1]"; 2171 } 2172 2173 TEST_F(append_003, append_003_011) 2174 { 2175 OString expVal( kTestStr7 ); 2176 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 2177 const sal_Char* input1 = kTestStr2; 2178 sal_Int32 input2 = 4; 2179 2180 aStrBuf.append( input1, input2 ); 2181 2182 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length less than 16) to the string buffer arrOUS[2]"; 2183 2184 } 2185 2186 TEST_F(append_003, append_003_012) 2187 { 2188 OString expVal( kTestStr2 ); 2189 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 2190 const sal_Char* input1 = kTestStr2; 2191 sal_Int32 input2 = 32; 2192 2193 aStrBuf.append( input1, input2 ); 2194 2195 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length more than 16) to the string buffer arrOUS[2]"; 2196 2197 } 2198 2199 TEST_F(append_003, append_003_013) 2200 { 2201 OString expVal( kTestStr1 ); 2202 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 2203 const sal_Char* input1 = kTestStr2; 2204 sal_Int32 input2 = 16; 2205 2206 aStrBuf.append( input1, input2 ); 2207 2208 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 16) to the string buffer arrOUS[2]"; 2209 2210 } 2211 2212 TEST_F(append_003, append_003_014) 2213 { 2214 OString expVal; 2215 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 2216 const sal_Char* input1 = kTestStr2; 2217 sal_Int32 input2 = 0; 2218 2219 aStrBuf.append( input1, input2 ); 2220 2221 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 0) to the string buffer arrOUS[2]"; 2222 2223 } 2224 2225 TEST_F(append_003, append_003_015) 2226 { 2227 // LLA: this is an illegal test, the input2 value must non-negative 2228 // LLA: OString expVal; 2229 // LLA: ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 2230 // LLA: const sal_Char* input1 = kTestStr2; 2231 // LLA: sal_Int32 input2 = -1; 2232 // LLA: 2233 // LLA: aStrBuf.append( input1, input2 ); 2234 // LLA: 2235 // LLA: ASSERT_TRUE(// LLA: ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) 2236 // LLA:) << // LLA: "Appends the string(length less than 0) to the string buffer arrOUS[2]"; 2237 2238 } 2239 2240 TEST_F(append_003, append_003_016) 2241 { 2242 OString expVal( kTestStr7 ); 2243 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 2244 const sal_Char* input1 = kTestStr2; 2245 sal_Int32 input2 = 4; 2246 2247 aStrBuf.append( input1, input2 ); 2248 2249 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length less than 16) to the string buffer arrOUS[3]"; 2250 2251 } 2252 2253 TEST_F(append_003, append_003_017) 2254 { 2255 OString expVal( kTestStr2 ); 2256 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 2257 const sal_Char* input1 = kTestStr2; 2258 sal_Int32 input2 = 32; 2259 2260 aStrBuf.append( input1, input2 ); 2261 2262 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length more than 16) to the string buffer arrOUS[3]"; 2263 2264 } 2265 2266 TEST_F(append_003, append_003_018) 2267 { 2268 OString expVal( kTestStr1 ); 2269 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 2270 const sal_Char* input1 = kTestStr2; 2271 sal_Int32 input2 = 16; 2272 2273 aStrBuf.append( input1, input2 ); 2274 2275 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 16) to the string buffer arrOUS[3]"; 2276 2277 } 2278 2279 TEST_F(append_003, append_003_019) 2280 { 2281 OString expVal; 2282 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 2283 const sal_Char* input1 = kTestStr2; 2284 sal_Int32 input2 = 0; 2285 2286 aStrBuf.append( input1, input2 ); 2287 2288 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 0) to the string buffer arrOUS[3]"; 2289 2290 } 2291 2292 TEST_F(append_003, append_003_020) 2293 { 2294 // LLA: this is an illegal test, the input2 value must non-negative 2295 // LLA: OString expVal; 2296 // LLA: ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 2297 // LLA: const sal_Char* input1 = kTestStr2; 2298 // LLA: sal_Int32 input2 = -1; 2299 // LLA: 2300 // LLA: aStrBuf.append( input1, input2 ); 2301 // LLA: 2302 // LLA: ASSERT_TRUE(// LLA: ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) 2303 // LLA:) << // LLA: "Appends the string(length less than 0) to the string buffer arrOUS[3]"; 2304 2305 } 2306 2307 TEST_F(append_003, append_003_021) 2308 { 2309 OString expVal( kTestStr29 ); 2310 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 2311 const sal_Char* input1 = kTestStr38; 2312 sal_Int32 input2 = 7; 2313 2314 aStrBuf.append( input1, input2 ); 2315 2316 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length less than 16) to the string buffer arrOUS[4]"; 2317 2318 } 2319 2320 TEST_F(append_003, append_003_022) 2321 { 2322 OString expVal( kTestStr39 ); 2323 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 2324 const sal_Char* input1 = kTestStr17; 2325 sal_Int32 input2 = 22; 2326 2327 aStrBuf.append( input1, input2 ); 2328 2329 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length more than 16) to the string buffer arrOUS[4]"; 2330 2331 } 2332 2333 TEST_F(append_003, append_003_023) 2334 { 2335 OString expVal( kTestStr40 ); 2336 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 2337 const sal_Char* input1 = kTestStr31; 2338 sal_Int32 input2 = 16; 2339 2340 aStrBuf.append( input1, input2 ); 2341 2342 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 16) to the string buffer arrOUS[4]"; 2343 2344 } 2345 2346 TEST_F(append_003, append_003_024) 2347 { 2348 OString expVal( kTestStr28 ); 2349 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 2350 const sal_Char* input1 = kTestStr2; 2351 sal_Int32 input2 = 0; 2352 2353 aStrBuf.append( input1, input2 ); 2354 2355 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 0) to the string buffer arrOUS[4]"; 2356 2357 } 2358 2359 TEST_F(append_003, append_003_025) 2360 { 2361 // LLA: this is an illegal test, the input2 value must non-negative 2362 // LLA: OString expVal( kTestStr42 ); 2363 // LLA: ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 2364 // LLA: const sal_Char* input1 = kTestStr2; 2365 // LLA: sal_Int32 input2 = -1; 2366 // LLA: 2367 // LLA: aStrBuf.append( input1, input2 ); 2368 // LLA: 2369 // LLA: ASSERT_TRUE(// LLA: ( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() ) 2370 // LLA:) << // LLA: "Appends the string(length less than 0) to the string buffer arrOUS[4]"; 2371 2372 } 2373 2374 #ifdef WITH_CORE 2375 TEST_F(append_003, append_003_026) 2376 { 2377 OString expVal; 2378 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 2379 const sal_Char* input1 = kTestStr25; 2380 sal_Int32 input2 = 0; 2381 2382 aStrBuf.append( input1, input2 ); 2383 2384 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the string(length equal to 0) to the string buffer(with INT_MAX)"; 2385 2386 } 2387 #endif 2388 2389 // ----------------------------------------------------------------------------- 2390 2391 class append_004 : public ::testing::Test 2392 { 2393 protected: 2394 OString* arrOUS[5]; 2395 2396 public: 2397 void SetUp() 2398 { 2399 arrOUS[0] = new OString( kTestStr7 ); 2400 arrOUS[1] = new OString( ); 2401 arrOUS[2] = new OString( kTestStr25 ); 2402 arrOUS[3] = new OString( "\0" ); 2403 arrOUS[4] = new OString( kTestStr28 ); 2404 2405 } 2406 2407 void TearDown() 2408 { 2409 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 2410 delete arrOUS[3]; delete arrOUS[4]; 2411 } 2412 }; 2413 2414 TEST_F(append_004, append_004_001) 2415 { 2416 OString expVal( kTestStr45 ); 2417 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2418 sal_Bool input = sal_True; 2419 2420 aStrBuf.append( input ); 2421 2422 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Bool(sal_True) to the string buffer arrOUS[0]"; 2423 2424 } 2425 2426 TEST_F(append_004, append_004_002) 2427 { 2428 OString expVal( kTestStr46 ); 2429 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2430 sal_Bool input = sal_False; 2431 2432 aStrBuf.append( input ); 2433 2434 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Bool(sal_False) to the string buffer arrOUS[0]"; 2435 2436 } 2437 2438 TEST_F(append_004, append_004_003) 2439 { 2440 OString expVal( kTestStr47 ); 2441 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 2442 sal_Bool input = sal_True; 2443 2444 aStrBuf.append( input ); 2445 2446 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Bool(sal_True) to the string buffer arrOUS[1]"; 2447 2448 } 2449 2450 TEST_F(append_004, append_004_004) 2451 { 2452 OString expVal( kTestStr48 ); 2453 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 2454 sal_Bool input = sal_False; 2455 2456 aStrBuf.append( input ); 2457 2458 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Bool(sal_False) to the string buffer arrOUS[1]"; 2459 2460 } 2461 2462 TEST_F(append_004, append_004_005) 2463 { 2464 OString expVal( kTestStr47 ); 2465 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 2466 sal_Bool input = sal_True; 2467 2468 aStrBuf.append( input ); 2469 2470 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Bool(sal_True) to the string buffer arrOUS[2]"; 2471 2472 } 2473 2474 TEST_F(append_004, append_004_006) 2475 { 2476 OString expVal( kTestStr48 ); 2477 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 2478 sal_Bool input = sal_False; 2479 2480 aStrBuf.append( input ); 2481 2482 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Bool(sal_False) to the string buffer arrOUS[2]"; 2483 2484 } 2485 2486 TEST_F(append_004, append_004_007) 2487 { 2488 OString expVal( kTestStr47 ); 2489 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 2490 sal_Bool input = sal_True; 2491 2492 aStrBuf.append( input ); 2493 2494 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Bool(sal_True) to the string buffer arrOUS[3]"; 2495 2496 } 2497 2498 TEST_F(append_004, append_004_008) 2499 { 2500 OString expVal( kTestStr48 ); 2501 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 2502 sal_Bool input = sal_False; 2503 2504 aStrBuf.append( input ); 2505 2506 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Bool(sal_False) to the string buffer arrOUS[3]"; 2507 2508 } 2509 2510 TEST_F(append_004, append_004_009) 2511 { 2512 OString expVal( kTestStr49 ); 2513 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 2514 sal_Bool input = sal_True; 2515 2516 aStrBuf.append( input ); 2517 2518 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Bool(sal_True) to the string buffer arrOUS[4]"; 2519 2520 } 2521 2522 TEST_F(append_004, append_004_010) 2523 { 2524 OString expVal( kTestStr50 ); 2525 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 2526 sal_Bool input = sal_False; 2527 2528 aStrBuf.append( input ); 2529 2530 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Bool(sal_False) to the string buffer arrOUS[4]"; 2531 2532 } 2533 2534 #ifdef WITH_CORE 2535 TEST_F(append_004, append_004_011) 2536 { 2537 OString expVal( kTestStr47 ); 2538 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 2539 sal_Bool input = sal_True; 2540 2541 aStrBuf.append( input ); 2542 2543 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Bool(sal_True) to the string buffer(with INT_MAX)"; 2544 2545 } 2546 2547 TEST_F(append_004, append_004_012) 2548 { 2549 OString expVal( kTestStr48 ); 2550 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 2551 sal_Bool input = sal_False; 2552 2553 aStrBuf.append( input ); 2554 2555 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Bool(sal_False) to the string buffer(with INT_MAX)"; 2556 2557 } 2558 #endif 2559 2560 //------------------------------------------------------------------------ 2561 // testing the method append(sal_Char c) 2562 //------------------------------------------------------------------------ 2563 class append_005 : public ::testing::Test 2564 { 2565 protected: 2566 OString* arrOUS[5]; 2567 2568 public: 2569 void SetUp() 2570 { 2571 arrOUS[0] = new OString( kTestStr7 ); 2572 arrOUS[1] = new OString( ); 2573 arrOUS[2] = new OString( kTestStr25 ); 2574 arrOUS[3] = new OString( "\0" ); 2575 arrOUS[4] = new OString( kTestStr28 ); 2576 2577 } 2578 2579 void TearDown() 2580 { 2581 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 2582 delete arrOUS[3]; delete arrOUS[4]; 2583 } 2584 }; 2585 2586 TEST_F(append_005, append_001) 2587 { 2588 OString expVal( kTestStr51 ); 2589 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2590 sal_Char input = 'M'; 2591 2592 aStrBuf.append( input ); 2593 2594 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Char(M) to the string buffer arrOUS[0]"; 2595 2596 } 2597 2598 TEST_F(append_005, append_002) 2599 { 2600 OString expVal( kTestStr143 ); 2601 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2602 sal_Char input = static_cast<sal_Char>(SAL_MAX_UINT8); 2603 2604 aStrBuf.append( input ); 2605 2606 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Unicode(kSInt8Max) to the string buffer arrOUS[0]"; 2607 2608 } 2609 2610 TEST_F(append_005, append_003) 2611 { 2612 OString expVal( kTestStr27 ); 2613 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 2614 sal_Char input = 's'; 2615 2616 aStrBuf.append( input ); 2617 2618 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Char(s) to the string buffer arrOUS[1]"; 2619 2620 } 2621 2622 TEST_F(append_005, append_004) 2623 { 2624 OString expVal( kTestStr144 ); 2625 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 2626 sal_Char input = static_cast<sal_Char>(SAL_MAX_UINT8); 2627 2628 aStrBuf.append( input ); 2629 2630 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Char(kSInt8Max) to the string buffer arrOUS[1]"; 2631 2632 } 2633 2634 TEST_F(append_005, append_005_005) 2635 { 2636 OString expVal( kTestStr27 ); 2637 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 2638 sal_Char input = 's'; 2639 2640 aStrBuf.append( input ); 2641 2642 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Char(s) to the string buffer arrOUS[2]"; 2643 2644 } 2645 2646 TEST_F(append_005, append_006) 2647 { 2648 OString expVal( kTestStr144 ); 2649 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 2650 sal_Char input = static_cast<sal_Char>(SAL_MAX_UINT8); 2651 2652 aStrBuf.append( input ); 2653 2654 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Char(kSInt8Max) to the string buffer arrOUS[2]"; 2655 2656 } 2657 2658 TEST_F(append_005, append_007) 2659 { 2660 OString expVal( kTestStr27 ); 2661 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 2662 sal_Char input = 's'; 2663 2664 aStrBuf.append( input ); 2665 2666 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Char(s) to the string buffer arrOUS[3]"; 2667 2668 } 2669 2670 TEST_F(append_005, append_008) 2671 { 2672 OString expVal( kTestStr144 ); 2673 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 2674 sal_Char input = static_cast<sal_Char>(SAL_MAX_UINT8); 2675 2676 aStrBuf.append( input ); 2677 2678 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Char(kSInt8Max) to the string buffer arrOUS[3]"; 2679 2680 } 2681 2682 TEST_F(append_005, append_009) 2683 { 2684 OString expVal( kTestStr56 ); 2685 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 2686 sal_Char input = 's'; 2687 2688 aStrBuf.append( input ); 2689 2690 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Char(s) to the string buffer arrOUS[4]"; 2691 2692 } 2693 2694 TEST_F(append_005, append_010) 2695 { 2696 OString expVal( kTestStr145 ); 2697 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 2698 sal_Char input = static_cast<sal_Char>(SAL_MAX_UINT8); 2699 2700 aStrBuf.append( input ); 2701 2702 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Char(kSInt8Max) to the string buffer arrOUS[4]"; 2703 2704 } 2705 2706 #ifdef WITH_CORE 2707 TEST_F(append_005, append_011) 2708 { 2709 OString expVal( kTestStr27 ); 2710 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 2711 sal_Char input = 's'; 2712 2713 aStrBuf.append( input ); 2714 2715 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Char(s) to the string buffer(with INT_MAX)"; 2716 2717 } 2718 2719 TEST_F(append_005, append_012) 2720 { 2721 OString expVal( kTestStr144 ); 2722 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 2723 sal_Char input = static_cast<sal_Char>(SAL_MAX_UINT8); 2724 2725 aStrBuf.append( input ); 2726 2727 ASSERT_TRUE(( aStrBuf.getStr()== expVal) &&( aStrBuf.getLength() == expVal.getLength() )) << "Appends the sal_Char(kSInt8Max) to the string buffer with INT_MAX)"; 2728 2729 } 2730 #endif 2731 2732 /** 2733 * Calls the method append(T, radix) and compares 2734 * returned OUString with OUString that passed in the array resArray. 2735 * 2736 * @param T, type of argument, passed to append 2737 * @param resArray, array of result ustrings to compare to 2738 * @param n the number of elements in the array resArray (testcases) 2739 * @param pTestResult the instance of the class TestResult 2740 * @param inArray [optional], array of value that is passed as first argument 2741 * to append 2742 * 2743 * @return true, if all returned OUString are equal to corresponding OUString in 2744 * resArray else, false. 2745 */ 2746 /*template <class T> 2747 sal_Bool test_append( const char** resArray, int n, sal_Int16 radix, 2748 const T *inArray, OStringBuffer &aStr1 ) 2749 { 2750 sal_Bool bRes = sal_True; 2751 2752 //sal_Char methName[MAXBUFLENGTH]; 2753 //sal_Char* pMeth = methName; 2754 sal_Int32 i; 2755 // static sal_Unicode aUchar[80]={0x12}; 2756 2757 for (i = 0; i < n; i++) 2758 { 2759 2760 OSL_ENSURE( i < 80, "ERROR: leave aUchar bound"); 2761 2762 // AStringToUStringCopy(aUchar,resArray[i]); 2763 2764 ::rtl::OString aStr2(aStr1.getStr()); 2765 ::rtl::OString aStr3( "-" ); 2766 2767 if (inArray == 0) 2768 { 2769 aStr2 += OString(resArray[i]); 2770 aStr1.append((T)i, radix); 2771 } 2772 else 2773 { 2774 // sal_Unicode aStr4[100]; 2775 if ( inArray[i] < 0 ) 2776 { 2777 aStr2 += aStr3; 2778 2779 } 2780 // if(AStringToUStringCopy(aStr4,resArray[i])) 2781 // { 2782 aStr2 += OString(resArray[i]); 2783 // } 2784 aStr1.append((T)inArray[i], radix); 2785 } 2786 2787 ASSERT_TRUE(aStr1.getStr()== aStr2 && 2788 aStr1.getLength() == aStr2.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[0]"; 2789 } 2790 2791 return (bRes); 2792 } 2793 #define test_append_Int32 test_append<sal_Int32> 2794 #define test_append_Int64 test_append<sal_Int64> 2795 #define test_append_float test_append<float> 2796 #define test_append_double test_append<double>*/ 2797 //------------------------------------------------------------------------ 2798 // testing the method append( sal_Int32 i, sal_Int16 radix=2 ) 2799 // testing the method append( sal_Int32 i, sal_Int16 radix=8 ) 2800 // testing the method append( sal_Int32 i, sal_Int16 radix=10 ) 2801 // testing the method append( sal_Int32 i, sal_Int16 radix=16 ) 2802 // testing the method append( sal_Int32 i, sal_Int16 radix=36 ) 2803 //------------------------------------------------------------------------ 2804 class append_006_Int32 : public ::testing::Test 2805 { 2806 protected: 2807 OString* arrOUS[5]; 2808 2809 public: 2810 void SetUp() 2811 { 2812 arrOUS[0] = new OString( kTestStr7 ); 2813 arrOUS[1] = new OString( ); 2814 arrOUS[2] = new OString( kTestStr25 ); 2815 arrOUS[3] = new OString( "\0" ); 2816 arrOUS[4] = new OString( kTestStr28 ); 2817 2818 } 2819 2820 void TearDown() 2821 { 2822 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 2823 delete arrOUS[3]; delete arrOUS[4]; 2824 } 2825 2826 // For some bizarre reason, only odd numbered tests were set up to run with cppunit 2827 }; 2828 2829 TEST_F(append_006_Int32, append_001) 2830 { 2831 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2832 OString expVal( aStrBuf.getStr() ); 2833 sal_Int32 input = 0; 2834 sal_Int16 radix = 2; 2835 2836 expVal += OString( "0" ); 2837 aStrBuf.append( input, radix ); 2838 2839 /*test_append_Int32((const char**)kBinaryNumsStr, 2840 kBinaryNumsCount, kRadixBinary, 2841 0, aStrBuf );*/ 2842 2843 ASSERT_TRUE(aStrBuf.getStr()== expVal && 2844 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[0]"; 2845 2846 } 2847 2848 TEST_F(append_006_Int32, append_002) 2849 { 2850 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2851 OString expVal( aStrBuf.getStr() ); 2852 sal_Int32 input = 4; 2853 sal_Int16 radix = 2; 2854 2855 expVal += OString( "100" ); 2856 aStrBuf.append( input, radix ); 2857 2858 ASSERT_TRUE(aStrBuf.getStr()== expVal && 2859 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[0]"; 2860 2861 } 2862 2863 TEST_F(append_006_Int32, append_003) 2864 { 2865 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2866 OString expVal( aStrBuf.getStr() ); 2867 sal_Int32 input = 8; 2868 sal_Int16 radix = 2; 2869 2870 expVal += OString( "1000" ); 2871 aStrBuf.append( input, radix ); 2872 2873 ASSERT_TRUE(aStrBuf.getStr()== expVal && 2874 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[0]"; 2875 2876 } 2877 2878 TEST_F(append_006_Int32, append_004) 2879 { 2880 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2881 OString expVal( aStrBuf.getStr() ); 2882 sal_Int32 input = 15; 2883 sal_Int16 radix = 2; 2884 2885 expVal += OString( "1111" ); 2886 aStrBuf.append( input, radix ); 2887 2888 ASSERT_TRUE(aStrBuf.getStr()== expVal && 2889 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[0]"; 2890 2891 } 2892 2893 TEST_F(append_006_Int32, append_005) 2894 { 2895 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2896 OString expVal( aStrBuf.getStr() ); 2897 sal_Int32 input = 0; 2898 sal_Int16 radix = 8; 2899 2900 expVal += OString( "0" ); 2901 aStrBuf.append( input, radix ); 2902 2903 ASSERT_TRUE(aStrBuf.getStr()== expVal && 2904 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[0]"; 2905 2906 } 2907 2908 TEST_F(append_006_Int32, append_006) 2909 { 2910 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2911 OString expVal( aStrBuf.getStr() ); 2912 sal_Int32 input = 4; 2913 sal_Int16 radix = 8; 2914 2915 expVal += OString( "4" ); 2916 aStrBuf.append( input, radix ); 2917 2918 ASSERT_TRUE(aStrBuf.getStr()== expVal && 2919 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[0]"; 2920 2921 } 2922 2923 TEST_F(append_006_Int32, append_007) 2924 { 2925 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2926 OString expVal( aStrBuf.getStr() ); 2927 sal_Int32 input = 8; 2928 sal_Int16 radix = 8; 2929 2930 expVal += OString( "10" ); 2931 aStrBuf.append( input, radix ); 2932 2933 ASSERT_TRUE(aStrBuf.getStr()== expVal && 2934 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[0]"; 2935 2936 } 2937 2938 TEST_F(append_006_Int32, append_008) 2939 { 2940 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2941 OString expVal( aStrBuf.getStr() ); 2942 sal_Int32 input = 15; 2943 sal_Int16 radix = 8; 2944 2945 expVal += OString( "17" ); 2946 aStrBuf.append( input, radix ); 2947 2948 ASSERT_TRUE(aStrBuf.getStr()== expVal && 2949 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[0]"; 2950 2951 } 2952 2953 TEST_F(append_006_Int32, append_009) 2954 { 2955 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2956 OString expVal( aStrBuf.getStr() ); 2957 sal_Int32 input = 0; 2958 sal_Int16 radix = 10; 2959 2960 expVal += OString( "0" ); 2961 aStrBuf.append( input, radix ); 2962 2963 ASSERT_TRUE(aStrBuf.getStr()== expVal && 2964 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[0]"; 2965 2966 } 2967 2968 TEST_F(append_006_Int32, append_010) 2969 { 2970 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2971 OString expVal( aStrBuf.getStr() ); 2972 sal_Int32 input = 4; 2973 sal_Int16 radix = 10; 2974 2975 expVal += OString( "4" ); 2976 aStrBuf.append( input, radix ); 2977 2978 ASSERT_TRUE(aStrBuf.getStr()== expVal && 2979 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[0]"; 2980 2981 } 2982 2983 TEST_F(append_006_Int32, append_011) 2984 { 2985 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 2986 OString expVal( aStrBuf.getStr() ); 2987 sal_Int32 input = 8; 2988 sal_Int16 radix = 10; 2989 2990 expVal += OString( "8" ); 2991 aStrBuf.append( input, radix ); 2992 2993 ASSERT_TRUE(aStrBuf.getStr()== expVal && 2994 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[0]"; 2995 2996 } 2997 2998 TEST_F(append_006_Int32, append_012) 2999 { 3000 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 3001 OString expVal( aStrBuf.getStr() ); 3002 sal_Int32 input = 15; 3003 sal_Int16 radix = 10; 3004 3005 expVal += OString( "15" ); 3006 aStrBuf.append( input, radix ); 3007 3008 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3009 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[0]"; 3010 3011 } 3012 3013 TEST_F(append_006_Int32, append_013) 3014 { 3015 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 3016 OString expVal( aStrBuf.getStr() ); 3017 sal_Int32 input = 0; 3018 sal_Int16 radix = 16; 3019 3020 expVal += OString( "0" ); 3021 aStrBuf.append( input, radix ); 3022 3023 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3024 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[0]"; 3025 3026 } 3027 3028 TEST_F(append_006_Int32, append_014) 3029 { 3030 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 3031 OString expVal( aStrBuf.getStr() ); 3032 sal_Int32 input = 4; 3033 sal_Int16 radix = 16; 3034 3035 expVal += OString( "4" ); 3036 aStrBuf.append( input, radix ); 3037 3038 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3039 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[0]"; 3040 3041 } 3042 3043 TEST_F(append_006_Int32, append_015) 3044 { 3045 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 3046 OString expVal( aStrBuf.getStr() ); 3047 sal_Int32 input = 8; 3048 sal_Int16 radix = 16; 3049 3050 expVal += OString( "8" ); 3051 aStrBuf.append( input, radix ); 3052 3053 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3054 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[0]"; 3055 3056 } 3057 3058 TEST_F(append_006_Int32, append_016) 3059 { 3060 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 3061 OString expVal( aStrBuf.getStr() ); 3062 sal_Int32 input = 15; 3063 sal_Int16 radix = 16; 3064 3065 expVal += OString( "f" ); 3066 aStrBuf.append( input, radix ); 3067 3068 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3069 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[0]"; 3070 3071 } 3072 3073 TEST_F(append_006_Int32, append_017) 3074 { 3075 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 3076 OString expVal( aStrBuf.getStr() ); 3077 sal_Int32 input = 0; 3078 sal_Int16 radix = 36; 3079 3080 expVal += OString( "0" ); 3081 aStrBuf.append( input, radix ); 3082 3083 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3084 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[0]"; 3085 3086 } 3087 3088 TEST_F(append_006_Int32, append_018) 3089 { 3090 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 3091 OString expVal( aStrBuf.getStr() ); 3092 sal_Int32 input = 4; 3093 sal_Int16 radix = 36; 3094 3095 expVal += OString( "4" ); 3096 aStrBuf.append( input, radix ); 3097 3098 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3099 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[0]"; 3100 3101 } 3102 3103 TEST_F(append_006_Int32, append_019) 3104 { 3105 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 3106 OString expVal( aStrBuf.getStr() ); 3107 sal_Int32 input = 8; 3108 sal_Int16 radix = 36; 3109 3110 expVal += OString( "8" ); 3111 aStrBuf.append( input, radix ); 3112 3113 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3114 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[0]"; 3115 3116 } 3117 3118 TEST_F(append_006_Int32, append_020) 3119 { 3120 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 3121 OString expVal( aStrBuf.getStr() ); 3122 sal_Int32 input = 35; 3123 sal_Int16 radix = 36; 3124 3125 expVal += OString( "z" ); 3126 aStrBuf.append( input, radix ); 3127 3128 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3129 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[0]"; 3130 3131 } 3132 3133 TEST_F(append_006_Int32, append_021) 3134 { 3135 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3136 OString expVal( aStrBuf.getStr() ); 3137 sal_Int32 input = 0; 3138 sal_Int16 radix = 2; 3139 3140 expVal += OString( "0" ); 3141 aStrBuf.append( input, radix ); 3142 3143 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3144 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[1]"; 3145 3146 } 3147 3148 TEST_F(append_006_Int32, append_022) 3149 { 3150 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3151 OString expVal( aStrBuf.getStr() ); 3152 sal_Int32 input = 4; 3153 sal_Int16 radix = 2; 3154 3155 expVal += OString( "100" ); 3156 aStrBuf.append( input, radix ); 3157 3158 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3159 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[1]"; 3160 3161 } 3162 3163 TEST_F(append_006_Int32, append_023) 3164 { 3165 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3166 OString expVal( aStrBuf.getStr() ); 3167 sal_Int32 input = 8; 3168 sal_Int16 radix = 2; 3169 3170 expVal += OString( "1000" ); 3171 aStrBuf.append( input, radix ); 3172 3173 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3174 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[1]"; 3175 3176 } 3177 3178 TEST_F(append_006_Int32, append_024) 3179 { 3180 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3181 OString expVal( aStrBuf.getStr() ); 3182 sal_Int32 input = 15; 3183 sal_Int16 radix = 2; 3184 3185 expVal += OString( "1111" ); 3186 aStrBuf.append( input, radix ); 3187 3188 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3189 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[1]"; 3190 3191 } 3192 3193 TEST_F(append_006_Int32, append_025) 3194 { 3195 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3196 OString expVal( aStrBuf.getStr() ); 3197 sal_Int32 input = 0; 3198 sal_Int16 radix = 8; 3199 3200 expVal += OString( "0" ); 3201 aStrBuf.append( input, radix ); 3202 3203 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3204 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[1]"; 3205 3206 } 3207 3208 TEST_F(append_006_Int32, append_026) 3209 { 3210 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3211 OString expVal( aStrBuf.getStr() ); 3212 sal_Int32 input = 4; 3213 sal_Int16 radix = 8; 3214 3215 expVal += OString( "4" ); 3216 aStrBuf.append( input, radix ); 3217 3218 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3219 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[1]"; 3220 3221 } 3222 3223 TEST_F(append_006_Int32, append_027) 3224 { 3225 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3226 OString expVal( aStrBuf.getStr() ); 3227 sal_Int32 input = 8; 3228 sal_Int16 radix = 8; 3229 3230 expVal += OString( "10" ); 3231 aStrBuf.append( input, radix ); 3232 3233 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3234 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[1]"; 3235 3236 } 3237 3238 TEST_F(append_006_Int32, append_028) 3239 { 3240 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3241 OString expVal( aStrBuf.getStr() ); 3242 sal_Int32 input = 15; 3243 sal_Int16 radix = 8; 3244 3245 expVal += OString( "17" ); 3246 aStrBuf.append( input, radix ); 3247 3248 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3249 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[1]"; 3250 3251 } 3252 3253 TEST_F(append_006_Int32, append_029) 3254 { 3255 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3256 OString expVal( aStrBuf.getStr() ); 3257 sal_Int32 input = 0; 3258 sal_Int16 radix = 10; 3259 3260 expVal += OString( "0" ); 3261 aStrBuf.append( input, radix ); 3262 3263 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3264 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[1]"; 3265 3266 } 3267 3268 TEST_F(append_006_Int32, append_030) 3269 { 3270 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3271 OString expVal( aStrBuf.getStr() ); 3272 sal_Int32 input = 4; 3273 sal_Int16 radix = 10; 3274 3275 expVal += OString( "4" ); 3276 aStrBuf.append( input, radix ); 3277 3278 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3279 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[1]"; 3280 3281 } 3282 3283 TEST_F(append_006_Int32, append_031) 3284 { 3285 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3286 OString expVal( aStrBuf.getStr() ); 3287 sal_Int32 input = 8; 3288 sal_Int16 radix = 10; 3289 3290 expVal += OString( "8" ); 3291 aStrBuf.append( input, radix ); 3292 3293 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3294 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[1]"; 3295 3296 } 3297 3298 TEST_F(append_006_Int32, append_032) 3299 { 3300 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3301 OString expVal( aStrBuf.getStr() ); 3302 sal_Int32 input = 15; 3303 sal_Int16 radix = 10; 3304 3305 expVal += OString( "15" ); 3306 aStrBuf.append( input, radix ); 3307 3308 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3309 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[1]"; 3310 3311 } 3312 3313 TEST_F(append_006_Int32, append_033) 3314 { 3315 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3316 OString expVal( aStrBuf.getStr() ); 3317 sal_Int32 input = 0; 3318 sal_Int16 radix = 16; 3319 3320 expVal += OString( "0" ); 3321 aStrBuf.append( input, radix ); 3322 3323 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3324 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[1]"; 3325 3326 } 3327 3328 TEST_F(append_006_Int32, append_034) 3329 { 3330 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3331 OString expVal( aStrBuf.getStr() ); 3332 sal_Int32 input = 4; 3333 sal_Int16 radix = 16; 3334 3335 expVal += OString( "4" ); 3336 aStrBuf.append( input, radix ); 3337 3338 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3339 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[1]"; 3340 3341 } 3342 3343 TEST_F(append_006_Int32, append_035) 3344 { 3345 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3346 OString expVal( aStrBuf.getStr() ); 3347 sal_Int32 input = 8; 3348 sal_Int16 radix = 16; 3349 3350 expVal += OString( "8" ); 3351 aStrBuf.append( input, radix ); 3352 3353 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3354 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[1]"; 3355 3356 } 3357 3358 TEST_F(append_006_Int32, append_036) 3359 { 3360 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3361 OString expVal( aStrBuf.getStr() ); 3362 sal_Int32 input = 15; 3363 sal_Int16 radix = 16; 3364 3365 expVal += OString( "f" ); 3366 aStrBuf.append( input, radix ); 3367 3368 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3369 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[1]"; 3370 3371 } 3372 3373 TEST_F(append_006_Int32, append_037) 3374 { 3375 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3376 OString expVal( aStrBuf.getStr() ); 3377 sal_Int32 input = 0; 3378 sal_Int16 radix = 36; 3379 3380 expVal += OString( "0" ); 3381 aStrBuf.append( input, radix ); 3382 3383 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3384 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[1]"; 3385 3386 } 3387 3388 TEST_F(append_006_Int32, append_038) 3389 { 3390 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3391 OString expVal( aStrBuf.getStr() ); 3392 sal_Int32 input = 4; 3393 sal_Int16 radix = 36; 3394 3395 expVal += OString( "4" ); 3396 aStrBuf.append( input, radix ); 3397 3398 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3399 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[1]"; 3400 3401 } 3402 3403 TEST_F(append_006_Int32, append_039) 3404 { 3405 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3406 OString expVal( aStrBuf.getStr() ); 3407 sal_Int32 input = 8; 3408 sal_Int16 radix = 36; 3409 3410 expVal += OString( "8" ); 3411 aStrBuf.append( input, radix ); 3412 3413 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3414 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[1]"; 3415 3416 } 3417 3418 TEST_F(append_006_Int32, append_040) 3419 { 3420 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 3421 OString expVal( aStrBuf.getStr() ); 3422 sal_Int32 input = 35; 3423 sal_Int16 radix = 36; 3424 3425 expVal += OString( "z" ); 3426 aStrBuf.append( input, radix ); 3427 3428 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3429 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[1]"; 3430 3431 } 3432 3433 TEST_F(append_006_Int32, append_041) 3434 { 3435 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3436 OString expVal( aStrBuf.getStr() ); 3437 sal_Int32 input = 0; 3438 sal_Int16 radix = 2; 3439 3440 expVal += OString( "0" ); 3441 aStrBuf.append( input, radix ); 3442 3443 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3444 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[2]"; 3445 3446 } 3447 3448 TEST_F(append_006_Int32, append_042) 3449 { 3450 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3451 OString expVal( aStrBuf.getStr() ); 3452 sal_Int32 input = 4; 3453 sal_Int16 radix = 2; 3454 3455 expVal += OString( "100" ); 3456 aStrBuf.append( input, radix ); 3457 3458 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3459 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[2]"; 3460 3461 } 3462 3463 TEST_F(append_006_Int32, append_043) 3464 { 3465 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3466 OString expVal( aStrBuf.getStr() ); 3467 sal_Int32 input = 8; 3468 sal_Int16 radix = 2; 3469 3470 expVal += OString( "1000" ); 3471 aStrBuf.append( input, radix ); 3472 3473 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3474 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[2]"; 3475 3476 } 3477 3478 TEST_F(append_006_Int32, append_044) 3479 { 3480 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3481 OString expVal( aStrBuf.getStr() ); 3482 sal_Int32 input = 15; 3483 sal_Int16 radix = 2; 3484 3485 expVal += OString( "1111" ); 3486 aStrBuf.append( input, radix ); 3487 3488 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3489 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[2]"; 3490 3491 } 3492 3493 TEST_F(append_006_Int32, append_045) 3494 { 3495 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3496 OString expVal( aStrBuf.getStr() ); 3497 sal_Int32 input = 0; 3498 sal_Int16 radix = 8; 3499 3500 expVal += OString( "0" ); 3501 aStrBuf.append( input, radix ); 3502 3503 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3504 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[2]"; 3505 3506 } 3507 3508 TEST_F(append_006_Int32, append_046) 3509 { 3510 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3511 OString expVal( aStrBuf.getStr() ); 3512 sal_Int32 input = 4; 3513 sal_Int16 radix = 8; 3514 3515 expVal += OString( "4" ); 3516 aStrBuf.append( input, radix ); 3517 3518 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3519 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[2]"; 3520 3521 } 3522 3523 TEST_F(append_006_Int32, append_047) 3524 { 3525 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3526 OString expVal( aStrBuf.getStr() ); 3527 sal_Int32 input = 8; 3528 sal_Int16 radix = 8; 3529 3530 expVal += OString( "10" ); 3531 aStrBuf.append( input, radix ); 3532 3533 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3534 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[2]"; 3535 3536 } 3537 3538 TEST_F(append_006_Int32, append_048) 3539 { 3540 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3541 OString expVal( aStrBuf.getStr() ); 3542 sal_Int32 input = 15; 3543 sal_Int16 radix = 8; 3544 3545 expVal += OString( "17" ); 3546 aStrBuf.append( input, radix ); 3547 3548 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3549 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[2]"; 3550 3551 } 3552 3553 TEST_F(append_006_Int32, append_049) 3554 { 3555 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3556 OString expVal( aStrBuf.getStr() ); 3557 sal_Int32 input = 0; 3558 sal_Int16 radix = 10; 3559 3560 expVal += OString( "0" ); 3561 aStrBuf.append( input, radix ); 3562 3563 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3564 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[2]"; 3565 3566 } 3567 3568 TEST_F(append_006_Int32, append_050) 3569 { 3570 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3571 OString expVal( aStrBuf.getStr() ); 3572 sal_Int32 input = 4; 3573 sal_Int16 radix = 10; 3574 3575 expVal += OString( "4" ); 3576 aStrBuf.append( input, radix ); 3577 3578 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3579 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[2]"; 3580 3581 } 3582 3583 TEST_F(append_006_Int32, append_051) 3584 { 3585 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3586 OString expVal( aStrBuf.getStr() ); 3587 sal_Int32 input = 8; 3588 sal_Int16 radix = 10; 3589 3590 expVal += OString( "8" ); 3591 aStrBuf.append( input, radix ); 3592 3593 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3594 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[2]"; 3595 3596 } 3597 3598 TEST_F(append_006_Int32, append_052) 3599 { 3600 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3601 OString expVal( aStrBuf.getStr() ); 3602 sal_Int32 input = 15; 3603 sal_Int16 radix = 10; 3604 3605 expVal += OString( "15" ); 3606 aStrBuf.append( input, radix ); 3607 3608 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3609 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[2]"; 3610 3611 } 3612 3613 TEST_F(append_006_Int32, append_053) 3614 { 3615 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3616 OString expVal( aStrBuf.getStr() ); 3617 sal_Int32 input = 0; 3618 sal_Int16 radix = 16; 3619 3620 expVal += OString( "0" ); 3621 aStrBuf.append( input, radix ); 3622 3623 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3624 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[2]"; 3625 3626 } 3627 3628 TEST_F(append_006_Int32, append_054) 3629 { 3630 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3631 OString expVal( aStrBuf.getStr() ); 3632 sal_Int32 input = 4; 3633 sal_Int16 radix = 16; 3634 3635 expVal += OString( "4" ); 3636 aStrBuf.append( input, radix ); 3637 3638 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3639 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[2]"; 3640 3641 } 3642 3643 TEST_F(append_006_Int32, append_055) 3644 { 3645 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3646 OString expVal( aStrBuf.getStr() ); 3647 sal_Int32 input = 8; 3648 sal_Int16 radix = 16; 3649 3650 expVal += OString( "8" ); 3651 aStrBuf.append( input, radix ); 3652 3653 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3654 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[2]"; 3655 3656 } 3657 3658 TEST_F(append_006_Int32, append_056) 3659 { 3660 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3661 OString expVal( aStrBuf.getStr() ); 3662 sal_Int32 input = 15; 3663 sal_Int16 radix = 16; 3664 3665 expVal += OString( "f" ); 3666 aStrBuf.append( input, radix ); 3667 3668 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3669 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[2]"; 3670 3671 } 3672 3673 TEST_F(append_006_Int32, append_057) 3674 { 3675 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3676 OString expVal( aStrBuf.getStr() ); 3677 sal_Int32 input = 0; 3678 sal_Int16 radix = 36; 3679 3680 expVal += OString( "0" ); 3681 aStrBuf.append( input, radix ); 3682 3683 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3684 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[2]"; 3685 3686 } 3687 3688 TEST_F(append_006_Int32, append_058) 3689 { 3690 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3691 OString expVal( aStrBuf.getStr() ); 3692 sal_Int32 input = 4; 3693 sal_Int16 radix = 36; 3694 3695 expVal += OString( "4" ); 3696 aStrBuf.append( input, radix ); 3697 3698 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3699 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[2]"; 3700 3701 } 3702 3703 TEST_F(append_006_Int32, append_059) 3704 { 3705 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3706 OString expVal( aStrBuf.getStr() ); 3707 sal_Int32 input = 8; 3708 sal_Int16 radix = 36; 3709 3710 expVal += OString( "8" ); 3711 aStrBuf.append( input, radix ); 3712 3713 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3714 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[2]"; 3715 3716 } 3717 3718 TEST_F(append_006_Int32, append_060) 3719 { 3720 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 3721 OString expVal( aStrBuf.getStr() ); 3722 sal_Int32 input = 35; 3723 sal_Int16 radix = 36; 3724 3725 expVal += OString( "z" ); 3726 aStrBuf.append( input, radix ); 3727 3728 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3729 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[2]"; 3730 3731 } 3732 3733 TEST_F(append_006_Int32, append_061) 3734 { 3735 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3736 OString expVal( aStrBuf.getStr() ); 3737 sal_Int32 input = 0; 3738 sal_Int16 radix = 2; 3739 3740 expVal += OString( "0" ); 3741 aStrBuf.append( input, radix ); 3742 3743 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3744 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[3]"; 3745 3746 } 3747 3748 TEST_F(append_006_Int32, append_062) 3749 { 3750 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3751 OString expVal( aStrBuf.getStr() ); 3752 sal_Int32 input = 4; 3753 sal_Int16 radix = 2; 3754 3755 expVal += OString( "100" ); 3756 aStrBuf.append( input, radix ); 3757 3758 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3759 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[3]"; 3760 3761 } 3762 3763 TEST_F(append_006_Int32, append_063) 3764 { 3765 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3766 OString expVal( aStrBuf.getStr() ); 3767 sal_Int32 input = 8; 3768 sal_Int16 radix = 2; 3769 3770 expVal += OString( "1000" ); 3771 aStrBuf.append( input, radix ); 3772 3773 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3774 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[3]"; 3775 3776 } 3777 3778 TEST_F(append_006_Int32, append_064) 3779 { 3780 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3781 OString expVal( aStrBuf.getStr() ); 3782 sal_Int32 input = 15; 3783 sal_Int16 radix = 2; 3784 3785 expVal += OString( "1111" ); 3786 aStrBuf.append( input, radix ); 3787 3788 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3789 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[3]"; 3790 3791 } 3792 3793 TEST_F(append_006_Int32, append_065) 3794 { 3795 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3796 OString expVal( aStrBuf.getStr() ); 3797 sal_Int32 input = 0; 3798 sal_Int16 radix = 8; 3799 3800 expVal += OString( "0" ); 3801 aStrBuf.append( input, radix ); 3802 3803 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3804 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[3]"; 3805 3806 } 3807 3808 TEST_F(append_006_Int32, append_066) 3809 { 3810 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3811 OString expVal( aStrBuf.getStr() ); 3812 sal_Int32 input = 4; 3813 sal_Int16 radix = 8; 3814 3815 expVal += OString( "4" ); 3816 aStrBuf.append( input, radix ); 3817 3818 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3819 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[3]"; 3820 3821 } 3822 3823 TEST_F(append_006_Int32, append_067) 3824 { 3825 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3826 OString expVal( aStrBuf.getStr() ); 3827 sal_Int32 input = 8; 3828 sal_Int16 radix = 8; 3829 3830 expVal += OString( "10" ); 3831 aStrBuf.append( input, radix ); 3832 3833 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3834 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[3]"; 3835 3836 } 3837 3838 TEST_F(append_006_Int32, append_068) 3839 { 3840 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3841 OString expVal( aStrBuf.getStr() ); 3842 sal_Int32 input = 15; 3843 sal_Int16 radix = 8; 3844 3845 expVal += OString( "17" ); 3846 aStrBuf.append( input, radix ); 3847 3848 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3849 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[3]"; 3850 3851 } 3852 3853 TEST_F(append_006_Int32, append_069) 3854 { 3855 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3856 OString expVal( aStrBuf.getStr() ); 3857 sal_Int32 input = 0; 3858 sal_Int16 radix = 10; 3859 3860 expVal += OString( "0" ); 3861 aStrBuf.append( input, radix ); 3862 3863 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3864 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[3]"; 3865 3866 } 3867 3868 TEST_F(append_006_Int32, append_070) 3869 { 3870 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3871 OString expVal( aStrBuf.getStr() ); 3872 sal_Int32 input = 4; 3873 sal_Int16 radix = 10; 3874 3875 expVal += OString( "4" ); 3876 aStrBuf.append( input, radix ); 3877 3878 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3879 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[3]"; 3880 3881 } 3882 3883 TEST_F(append_006_Int32, append_071) 3884 { 3885 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3886 OString expVal( aStrBuf.getStr() ); 3887 sal_Int32 input = 8; 3888 sal_Int16 radix = 10; 3889 3890 expVal += OString( "8" ); 3891 aStrBuf.append( input, radix ); 3892 3893 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3894 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[3]"; 3895 3896 } 3897 3898 TEST_F(append_006_Int32, append_072) 3899 { 3900 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3901 OString expVal( aStrBuf.getStr() ); 3902 sal_Int32 input = 15; 3903 sal_Int16 radix = 10; 3904 3905 expVal += OString( "15" ); 3906 aStrBuf.append( input, radix ); 3907 3908 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3909 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[3]"; 3910 3911 } 3912 3913 TEST_F(append_006_Int32, append_073) 3914 { 3915 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3916 OString expVal( aStrBuf.getStr() ); 3917 sal_Int32 input = 0; 3918 sal_Int16 radix = 16; 3919 3920 expVal += OString( "0" ); 3921 aStrBuf.append( input, radix ); 3922 3923 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3924 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[3]"; 3925 3926 } 3927 3928 TEST_F(append_006_Int32, append_074) 3929 { 3930 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3931 OString expVal( aStrBuf.getStr() ); 3932 sal_Int32 input = 4; 3933 sal_Int16 radix = 16; 3934 3935 expVal += OString( "4" ); 3936 aStrBuf.append( input, radix ); 3937 3938 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3939 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[3]"; 3940 3941 } 3942 3943 TEST_F(append_006_Int32, append_075) 3944 { 3945 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3946 OString expVal( aStrBuf.getStr() ); 3947 sal_Int32 input = 8; 3948 sal_Int16 radix = 16; 3949 3950 expVal += OString( "8" ); 3951 aStrBuf.append( input, radix ); 3952 3953 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3954 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[3]"; 3955 3956 } 3957 3958 TEST_F(append_006_Int32, append_076) 3959 { 3960 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3961 OString expVal( aStrBuf.getStr() ); 3962 sal_Int32 input = 15; 3963 sal_Int16 radix = 16; 3964 3965 expVal += OString( "f" ); 3966 aStrBuf.append( input, radix ); 3967 3968 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3969 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[3]"; 3970 3971 } 3972 3973 TEST_F(append_006_Int32, append_077) 3974 { 3975 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3976 OString expVal( aStrBuf.getStr() ); 3977 sal_Int32 input = 0; 3978 sal_Int16 radix = 36; 3979 3980 expVal += OString( "0" ); 3981 aStrBuf.append( input, radix ); 3982 3983 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3984 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[3]"; 3985 3986 } 3987 3988 TEST_F(append_006_Int32, append_078) 3989 { 3990 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 3991 OString expVal( aStrBuf.getStr() ); 3992 sal_Int32 input = 4; 3993 sal_Int16 radix = 36; 3994 3995 expVal += OString( "4" ); 3996 aStrBuf.append( input, radix ); 3997 3998 ASSERT_TRUE(aStrBuf.getStr()== expVal && 3999 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[3]"; 4000 4001 } 4002 4003 TEST_F(append_006_Int32, append_079) 4004 { 4005 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 4006 OString expVal( aStrBuf.getStr() ); 4007 sal_Int32 input = 8; 4008 sal_Int16 radix = 36; 4009 4010 expVal += OString( "8" ); 4011 aStrBuf.append( input, radix ); 4012 4013 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4014 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[3]"; 4015 4016 } 4017 4018 TEST_F(append_006_Int32, append_080) 4019 { 4020 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 4021 OString expVal( aStrBuf.getStr() ); 4022 sal_Int32 input = 35; 4023 sal_Int16 radix = 36; 4024 4025 expVal += OString( "z" ); 4026 aStrBuf.append( input, radix ); 4027 4028 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4029 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[3]"; 4030 4031 } 4032 4033 TEST_F(append_006_Int32, append_081) 4034 { 4035 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4036 OString expVal( aStrBuf.getStr() ); 4037 sal_Int32 input = 0; 4038 sal_Int16 radix = 2; 4039 4040 expVal += OString( "0" ); 4041 aStrBuf.append( input, radix ); 4042 4043 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4044 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[4]"; 4045 4046 } 4047 4048 TEST_F(append_006_Int32, append_082) 4049 { 4050 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4051 OString expVal( aStrBuf.getStr() ); 4052 sal_Int32 input = 4; 4053 sal_Int16 radix = 2; 4054 4055 expVal += OString( "100" ); 4056 aStrBuf.append( input, radix ); 4057 4058 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4059 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[4]"; 4060 4061 } 4062 4063 TEST_F(append_006_Int32, append_083) 4064 { 4065 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4066 OString expVal( aStrBuf.getStr() ); 4067 sal_Int32 input = 8; 4068 sal_Int16 radix = 2; 4069 4070 expVal += OString( "1000" ); 4071 aStrBuf.append( input, radix ); 4072 4073 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4074 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[4]"; 4075 4076 } 4077 4078 TEST_F(append_006_Int32, append_084) 4079 { 4080 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4081 OString expVal( aStrBuf.getStr() ); 4082 sal_Int32 input = 15; 4083 sal_Int16 radix = 2; 4084 4085 expVal += OString( "1111" ); 4086 aStrBuf.append( input, radix ); 4087 4088 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4089 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_kRadixBinary for arrOUS[4]"; 4090 4091 } 4092 4093 TEST_F(append_006_Int32, append_085) 4094 { 4095 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4096 OString expVal( aStrBuf.getStr() ); 4097 sal_Int32 input = 0; 4098 sal_Int16 radix = 8; 4099 4100 expVal += OString( "0" ); 4101 aStrBuf.append( input, radix ); 4102 4103 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4104 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[4]"; 4105 4106 } 4107 4108 TEST_F(append_006_Int32, append_086) 4109 { 4110 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4111 OString expVal( aStrBuf.getStr() ); 4112 sal_Int32 input = 4; 4113 sal_Int16 radix = 8; 4114 4115 expVal += OString( "4" ); 4116 aStrBuf.append( input, radix ); 4117 4118 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4119 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[4]"; 4120 4121 } 4122 4123 TEST_F(append_006_Int32, append_087) 4124 { 4125 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4126 OString expVal( aStrBuf.getStr() ); 4127 sal_Int32 input = 8; 4128 sal_Int16 radix = 8; 4129 4130 expVal += OString( "10" ); 4131 aStrBuf.append( input, radix ); 4132 4133 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4134 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[4]"; 4135 4136 } 4137 4138 TEST_F(append_006_Int32, append_088) 4139 { 4140 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4141 OString expVal( aStrBuf.getStr() ); 4142 sal_Int32 input = 15; 4143 sal_Int16 radix = 8; 4144 4145 expVal += OString( "17" ); 4146 aStrBuf.append( input, radix ); 4147 4148 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4149 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_kRadixOctol for arrOUS[4]"; 4150 4151 } 4152 4153 TEST_F(append_006_Int32, append_089) 4154 { 4155 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4156 OString expVal( aStrBuf.getStr() ); 4157 sal_Int32 input = 0; 4158 sal_Int16 radix = 10; 4159 4160 expVal += OString( "0" ); 4161 aStrBuf.append( input, radix ); 4162 4163 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4164 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[4]"; 4165 4166 } 4167 4168 TEST_F(append_006_Int32, append_090) 4169 { 4170 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4171 OString expVal( aStrBuf.getStr() ); 4172 sal_Int32 input = 4; 4173 sal_Int16 radix = 10; 4174 4175 expVal += OString( "4" ); 4176 aStrBuf.append( input, radix ); 4177 4178 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4179 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[4]"; 4180 4181 } 4182 4183 TEST_F(append_006_Int32, append_091) 4184 { 4185 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4186 OString expVal( aStrBuf.getStr() ); 4187 sal_Int32 input = 8; 4188 sal_Int16 radix = 10; 4189 4190 expVal += OString( "8" ); 4191 aStrBuf.append( input, radix ); 4192 4193 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4194 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[4]"; 4195 4196 } 4197 4198 TEST_F(append_006_Int32, append_092) 4199 { 4200 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4201 OString expVal( aStrBuf.getStr() ); 4202 sal_Int32 input = 15; 4203 sal_Int16 radix = 10; 4204 4205 expVal += OString( "15" ); 4206 aStrBuf.append( input, radix ); 4207 4208 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4209 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_kRadixDecimal for arrOUS[4]"; 4210 4211 } 4212 4213 TEST_F(append_006_Int32, append_093) 4214 { 4215 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4216 OString expVal( aStrBuf.getStr() ); 4217 sal_Int32 input = 0; 4218 sal_Int16 radix = 16; 4219 4220 expVal += OString( "0" ); 4221 aStrBuf.append( input, radix ); 4222 4223 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4224 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[4]"; 4225 4226 } 4227 4228 TEST_F(append_006_Int32, append_094) 4229 { 4230 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4231 OString expVal( aStrBuf.getStr() ); 4232 sal_Int32 input = 4; 4233 sal_Int16 radix = 16; 4234 4235 expVal += OString( "4" ); 4236 aStrBuf.append( input, radix ); 4237 4238 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4239 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[4]"; 4240 4241 } 4242 4243 TEST_F(append_006_Int32, append_095) 4244 { 4245 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4246 OString expVal( aStrBuf.getStr() ); 4247 sal_Int32 input = 8; 4248 sal_Int16 radix = 16; 4249 4250 expVal += OString( "8" ); 4251 aStrBuf.append( input, radix ); 4252 4253 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4254 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[4]"; 4255 4256 } 4257 4258 TEST_F(append_006_Int32, append_096) 4259 { 4260 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4261 OString expVal( aStrBuf.getStr() ); 4262 sal_Int32 input = 15; 4263 sal_Int16 radix = 16; 4264 4265 expVal += OString( "f" ); 4266 aStrBuf.append( input, radix ); 4267 4268 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4269 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_kRadixHexdecimal for arrOUS[4]"; 4270 4271 } 4272 4273 TEST_F(append_006_Int32, append_097) 4274 { 4275 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4276 OString expVal( aStrBuf.getStr() ); 4277 sal_Int32 input = 0; 4278 sal_Int16 radix = 36; 4279 4280 expVal += OString( "0" ); 4281 aStrBuf.append( input, radix ); 4282 4283 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4284 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[4]"; 4285 4286 } 4287 4288 TEST_F(append_006_Int32, append_098) 4289 { 4290 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4291 OString expVal( aStrBuf.getStr() ); 4292 sal_Int32 input = 4; 4293 sal_Int16 radix = 36; 4294 4295 expVal += OString( "4" ); 4296 aStrBuf.append( input, radix ); 4297 4298 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4299 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[4]"; 4300 4301 } 4302 4303 TEST_F(append_006_Int32, append_099) 4304 { 4305 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4306 OString expVal( aStrBuf.getStr() ); 4307 sal_Int32 input = 8; 4308 sal_Int16 radix = 36; 4309 4310 expVal += OString( "8" ); 4311 aStrBuf.append( input, radix ); 4312 4313 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4314 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[4]"; 4315 4316 } 4317 4318 TEST_F(append_006_Int32, append_100) 4319 { 4320 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4321 OString expVal( aStrBuf.getStr() ); 4322 sal_Int32 input = 35; 4323 sal_Int16 radix = 36; 4324 4325 expVal += OString( "z" ); 4326 aStrBuf.append( input, radix ); 4327 4328 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4329 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_kRadixBase36 for arrOUS[4]"; 4330 4331 } 4332 4333 //------------------------------------------------------------------------ 4334 // testing the method append( sal_Int32 i, sal_Int16 radix=2 ) 4335 // where i = large constants 4336 // testing the method append( sal_Int32 i, sal_Int16 radix=8 ) 4337 // where i = large constants 4338 // testing the method append( sal_Int32 i, sal_Int16 radix=10 ) 4339 // where i = large constants 4340 // testing the method append( sal_Int32 i, sal_Int16 radix=16 ) 4341 // where i = large constants 4342 // testing the method append( sal_Int32 i, sal_Int16 radix=36 ) 4343 // where i = large constants 4344 //------------------------------------------------------------------------ 4345 class append_006_Int32_Bounderies : public ::testing::Test 4346 { 4347 protected: 4348 OString* arrOUS[5]; 4349 4350 public: 4351 void SetUp() 4352 { 4353 arrOUS[0] = new OString( kTestStr7 ); 4354 arrOUS[1] = new OString( ); 4355 arrOUS[2] = new OString( kTestStr25 ); 4356 arrOUS[3] = new OString( "\0" ); 4357 arrOUS[4] = new OString( kTestStr28 ); 4358 4359 } 4360 4361 void TearDown() 4362 { 4363 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 4364 delete arrOUS[3]; delete arrOUS[4]; 4365 } 4366 }; 4367 4368 TEST_F(append_006_Int32_Bounderies, append_001) 4369 { 4370 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 4371 OString expVal( aStrBuf.getStr() ); 4372 sal_Int32 input = kSInt8Max; 4373 sal_Int16 radix = 2; 4374 4375 expVal += OString( "1111111" ); 4376 aStrBuf.append( input, radix ); 4377 4378 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4379 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[0]"; 4380 4381 } 4382 4383 TEST_F(append_006_Int32_Bounderies, append_002) 4384 { 4385 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 4386 OString expVal( aStrBuf.getStr() ); 4387 sal_Int32 input = kSInt32Max; 4388 sal_Int16 radix = 2; 4389 4390 expVal += OString( "1111111111111111111111111111111" ); 4391 aStrBuf.append( input, radix ); 4392 4393 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4394 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[0]"; 4395 4396 } 4397 4398 TEST_F(append_006_Int32_Bounderies, append_003) 4399 { 4400 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 4401 OString expVal( aStrBuf.getStr() ); 4402 sal_Int32 input = kSInt8Max; 4403 sal_Int16 radix = 8; 4404 4405 expVal += OString( "177" ); 4406 aStrBuf.append( input, radix ); 4407 4408 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4409 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[0]"; 4410 4411 } 4412 4413 TEST_F(append_006_Int32_Bounderies, append_004) 4414 { 4415 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 4416 OString expVal( aStrBuf.getStr() ); 4417 sal_Int32 input = kSInt32Max; 4418 sal_Int16 radix = 8; 4419 4420 expVal += OString( "17777777777" ); 4421 aStrBuf.append( input, radix ); 4422 4423 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4424 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[0]"; 4425 4426 } 4427 4428 TEST_F(append_006_Int32_Bounderies, append_005) 4429 { 4430 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 4431 OString expVal( aStrBuf.getStr() ); 4432 sal_Int32 input = kSInt8Max; 4433 sal_Int16 radix = 10; 4434 4435 expVal += OString( "127" ); 4436 aStrBuf.append( input, radix ); 4437 4438 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4439 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[0]"; 4440 4441 } 4442 4443 TEST_F(append_006_Int32_Bounderies, append_006) 4444 { 4445 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 4446 OString expVal( aStrBuf.getStr() ); 4447 sal_Int32 input = kSInt32Max; 4448 sal_Int16 radix = 10; 4449 4450 expVal += OString( "2147483647" ); 4451 aStrBuf.append( input, radix ); 4452 4453 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4454 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[0]"; 4455 4456 } 4457 4458 TEST_F(append_006_Int32_Bounderies, append_007) 4459 { 4460 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 4461 OString expVal( aStrBuf.getStr() ); 4462 sal_Int32 input = kSInt8Max; 4463 sal_Int16 radix = 16; 4464 4465 expVal += OString( "7f" ); 4466 aStrBuf.append( input, radix ); 4467 4468 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4469 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[0]"; 4470 4471 } 4472 4473 TEST_F(append_006_Int32_Bounderies, append_008) 4474 { 4475 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 4476 OString expVal( aStrBuf.getStr() ); 4477 sal_Int32 input = kSInt32Max; 4478 sal_Int16 radix = 16; 4479 4480 expVal += OString( "7fffffff" ); 4481 aStrBuf.append( input, radix ); 4482 4483 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4484 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[0]"; 4485 4486 } 4487 4488 TEST_F(append_006_Int32_Bounderies, append_009) 4489 { 4490 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 4491 OString expVal( aStrBuf.getStr() ); 4492 sal_Int32 input = kSInt8Max; 4493 sal_Int16 radix = 36; 4494 4495 expVal += OString( "3j" ); 4496 aStrBuf.append( input, radix ); 4497 4498 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4499 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[0]"; 4500 4501 } 4502 4503 TEST_F(append_006_Int32_Bounderies, append_010) 4504 { 4505 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 4506 OString expVal( aStrBuf.getStr() ); 4507 sal_Int32 input = kSInt32Max; 4508 sal_Int16 radix = 36; 4509 4510 expVal += OString( "zik0zj" ); 4511 aStrBuf.append( input, radix ); 4512 4513 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4514 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[0]"; 4515 4516 } 4517 4518 TEST_F(append_006_Int32_Bounderies, append_011) 4519 { 4520 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 4521 OString expVal( aStrBuf.getStr() ); 4522 sal_Int32 input = kSInt8Max; 4523 sal_Int16 radix = 2; 4524 4525 expVal += OString( "1111111" ); 4526 aStrBuf.append( input, radix ); 4527 4528 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4529 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[1]"; 4530 4531 } 4532 4533 TEST_F(append_006_Int32_Bounderies, append_012) 4534 { 4535 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 4536 OString expVal( aStrBuf.getStr() ); 4537 sal_Int32 input = kSInt32Max; 4538 sal_Int16 radix = 2; 4539 4540 expVal += OString( "1111111111111111111111111111111" ); 4541 aStrBuf.append( input, radix ); 4542 4543 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4544 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[1]"; 4545 4546 } 4547 4548 TEST_F(append_006_Int32_Bounderies, append_013) 4549 { 4550 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 4551 OString expVal( aStrBuf.getStr() ); 4552 sal_Int32 input = kSInt8Max; 4553 sal_Int16 radix = 8; 4554 4555 expVal += OString( "177" ); 4556 aStrBuf.append( input, radix ); 4557 4558 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4559 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[1]"; 4560 4561 } 4562 4563 TEST_F(append_006_Int32_Bounderies, append_014) 4564 { 4565 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 4566 OString expVal( aStrBuf.getStr() ); 4567 sal_Int32 input = kSInt32Max; 4568 sal_Int16 radix = 8; 4569 4570 expVal += OString( "17777777777" ); 4571 aStrBuf.append( input, radix ); 4572 4573 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4574 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[1]"; 4575 4576 } 4577 4578 TEST_F(append_006_Int32_Bounderies, append_015) 4579 { 4580 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 4581 OString expVal( aStrBuf.getStr() ); 4582 sal_Int32 input = kSInt8Max; 4583 sal_Int16 radix = 10; 4584 4585 expVal += OString( "127" ); 4586 aStrBuf.append( input, radix ); 4587 4588 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4589 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[1]"; 4590 4591 } 4592 4593 TEST_F(append_006_Int32_Bounderies, append_016) 4594 { 4595 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 4596 OString expVal( aStrBuf.getStr() ); 4597 sal_Int32 input = kSInt32Max; 4598 sal_Int16 radix = 10; 4599 4600 expVal += OString( "2147483647" ); 4601 aStrBuf.append( input, radix ); 4602 4603 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4604 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[1]"; 4605 4606 } 4607 4608 TEST_F(append_006_Int32_Bounderies, append_017) 4609 { 4610 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 4611 OString expVal( aStrBuf.getStr() ); 4612 sal_Int32 input = kSInt8Max; 4613 sal_Int16 radix = 16; 4614 4615 expVal += OString( "7f" ); 4616 aStrBuf.append( input, radix ); 4617 4618 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4619 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[1]"; 4620 4621 } 4622 4623 TEST_F(append_006_Int32_Bounderies, append_018) 4624 { 4625 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 4626 OString expVal( aStrBuf.getStr() ); 4627 sal_Int32 input = kSInt32Max; 4628 sal_Int16 radix = 16; 4629 4630 expVal += OString( "7fffffff" ); 4631 aStrBuf.append( input, radix ); 4632 4633 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4634 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[1]"; 4635 4636 } 4637 4638 TEST_F(append_006_Int32_Bounderies, append_019) 4639 { 4640 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 4641 OString expVal( aStrBuf.getStr() ); 4642 sal_Int32 input = kSInt8Max; 4643 sal_Int16 radix = 36; 4644 4645 expVal += OString( "3j" ); 4646 aStrBuf.append( input, radix ); 4647 4648 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4649 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[1]"; 4650 4651 } 4652 4653 TEST_F(append_006_Int32_Bounderies, append_020) 4654 { 4655 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 4656 OString expVal( aStrBuf.getStr() ); 4657 sal_Int32 input = kSInt32Max; 4658 sal_Int16 radix = 36; 4659 4660 expVal += OString( "zik0zj" ); 4661 aStrBuf.append( input, radix ); 4662 4663 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4664 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[1]"; 4665 4666 } 4667 4668 TEST_F(append_006_Int32_Bounderies, append_021) 4669 { 4670 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 4671 OString expVal( aStrBuf.getStr() ); 4672 sal_Int32 input = kSInt8Max; 4673 sal_Int16 radix = 2; 4674 4675 expVal += OString( "1111111" ); 4676 aStrBuf.append( input, radix ); 4677 4678 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4679 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[2]"; 4680 4681 } 4682 4683 TEST_F(append_006_Int32_Bounderies, append_022) 4684 { 4685 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 4686 OString expVal( aStrBuf.getStr() ); 4687 sal_Int32 input = kSInt32Max; 4688 sal_Int16 radix = 2; 4689 4690 expVal += OString( "1111111111111111111111111111111" ); 4691 aStrBuf.append( input, radix ); 4692 4693 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4694 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[2]"; 4695 4696 } 4697 4698 TEST_F(append_006_Int32_Bounderies, append_023) 4699 { 4700 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 4701 OString expVal( aStrBuf.getStr() ); 4702 sal_Int32 input = kSInt8Max; 4703 sal_Int16 radix = 8; 4704 4705 expVal += OString( "177" ); 4706 aStrBuf.append( input, radix ); 4707 4708 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4709 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[2]"; 4710 4711 } 4712 4713 TEST_F(append_006_Int32_Bounderies, append_024) 4714 { 4715 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 4716 OString expVal( aStrBuf.getStr() ); 4717 sal_Int32 input = kSInt32Max; 4718 sal_Int16 radix = 8; 4719 4720 expVal += OString( "17777777777" ); 4721 aStrBuf.append( input, radix ); 4722 4723 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4724 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[2]"; 4725 4726 } 4727 4728 TEST_F(append_006_Int32_Bounderies, append_025) 4729 { 4730 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 4731 OString expVal( aStrBuf.getStr() ); 4732 sal_Int32 input = kSInt8Max; 4733 sal_Int16 radix = 10; 4734 4735 expVal += OString( "127" ); 4736 aStrBuf.append( input, radix ); 4737 4738 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4739 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[2]"; 4740 4741 } 4742 4743 TEST_F(append_006_Int32_Bounderies, append_026) 4744 { 4745 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 4746 OString expVal( aStrBuf.getStr() ); 4747 sal_Int32 input = kSInt32Max; 4748 sal_Int16 radix = 10; 4749 4750 expVal += OString( "2147483647" ); 4751 aStrBuf.append( input, radix ); 4752 4753 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4754 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[2]"; 4755 4756 } 4757 4758 TEST_F(append_006_Int32_Bounderies, append_027) 4759 { 4760 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 4761 OString expVal( aStrBuf.getStr() ); 4762 sal_Int32 input = kSInt8Max; 4763 sal_Int16 radix = 16; 4764 4765 expVal += OString( "7f" ); 4766 aStrBuf.append( input, radix ); 4767 4768 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4769 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[2]"; 4770 4771 } 4772 4773 TEST_F(append_006_Int32_Bounderies, append_028) 4774 { 4775 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 4776 OString expVal( aStrBuf.getStr() ); 4777 sal_Int32 input = kSInt32Max; 4778 sal_Int16 radix = 16; 4779 4780 expVal += OString( "7fffffff" ); 4781 aStrBuf.append( input, radix ); 4782 4783 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4784 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[2]"; 4785 4786 } 4787 4788 TEST_F(append_006_Int32_Bounderies, append_029) 4789 { 4790 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 4791 OString expVal( aStrBuf.getStr() ); 4792 sal_Int32 input = kSInt8Max; 4793 sal_Int16 radix = 36; 4794 4795 expVal += OString( "3j" ); 4796 aStrBuf.append( input, radix ); 4797 4798 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4799 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[2]"; 4800 4801 } 4802 4803 TEST_F(append_006_Int32_Bounderies, append_030) 4804 { 4805 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 4806 OString expVal( aStrBuf.getStr() ); 4807 sal_Int32 input = kSInt32Max; 4808 sal_Int16 radix = 36; 4809 4810 expVal += OString( "zik0zj" ); 4811 aStrBuf.append( input, radix ); 4812 4813 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4814 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[2]"; 4815 4816 } 4817 4818 TEST_F(append_006_Int32_Bounderies, append_031) 4819 { 4820 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 4821 OString expVal( aStrBuf.getStr() ); 4822 sal_Int32 input = kSInt8Max; 4823 sal_Int16 radix = 2; 4824 4825 expVal += OString( "1111111" ); 4826 aStrBuf.append( input, radix ); 4827 4828 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4829 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[3]"; 4830 4831 } 4832 4833 TEST_F(append_006_Int32_Bounderies, append_032) 4834 { 4835 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 4836 OString expVal( aStrBuf.getStr() ); 4837 sal_Int32 input = kSInt32Max; 4838 sal_Int16 radix = 2; 4839 4840 expVal += OString( "1111111111111111111111111111111" ); 4841 aStrBuf.append( input, radix ); 4842 4843 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4844 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[3]"; 4845 4846 } 4847 4848 TEST_F(append_006_Int32_Bounderies, append_033) 4849 { 4850 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 4851 OString expVal( aStrBuf.getStr() ); 4852 sal_Int32 input = kSInt8Max; 4853 sal_Int16 radix = 8; 4854 4855 expVal += OString( "177" ); 4856 aStrBuf.append( input, radix ); 4857 4858 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4859 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[3]"; 4860 4861 } 4862 4863 TEST_F(append_006_Int32_Bounderies, append_034) 4864 { 4865 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 4866 OString expVal( aStrBuf.getStr() ); 4867 sal_Int32 input = kSInt32Max; 4868 sal_Int16 radix = 8; 4869 4870 expVal += OString( "17777777777" ); 4871 aStrBuf.append( input, radix ); 4872 4873 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4874 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[3]"; 4875 4876 } 4877 4878 TEST_F(append_006_Int32_Bounderies, append_035) 4879 { 4880 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 4881 OString expVal( aStrBuf.getStr() ); 4882 sal_Int32 input = kSInt8Max; 4883 sal_Int16 radix = 10; 4884 4885 expVal += OString( "127" ); 4886 aStrBuf.append( input, radix ); 4887 4888 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4889 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[3]"; 4890 4891 } 4892 4893 TEST_F(append_006_Int32_Bounderies, append_036) 4894 { 4895 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 4896 OString expVal( aStrBuf.getStr() ); 4897 sal_Int32 input = kSInt32Max; 4898 sal_Int16 radix = 10; 4899 4900 expVal += OString( "2147483647" ); 4901 aStrBuf.append( input, radix ); 4902 4903 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4904 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[3]"; 4905 4906 } 4907 4908 TEST_F(append_006_Int32_Bounderies, append_037) 4909 { 4910 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 4911 OString expVal( aStrBuf.getStr() ); 4912 sal_Int32 input = kSInt8Max; 4913 sal_Int16 radix = 16; 4914 4915 expVal += OString( "7f" ); 4916 aStrBuf.append( input, radix ); 4917 4918 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4919 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[3]"; 4920 4921 } 4922 4923 TEST_F(append_006_Int32_Bounderies, append_038) 4924 { 4925 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 4926 OString expVal( aStrBuf.getStr() ); 4927 sal_Int32 input = kSInt32Max; 4928 sal_Int16 radix = 16; 4929 4930 expVal += OString( "7fffffff" ); 4931 aStrBuf.append( input, radix ); 4932 4933 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4934 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[3]"; 4935 4936 } 4937 4938 TEST_F(append_006_Int32_Bounderies, append_039) 4939 { 4940 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 4941 OString expVal( aStrBuf.getStr() ); 4942 sal_Int32 input = kSInt8Max; 4943 sal_Int16 radix = 36; 4944 4945 expVal += OString( "3j" ); 4946 aStrBuf.append( input, radix ); 4947 4948 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4949 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[3]"; 4950 4951 } 4952 4953 TEST_F(append_006_Int32_Bounderies, append_040) 4954 { 4955 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 4956 OString expVal( aStrBuf.getStr() ); 4957 sal_Int32 input = kSInt32Max; 4958 sal_Int16 radix = 36; 4959 4960 expVal += OString( "zik0zj" ); 4961 aStrBuf.append( input, radix ); 4962 4963 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4964 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[3]"; 4965 4966 } 4967 4968 TEST_F(append_006_Int32_Bounderies, append_041) 4969 { 4970 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4971 OString expVal( aStrBuf.getStr() ); 4972 sal_Int32 input = kSInt8Max; 4973 sal_Int16 radix = 2; 4974 4975 expVal += OString( "1111111" ); 4976 aStrBuf.append( input, radix ); 4977 4978 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4979 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[4]"; 4980 4981 } 4982 4983 TEST_F(append_006_Int32_Bounderies, append_042) 4984 { 4985 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 4986 OString expVal( aStrBuf.getStr() ); 4987 sal_Int32 input = kSInt32Max; 4988 sal_Int16 radix = 2; 4989 4990 expVal += OString( "1111111111111111111111111111111" ); 4991 aStrBuf.append( input, radix ); 4992 4993 ASSERT_TRUE(aStrBuf.getStr()== expVal && 4994 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_Bounderies_kRadixBinary for arrOUS[4]"; 4995 4996 } 4997 4998 TEST_F(append_006_Int32_Bounderies, append_043) 4999 { 5000 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 5001 OString expVal( aStrBuf.getStr() ); 5002 sal_Int32 input = kSInt8Max; 5003 sal_Int16 radix = 8; 5004 5005 expVal += OString( "177" ); 5006 aStrBuf.append( input, radix ); 5007 5008 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5009 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[4]"; 5010 5011 } 5012 5013 TEST_F(append_006_Int32_Bounderies, append_044) 5014 { 5015 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 5016 OString expVal( aStrBuf.getStr() ); 5017 sal_Int32 input = kSInt32Max; 5018 sal_Int16 radix = 8; 5019 5020 expVal += OString( "17777777777" ); 5021 aStrBuf.append( input, radix ); 5022 5023 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5024 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_Bounderies_kRadixBinary for arrOUS[4]"; 5025 5026 } 5027 5028 TEST_F(append_006_Int32_Bounderies, append_045) 5029 { 5030 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 5031 OString expVal( aStrBuf.getStr() ); 5032 sal_Int32 input = kSInt8Max; 5033 sal_Int16 radix = 10; 5034 5035 expVal += OString( "127" ); 5036 aStrBuf.append( input, radix ); 5037 5038 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5039 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[4]"; 5040 5041 } 5042 5043 TEST_F(append_006_Int32_Bounderies, append_046) 5044 { 5045 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 5046 OString expVal( aStrBuf.getStr() ); 5047 sal_Int32 input = kSInt32Max; 5048 sal_Int16 radix = 10; 5049 5050 expVal += OString( "2147483647" ); 5051 aStrBuf.append( input, radix ); 5052 5053 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5054 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_Bounderies_kRadixBinary for arrOUS[4]"; 5055 5056 } 5057 5058 TEST_F(append_006_Int32_Bounderies, append_047) 5059 { 5060 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 5061 OString expVal( aStrBuf.getStr() ); 5062 sal_Int32 input = kSInt8Max; 5063 sal_Int16 radix = 16; 5064 5065 expVal += OString( "7f" ); 5066 aStrBuf.append( input, radix ); 5067 5068 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5069 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[4]"; 5070 5071 } 5072 5073 TEST_F(append_006_Int32_Bounderies, append_048) 5074 { 5075 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 5076 OString expVal( aStrBuf.getStr() ); 5077 sal_Int32 input = kSInt32Max; 5078 sal_Int16 radix = 16; 5079 5080 expVal += OString( "7fffffff" ); 5081 aStrBuf.append( input, radix ); 5082 5083 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5084 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_Bounderies_kRadixBinary for arrOUS[4]"; 5085 5086 } 5087 5088 TEST_F(append_006_Int32_Bounderies, append_049) 5089 { 5090 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 5091 OString expVal( aStrBuf.getStr() ); 5092 sal_Int32 input = kSInt8Max; 5093 sal_Int16 radix = 36; 5094 5095 expVal += OString( "3j" ); 5096 aStrBuf.append( input, radix ); 5097 5098 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5099 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[4]"; 5100 5101 } 5102 5103 TEST_F(append_006_Int32_Bounderies, append_050) 5104 { 5105 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 5106 OString expVal( aStrBuf.getStr() ); 5107 sal_Int32 input = kSInt32Max; 5108 sal_Int16 radix = 36; 5109 5110 expVal += OString( "zik0zj" ); 5111 aStrBuf.append( input, radix ); 5112 5113 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5114 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_Bounderies_kRadixBinary for arrOUS[4]"; 5115 5116 } 5117 5118 //------------------------------------------------------------------------ 5119 // testing the method append( sal_Int32 i, sal_Int16 radix=2 ) 5120 // for negative value 5121 // testing the method append( sal_Int32 i, sal_Int16 radix=8 ) 5122 // for negative value 5123 // testing the method append( sal_Int32 i, sal_Int16 radix=10 ) 5124 // for negative value 5125 // testing the method append( sal_Int32 i, sal_Int16 radix=16 ) 5126 // for negative value 5127 // testing the method append( sal_Int32 i, sal_Int16 radix=36 ) 5128 // for negative value 5129 //------------------------------------------------------------------------ 5130 class append_006_Int32_Negative : public ::testing::Test 5131 { 5132 protected: 5133 OString* arrOUS[5]; 5134 5135 public: 5136 void SetUp() 5137 { 5138 arrOUS[0] = new OString( kTestStr7 ); 5139 arrOUS[1] = new OString( ); 5140 arrOUS[2] = new OString( kTestStr25 ); 5141 arrOUS[3] = new OString( "\0" ); 5142 arrOUS[4] = new OString( kTestStr28 ); 5143 5144 } 5145 5146 void TearDown() 5147 { 5148 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 5149 delete arrOUS[3]; delete arrOUS[4]; 5150 } 5151 }; 5152 5153 TEST_F(append_006_Int32_Negative, append_001) 5154 { 5155 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5156 OString expVal( aStrBuf.getStr() ); 5157 sal_Int32 input = -0; 5158 sal_Int16 radix = 2; 5159 5160 expVal += OString( "0" ); 5161 aStrBuf.append( input, radix ); 5162 5163 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5164 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[0]"; 5165 5166 } 5167 5168 TEST_F(append_006_Int32_Negative, append_002) 5169 { 5170 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5171 OString expVal( aStrBuf.getStr() ); 5172 sal_Int32 input = -4; 5173 sal_Int16 radix = 2; 5174 5175 expVal += OString( "-" ); 5176 expVal += OString( "100" ); 5177 aStrBuf.append( input, radix ); 5178 5179 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5180 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[0]"; 5181 5182 } 5183 5184 TEST_F(append_006_Int32_Negative, append_003) 5185 { 5186 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5187 OString expVal( aStrBuf.getStr() ); 5188 sal_Int32 input = -8; 5189 sal_Int16 radix = 2; 5190 5191 expVal += OString( "-" ); 5192 expVal += OString( "1000" ); 5193 aStrBuf.append( input, radix ); 5194 5195 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5196 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[0]"; 5197 5198 } 5199 5200 TEST_F(append_006_Int32_Negative, append_004) 5201 { 5202 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5203 OString expVal( aStrBuf.getStr() ); 5204 sal_Int32 input = -15; 5205 sal_Int16 radix = 2; 5206 5207 expVal += OString( "-" ); 5208 expVal += OString( "1111" ); 5209 aStrBuf.append( input, radix ); 5210 5211 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5212 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[0]"; 5213 5214 } 5215 5216 TEST_F(append_006_Int32_Negative, append_005) 5217 { 5218 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5219 OString expVal( aStrBuf.getStr() ); 5220 sal_Int32 input = -0; 5221 sal_Int16 radix = 8; 5222 5223 expVal += OString( "0" ); 5224 aStrBuf.append( input, radix ); 5225 5226 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5227 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[0]"; 5228 5229 } 5230 5231 TEST_F(append_006_Int32_Negative, append_006) 5232 { 5233 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5234 OString expVal( aStrBuf.getStr() ); 5235 sal_Int32 input = -4; 5236 sal_Int16 radix = 8; 5237 5238 expVal += OString( "-" ); 5239 expVal += OString( "4" ); 5240 aStrBuf.append( input, radix ); 5241 5242 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5243 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[0]"; 5244 5245 } 5246 5247 TEST_F(append_006_Int32_Negative, append_007) 5248 { 5249 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5250 OString expVal( aStrBuf.getStr() ); 5251 sal_Int32 input = -8; 5252 sal_Int16 radix = 8; 5253 5254 expVal += OString( "-" ); 5255 expVal += OString( "10" ); 5256 aStrBuf.append( input, radix ); 5257 5258 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5259 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[0]"; 5260 5261 } 5262 5263 TEST_F(append_006_Int32_Negative, append_008) 5264 { 5265 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5266 OString expVal( aStrBuf.getStr() ); 5267 sal_Int32 input = -15; 5268 sal_Int16 radix = 8; 5269 5270 expVal += OString( "-" ); 5271 expVal += OString( "17" ); 5272 aStrBuf.append( input, radix ); 5273 5274 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5275 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[0]"; 5276 5277 } 5278 5279 TEST_F(append_006_Int32_Negative, append_009) 5280 { 5281 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5282 OString expVal( aStrBuf.getStr() ); 5283 sal_Int32 input = -0; 5284 sal_Int16 radix = 10; 5285 5286 expVal += OString( "0" ); 5287 aStrBuf.append( input, radix ); 5288 5289 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5290 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[0]"; 5291 5292 } 5293 5294 TEST_F(append_006_Int32_Negative, append_010) 5295 { 5296 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5297 OString expVal( aStrBuf.getStr() ); 5298 sal_Int32 input = -4; 5299 sal_Int16 radix = 10; 5300 5301 expVal += OString( "-" ); 5302 expVal += OString( "4" ); 5303 aStrBuf.append( input, radix ); 5304 5305 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5306 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[0]"; 5307 5308 } 5309 5310 TEST_F(append_006_Int32_Negative, append_011) 5311 { 5312 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5313 OString expVal( aStrBuf.getStr() ); 5314 sal_Int32 input = -8; 5315 sal_Int16 radix = 10; 5316 5317 expVal += OString( "-" ); 5318 expVal += OString( "8" ); 5319 aStrBuf.append( input, radix ); 5320 5321 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5322 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[0]"; 5323 5324 } 5325 5326 TEST_F(append_006_Int32_Negative, append_012) 5327 { 5328 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5329 OString expVal( aStrBuf.getStr() ); 5330 sal_Int32 input = -15; 5331 sal_Int16 radix = 10; 5332 5333 expVal += OString( "-" ); 5334 expVal += OString( "15" ); 5335 aStrBuf.append( input, radix ); 5336 5337 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5338 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[0]"; 5339 5340 } 5341 5342 TEST_F(append_006_Int32_Negative, append_013) 5343 { 5344 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5345 OString expVal( aStrBuf.getStr() ); 5346 sal_Int32 input = -0; 5347 sal_Int16 radix = 16; 5348 5349 expVal += OString( "0" ); 5350 aStrBuf.append( input, radix ); 5351 5352 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5353 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[0]"; 5354 5355 } 5356 5357 TEST_F(append_006_Int32_Negative, append_014) 5358 { 5359 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5360 OString expVal( aStrBuf.getStr() ); 5361 sal_Int32 input = -4; 5362 sal_Int16 radix = 16; 5363 5364 expVal += OString( "-" ); 5365 expVal += OString( "4" ); 5366 aStrBuf.append( input, radix ); 5367 5368 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5369 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[0]"; 5370 5371 } 5372 5373 TEST_F(append_006_Int32_Negative, append_015) 5374 { 5375 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5376 OString expVal( aStrBuf.getStr() ); 5377 sal_Int32 input = -8; 5378 sal_Int16 radix = 16; 5379 5380 expVal += OString( "-" ); 5381 expVal += OString( "8" ); 5382 aStrBuf.append( input, radix ); 5383 5384 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5385 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[0]"; 5386 5387 } 5388 5389 TEST_F(append_006_Int32_Negative, append_016) 5390 { 5391 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5392 OString expVal( aStrBuf.getStr() ); 5393 sal_Int32 input = -15; 5394 sal_Int16 radix = 16; 5395 5396 expVal += OString( "-" ); 5397 expVal += OString( "f" ); 5398 aStrBuf.append( input, radix ); 5399 5400 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5401 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[0]"; 5402 5403 } 5404 5405 TEST_F(append_006_Int32_Negative, append_017) 5406 { 5407 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5408 OString expVal( aStrBuf.getStr() ); 5409 sal_Int32 input = -0; 5410 sal_Int16 radix = 36; 5411 5412 expVal += OString( "0" ); 5413 aStrBuf.append( input, radix ); 5414 5415 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5416 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[0]"; 5417 5418 } 5419 5420 TEST_F(append_006_Int32_Negative, append_018) 5421 { 5422 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5423 OString expVal( aStrBuf.getStr() ); 5424 sal_Int32 input = -4; 5425 sal_Int16 radix = 36; 5426 5427 expVal += OString( "-" ); 5428 expVal += OString( "4" ); 5429 aStrBuf.append( input, radix ); 5430 5431 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5432 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[0]"; 5433 5434 } 5435 5436 TEST_F(append_006_Int32_Negative, append_019) 5437 { 5438 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5439 OString expVal( aStrBuf.getStr() ); 5440 sal_Int32 input = -8; 5441 sal_Int16 radix = 36; 5442 5443 expVal += OString( "-" ); 5444 expVal += OString( "8" ); 5445 aStrBuf.append( input, radix ); 5446 5447 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5448 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[0]"; 5449 5450 } 5451 5452 TEST_F(append_006_Int32_Negative, append_020) 5453 { 5454 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 5455 OString expVal( aStrBuf.getStr() ); 5456 sal_Int32 input = -35; 5457 sal_Int16 radix = 36; 5458 5459 expVal += OString( "-" ); 5460 expVal += OString( "z" ); 5461 aStrBuf.append( input, radix ); 5462 5463 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5464 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[0]"; 5465 5466 } 5467 5468 TEST_F(append_006_Int32_Negative, append_021) 5469 { 5470 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5471 OString expVal( aStrBuf.getStr() ); 5472 sal_Int32 input = -0; 5473 sal_Int16 radix = 2; 5474 5475 expVal += OString( "0" ); 5476 aStrBuf.append( input, radix ); 5477 5478 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5479 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[1]"; 5480 5481 } 5482 5483 TEST_F(append_006_Int32_Negative, append_022) 5484 { 5485 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5486 OString expVal( aStrBuf.getStr() ); 5487 sal_Int32 input = -4; 5488 sal_Int16 radix = 2; 5489 5490 expVal += OString( "-" ); 5491 expVal += OString( "100" ); 5492 aStrBuf.append( input, radix ); 5493 5494 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5495 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[1]"; 5496 5497 } 5498 5499 TEST_F(append_006_Int32_Negative, append_023) 5500 { 5501 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5502 OString expVal( aStrBuf.getStr() ); 5503 sal_Int32 input = -8; 5504 sal_Int16 radix = 2; 5505 5506 expVal += OString( "-" ); 5507 expVal += OString( "1000" ); 5508 aStrBuf.append( input, radix ); 5509 5510 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5511 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[1]"; 5512 5513 } 5514 5515 TEST_F(append_006_Int32_Negative, append_024) 5516 { 5517 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5518 OString expVal( aStrBuf.getStr() ); 5519 sal_Int32 input = -15; 5520 sal_Int16 radix = 2; 5521 5522 expVal += OString( "-" ); 5523 expVal += OString( "1111" ); 5524 aStrBuf.append( input, radix ); 5525 5526 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5527 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[1]"; 5528 5529 } 5530 5531 TEST_F(append_006_Int32_Negative, append_025) 5532 { 5533 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5534 OString expVal( aStrBuf.getStr() ); 5535 sal_Int32 input = -0; 5536 sal_Int16 radix = 8; 5537 5538 expVal += OString( "0" ); 5539 aStrBuf.append( input, radix ); 5540 5541 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5542 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[1]"; 5543 5544 } 5545 5546 TEST_F(append_006_Int32_Negative, append_026) 5547 { 5548 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5549 OString expVal( aStrBuf.getStr() ); 5550 sal_Int32 input = -4; 5551 sal_Int16 radix = 8; 5552 5553 expVal += OString( "-" ); 5554 expVal += OString( "4" ); 5555 aStrBuf.append( input, radix ); 5556 5557 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5558 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[1]"; 5559 5560 } 5561 5562 TEST_F(append_006_Int32_Negative, append_027) 5563 { 5564 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5565 OString expVal( aStrBuf.getStr() ); 5566 sal_Int32 input = -8; 5567 sal_Int16 radix = 8; 5568 5569 expVal += OString( "-" ); 5570 expVal += OString( "10" ); 5571 aStrBuf.append( input, radix ); 5572 5573 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5574 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[1]"; 5575 5576 } 5577 5578 TEST_F(append_006_Int32_Negative, append_028) 5579 { 5580 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5581 OString expVal( aStrBuf.getStr() ); 5582 sal_Int32 input = -15; 5583 sal_Int16 radix = 8; 5584 5585 expVal += OString( "-" ); 5586 expVal += OString( "17" ); 5587 aStrBuf.append( input, radix ); 5588 5589 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5590 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[1]"; 5591 5592 } 5593 5594 TEST_F(append_006_Int32_Negative, append_029) 5595 { 5596 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5597 OString expVal( aStrBuf.getStr() ); 5598 sal_Int32 input = -0; 5599 sal_Int16 radix = 10; 5600 5601 expVal += OString( "0" ); 5602 aStrBuf.append( input, radix ); 5603 5604 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5605 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[1]"; 5606 5607 } 5608 5609 TEST_F(append_006_Int32_Negative, append_030) 5610 { 5611 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5612 OString expVal( aStrBuf.getStr() ); 5613 sal_Int32 input = -4; 5614 sal_Int16 radix = 10; 5615 5616 expVal += OString( "-" ); 5617 expVal += OString( "4" ); 5618 aStrBuf.append( input, radix ); 5619 5620 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5621 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[1]"; 5622 5623 } 5624 5625 TEST_F(append_006_Int32_Negative, append_031) 5626 { 5627 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5628 OString expVal( aStrBuf.getStr() ); 5629 sal_Int32 input = -8; 5630 sal_Int16 radix = 10; 5631 5632 expVal += OString( "-" ); 5633 expVal += OString( "8" ); 5634 aStrBuf.append( input, radix ); 5635 5636 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5637 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[1]"; 5638 5639 } 5640 5641 TEST_F(append_006_Int32_Negative, append_032) 5642 { 5643 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5644 OString expVal( aStrBuf.getStr() ); 5645 sal_Int32 input = -15; 5646 sal_Int16 radix = 10; 5647 5648 expVal += OString( "-" ); 5649 expVal += OString( "15" ); 5650 aStrBuf.append( input, radix ); 5651 5652 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5653 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[1]"; 5654 5655 } 5656 5657 TEST_F(append_006_Int32_Negative, append_033) 5658 { 5659 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5660 OString expVal( aStrBuf.getStr() ); 5661 sal_Int32 input = -0; 5662 sal_Int16 radix = 16; 5663 5664 expVal += OString( "0" ); 5665 aStrBuf.append( input, radix ); 5666 5667 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5668 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[1]"; 5669 5670 } 5671 5672 TEST_F(append_006_Int32_Negative, append_034) 5673 { 5674 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5675 OString expVal( aStrBuf.getStr() ); 5676 sal_Int32 input = -4; 5677 sal_Int16 radix = 16; 5678 5679 expVal += OString( "-" ); 5680 expVal += OString( "4" ); 5681 aStrBuf.append( input, radix ); 5682 5683 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5684 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[1]"; 5685 5686 } 5687 5688 TEST_F(append_006_Int32_Negative, append_035) 5689 { 5690 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5691 OString expVal( aStrBuf.getStr() ); 5692 sal_Int32 input = -8; 5693 sal_Int16 radix = 16; 5694 5695 expVal += OString( "-" ); 5696 expVal += OString( "8" ); 5697 aStrBuf.append( input, radix ); 5698 5699 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5700 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[1]"; 5701 5702 } 5703 5704 TEST_F(append_006_Int32_Negative, append_036) 5705 { 5706 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5707 OString expVal( aStrBuf.getStr() ); 5708 sal_Int32 input = -15; 5709 sal_Int16 radix = 16; 5710 5711 expVal += OString( "-" ); 5712 expVal += OString( "f" ); 5713 aStrBuf.append( input, radix ); 5714 5715 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5716 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[1]"; 5717 5718 } 5719 5720 TEST_F(append_006_Int32_Negative, append_037) 5721 { 5722 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5723 OString expVal( aStrBuf.getStr() ); 5724 sal_Int32 input = -0; 5725 sal_Int16 radix = 36; 5726 5727 expVal += OString( "0" ); 5728 aStrBuf.append( input, radix ); 5729 5730 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5731 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[1]"; 5732 5733 } 5734 5735 TEST_F(append_006_Int32_Negative, append_038) 5736 { 5737 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5738 OString expVal( aStrBuf.getStr() ); 5739 sal_Int32 input = -4; 5740 sal_Int16 radix = 36; 5741 5742 expVal += OString( "-" ); 5743 expVal += OString( "4" ); 5744 aStrBuf.append( input, radix ); 5745 5746 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5747 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[1]"; 5748 5749 } 5750 5751 TEST_F(append_006_Int32_Negative, append_039) 5752 { 5753 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5754 OString expVal( aStrBuf.getStr() ); 5755 sal_Int32 input = -8; 5756 sal_Int16 radix = 36; 5757 5758 expVal += OString( "-" ); 5759 expVal += OString( "8" ); 5760 aStrBuf.append( input, radix ); 5761 5762 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5763 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[1]"; 5764 5765 } 5766 5767 TEST_F(append_006_Int32_Negative, append_040) 5768 { 5769 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 5770 OString expVal( aStrBuf.getStr() ); 5771 sal_Int32 input = -35; 5772 sal_Int16 radix = 36; 5773 5774 expVal += OString( "-" ); 5775 expVal += OString( "z" ); 5776 aStrBuf.append( input, radix ); 5777 5778 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5779 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[1]"; 5780 5781 } 5782 5783 TEST_F(append_006_Int32_Negative, append_041) 5784 { 5785 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 5786 OString expVal( aStrBuf.getStr() ); 5787 sal_Int32 input = -0; 5788 sal_Int16 radix = 2; 5789 5790 expVal += OString( "0" ); 5791 aStrBuf.append( input, radix ); 5792 5793 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5794 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[2]"; 5795 5796 } 5797 5798 TEST_F(append_006_Int32_Negative, append_042) 5799 { 5800 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 5801 OString expVal( aStrBuf.getStr() ); 5802 sal_Int32 input = -4; 5803 sal_Int16 radix = 2; 5804 5805 expVal += OString( "-" ); 5806 expVal += OString( "100" ); 5807 aStrBuf.append( input, radix ); 5808 5809 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5810 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[2]"; 5811 5812 } 5813 5814 TEST_F(append_006_Int32_Negative, append_043) 5815 { 5816 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 5817 OString expVal( aStrBuf.getStr() ); 5818 sal_Int32 input = -8; 5819 sal_Int16 radix = 2; 5820 5821 expVal += OString( "-" ); 5822 expVal += OString( "1000" ); 5823 aStrBuf.append( input, radix ); 5824 5825 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5826 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[2]"; 5827 5828 } 5829 5830 TEST_F(append_006_Int32_Negative, append_044) 5831 { 5832 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 5833 OString expVal( aStrBuf.getStr() ); 5834 sal_Int32 input = -15; 5835 sal_Int16 radix = 2; 5836 5837 expVal += OString( "-" ); 5838 expVal += OString( "1111" ); 5839 aStrBuf.append( input, radix ); 5840 5841 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5842 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[2]"; 5843 5844 } 5845 5846 TEST_F(append_006_Int32_Negative, append_045) 5847 { 5848 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 5849 OString expVal( aStrBuf.getStr() ); 5850 sal_Int32 input = -0; 5851 sal_Int16 radix = 8; 5852 5853 expVal += OString( "0" ); 5854 aStrBuf.append( input, radix ); 5855 5856 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5857 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[2]"; 5858 5859 } 5860 5861 TEST_F(append_006_Int32_Negative, append_046) 5862 { 5863 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 5864 OString expVal( aStrBuf.getStr() ); 5865 sal_Int32 input = -4; 5866 sal_Int16 radix = 8; 5867 5868 expVal += OString( "-" ); 5869 expVal += OString( "4" ); 5870 aStrBuf.append( input, radix ); 5871 5872 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5873 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[2]"; 5874 5875 } 5876 5877 TEST_F(append_006_Int32_Negative, append_047) 5878 { 5879 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 5880 OString expVal( aStrBuf.getStr() ); 5881 sal_Int32 input = -8; 5882 sal_Int16 radix = 8; 5883 5884 expVal += OString( "-" ); 5885 expVal += OString( "10" ); 5886 aStrBuf.append( input, radix ); 5887 5888 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5889 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[2]"; 5890 5891 } 5892 5893 TEST_F(append_006_Int32_Negative, append_048) 5894 { 5895 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 5896 OString expVal( aStrBuf.getStr() ); 5897 sal_Int32 input = -15; 5898 sal_Int16 radix = 8; 5899 5900 expVal += OString( "-" ); 5901 expVal += OString( "17" ); 5902 aStrBuf.append( input, radix ); 5903 5904 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5905 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[2]"; 5906 5907 } 5908 5909 TEST_F(append_006_Int32_Negative, append_049) 5910 { 5911 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 5912 OString expVal( aStrBuf.getStr() ); 5913 sal_Int32 input = -0; 5914 sal_Int16 radix = 10; 5915 5916 expVal += OString( "0" ); 5917 aStrBuf.append( input, radix ); 5918 5919 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5920 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[2]"; 5921 5922 } 5923 5924 TEST_F(append_006_Int32_Negative, append_050) 5925 { 5926 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 5927 OString expVal( aStrBuf.getStr() ); 5928 sal_Int32 input = -4; 5929 sal_Int16 radix = 10; 5930 5931 expVal += OString( "-" ); 5932 expVal += OString( "4" ); 5933 aStrBuf.append( input, radix ); 5934 5935 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5936 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[2]"; 5937 5938 } 5939 5940 TEST_F(append_006_Int32_Negative, append_051) 5941 { 5942 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 5943 OString expVal( aStrBuf.getStr() ); 5944 sal_Int32 input = -8; 5945 sal_Int16 radix = 10; 5946 5947 expVal += OString( "-" ); 5948 expVal += OString( "8" ); 5949 aStrBuf.append( input, radix ); 5950 5951 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5952 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[2]"; 5953 5954 } 5955 5956 TEST_F(append_006_Int32_Negative, append_052) 5957 { 5958 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 5959 OString expVal( aStrBuf.getStr() ); 5960 sal_Int32 input = -15; 5961 sal_Int16 radix = 10; 5962 5963 expVal += OString( "-" ); 5964 expVal += OString( "15" ); 5965 aStrBuf.append( input, radix ); 5966 5967 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5968 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[2]"; 5969 5970 } 5971 5972 TEST_F(append_006_Int32_Negative, append_053) 5973 { 5974 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 5975 OString expVal( aStrBuf.getStr() ); 5976 sal_Int32 input = -0; 5977 sal_Int16 radix = 16; 5978 5979 expVal += OString( "0" ); 5980 aStrBuf.append( input, radix ); 5981 5982 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5983 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[2]"; 5984 5985 } 5986 5987 TEST_F(append_006_Int32_Negative, append_054) 5988 { 5989 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 5990 OString expVal( aStrBuf.getStr() ); 5991 sal_Int32 input = -4; 5992 sal_Int16 radix = 16; 5993 5994 expVal += OString( "-" ); 5995 expVal += OString( "4" ); 5996 aStrBuf.append( input, radix ); 5997 5998 ASSERT_TRUE(aStrBuf.getStr()== expVal && 5999 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[2]"; 6000 6001 } 6002 6003 TEST_F(append_006_Int32_Negative, append_055) 6004 { 6005 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 6006 OString expVal( aStrBuf.getStr() ); 6007 sal_Int32 input = -8; 6008 sal_Int16 radix = 16; 6009 6010 expVal += OString( "-" ); 6011 expVal += OString( "8" ); 6012 aStrBuf.append( input, radix ); 6013 6014 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6015 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[2]"; 6016 6017 } 6018 6019 TEST_F(append_006_Int32_Negative, append_056) 6020 { 6021 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 6022 OString expVal( aStrBuf.getStr() ); 6023 sal_Int32 input = -15; 6024 sal_Int16 radix = 16; 6025 6026 expVal += OString( "-" ); 6027 expVal += OString( "f" ); 6028 aStrBuf.append( input, radix ); 6029 6030 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6031 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[2]"; 6032 6033 } 6034 6035 TEST_F(append_006_Int32_Negative, append_057) 6036 { 6037 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 6038 OString expVal( aStrBuf.getStr() ); 6039 sal_Int32 input = -0; 6040 sal_Int16 radix = 36; 6041 6042 expVal += OString( "0" ); 6043 aStrBuf.append( input, radix ); 6044 6045 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6046 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[2]"; 6047 6048 } 6049 6050 TEST_F(append_006_Int32_Negative, append_058) 6051 { 6052 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 6053 OString expVal( aStrBuf.getStr() ); 6054 sal_Int32 input = -4; 6055 sal_Int16 radix = 36; 6056 6057 expVal += OString( "-" ); 6058 expVal += OString( "4" ); 6059 aStrBuf.append( input, radix ); 6060 6061 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6062 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[2]"; 6063 6064 } 6065 6066 TEST_F(append_006_Int32_Negative, append_059) 6067 { 6068 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 6069 OString expVal( aStrBuf.getStr() ); 6070 sal_Int32 input = -8; 6071 sal_Int16 radix = 36; 6072 6073 expVal += OString( "-" ); 6074 expVal += OString( "8" ); 6075 aStrBuf.append( input, radix ); 6076 6077 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6078 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[2]"; 6079 6080 } 6081 6082 TEST_F(append_006_Int32_Negative, append_060) 6083 { 6084 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 6085 OString expVal( aStrBuf.getStr() ); 6086 sal_Int32 input = -35; 6087 sal_Int16 radix = 36; 6088 6089 expVal += OString( "-" ); 6090 expVal += OString( "z" ); 6091 aStrBuf.append( input, radix ); 6092 6093 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6094 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[2]"; 6095 6096 } 6097 6098 TEST_F(append_006_Int32_Negative, append_061) 6099 { 6100 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6101 OString expVal( aStrBuf.getStr() ); 6102 sal_Int32 input = -0; 6103 sal_Int16 radix = 2; 6104 6105 expVal += OString( "0" ); 6106 aStrBuf.append( input, radix ); 6107 6108 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6109 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[3]"; 6110 6111 } 6112 6113 TEST_F(append_006_Int32_Negative, append_062) 6114 { 6115 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6116 OString expVal( aStrBuf.getStr() ); 6117 sal_Int32 input = -4; 6118 sal_Int16 radix = 2; 6119 6120 expVal += OString( "-" ); 6121 expVal += OString( "100" ); 6122 aStrBuf.append( input, radix ); 6123 6124 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6125 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[3]"; 6126 6127 } 6128 6129 TEST_F(append_006_Int32_Negative, append_063) 6130 { 6131 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6132 OString expVal( aStrBuf.getStr() ); 6133 sal_Int32 input = -8; 6134 sal_Int16 radix = 2; 6135 6136 expVal += OString( "-" ); 6137 expVal += OString( "1000" ); 6138 aStrBuf.append( input, radix ); 6139 6140 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6141 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[3]"; 6142 6143 } 6144 6145 TEST_F(append_006_Int32_Negative, append_064) 6146 { 6147 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6148 OString expVal( aStrBuf.getStr() ); 6149 sal_Int32 input = -15; 6150 sal_Int16 radix = 2; 6151 6152 expVal += OString( "-" ); 6153 expVal += OString( "1111" ); 6154 aStrBuf.append( input, radix ); 6155 6156 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6157 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[3]"; 6158 6159 } 6160 6161 TEST_F(append_006_Int32_Negative, append_065) 6162 { 6163 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6164 OString expVal( aStrBuf.getStr() ); 6165 sal_Int32 input = -0; 6166 sal_Int16 radix = 8; 6167 6168 expVal += OString( "0" ); 6169 aStrBuf.append( input, radix ); 6170 6171 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6172 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[3]"; 6173 6174 } 6175 6176 TEST_F(append_006_Int32_Negative, append_066) 6177 { 6178 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6179 OString expVal( aStrBuf.getStr() ); 6180 sal_Int32 input = -4; 6181 sal_Int16 radix = 8; 6182 6183 expVal += OString( "-" ); 6184 expVal += OString( "4" ); 6185 aStrBuf.append( input, radix ); 6186 6187 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6188 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[3]"; 6189 6190 } 6191 6192 TEST_F(append_006_Int32_Negative, append_067) 6193 { 6194 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6195 OString expVal( aStrBuf.getStr() ); 6196 sal_Int32 input = -8; 6197 sal_Int16 radix = 8; 6198 6199 expVal += OString( "-" ); 6200 expVal += OString( "10" ); 6201 aStrBuf.append( input, radix ); 6202 6203 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6204 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[3]"; 6205 6206 } 6207 6208 TEST_F(append_006_Int32_Negative, append_068) 6209 { 6210 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6211 OString expVal( aStrBuf.getStr() ); 6212 sal_Int32 input = -15; 6213 sal_Int16 radix = 8; 6214 6215 expVal += OString( "-" ); 6216 expVal += OString( "17" ); 6217 aStrBuf.append( input, radix ); 6218 6219 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6220 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[3]"; 6221 6222 } 6223 6224 TEST_F(append_006_Int32_Negative, append_069) 6225 { 6226 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6227 OString expVal( aStrBuf.getStr() ); 6228 sal_Int32 input = -0; 6229 sal_Int16 radix = 10; 6230 6231 expVal += OString( "0" ); 6232 aStrBuf.append( input, radix ); 6233 6234 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6235 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[3]"; 6236 6237 } 6238 6239 TEST_F(append_006_Int32_Negative, append_070) 6240 { 6241 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6242 OString expVal( aStrBuf.getStr() ); 6243 sal_Int32 input = -4; 6244 sal_Int16 radix = 10; 6245 6246 expVal += OString( "-" ); 6247 expVal += OString( "4" ); 6248 aStrBuf.append( input, radix ); 6249 6250 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6251 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[3]"; 6252 6253 } 6254 6255 TEST_F(append_006_Int32_Negative, append_071) 6256 { 6257 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6258 OString expVal( aStrBuf.getStr() ); 6259 sal_Int32 input = -8; 6260 sal_Int16 radix = 10; 6261 6262 expVal += OString( "-" ); 6263 expVal += OString( "8" ); 6264 aStrBuf.append( input, radix ); 6265 6266 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6267 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[3]"; 6268 6269 } 6270 6271 TEST_F(append_006_Int32_Negative, append_072) 6272 { 6273 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6274 OString expVal( aStrBuf.getStr() ); 6275 sal_Int32 input = -15; 6276 sal_Int16 radix = 10; 6277 6278 expVal += OString( "-" ); 6279 expVal += OString( "15" ); 6280 aStrBuf.append( input, radix ); 6281 6282 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6283 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[3]"; 6284 6285 } 6286 6287 TEST_F(append_006_Int32_Negative, append_073) 6288 { 6289 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6290 OString expVal( aStrBuf.getStr() ); 6291 sal_Int32 input = -0; 6292 sal_Int16 radix = 16; 6293 6294 expVal += OString( "0" ); 6295 aStrBuf.append( input, radix ); 6296 6297 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6298 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[3]"; 6299 6300 } 6301 6302 TEST_F(append_006_Int32_Negative, append_074) 6303 { 6304 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6305 OString expVal( aStrBuf.getStr() ); 6306 sal_Int32 input = -4; 6307 sal_Int16 radix = 16; 6308 6309 expVal += OString( "-" ); 6310 expVal += OString( "4" ); 6311 aStrBuf.append( input, radix ); 6312 6313 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6314 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[3]"; 6315 6316 } 6317 6318 TEST_F(append_006_Int32_Negative, append_075) 6319 { 6320 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6321 OString expVal( aStrBuf.getStr() ); 6322 sal_Int32 input = -8; 6323 sal_Int16 radix = 16; 6324 6325 expVal += OString( "-" ); 6326 expVal += OString( "8" ); 6327 aStrBuf.append( input, radix ); 6328 6329 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6330 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[3]"; 6331 6332 } 6333 6334 TEST_F(append_006_Int32_Negative, append_076) 6335 { 6336 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6337 OString expVal( aStrBuf.getStr() ); 6338 sal_Int32 input = -15; 6339 sal_Int16 radix = 16; 6340 6341 expVal += OString( "-" ); 6342 expVal += OString( "f" ); 6343 aStrBuf.append( input, radix ); 6344 6345 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6346 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[3]"; 6347 6348 } 6349 6350 TEST_F(append_006_Int32_Negative, append_077) 6351 { 6352 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6353 OString expVal( aStrBuf.getStr() ); 6354 sal_Int32 input = -0; 6355 sal_Int16 radix = 36; 6356 6357 expVal += OString( "0" ); 6358 aStrBuf.append( input, radix ); 6359 6360 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6361 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[3]"; 6362 6363 } 6364 6365 TEST_F(append_006_Int32_Negative, append_078) 6366 { 6367 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6368 OString expVal( aStrBuf.getStr() ); 6369 sal_Int32 input = -4; 6370 sal_Int16 radix = 36; 6371 6372 expVal += OString( "-" ); 6373 expVal += OString( "4" ); 6374 aStrBuf.append( input, radix ); 6375 6376 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6377 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[3]"; 6378 6379 } 6380 6381 TEST_F(append_006_Int32_Negative, append_079) 6382 { 6383 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6384 OString expVal( aStrBuf.getStr() ); 6385 sal_Int32 input = -8; 6386 sal_Int16 radix = 36; 6387 6388 expVal += OString( "-" ); 6389 expVal += OString( "8" ); 6390 aStrBuf.append( input, radix ); 6391 6392 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6393 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[3]"; 6394 6395 } 6396 6397 TEST_F(append_006_Int32_Negative, append_080) 6398 { 6399 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6400 OString expVal( aStrBuf.getStr() ); 6401 sal_Int32 input = -35; 6402 sal_Int16 radix = 36; 6403 6404 expVal += OString( "-" ); 6405 expVal += OString( "z" ); 6406 aStrBuf.append( input, radix ); 6407 6408 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6409 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[3]"; 6410 6411 } 6412 6413 TEST_F(append_006_Int32_Negative, append_081) 6414 { 6415 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6416 OString expVal( aStrBuf.getStr() ); 6417 sal_Int32 input = -0; 6418 sal_Int16 radix = 2; 6419 6420 expVal += OString( "0" ); 6421 aStrBuf.append( input, radix ); 6422 6423 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6424 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[4]"; 6425 6426 } 6427 6428 TEST_F(append_006_Int32_Negative, append_082) 6429 { 6430 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6431 OString expVal( aStrBuf.getStr() ); 6432 sal_Int32 input = -4; 6433 sal_Int16 radix = 2; 6434 6435 expVal += OString( "-" ); 6436 expVal += OString( "100" ); 6437 aStrBuf.append( input, radix ); 6438 6439 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6440 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[4]"; 6441 6442 } 6443 6444 TEST_F(append_006_Int32_Negative, append_083) 6445 { 6446 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6447 OString expVal( aStrBuf.getStr() ); 6448 sal_Int32 input = -8; 6449 sal_Int16 radix = 2; 6450 6451 expVal += OString( "-" ); 6452 expVal += OString( "1000" ); 6453 aStrBuf.append( input, radix ); 6454 6455 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6456 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[4]"; 6457 6458 } 6459 6460 TEST_F(append_006_Int32_Negative, append_084) 6461 { 6462 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6463 OString expVal( aStrBuf.getStr() ); 6464 sal_Int32 input = -15; 6465 sal_Int16 radix = 2; 6466 6467 expVal += OString( "-" ); 6468 expVal += OString( "1111" ); 6469 aStrBuf.append( input, radix ); 6470 6471 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6472 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 2)_006_negative_kRadixBinary for arrOUS[4]"; 6473 6474 } 6475 6476 TEST_F(append_006_Int32_Negative, append_085) 6477 { 6478 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6479 OString expVal( aStrBuf.getStr() ); 6480 sal_Int32 input = -0; 6481 sal_Int16 radix = 8; 6482 6483 expVal += OString( "0" ); 6484 aStrBuf.append( input, radix ); 6485 6486 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6487 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[4]"; 6488 6489 } 6490 6491 TEST_F(append_006_Int32_Negative, append_086) 6492 { 6493 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6494 OString expVal( aStrBuf.getStr() ); 6495 sal_Int32 input = -4; 6496 sal_Int16 radix = 8; 6497 6498 expVal += OString( "-" ); 6499 expVal += OString( "4" ); 6500 aStrBuf.append( input, radix ); 6501 6502 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6503 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[4]"; 6504 6505 } 6506 6507 TEST_F(append_006_Int32_Negative, append_087) 6508 { 6509 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6510 OString expVal( aStrBuf.getStr() ); 6511 sal_Int32 input = -8; 6512 sal_Int16 radix = 8; 6513 6514 expVal += OString( "-" ); 6515 expVal += OString( "10" ); 6516 aStrBuf.append( input, radix ); 6517 6518 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6519 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[4]"; 6520 6521 } 6522 6523 TEST_F(append_006_Int32_Negative, append_088) 6524 { 6525 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6526 OString expVal( aStrBuf.getStr() ); 6527 sal_Int32 input = -15; 6528 sal_Int16 radix = 8; 6529 6530 expVal += OString( "-" ); 6531 expVal += OString( "17" ); 6532 aStrBuf.append( input, radix ); 6533 6534 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6535 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 8)_006_negative_kRadixOctol for arrOUS[4]"; 6536 6537 } 6538 6539 TEST_F(append_006_Int32_Negative, append_089) 6540 { 6541 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6542 OString expVal( aStrBuf.getStr() ); 6543 sal_Int32 input = -0; 6544 sal_Int16 radix = 10; 6545 6546 expVal += OString( "0" ); 6547 aStrBuf.append( input, radix ); 6548 6549 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6550 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[4]"; 6551 6552 } 6553 6554 TEST_F(append_006_Int32_Negative, append_090) 6555 { 6556 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6557 OString expVal( aStrBuf.getStr() ); 6558 sal_Int32 input = -4; 6559 sal_Int16 radix = 10; 6560 6561 expVal += OString( "-" ); 6562 expVal += OString( "4" ); 6563 aStrBuf.append( input, radix ); 6564 6565 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6566 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[4]"; 6567 6568 } 6569 6570 TEST_F(append_006_Int32_Negative, append_091) 6571 { 6572 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6573 OString expVal( aStrBuf.getStr() ); 6574 sal_Int32 input = -8; 6575 sal_Int16 radix = 10; 6576 6577 expVal += OString( "-" ); 6578 expVal += OString( "8" ); 6579 aStrBuf.append( input, radix ); 6580 6581 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6582 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[4]"; 6583 6584 } 6585 6586 TEST_F(append_006_Int32_Negative, append_092) 6587 { 6588 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6589 OString expVal( aStrBuf.getStr() ); 6590 sal_Int32 input = -15; 6591 sal_Int16 radix = 10; 6592 6593 expVal += OString( "-" ); 6594 expVal += OString( "15" ); 6595 aStrBuf.append( input, radix ); 6596 6597 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6598 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 10)_006_negative_kRadixDecimal for arrOUS[4]"; 6599 6600 } 6601 6602 TEST_F(append_006_Int32_Negative, append_093) 6603 { 6604 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6605 OString expVal( aStrBuf.getStr() ); 6606 sal_Int32 input = -0; 6607 sal_Int16 radix = 16; 6608 6609 expVal += OString( "0" ); 6610 aStrBuf.append( input, radix ); 6611 6612 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6613 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[4]"; 6614 6615 } 6616 6617 TEST_F(append_006_Int32_Negative, append_094) 6618 { 6619 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6620 OString expVal( aStrBuf.getStr() ); 6621 sal_Int32 input = -4; 6622 sal_Int16 radix = 16; 6623 6624 expVal += OString( "-" ); 6625 expVal += OString( "4" ); 6626 aStrBuf.append( input, radix ); 6627 6628 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6629 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[4]"; 6630 6631 } 6632 6633 TEST_F(append_006_Int32_Negative, append_095) 6634 { 6635 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6636 OString expVal( aStrBuf.getStr() ); 6637 sal_Int32 input = -8; 6638 sal_Int16 radix = 16; 6639 6640 expVal += OString( "-" ); 6641 expVal += OString( "8" ); 6642 aStrBuf.append( input, radix ); 6643 6644 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6645 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[4]"; 6646 6647 } 6648 6649 TEST_F(append_006_Int32_Negative, append_096) 6650 { 6651 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6652 OString expVal( aStrBuf.getStr() ); 6653 sal_Int32 input = -15; 6654 sal_Int16 radix = 16; 6655 6656 expVal += OString( "-" ); 6657 expVal += OString( "f" ); 6658 aStrBuf.append( input, radix ); 6659 6660 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6661 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 16)_006_negative_kRadixHexdecimal for arrOUS[4]"; 6662 6663 } 6664 6665 TEST_F(append_006_Int32_Negative, append_097) 6666 { 6667 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6668 OString expVal( aStrBuf.getStr() ); 6669 sal_Int32 input = -0; 6670 sal_Int16 radix = 36; 6671 6672 expVal += OString( "0" ); 6673 aStrBuf.append( input, radix ); 6674 6675 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6676 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[4]"; 6677 6678 } 6679 6680 TEST_F(append_006_Int32_Negative, append_098) 6681 { 6682 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6683 OString expVal( aStrBuf.getStr() ); 6684 sal_Int32 input = -4; 6685 sal_Int16 radix = 36; 6686 6687 expVal += OString( "-" ); 6688 expVal += OString( "4" ); 6689 aStrBuf.append( input, radix ); 6690 6691 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6692 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[4]"; 6693 6694 } 6695 6696 TEST_F(append_006_Int32_Negative, append_099) 6697 { 6698 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6699 OString expVal( aStrBuf.getStr() ); 6700 sal_Int32 input = -8; 6701 sal_Int16 radix = 36; 6702 6703 expVal += OString( "-" ); 6704 expVal += OString( "8" ); 6705 aStrBuf.append( input, radix ); 6706 6707 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6708 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[4]"; 6709 6710 } 6711 6712 TEST_F(append_006_Int32_Negative, append_100) 6713 { 6714 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6715 OString expVal( aStrBuf.getStr() ); 6716 sal_Int32 input = -35; 6717 sal_Int16 radix = 36; 6718 6719 expVal += OString( "-" ); 6720 expVal += OString( "z" ); 6721 aStrBuf.append( input, radix ); 6722 6723 ASSERT_TRUE(aStrBuf.getStr()== expVal && 6724 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int32, radix 36)_006_negative_kRadixBase36 for arrOUS[4]"; 6725 6726 } 6727 6728 //------------------------------------------------------------------------ 6729 // testing the method append( sal_Int32 i, sal_Int16 radix ) where radix = -5 6730 //------------------------------------------------------------------------ 6731 class append_006_Int32_WrongRadix : public ::testing::Test 6732 { 6733 protected: 6734 OString* arrOUS[5]; 6735 sal_Int32 intVal; 6736 6737 public: 6738 void SetUp() 6739 { 6740 arrOUS[0] = new OString( kTestStr7 ); 6741 arrOUS[1] = new OString( ); 6742 arrOUS[2] = new OString( kTestStr25 ); 6743 arrOUS[3] = new OString( "\0" ); 6744 arrOUS[4] = new OString( kTestStr28 ); 6745 intVal = 11; 6746 6747 } 6748 6749 void TearDown() 6750 { 6751 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 6752 delete arrOUS[3]; delete arrOUS[4]; 6753 } 6754 }; 6755 6756 TEST_F(append_006_Int32_WrongRadix, append_001) 6757 { 6758 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 6759 OString expVal( kTestStr59 ); 6760 6761 aStrBuf.append( intVal, -5 ); 6762 6763 ASSERT_TRUE(sal_True) << "Appends the WrongRadix to the string buffer arrOUS[0]"; 6764 6765 } 6766 6767 TEST_F(append_006_Int32_WrongRadix, append_002) 6768 { 6769 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 6770 OString expVal( kTestStr60 ); 6771 6772 aStrBuf.append( intVal, -5 ); 6773 6774 ASSERT_TRUE(sal_True) << "Appends the WrongRadix to the string buffer arrOUS[1]"; 6775 6776 } 6777 6778 TEST_F(append_006_Int32_WrongRadix, append_003) 6779 { 6780 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 6781 OString expVal( kTestStr60 ); 6782 6783 aStrBuf.append( intVal, -5 ); 6784 6785 ASSERT_TRUE(sal_True) << "Appends the WrongRadix to the string buffer arrOUS[2]"; 6786 6787 } 6788 6789 TEST_F(append_006_Int32_WrongRadix, append_004) 6790 { 6791 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 6792 OString expVal( kTestStr60 ); 6793 6794 aStrBuf.append( intVal, -5 ); 6795 6796 ASSERT_TRUE(sal_True) << "Appends the WrongRadix to the string buffer arrOUS[3]"; 6797 6798 } 6799 6800 TEST_F(append_006_Int32_WrongRadix, append_005) 6801 { 6802 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 6803 OString expVal( kTestStr61 ); 6804 6805 aStrBuf.append( intVal, -5 ); 6806 6807 ASSERT_TRUE(sal_True) << "Appends the WrongRadix to the string buffer arrOUS[4]"; 6808 6809 } 6810 #ifdef WITH_CORE 6811 TEST_F(append_006_Int32_WrongRadix, append_006) 6812 { 6813 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 6814 OString expVal( kTestStr60 ); 6815 6816 aStrBuf.append( intVal, -5 ); 6817 6818 ASSERT_TRUE(sal_True) << "Appends the WrongRadix to the string buffer(with INT_MAX)"; 6819 6820 } 6821 #endif 6822 6823 //------------------------------------------------------------------------ 6824 class append_006_Int32_defaultParam : public ::testing::Test 6825 { 6826 protected: 6827 OString* arrOUS[5]; 6828 6829 public: 6830 void SetUp() 6831 { 6832 arrOUS[0] = new OString( kTestStr7 ); 6833 arrOUS[1] = new OString( ); 6834 arrOUS[2] = new OString( kTestStr25 ); 6835 arrOUS[3] = new OString( "\0" ); 6836 arrOUS[4] = new OString( kTestStr28 ); 6837 6838 } 6839 6840 void TearDown() 6841 { 6842 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 6843 delete arrOUS[3]; delete arrOUS[4]; 6844 } 6845 }; 6846 6847 TEST_F(append_006_Int32_defaultParam, append_001) 6848 { 6849 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 6850 OString expVal( kTestStr59 ); 6851 sal_Int32 input = 11; 6852 6853 aStrBuf.append( input ); 6854 6855 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 11 and return OStringBuffer[0]+11"; 6856 6857 } 6858 6859 TEST_F(append_006_Int32_defaultParam, append_002) 6860 { 6861 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 6862 OString expVal( kTestStr62 ); 6863 sal_Int32 input = 0; 6864 6865 aStrBuf.append( input ); 6866 6867 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 0 and return OStringBuffer[0]+0"; 6868 6869 } 6870 6871 TEST_F(append_006_Int32_defaultParam, append_003) 6872 { 6873 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 6874 OString expVal( kTestStr63 ); 6875 sal_Int32 input = -11; 6876 6877 aStrBuf.append( input ); 6878 6879 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 -11 and return OStringBuffer[0]+(-11)"; 6880 6881 } 6882 6883 TEST_F(append_006_Int32_defaultParam, append_004) 6884 { 6885 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 6886 OString expVal( kTestStr64 ); 6887 sal_Int32 input = 2147483647; 6888 6889 aStrBuf.append( input ); 6890 6891 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 2147483647 and return OStringBuffer[0]+2147483647"; 6892 6893 } 6894 6895 TEST_F(append_006_Int32_defaultParam, append_005) 6896 { 6897 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 6898 OString expVal( kTestStr65 ); 6899 sal_Int32 input = kNonSInt32Max; 6900 6901 aStrBuf.append( input ); 6902 6903 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 -2147483648 and return OStringBuffer[0]+(-2147483648)"; 6904 6905 } 6906 6907 TEST_F(append_006_Int32_defaultParam, append_006) 6908 { 6909 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 6910 OString expVal( kTestStr60 ); 6911 sal_Int32 input = 11; 6912 6913 aStrBuf.append( input ); 6914 6915 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 11 and return OStringBuffer[1]+11"; 6916 6917 } 6918 6919 TEST_F(append_006_Int32_defaultParam, append_007) 6920 { 6921 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 6922 OString expVal( kTestStr66 ); 6923 sal_Int32 input = 0; 6924 6925 aStrBuf.append( input ); 6926 6927 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 0 and return OStringBuffer[1]+0"; 6928 6929 } 6930 6931 TEST_F(append_006_Int32_defaultParam, append_008) 6932 { 6933 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 6934 OString expVal( kTestStr67 ); 6935 sal_Int32 input = -11; 6936 6937 aStrBuf.append( input ); 6938 6939 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 -11 and return OStringBuffer[1]+(-11)"; 6940 6941 } 6942 6943 TEST_F(append_006_Int32_defaultParam, append_009) 6944 { 6945 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 6946 OString expVal( kTestStr68 ); 6947 sal_Int32 input = 2147483647; 6948 6949 aStrBuf.append( input ); 6950 6951 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 2147483647 and return OStringBuffer[1]+2147483647"; 6952 6953 } 6954 6955 TEST_F(append_006_Int32_defaultParam, append_010) 6956 { 6957 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 6958 OString expVal( kTestStr69 ); 6959 sal_Int32 input = SAL_MIN_INT32 /*-2147483648*/; 6960 6961 aStrBuf.append( input ); 6962 6963 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 -2147483648 and return OStringBuffer[1]+(-2147483648)"; 6964 6965 } 6966 6967 TEST_F(append_006_Int32_defaultParam, append_011) 6968 { 6969 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 6970 OString expVal( kTestStr60 ); 6971 sal_Int32 input = 11; 6972 6973 aStrBuf.append( input ); 6974 6975 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 11 and return OStringBuffer[2]+11"; 6976 6977 } 6978 6979 TEST_F(append_006_Int32_defaultParam, append_012) 6980 { 6981 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 6982 OString expVal( kTestStr66 ); 6983 sal_Int32 input = 0; 6984 6985 aStrBuf.append( input ); 6986 6987 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 0 and return OUStringBuffer[2]+0"; 6988 6989 } 6990 6991 TEST_F(append_006_Int32_defaultParam, append_013) 6992 { 6993 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 6994 OString expVal( kTestStr67 ); 6995 sal_Int32 input = -11; 6996 6997 aStrBuf.append( input ); 6998 6999 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 -11 and return OUStringBuffer[2]+(-11)"; 7000 7001 } 7002 7003 TEST_F(append_006_Int32_defaultParam, append_014) 7004 { 7005 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 7006 OString expVal( kTestStr68 ); 7007 sal_Int32 input = 2147483647; 7008 7009 aStrBuf.append( input ); 7010 7011 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 2147483647 and return OStringBuffer[2]+2147483647"; 7012 7013 } 7014 7015 TEST_F(append_006_Int32_defaultParam, append_015) 7016 { 7017 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 7018 OString expVal( kTestStr69 ); 7019 sal_Int32 input = SAL_MIN_INT32; 7020 7021 aStrBuf.append( input ); 7022 7023 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 -2147483648 and return OStringBuffer[2]+(-2147483648)"; 7024 7025 } 7026 7027 TEST_F(append_006_Int32_defaultParam, append_016) 7028 { 7029 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 7030 OString expVal( kTestStr60 ); 7031 sal_Int32 input = 11; 7032 7033 aStrBuf.append( input ); 7034 7035 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 11 and return OStringBuffer[3]+11"; 7036 7037 } 7038 7039 TEST_F(append_006_Int32_defaultParam, append_017) 7040 { 7041 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 7042 OString expVal( kTestStr66 ); 7043 sal_Int32 input = 0; 7044 7045 aStrBuf.append( input ); 7046 7047 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 0 and return OStringBuffer[3]+0"; 7048 7049 } 7050 7051 TEST_F(append_006_Int32_defaultParam, append_018) 7052 { 7053 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 7054 OString expVal( kTestStr67 ); 7055 sal_Int32 input = -11; 7056 7057 aStrBuf.append( input ); 7058 7059 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 -11 and return OStringBuffer[3]+(-11)"; 7060 7061 } 7062 7063 TEST_F(append_006_Int32_defaultParam, append_019) 7064 { 7065 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 7066 OString expVal( kTestStr68 ); 7067 sal_Int32 input = 2147483647; 7068 7069 aStrBuf.append( input ); 7070 7071 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 2147483647 and return OStringBuffer[3]+2147483647"; 7072 7073 } 7074 7075 TEST_F(append_006_Int32_defaultParam, append_020) 7076 { 7077 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 7078 OString expVal( kTestStr69 ); 7079 sal_Int32 input = SAL_MIN_INT32; 7080 7081 aStrBuf.append( input ); 7082 7083 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 -2147483648 and return OStringBuffer[3]+(-2147483648)"; 7084 7085 } 7086 7087 TEST_F(append_006_Int32_defaultParam, append_021) 7088 { 7089 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 7090 OString expVal( kTestStr61 ); 7091 sal_Int32 input = 11; 7092 7093 aStrBuf.append( input ); 7094 7095 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 11 and return OStringBuffer[4]+11"; 7096 7097 } 7098 7099 TEST_F(append_006_Int32_defaultParam, append_022) 7100 { 7101 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 7102 OString expVal( kTestStr70 ); 7103 sal_Int32 input = 0; 7104 7105 aStrBuf.append( input ); 7106 7107 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 0 and return OStringBuffer[4]+0"; 7108 7109 } 7110 7111 TEST_F(append_006_Int32_defaultParam, append_023) 7112 { 7113 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 7114 OString expVal( kTestStr71 ); 7115 sal_Int32 input = -11; 7116 7117 aStrBuf.append( input ); 7118 7119 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 -11 and return OStringBuffer[4]+(-11)"; 7120 7121 } 7122 7123 TEST_F(append_006_Int32_defaultParam, append_024) 7124 { 7125 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 7126 OString expVal( kTestStr72 ); 7127 sal_Int32 input = 2147483647; 7128 7129 aStrBuf.append( input ); 7130 7131 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 2147483647 and return OStringBuffer[4]+2147483647"; 7132 7133 } 7134 7135 TEST_F(append_006_Int32_defaultParam, append_025) 7136 { 7137 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 7138 OString expVal( kTestStr73 ); 7139 sal_Int32 input = SAL_MIN_INT32; 7140 7141 aStrBuf.append( input ); 7142 7143 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 -2147483648 and return OStringBuffer[4]+(-2147483648)"; 7144 7145 } 7146 #ifdef WITH_CORE 7147 TEST_F(append_006_Int32_defaultParam, append_026) 7148 { 7149 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 7150 OString expVal( kTestStr60 ); 7151 sal_Int32 input = 11; 7152 7153 aStrBuf.append( input ); 7154 7155 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 11 and return OStringBuffer(kSInt32Max)+11"; 7156 7157 } 7158 7159 TEST_F(append_006_Int32_defaultParam, append_027) 7160 { 7161 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 7162 OString expVal( kTestStr66 ); 7163 sal_Int32 input = 0; 7164 7165 aStrBuf.append( input ); 7166 7167 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 0 and return OStringBuffer(kSInt32Max)+0"; 7168 7169 } 7170 7171 TEST_F(append_006_Int32_defaultParam, append_028) 7172 { 7173 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 7174 OString expVal( kTestStr67 ); 7175 sal_Int32 input = -11; 7176 7177 aStrBuf.append( input ); 7178 7179 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 -11 and return OStringBuffer(kSInt32Max)+(-11)"; 7180 7181 } 7182 7183 TEST_F(append_006_Int32_defaultParam, append_029) 7184 { 7185 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 7186 OString expVal( kTestStr68 ); 7187 sal_Int32 input = 2147483647; 7188 7189 aStrBuf.append( input ); 7190 7191 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 2147483647 and return OStringBuffer(kSInt32Max)+2147483647"; 7192 7193 } 7194 7195 TEST_F(append_006_Int32_defaultParam, append_030) 7196 { 7197 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 7198 OString expVal( kTestStr69 ); 7199 sal_Int32 input = SAL_MIN_INT32; 7200 7201 aStrBuf.append( input ); 7202 7203 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int32 -2147483648 and return OStringBuffer(kSInt32Max)+(-2147483648)"; 7204 7205 } 7206 #endif 7207 7208 //------------------------------------------------------------------------ 7209 // testing the method append( sal_Int64 l, sal_Int16 radix=2 ) 7210 // testing the method append( sal_Int64 l, sal_Int16 radix=8 ) 7211 // testing the method append( sal_Int64 l, sal_Int16 radix=10 ) 7212 // testing the method append( sal_Int64 l, sal_Int16 radix=16 ) 7213 // testing the method append( sal_Int64 l, sal_Int16 radix=36 ) 7214 //------------------------------------------------------------------------ 7215 class append_007_Int64 : public ::testing::Test 7216 { 7217 protected: 7218 OString* arrOUS[5]; 7219 7220 public: 7221 void SetUp() 7222 { 7223 arrOUS[0] = new OString( kTestStr7 ); 7224 arrOUS[1] = new OString( ); 7225 arrOUS[2] = new OString( kTestStr25 ); 7226 arrOUS[3] = new OString( "\0" ); 7227 arrOUS[4] = new OString( kTestStr28 ); 7228 7229 } 7230 7231 void TearDown() 7232 { 7233 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 7234 delete arrOUS[3]; delete arrOUS[4]; 7235 } 7236 }; 7237 7238 TEST_F(append_007_Int64, append_001) 7239 { 7240 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7241 OString expVal( aStrBuf.getStr() ); 7242 sal_Int64 input = 0; 7243 sal_Int16 radix = 2; 7244 7245 expVal += OString( "0" ); 7246 aStrBuf.append( input, radix ); 7247 7248 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7249 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[0]"; 7250 7251 } 7252 7253 TEST_F(append_007_Int64, append_002) 7254 { 7255 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7256 OString expVal( aStrBuf.getStr() ); 7257 sal_Int64 input = 4; 7258 sal_Int16 radix = 2; 7259 7260 expVal += OString( "100" ); 7261 aStrBuf.append( input, radix ); 7262 7263 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7264 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[0]"; 7265 7266 } 7267 7268 TEST_F(append_007_Int64, append_003) 7269 { 7270 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7271 OString expVal( aStrBuf.getStr() ); 7272 sal_Int64 input = 8; 7273 sal_Int16 radix = 2; 7274 7275 expVal += OString( "1000" ); 7276 aStrBuf.append( input, radix ); 7277 7278 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7279 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[0]"; 7280 7281 } 7282 7283 TEST_F(append_007_Int64, append_004) 7284 { 7285 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7286 OString expVal( aStrBuf.getStr() ); 7287 sal_Int64 input = 15; 7288 sal_Int16 radix = 2; 7289 7290 expVal += OString( "1111" ); 7291 aStrBuf.append( input, radix ); 7292 7293 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7294 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[0]"; 7295 7296 } 7297 7298 TEST_F(append_007_Int64, append_005) 7299 { 7300 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7301 OString expVal( aStrBuf.getStr() ); 7302 sal_Int64 input = 0; 7303 sal_Int16 radix = 8; 7304 7305 expVal += OString( "0" ); 7306 aStrBuf.append( input, radix ); 7307 7308 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7309 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[0]"; 7310 7311 } 7312 7313 TEST_F(append_007_Int64, append_006) 7314 { 7315 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7316 OString expVal( aStrBuf.getStr() ); 7317 sal_Int64 input = 4; 7318 sal_Int16 radix = 8; 7319 7320 expVal += OString( "4" ); 7321 aStrBuf.append( input, radix ); 7322 7323 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7324 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[0]"; 7325 7326 } 7327 7328 TEST_F(append_007_Int64, append_007) 7329 { 7330 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7331 OString expVal( aStrBuf.getStr() ); 7332 sal_Int64 input = 8; 7333 sal_Int16 radix = 8; 7334 7335 expVal += OString( "10" ); 7336 aStrBuf.append( input, radix ); 7337 7338 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7339 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[0]"; 7340 7341 } 7342 7343 TEST_F(append_007_Int64, append_008) 7344 { 7345 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7346 OString expVal( aStrBuf.getStr() ); 7347 sal_Int64 input = 15; 7348 sal_Int16 radix = 8; 7349 7350 expVal += OString( "17" ); 7351 aStrBuf.append( input, radix ); 7352 7353 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7354 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[0]"; 7355 7356 } 7357 7358 TEST_F(append_007_Int64, append_009) 7359 { 7360 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7361 OString expVal( aStrBuf.getStr() ); 7362 sal_Int64 input = 0; 7363 sal_Int16 radix = 10; 7364 7365 expVal += OString( "0" ); 7366 aStrBuf.append( input, radix ); 7367 7368 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7369 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[0]"; 7370 7371 } 7372 7373 TEST_F(append_007_Int64, append_010) 7374 { 7375 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7376 OString expVal( aStrBuf.getStr() ); 7377 sal_Int64 input = 4; 7378 sal_Int16 radix = 10; 7379 7380 expVal += OString( "4" ); 7381 aStrBuf.append( input, radix ); 7382 7383 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7384 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[0]"; 7385 7386 } 7387 7388 TEST_F(append_007_Int64, append_011) 7389 { 7390 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7391 OString expVal( aStrBuf.getStr() ); 7392 sal_Int64 input = 8; 7393 sal_Int16 radix = 10; 7394 7395 expVal += OString( "8" ); 7396 aStrBuf.append( input, radix ); 7397 7398 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7399 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[0]"; 7400 7401 } 7402 7403 TEST_F(append_007_Int64, append_012) 7404 { 7405 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7406 OString expVal( aStrBuf.getStr() ); 7407 sal_Int64 input = 15; 7408 sal_Int16 radix = 10; 7409 7410 expVal += OString( "15" ); 7411 aStrBuf.append( input, radix ); 7412 7413 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7414 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[0]"; 7415 7416 } 7417 7418 TEST_F(append_007_Int64, append_013) 7419 { 7420 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7421 OString expVal( aStrBuf.getStr() ); 7422 sal_Int64 input = 0; 7423 sal_Int16 radix = 16; 7424 7425 expVal += OString( "0" ); 7426 aStrBuf.append( input, radix ); 7427 7428 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7429 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[0]"; 7430 7431 } 7432 7433 TEST_F(append_007_Int64, append_014) 7434 { 7435 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7436 OString expVal( aStrBuf.getStr() ); 7437 sal_Int64 input = 4; 7438 sal_Int16 radix = 16; 7439 7440 expVal += OString( "4" ); 7441 aStrBuf.append( input, radix ); 7442 7443 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7444 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[0]"; 7445 7446 } 7447 7448 TEST_F(append_007_Int64, append_015) 7449 { 7450 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7451 OString expVal( aStrBuf.getStr() ); 7452 sal_Int64 input = 8; 7453 sal_Int16 radix = 16; 7454 7455 expVal += OString( "8" ); 7456 aStrBuf.append( input, radix ); 7457 7458 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7459 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[0]"; 7460 7461 } 7462 7463 TEST_F(append_007_Int64, append_016) 7464 { 7465 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7466 OString expVal( aStrBuf.getStr() ); 7467 sal_Int64 input = 15; 7468 sal_Int16 radix = 16; 7469 7470 expVal += OString( "f" ); 7471 aStrBuf.append( input, radix ); 7472 7473 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7474 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[0]"; 7475 7476 } 7477 7478 TEST_F(append_007_Int64, append_017) 7479 { 7480 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7481 OString expVal( aStrBuf.getStr() ); 7482 sal_Int64 input = 0; 7483 sal_Int16 radix = 36; 7484 7485 expVal += OString( "0" ); 7486 aStrBuf.append( input, radix ); 7487 7488 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7489 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[0]"; 7490 7491 } 7492 7493 TEST_F(append_007_Int64, append_018) 7494 { 7495 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7496 OString expVal( aStrBuf.getStr() ); 7497 sal_Int64 input = 4; 7498 sal_Int16 radix = 36; 7499 7500 expVal += OString( "4" ); 7501 aStrBuf.append( input, radix ); 7502 7503 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7504 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[0]"; 7505 7506 } 7507 7508 TEST_F(append_007_Int64, append_019) 7509 { 7510 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7511 OString expVal( aStrBuf.getStr() ); 7512 sal_Int64 input = 8; 7513 sal_Int16 radix = 36; 7514 7515 expVal += OString( "8" ); 7516 aStrBuf.append( input, radix ); 7517 7518 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7519 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[0]"; 7520 7521 } 7522 7523 TEST_F(append_007_Int64, append_020) 7524 { 7525 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 7526 OString expVal( aStrBuf.getStr() ); 7527 sal_Int64 input = 35; 7528 sal_Int16 radix = 36; 7529 7530 expVal += OString( "z" ); 7531 aStrBuf.append( input, radix ); 7532 7533 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7534 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[0]"; 7535 7536 } 7537 7538 TEST_F(append_007_Int64, append_021) 7539 { 7540 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7541 OString expVal( aStrBuf.getStr() ); 7542 sal_Int64 input = 0; 7543 sal_Int16 radix = 2; 7544 7545 expVal += OString( "0" ); 7546 aStrBuf.append( input, radix ); 7547 7548 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7549 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[1]"; 7550 7551 } 7552 7553 TEST_F(append_007_Int64, append_022) 7554 { 7555 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7556 OString expVal( aStrBuf.getStr() ); 7557 sal_Int64 input = 4; 7558 sal_Int16 radix = 2; 7559 7560 expVal += OString( "100" ); 7561 aStrBuf.append( input, radix ); 7562 7563 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7564 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[1]"; 7565 7566 } 7567 7568 TEST_F(append_007_Int64, append_023) 7569 { 7570 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7571 OString expVal( aStrBuf.getStr() ); 7572 sal_Int64 input = 8; 7573 sal_Int16 radix = 2; 7574 7575 expVal += OString( "1000" ); 7576 aStrBuf.append( input, radix ); 7577 7578 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7579 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[1]"; 7580 7581 } 7582 7583 TEST_F(append_007_Int64, append_024) 7584 { 7585 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7586 OString expVal( aStrBuf.getStr() ); 7587 sal_Int64 input = 15; 7588 sal_Int16 radix = 2; 7589 7590 expVal += OString( "1111" ); 7591 aStrBuf.append( input, radix ); 7592 7593 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7594 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[1]"; 7595 7596 } 7597 7598 TEST_F(append_007_Int64, append_025) 7599 { 7600 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7601 OString expVal( aStrBuf.getStr() ); 7602 sal_Int64 input = 0; 7603 sal_Int16 radix = 8; 7604 7605 expVal += OString( "0" ); 7606 aStrBuf.append( input, radix ); 7607 7608 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7609 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[1]"; 7610 7611 } 7612 7613 TEST_F(append_007_Int64, append_026) 7614 { 7615 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7616 OString expVal( aStrBuf.getStr() ); 7617 sal_Int64 input = 4; 7618 sal_Int16 radix = 8; 7619 7620 expVal += OString( "4" ); 7621 aStrBuf.append( input, radix ); 7622 7623 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7624 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[1]"; 7625 7626 } 7627 7628 TEST_F(append_007_Int64, append_027) 7629 { 7630 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7631 OString expVal( aStrBuf.getStr() ); 7632 sal_Int64 input = 8; 7633 sal_Int16 radix = 8; 7634 7635 expVal += OString( "10" ); 7636 aStrBuf.append( input, radix ); 7637 7638 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7639 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[1]"; 7640 7641 } 7642 7643 TEST_F(append_007_Int64, append_028) 7644 { 7645 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7646 OString expVal( aStrBuf.getStr() ); 7647 sal_Int64 input = 15; 7648 sal_Int16 radix = 8; 7649 7650 expVal += OString( "17" ); 7651 aStrBuf.append( input, radix ); 7652 7653 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7654 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[1]"; 7655 7656 } 7657 7658 TEST_F(append_007_Int64, append_029) 7659 { 7660 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7661 OString expVal( aStrBuf.getStr() ); 7662 sal_Int64 input = 0; 7663 sal_Int16 radix = 10; 7664 7665 expVal += OString( "0" ); 7666 aStrBuf.append( input, radix ); 7667 7668 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7669 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[1]"; 7670 7671 } 7672 7673 TEST_F(append_007_Int64, append_030) 7674 { 7675 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7676 OString expVal( aStrBuf.getStr() ); 7677 sal_Int64 input = 4; 7678 sal_Int16 radix = 10; 7679 7680 expVal += OString( "4" ); 7681 aStrBuf.append( input, radix ); 7682 7683 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7684 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[1]"; 7685 7686 } 7687 7688 TEST_F(append_007_Int64, append_031) 7689 { 7690 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7691 OString expVal( aStrBuf.getStr() ); 7692 sal_Int64 input = 8; 7693 sal_Int16 radix = 10; 7694 7695 expVal += OString( "8" ); 7696 aStrBuf.append( input, radix ); 7697 7698 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7699 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[1]"; 7700 7701 } 7702 7703 TEST_F(append_007_Int64, append_032) 7704 { 7705 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7706 OString expVal( aStrBuf.getStr() ); 7707 sal_Int64 input = 15; 7708 sal_Int16 radix = 10; 7709 7710 expVal += OString( "15" ); 7711 aStrBuf.append( input, radix ); 7712 7713 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7714 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[1]"; 7715 7716 } 7717 7718 TEST_F(append_007_Int64, append_033) 7719 { 7720 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7721 OString expVal( aStrBuf.getStr() ); 7722 sal_Int64 input = 0; 7723 sal_Int16 radix = 16; 7724 7725 expVal += OString( "0" ); 7726 aStrBuf.append( input, radix ); 7727 7728 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7729 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[1]"; 7730 7731 } 7732 7733 TEST_F(append_007_Int64, append_034) 7734 { 7735 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7736 OString expVal( aStrBuf.getStr() ); 7737 sal_Int64 input = 4; 7738 sal_Int16 radix = 16; 7739 7740 expVal += OString( "4" ); 7741 aStrBuf.append( input, radix ); 7742 7743 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7744 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[1]"; 7745 7746 } 7747 7748 TEST_F(append_007_Int64, append_035) 7749 { 7750 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7751 OString expVal( aStrBuf.getStr() ); 7752 sal_Int64 input = 8; 7753 sal_Int16 radix = 16; 7754 7755 expVal += OString( "8" ); 7756 aStrBuf.append( input, radix ); 7757 7758 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7759 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[1]"; 7760 7761 } 7762 7763 TEST_F(append_007_Int64, append_036) 7764 { 7765 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7766 OString expVal( aStrBuf.getStr() ); 7767 sal_Int64 input = 15; 7768 sal_Int16 radix = 16; 7769 7770 expVal += OString( "f" ); 7771 aStrBuf.append( input, radix ); 7772 7773 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7774 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[1]"; 7775 7776 } 7777 7778 TEST_F(append_007_Int64, append_037) 7779 { 7780 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7781 OString expVal( aStrBuf.getStr() ); 7782 sal_Int64 input = 0; 7783 sal_Int16 radix = 36; 7784 7785 expVal += OString( "0" ); 7786 aStrBuf.append( input, radix ); 7787 7788 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7789 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[1]"; 7790 7791 } 7792 7793 TEST_F(append_007_Int64, append_038) 7794 { 7795 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7796 OString expVal( aStrBuf.getStr() ); 7797 sal_Int64 input = 4; 7798 sal_Int16 radix = 36; 7799 7800 expVal += OString( "4" ); 7801 aStrBuf.append( input, radix ); 7802 7803 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7804 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[1]"; 7805 7806 } 7807 7808 TEST_F(append_007_Int64, append_039) 7809 { 7810 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7811 OString expVal( aStrBuf.getStr() ); 7812 sal_Int64 input = 8; 7813 sal_Int16 radix = 36; 7814 7815 expVal += OString( "8" ); 7816 aStrBuf.append( input, radix ); 7817 7818 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7819 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[1]"; 7820 7821 } 7822 7823 TEST_F(append_007_Int64, append_040) 7824 { 7825 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 7826 OString expVal( aStrBuf.getStr() ); 7827 sal_Int64 input = 35; 7828 sal_Int16 radix = 36; 7829 7830 expVal += OString( "z" ); 7831 aStrBuf.append( input, radix ); 7832 7833 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7834 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[1]"; 7835 7836 } 7837 7838 TEST_F(append_007_Int64, append_041) 7839 { 7840 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 7841 OString expVal( aStrBuf.getStr() ); 7842 sal_Int64 input = 0; 7843 sal_Int16 radix = 2; 7844 7845 expVal += OString( "0" ); 7846 aStrBuf.append( input, radix ); 7847 7848 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7849 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[2]"; 7850 7851 } 7852 7853 TEST_F(append_007_Int64, append_042) 7854 { 7855 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 7856 OString expVal( aStrBuf.getStr() ); 7857 sal_Int64 input = 4; 7858 sal_Int16 radix = 2; 7859 7860 expVal += OString( "100" ); 7861 aStrBuf.append( input, radix ); 7862 7863 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7864 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[2]"; 7865 7866 } 7867 7868 TEST_F(append_007_Int64, append_043) 7869 { 7870 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 7871 OString expVal( aStrBuf.getStr() ); 7872 sal_Int64 input = 8; 7873 sal_Int16 radix = 2; 7874 7875 expVal += OString( "1000" ); 7876 aStrBuf.append( input, radix ); 7877 7878 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7879 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[2]"; 7880 7881 } 7882 7883 TEST_F(append_007_Int64, append_044) 7884 { 7885 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 7886 OString expVal( aStrBuf.getStr() ); 7887 sal_Int64 input = 15; 7888 sal_Int16 radix = 2; 7889 7890 expVal += OString( "1111" ); 7891 aStrBuf.append( input, radix ); 7892 7893 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7894 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[2]"; 7895 7896 } 7897 7898 TEST_F(append_007_Int64, append_045) 7899 { 7900 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 7901 OString expVal( aStrBuf.getStr() ); 7902 sal_Int64 input = 0; 7903 sal_Int16 radix = 8; 7904 7905 expVal += OString( "0" ); 7906 aStrBuf.append( input, radix ); 7907 7908 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7909 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[2]"; 7910 7911 } 7912 7913 TEST_F(append_007_Int64, append_046) 7914 { 7915 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 7916 OString expVal( aStrBuf.getStr() ); 7917 sal_Int64 input = 4; 7918 sal_Int16 radix = 8; 7919 7920 expVal += OString( "4" ); 7921 aStrBuf.append( input, radix ); 7922 7923 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7924 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[2]"; 7925 7926 } 7927 7928 TEST_F(append_007_Int64, append_047) 7929 { 7930 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 7931 OString expVal( aStrBuf.getStr() ); 7932 sal_Int64 input = 8; 7933 sal_Int16 radix = 8; 7934 7935 expVal += OString( "10" ); 7936 aStrBuf.append( input, radix ); 7937 7938 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7939 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[2]"; 7940 7941 } 7942 7943 TEST_F(append_007_Int64, append_048) 7944 { 7945 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 7946 OString expVal( aStrBuf.getStr() ); 7947 sal_Int64 input = 15; 7948 sal_Int16 radix = 8; 7949 7950 expVal += OString( "17" ); 7951 aStrBuf.append( input, radix ); 7952 7953 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7954 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[2]"; 7955 7956 } 7957 7958 TEST_F(append_007_Int64, append_049) 7959 { 7960 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 7961 OString expVal( aStrBuf.getStr() ); 7962 sal_Int64 input = 0; 7963 sal_Int16 radix = 10; 7964 7965 expVal += OString( "0" ); 7966 aStrBuf.append( input, radix ); 7967 7968 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7969 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[2]"; 7970 7971 } 7972 7973 TEST_F(append_007_Int64, append_050) 7974 { 7975 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 7976 OString expVal( aStrBuf.getStr() ); 7977 sal_Int64 input = 4; 7978 sal_Int16 radix = 10; 7979 7980 expVal += OString( "4" ); 7981 aStrBuf.append( input, radix ); 7982 7983 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7984 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[2]"; 7985 7986 } 7987 7988 TEST_F(append_007_Int64, append_051) 7989 { 7990 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 7991 OString expVal( aStrBuf.getStr() ); 7992 sal_Int64 input = 8; 7993 sal_Int16 radix = 10; 7994 7995 expVal += OString( "8" ); 7996 aStrBuf.append( input, radix ); 7997 7998 ASSERT_TRUE(aStrBuf.getStr()== expVal && 7999 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[2]"; 8000 8001 } 8002 8003 TEST_F(append_007_Int64, append_052) 8004 { 8005 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 8006 OString expVal( aStrBuf.getStr() ); 8007 sal_Int64 input = 15; 8008 sal_Int16 radix = 10; 8009 8010 expVal += OString( "15" ); 8011 aStrBuf.append( input, radix ); 8012 8013 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8014 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[2]"; 8015 8016 } 8017 8018 TEST_F(append_007_Int64, append_053) 8019 { 8020 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 8021 OString expVal( aStrBuf.getStr() ); 8022 sal_Int64 input = 0; 8023 sal_Int16 radix = 16; 8024 8025 expVal += OString( "0" ); 8026 aStrBuf.append( input, radix ); 8027 8028 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8029 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[2]"; 8030 8031 } 8032 8033 TEST_F(append_007_Int64, append_054) 8034 { 8035 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 8036 OString expVal( aStrBuf.getStr() ); 8037 sal_Int64 input = 4; 8038 sal_Int16 radix = 16; 8039 8040 expVal += OString( "4" ); 8041 aStrBuf.append( input, radix ); 8042 8043 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8044 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[2]"; 8045 8046 } 8047 8048 TEST_F(append_007_Int64, append_055) 8049 { 8050 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 8051 OString expVal( aStrBuf.getStr() ); 8052 sal_Int64 input = 8; 8053 sal_Int16 radix = 16; 8054 8055 expVal += OString( "8" ); 8056 aStrBuf.append( input, radix ); 8057 8058 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8059 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[2]"; 8060 8061 } 8062 8063 TEST_F(append_007_Int64, append_056) 8064 { 8065 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 8066 OString expVal( aStrBuf.getStr() ); 8067 sal_Int64 input = 15; 8068 sal_Int16 radix = 16; 8069 8070 expVal += OString( "f" ); 8071 aStrBuf.append( input, radix ); 8072 8073 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8074 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[2]"; 8075 8076 } 8077 8078 TEST_F(append_007_Int64, append_057) 8079 { 8080 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 8081 OString expVal( aStrBuf.getStr() ); 8082 sal_Int64 input = 0; 8083 sal_Int16 radix = 36; 8084 8085 expVal += OString( "0" ); 8086 aStrBuf.append( input, radix ); 8087 8088 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8089 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[2]"; 8090 8091 } 8092 8093 TEST_F(append_007_Int64, append_058) 8094 { 8095 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 8096 OString expVal( aStrBuf.getStr() ); 8097 sal_Int64 input = 4; 8098 sal_Int16 radix = 36; 8099 8100 expVal += OString( "4" ); 8101 aStrBuf.append( input, radix ); 8102 8103 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8104 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[2]"; 8105 8106 } 8107 8108 TEST_F(append_007_Int64, append_059) 8109 { 8110 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 8111 OString expVal( aStrBuf.getStr() ); 8112 sal_Int64 input = 8; 8113 sal_Int16 radix = 36; 8114 8115 expVal += OString( "8" ); 8116 aStrBuf.append( input, radix ); 8117 8118 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8119 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[2]"; 8120 8121 } 8122 8123 TEST_F(append_007_Int64, append_060) 8124 { 8125 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 8126 OString expVal( aStrBuf.getStr() ); 8127 sal_Int64 input = 35; 8128 sal_Int16 radix = 36; 8129 8130 expVal += OString( "z" ); 8131 aStrBuf.append( input, radix ); 8132 8133 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8134 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[2]"; 8135 8136 } 8137 8138 TEST_F(append_007_Int64, append_061) 8139 { 8140 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8141 OString expVal( aStrBuf.getStr() ); 8142 sal_Int64 input = 0; 8143 sal_Int16 radix = 2; 8144 8145 expVal += OString( "0" ); 8146 aStrBuf.append( input, radix ); 8147 8148 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8149 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[3]"; 8150 8151 } 8152 8153 TEST_F(append_007_Int64, append_062) 8154 { 8155 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8156 OString expVal( aStrBuf.getStr() ); 8157 sal_Int64 input = 4; 8158 sal_Int16 radix = 2; 8159 8160 expVal += OString( "100" ); 8161 aStrBuf.append( input, radix ); 8162 8163 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8164 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[3]"; 8165 8166 } 8167 8168 TEST_F(append_007_Int64, append_063) 8169 { 8170 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8171 OString expVal( aStrBuf.getStr() ); 8172 sal_Int64 input = 8; 8173 sal_Int16 radix = 2; 8174 8175 expVal += OString( "1000" ); 8176 aStrBuf.append( input, radix ); 8177 8178 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8179 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[3]"; 8180 8181 } 8182 8183 TEST_F(append_007_Int64, append_064) 8184 { 8185 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8186 OString expVal( aStrBuf.getStr() ); 8187 sal_Int64 input = 15; 8188 sal_Int16 radix = 2; 8189 8190 expVal += OString( "1111" ); 8191 aStrBuf.append( input, radix ); 8192 8193 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8194 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[3]"; 8195 8196 } 8197 8198 TEST_F(append_007_Int64, append_065) 8199 { 8200 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8201 OString expVal( aStrBuf.getStr() ); 8202 sal_Int64 input = 0; 8203 sal_Int16 radix = 8; 8204 8205 expVal += OString( "0" ); 8206 aStrBuf.append( input, radix ); 8207 8208 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8209 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[3]"; 8210 8211 } 8212 8213 TEST_F(append_007_Int64, append_066) 8214 { 8215 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8216 OString expVal( aStrBuf.getStr() ); 8217 sal_Int64 input = 4; 8218 sal_Int16 radix = 8; 8219 8220 expVal += OString( "4" ); 8221 aStrBuf.append( input, radix ); 8222 8223 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8224 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[3]"; 8225 8226 } 8227 8228 TEST_F(append_007_Int64, append_067) 8229 { 8230 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8231 OString expVal( aStrBuf.getStr() ); 8232 sal_Int64 input = 8; 8233 sal_Int16 radix = 8; 8234 8235 expVal += OString( "10" ); 8236 aStrBuf.append( input, radix ); 8237 8238 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8239 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[3]"; 8240 8241 } 8242 8243 TEST_F(append_007_Int64, append_068) 8244 { 8245 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8246 OString expVal( aStrBuf.getStr() ); 8247 sal_Int64 input = 15; 8248 sal_Int16 radix = 8; 8249 8250 expVal += OString( "17" ); 8251 aStrBuf.append( input, radix ); 8252 8253 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8254 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[3]"; 8255 8256 } 8257 8258 TEST_F(append_007_Int64, append_069) 8259 { 8260 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8261 OString expVal( aStrBuf.getStr() ); 8262 sal_Int64 input = 0; 8263 sal_Int16 radix = 10; 8264 8265 expVal += OString( "0" ); 8266 aStrBuf.append( input, radix ); 8267 8268 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8269 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[3]"; 8270 8271 } 8272 8273 TEST_F(append_007_Int64, append_070) 8274 { 8275 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8276 OString expVal( aStrBuf.getStr() ); 8277 sal_Int64 input = 4; 8278 sal_Int16 radix = 10; 8279 8280 expVal += OString( "4" ); 8281 aStrBuf.append( input, radix ); 8282 8283 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8284 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[3]"; 8285 8286 } 8287 8288 TEST_F(append_007_Int64, append_071) 8289 { 8290 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8291 OString expVal( aStrBuf.getStr() ); 8292 sal_Int64 input = 8; 8293 sal_Int16 radix = 10; 8294 8295 expVal += OString( "8" ); 8296 aStrBuf.append( input, radix ); 8297 8298 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8299 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[3]"; 8300 8301 } 8302 8303 TEST_F(append_007_Int64, append_072) 8304 { 8305 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8306 OString expVal( aStrBuf.getStr() ); 8307 sal_Int64 input = 15; 8308 sal_Int16 radix = 10; 8309 8310 expVal += OString( "15" ); 8311 aStrBuf.append( input, radix ); 8312 8313 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8314 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[3]"; 8315 8316 } 8317 8318 TEST_F(append_007_Int64, append_073) 8319 { 8320 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8321 OString expVal( aStrBuf.getStr() ); 8322 sal_Int64 input = 0; 8323 sal_Int16 radix = 16; 8324 8325 expVal += OString( "0" ); 8326 aStrBuf.append( input, radix ); 8327 8328 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8329 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[3]"; 8330 8331 } 8332 8333 TEST_F(append_007_Int64, append_074) 8334 { 8335 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8336 OString expVal( aStrBuf.getStr() ); 8337 sal_Int64 input = 4; 8338 sal_Int16 radix = 16; 8339 8340 expVal += OString( "4" ); 8341 aStrBuf.append( input, radix ); 8342 8343 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8344 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[3]"; 8345 8346 } 8347 8348 TEST_F(append_007_Int64, append_075) 8349 { 8350 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8351 OString expVal( aStrBuf.getStr() ); 8352 sal_Int64 input = 8; 8353 sal_Int16 radix = 16; 8354 8355 expVal += OString( "8" ); 8356 aStrBuf.append( input, radix ); 8357 8358 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8359 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[3]"; 8360 8361 } 8362 8363 TEST_F(append_007_Int64, append_076) 8364 { 8365 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8366 OString expVal( aStrBuf.getStr() ); 8367 sal_Int64 input = 15; 8368 sal_Int16 radix = 16; 8369 8370 expVal += OString( "f" ); 8371 aStrBuf.append( input, radix ); 8372 8373 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8374 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[3]"; 8375 8376 } 8377 8378 TEST_F(append_007_Int64, append_077) 8379 { 8380 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8381 OString expVal( aStrBuf.getStr() ); 8382 sal_Int64 input = 0; 8383 sal_Int16 radix = 36; 8384 8385 expVal += OString( "0" ); 8386 aStrBuf.append( input, radix ); 8387 8388 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8389 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[3]"; 8390 8391 } 8392 8393 TEST_F(append_007_Int64, append_078) 8394 { 8395 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8396 OString expVal( aStrBuf.getStr() ); 8397 sal_Int64 input = 4; 8398 sal_Int16 radix = 36; 8399 8400 expVal += OString( "4" ); 8401 aStrBuf.append( input, radix ); 8402 8403 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8404 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[3]"; 8405 8406 } 8407 8408 TEST_F(append_007_Int64, append_079) 8409 { 8410 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8411 OString expVal( aStrBuf.getStr() ); 8412 sal_Int64 input = 8; 8413 sal_Int16 radix = 36; 8414 8415 expVal += OString( "8" ); 8416 aStrBuf.append( input, radix ); 8417 8418 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8419 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[3]"; 8420 8421 } 8422 8423 TEST_F(append_007_Int64, append_080) 8424 { 8425 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 8426 OString expVal( aStrBuf.getStr() ); 8427 sal_Int64 input = 35; 8428 sal_Int16 radix = 36; 8429 8430 expVal += OString( "z" ); 8431 aStrBuf.append( input, radix ); 8432 8433 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8434 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[3]"; 8435 8436 } 8437 8438 TEST_F(append_007_Int64, append_081) 8439 { 8440 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8441 OString expVal( aStrBuf.getStr() ); 8442 sal_Int64 input = 0; 8443 sal_Int16 radix = 2; 8444 8445 expVal += OString( "0" ); 8446 aStrBuf.append( input, radix ); 8447 8448 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8449 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[4]"; 8450 8451 } 8452 8453 TEST_F(append_007_Int64, append_082) 8454 { 8455 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8456 OString expVal( aStrBuf.getStr() ); 8457 sal_Int64 input = 4; 8458 sal_Int16 radix = 2; 8459 8460 expVal += OString( "100" ); 8461 aStrBuf.append( input, radix ); 8462 8463 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8464 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[4]"; 8465 8466 } 8467 8468 TEST_F(append_007_Int64, append_083) 8469 { 8470 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8471 OString expVal( aStrBuf.getStr() ); 8472 sal_Int64 input = 8; 8473 sal_Int16 radix = 2; 8474 8475 expVal += OString( "1000" ); 8476 aStrBuf.append( input, radix ); 8477 8478 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8479 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[4]"; 8480 8481 } 8482 8483 TEST_F(append_007_Int64, append_084) 8484 { 8485 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8486 OString expVal( aStrBuf.getStr() ); 8487 sal_Int64 input = 15; 8488 sal_Int16 radix = 2; 8489 8490 expVal += OString( "1111" ); 8491 aStrBuf.append( input, radix ); 8492 8493 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8494 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_kRadixBinary for arrOUS[4]"; 8495 8496 } 8497 8498 TEST_F(append_007_Int64, append_085) 8499 { 8500 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8501 OString expVal( aStrBuf.getStr() ); 8502 sal_Int64 input = 0; 8503 sal_Int16 radix = 8; 8504 8505 expVal += OString( "0" ); 8506 aStrBuf.append( input, radix ); 8507 8508 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8509 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[4]"; 8510 8511 } 8512 8513 TEST_F(append_007_Int64, append_086) 8514 { 8515 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8516 OString expVal( aStrBuf.getStr() ); 8517 sal_Int64 input = 4; 8518 sal_Int16 radix = 8; 8519 8520 expVal += OString( "4" ); 8521 aStrBuf.append( input, radix ); 8522 8523 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8524 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[4]"; 8525 8526 } 8527 8528 TEST_F(append_007_Int64, append_087) 8529 { 8530 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8531 OString expVal( aStrBuf.getStr() ); 8532 sal_Int64 input = 8; 8533 sal_Int16 radix = 8; 8534 8535 expVal += OString( "10" ); 8536 aStrBuf.append( input, radix ); 8537 8538 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8539 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[4]"; 8540 8541 } 8542 8543 TEST_F(append_007_Int64, append_088) 8544 { 8545 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8546 OString expVal( aStrBuf.getStr() ); 8547 sal_Int64 input = 15; 8548 sal_Int16 radix = 8; 8549 8550 expVal += OString( "17" ); 8551 aStrBuf.append( input, radix ); 8552 8553 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8554 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_kRadixOctol for arrOUS[4]"; 8555 8556 } 8557 8558 TEST_F(append_007_Int64, append_089) 8559 { 8560 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8561 OString expVal( aStrBuf.getStr() ); 8562 sal_Int64 input = 0; 8563 sal_Int16 radix = 10; 8564 8565 expVal += OString( "0" ); 8566 aStrBuf.append( input, radix ); 8567 8568 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8569 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[4]"; 8570 8571 } 8572 8573 TEST_F(append_007_Int64, append_090) 8574 { 8575 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8576 OString expVal( aStrBuf.getStr() ); 8577 sal_Int64 input = 4; 8578 sal_Int16 radix = 10; 8579 8580 expVal += OString( "4" ); 8581 aStrBuf.append( input, radix ); 8582 8583 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8584 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[4]"; 8585 8586 } 8587 8588 TEST_F(append_007_Int64, append_091) 8589 { 8590 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8591 OString expVal( aStrBuf.getStr() ); 8592 sal_Int64 input = 8; 8593 sal_Int16 radix = 10; 8594 8595 expVal += OString( "8" ); 8596 aStrBuf.append( input, radix ); 8597 8598 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8599 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[4]"; 8600 8601 } 8602 8603 TEST_F(append_007_Int64, append_092) 8604 { 8605 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8606 OString expVal( aStrBuf.getStr() ); 8607 sal_Int64 input = 15; 8608 sal_Int16 radix = 10; 8609 8610 expVal += OString( "15" ); 8611 aStrBuf.append( input, radix ); 8612 8613 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8614 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_kRadixDecimal for arrOUS[4]"; 8615 8616 } 8617 8618 TEST_F(append_007_Int64, append_093) 8619 { 8620 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8621 OString expVal( aStrBuf.getStr() ); 8622 sal_Int64 input = 0; 8623 sal_Int16 radix = 16; 8624 8625 expVal += OString( "0" ); 8626 aStrBuf.append( input, radix ); 8627 8628 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8629 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[4]"; 8630 8631 } 8632 8633 TEST_F(append_007_Int64, append_094) 8634 { 8635 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8636 OString expVal( aStrBuf.getStr() ); 8637 sal_Int64 input = 4; 8638 sal_Int16 radix = 16; 8639 8640 expVal += OString( "4" ); 8641 aStrBuf.append( input, radix ); 8642 8643 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8644 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[4]"; 8645 8646 } 8647 8648 TEST_F(append_007_Int64, append_095) 8649 { 8650 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8651 OString expVal( aStrBuf.getStr() ); 8652 sal_Int64 input = 8; 8653 sal_Int16 radix = 16; 8654 8655 expVal += OString( "8" ); 8656 aStrBuf.append( input, radix ); 8657 8658 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8659 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[4]"; 8660 8661 } 8662 8663 TEST_F(append_007_Int64, append_096) 8664 { 8665 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8666 OString expVal( aStrBuf.getStr() ); 8667 sal_Int64 input = 15; 8668 sal_Int16 radix = 16; 8669 8670 expVal += OString( "f" ); 8671 aStrBuf.append( input, radix ); 8672 8673 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8674 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_kRadixHexdecimal for arrOUS[4]"; 8675 8676 } 8677 8678 TEST_F(append_007_Int64, append_097) 8679 { 8680 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8681 OString expVal( aStrBuf.getStr() ); 8682 sal_Int64 input = 0; 8683 sal_Int16 radix = 36; 8684 8685 expVal += OString( "0" ); 8686 aStrBuf.append( input, radix ); 8687 8688 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8689 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[4]"; 8690 8691 } 8692 8693 TEST_F(append_007_Int64, append_098) 8694 { 8695 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8696 OString expVal( aStrBuf.getStr() ); 8697 sal_Int64 input = 4; 8698 sal_Int16 radix = 36; 8699 8700 expVal += OString( "4" ); 8701 aStrBuf.append( input, radix ); 8702 8703 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8704 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[4]"; 8705 8706 } 8707 8708 TEST_F(append_007_Int64, append_099) 8709 { 8710 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8711 OString expVal( aStrBuf.getStr() ); 8712 sal_Int64 input = 8; 8713 sal_Int16 radix = 36; 8714 8715 expVal += OString( "8" ); 8716 aStrBuf.append( input, radix ); 8717 8718 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8719 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[4]"; 8720 8721 } 8722 8723 TEST_F(append_007_Int64, append_100) 8724 { 8725 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 8726 OString expVal( aStrBuf.getStr() ); 8727 sal_Int64 input = 35; 8728 sal_Int16 radix = 36; 8729 8730 expVal += OString( "z" ); 8731 aStrBuf.append( input, radix ); 8732 8733 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8734 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_kRadixBase36 for arrOUS[4]"; 8735 8736 } 8737 8738 //------------------------------------------------------------------------ 8739 // testing the method append( sal_Int64 i, sal_Int16 radix=2 ) 8740 // where i = large constants 8741 // testing the method append( sal_Int64 i, sal_Int16 radix=8 ) 8742 // where i = large constants 8743 // testing the method append( sal_Int64 i, sal_Int16 radix=10 ) 8744 // where i = large constants 8745 // testing the method append( sal_Int64 i, sal_Int16 radix=16 ) 8746 // where i = large constants 8747 // testing the method append( sal_Int64 i, sal_Int16 radix=36 ) 8748 // where i = large constants 8749 //------------------------------------------------------------------------ 8750 class append_007_Int64_Bounderies : public ::testing::Test 8751 { 8752 protected: 8753 OString* arrOUS[5]; 8754 8755 public: 8756 void SetUp() 8757 { 8758 arrOUS[0] = new OString( kTestStr7 ); 8759 arrOUS[1] = new OString( ); 8760 arrOUS[2] = new OString( kTestStr25 ); 8761 arrOUS[3] = new OString( "\0" ); 8762 arrOUS[4] = new OString( kTestStr28 ); 8763 8764 } 8765 8766 void TearDown() 8767 { 8768 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 8769 delete arrOUS[3]; delete arrOUS[4]; 8770 } 8771 }; 8772 8773 TEST_F(append_007_Int64_Bounderies, append_001) 8774 { 8775 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 8776 OString expVal( aStrBuf.getStr() ); 8777 sal_Int64 input = kSInt8Max; 8778 sal_Int16 radix = 2; 8779 8780 expVal += OString( "1111111" ); 8781 aStrBuf.append( input, radix ); 8782 8783 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8784 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[0]"; 8785 8786 } 8787 8788 TEST_F(append_007_Int64_Bounderies, append_002) 8789 { 8790 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 8791 OString expVal( aStrBuf.getStr() ); 8792 sal_Int64 input = kSInt64Max; 8793 sal_Int16 radix = 2; 8794 8795 expVal += OString( "111111111111111111111111111111111111111111111111111111111111111" ); 8796 aStrBuf.append( input, radix ); 8797 8798 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8799 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[0]"; 8800 8801 } 8802 8803 TEST_F(append_007_Int64_Bounderies, append_003) 8804 { 8805 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 8806 OString expVal( aStrBuf.getStr() ); 8807 sal_Int64 input = kSInt8Max; 8808 sal_Int16 radix = 8; 8809 8810 expVal += OString( "177" ); 8811 aStrBuf.append( input, radix ); 8812 8813 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8814 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[0]"; 8815 8816 } 8817 8818 TEST_F(append_007_Int64_Bounderies, append_004) 8819 { 8820 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 8821 OString expVal( aStrBuf.getStr() ); 8822 sal_Int64 input = kSInt64Max; 8823 sal_Int16 radix = 8; 8824 8825 expVal += OString( "777777777777777777777" ); 8826 aStrBuf.append( input, radix ); 8827 8828 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8829 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[0]"; 8830 8831 } 8832 8833 TEST_F(append_007_Int64_Bounderies, append_005) 8834 { 8835 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 8836 OString expVal( aStrBuf.getStr() ); 8837 sal_Int64 input = kSInt8Max; 8838 sal_Int16 radix = 10; 8839 8840 expVal += OString( "127" ); 8841 aStrBuf.append( input, radix ); 8842 8843 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8844 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[0]"; 8845 8846 } 8847 8848 TEST_F(append_007_Int64_Bounderies, append_006) 8849 { 8850 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 8851 OString expVal( aStrBuf.getStr() ); 8852 sal_Int64 input = kSInt64Max; 8853 sal_Int16 radix = 10; 8854 8855 expVal += OString( "9223372036854775807" ); 8856 aStrBuf.append( input, radix ); 8857 8858 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8859 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[0]"; 8860 8861 } 8862 8863 TEST_F(append_007_Int64_Bounderies, append_007) 8864 { 8865 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 8866 OString expVal( aStrBuf.getStr() ); 8867 sal_Int64 input = kSInt8Max; 8868 sal_Int16 radix = 16; 8869 8870 expVal += OString( "7f" ); 8871 aStrBuf.append( input, radix ); 8872 8873 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8874 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[0]"; 8875 8876 } 8877 8878 TEST_F(append_007_Int64_Bounderies, append_008) 8879 { 8880 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 8881 OString expVal( aStrBuf.getStr() ); 8882 sal_Int64 input = kSInt64Max; 8883 sal_Int16 radix = 16; 8884 8885 expVal += OString( "7fffffffffffffff" ); 8886 aStrBuf.append( input, radix ); 8887 8888 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8889 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[0]"; 8890 8891 } 8892 8893 TEST_F(append_007_Int64_Bounderies, append_009) 8894 { 8895 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 8896 OString expVal( aStrBuf.getStr() ); 8897 sal_Int64 input = kSInt8Max; 8898 sal_Int16 radix = 36; 8899 8900 expVal += OString( "3j" ); 8901 aStrBuf.append( input, radix ); 8902 8903 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8904 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[0]"; 8905 8906 } 8907 8908 TEST_F(append_007_Int64_Bounderies, append_010) 8909 { 8910 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 8911 OString expVal( aStrBuf.getStr() ); 8912 sal_Int64 input = kSInt64Max; 8913 sal_Int16 radix = 36; 8914 8915 expVal += OString( "1y2p0ij32e8e7" ); 8916 aStrBuf.append( input, radix ); 8917 8918 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8919 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[0]"; 8920 8921 } 8922 8923 TEST_F(append_007_Int64_Bounderies, append_011) 8924 { 8925 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 8926 OString expVal( aStrBuf.getStr() ); 8927 sal_Int64 input = kSInt8Max; 8928 sal_Int16 radix = 2; 8929 8930 expVal += OString( "1111111" ); 8931 aStrBuf.append( input, radix ); 8932 8933 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8934 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[1]"; 8935 8936 } 8937 8938 TEST_F(append_007_Int64_Bounderies, append_012) 8939 { 8940 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 8941 OString expVal( aStrBuf.getStr() ); 8942 sal_Int64 input = kSInt64Max; 8943 sal_Int16 radix = 2; 8944 8945 expVal += OString( "111111111111111111111111111111111111111111111111111111111111111" ); 8946 aStrBuf.append( input, radix ); 8947 8948 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8949 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[1]"; 8950 8951 } 8952 8953 TEST_F(append_007_Int64_Bounderies, append_013) 8954 { 8955 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 8956 OString expVal( aStrBuf.getStr() ); 8957 sal_Int64 input = kSInt8Max; 8958 sal_Int16 radix = 8; 8959 8960 expVal += OString( "177" ); 8961 aStrBuf.append( input, radix ); 8962 8963 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8964 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[1]"; 8965 8966 } 8967 8968 TEST_F(append_007_Int64_Bounderies, append_014) 8969 { 8970 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 8971 OString expVal( aStrBuf.getStr() ); 8972 sal_Int64 input = kSInt64Max; 8973 sal_Int16 radix = 8; 8974 8975 expVal += OString( "777777777777777777777" ); 8976 aStrBuf.append( input, radix ); 8977 8978 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8979 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[1]"; 8980 8981 } 8982 8983 TEST_F(append_007_Int64_Bounderies, append_015) 8984 { 8985 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 8986 OString expVal( aStrBuf.getStr() ); 8987 sal_Int64 input = kSInt8Max; 8988 sal_Int16 radix = 10; 8989 8990 expVal += OString( "127" ); 8991 aStrBuf.append( input, radix ); 8992 8993 ASSERT_TRUE(aStrBuf.getStr()== expVal && 8994 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[1]"; 8995 8996 } 8997 8998 TEST_F(append_007_Int64_Bounderies, append_016) 8999 { 9000 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 9001 OString expVal( aStrBuf.getStr() ); 9002 sal_Int64 input = kSInt64Max; 9003 sal_Int16 radix = 10; 9004 9005 expVal += OString( "9223372036854775807" ); 9006 aStrBuf.append( input, radix ); 9007 9008 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9009 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[1]"; 9010 9011 } 9012 9013 TEST_F(append_007_Int64_Bounderies, append_017) 9014 { 9015 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 9016 OString expVal( aStrBuf.getStr() ); 9017 sal_Int64 input = kSInt8Max; 9018 sal_Int16 radix = 16; 9019 9020 expVal += OString( "7f" ); 9021 aStrBuf.append( input, radix ); 9022 9023 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9024 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[1]"; 9025 9026 } 9027 9028 TEST_F(append_007_Int64_Bounderies, append_018) 9029 { 9030 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 9031 OString expVal( aStrBuf.getStr() ); 9032 sal_Int64 input = kSInt64Max; 9033 sal_Int16 radix = 16; 9034 9035 expVal += OString( "7fffffffffffffff" ); 9036 aStrBuf.append( input, radix ); 9037 9038 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9039 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[1]"; 9040 9041 } 9042 9043 TEST_F(append_007_Int64_Bounderies, append_019) 9044 { 9045 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 9046 OString expVal( aStrBuf.getStr() ); 9047 sal_Int64 input = kSInt8Max; 9048 sal_Int16 radix = 36; 9049 9050 expVal += OString( "3j" ); 9051 aStrBuf.append( input, radix ); 9052 9053 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9054 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[1]"; 9055 9056 } 9057 9058 TEST_F(append_007_Int64_Bounderies, append_020) 9059 { 9060 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 9061 OString expVal( aStrBuf.getStr() ); 9062 sal_Int64 input = kSInt64Max; 9063 sal_Int16 radix = 36; 9064 9065 expVal += OString( "1y2p0ij32e8e7" ); 9066 aStrBuf.append( input, radix ); 9067 9068 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9069 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[1]"; 9070 9071 } 9072 9073 TEST_F(append_007_Int64_Bounderies, append_021) 9074 { 9075 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 9076 OString expVal( aStrBuf.getStr() ); 9077 sal_Int64 input = kSInt8Max; 9078 sal_Int16 radix = 2; 9079 9080 expVal += OString( "1111111" ); 9081 aStrBuf.append( input, radix ); 9082 9083 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9084 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[2]"; 9085 9086 } 9087 9088 TEST_F(append_007_Int64_Bounderies, append_022) 9089 { 9090 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 9091 OString expVal( aStrBuf.getStr() ); 9092 sal_Int64 input = kSInt64Max; 9093 sal_Int16 radix = 2; 9094 9095 expVal += OString( "111111111111111111111111111111111111111111111111111111111111111" ); 9096 aStrBuf.append( input, radix ); 9097 9098 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9099 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[2]"; 9100 9101 } 9102 9103 TEST_F(append_007_Int64_Bounderies, append_023) 9104 { 9105 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 9106 OString expVal( aStrBuf.getStr() ); 9107 sal_Int64 input = kSInt8Max; 9108 sal_Int16 radix = 8; 9109 9110 expVal += OString( "177" ); 9111 aStrBuf.append( input, radix ); 9112 9113 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9114 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[2]"; 9115 9116 } 9117 9118 TEST_F(append_007_Int64_Bounderies, append_024) 9119 { 9120 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 9121 OString expVal( aStrBuf.getStr() ); 9122 sal_Int64 input = kSInt64Max; 9123 sal_Int16 radix = 8; 9124 9125 expVal += OString( "777777777777777777777" ); 9126 aStrBuf.append( input, radix ); 9127 9128 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9129 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[2]"; 9130 9131 } 9132 9133 TEST_F(append_007_Int64_Bounderies, append_025) 9134 { 9135 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 9136 OString expVal( aStrBuf.getStr() ); 9137 sal_Int64 input = kSInt8Max; 9138 sal_Int16 radix = 10; 9139 9140 expVal += OString( "127" ); 9141 aStrBuf.append( input, radix ); 9142 9143 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9144 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[2]"; 9145 9146 } 9147 9148 TEST_F(append_007_Int64_Bounderies, append_026) 9149 { 9150 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 9151 OString expVal( aStrBuf.getStr() ); 9152 sal_Int64 input = kSInt64Max; 9153 sal_Int16 radix = 10; 9154 9155 expVal += OString( "9223372036854775807" ); 9156 aStrBuf.append( input, radix ); 9157 9158 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9159 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[2]"; 9160 9161 } 9162 9163 TEST_F(append_007_Int64_Bounderies, append_027) 9164 { 9165 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 9166 OString expVal( aStrBuf.getStr() ); 9167 sal_Int64 input = kSInt8Max; 9168 sal_Int16 radix = 16; 9169 9170 expVal += OString( "7f" ); 9171 aStrBuf.append( input, radix ); 9172 9173 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9174 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[2]"; 9175 9176 } 9177 9178 TEST_F(append_007_Int64_Bounderies, append_028) 9179 { 9180 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 9181 OString expVal( aStrBuf.getStr() ); 9182 sal_Int64 input = kSInt64Max; 9183 sal_Int16 radix = 16; 9184 9185 expVal += OString( "7fffffffffffffff" ); 9186 aStrBuf.append( input, radix ); 9187 9188 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9189 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[2]"; 9190 9191 } 9192 9193 TEST_F(append_007_Int64_Bounderies, append_029) 9194 { 9195 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 9196 OString expVal( aStrBuf.getStr() ); 9197 sal_Int64 input = kSInt8Max; 9198 sal_Int16 radix = 36; 9199 9200 expVal += OString( "3j" ); 9201 aStrBuf.append( input, radix ); 9202 9203 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9204 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[2]"; 9205 9206 } 9207 9208 TEST_F(append_007_Int64_Bounderies, append_030) 9209 { 9210 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 9211 OString expVal( aStrBuf.getStr() ); 9212 sal_Int64 input = kSInt64Max; 9213 sal_Int16 radix = 36; 9214 9215 expVal += OString( "1y2p0ij32e8e7" ); 9216 aStrBuf.append( input, radix ); 9217 9218 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9219 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[2]"; 9220 9221 } 9222 9223 TEST_F(append_007_Int64_Bounderies, append_031) 9224 { 9225 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 9226 OString expVal( aStrBuf.getStr() ); 9227 sal_Int64 input = kSInt8Max; 9228 sal_Int16 radix = 2; 9229 9230 expVal += OString( "1111111" ); 9231 aStrBuf.append( input, radix ); 9232 9233 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9234 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[3]"; 9235 9236 } 9237 9238 TEST_F(append_007_Int64_Bounderies, append_032) 9239 { 9240 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 9241 OString expVal( aStrBuf.getStr() ); 9242 sal_Int64 input = kSInt64Max; 9243 sal_Int16 radix = 2; 9244 9245 expVal += OString( "111111111111111111111111111111111111111111111111111111111111111" ); 9246 aStrBuf.append( input, radix ); 9247 9248 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9249 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[3]"; 9250 9251 } 9252 9253 TEST_F(append_007_Int64_Bounderies, append_033) 9254 { 9255 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 9256 OString expVal( aStrBuf.getStr() ); 9257 sal_Int64 input = kSInt8Max; 9258 sal_Int16 radix = 8; 9259 9260 expVal += OString( "177" ); 9261 aStrBuf.append( input, radix ); 9262 9263 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9264 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[3]"; 9265 9266 } 9267 9268 TEST_F(append_007_Int64_Bounderies, append_034) 9269 { 9270 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 9271 OString expVal( aStrBuf.getStr() ); 9272 sal_Int64 input = kSInt64Max; 9273 sal_Int16 radix = 8; 9274 9275 expVal += OString( "777777777777777777777" ); 9276 aStrBuf.append( input, radix ); 9277 9278 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9279 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[3]"; 9280 9281 } 9282 9283 TEST_F(append_007_Int64_Bounderies, append_035) 9284 { 9285 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 9286 OString expVal( aStrBuf.getStr() ); 9287 sal_Int64 input = kSInt8Max; 9288 sal_Int16 radix = 10; 9289 9290 expVal += OString( "127" ); 9291 aStrBuf.append( input, radix ); 9292 9293 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9294 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[3]"; 9295 9296 } 9297 9298 TEST_F(append_007_Int64_Bounderies, append_036) 9299 { 9300 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 9301 OString expVal( aStrBuf.getStr() ); 9302 sal_Int64 input = kSInt64Max; 9303 sal_Int16 radix = 10; 9304 9305 expVal += OString( "9223372036854775807" ); 9306 aStrBuf.append( input, radix ); 9307 9308 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9309 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[3]"; 9310 9311 } 9312 9313 TEST_F(append_007_Int64_Bounderies, append_037) 9314 { 9315 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 9316 OString expVal( aStrBuf.getStr() ); 9317 sal_Int64 input = kSInt8Max; 9318 sal_Int16 radix = 16; 9319 9320 expVal += OString( "7f" ); 9321 aStrBuf.append( input, radix ); 9322 9323 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9324 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[3]"; 9325 9326 } 9327 9328 TEST_F(append_007_Int64_Bounderies, append_038) 9329 { 9330 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 9331 OString expVal( aStrBuf.getStr() ); 9332 sal_Int64 input = kSInt64Max; 9333 sal_Int16 radix = 16; 9334 9335 expVal += OString( "7fffffffffffffff" ); 9336 aStrBuf.append( input, radix ); 9337 9338 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9339 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[3]"; 9340 9341 } 9342 9343 TEST_F(append_007_Int64_Bounderies, append_039) 9344 { 9345 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 9346 OString expVal( aStrBuf.getStr() ); 9347 sal_Int64 input = kSInt8Max; 9348 sal_Int16 radix = 36; 9349 9350 expVal += OString( "3j" ); 9351 aStrBuf.append( input, radix ); 9352 9353 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9354 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[3]"; 9355 9356 } 9357 9358 TEST_F(append_007_Int64_Bounderies, append_040) 9359 { 9360 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 9361 OString expVal( aStrBuf.getStr() ); 9362 sal_Int64 input = kSInt64Max; 9363 sal_Int16 radix = 36; 9364 9365 expVal += OString( "1y2p0ij32e8e7" ); 9366 aStrBuf.append( input, radix ); 9367 9368 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9369 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[3]"; 9370 9371 } 9372 9373 TEST_F(append_007_Int64_Bounderies, append_041) 9374 { 9375 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 9376 OString expVal( aStrBuf.getStr() ); 9377 sal_Int64 input = kSInt8Max; 9378 sal_Int16 radix = 2; 9379 9380 expVal += OString( "1111111" ); 9381 aStrBuf.append( input, radix ); 9382 9383 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9384 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[4]"; 9385 9386 } 9387 9388 TEST_F(append_007_Int64_Bounderies, append_042) 9389 { 9390 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 9391 OString expVal( aStrBuf.getStr() ); 9392 sal_Int64 input = kSInt64Max; 9393 sal_Int16 radix = 2; 9394 9395 expVal += OString( "111111111111111111111111111111111111111111111111111111111111111" ); 9396 aStrBuf.append( input, radix ); 9397 9398 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9399 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_Bounderies_kRadixBinary for arrOUS[4]"; 9400 9401 } 9402 9403 TEST_F(append_007_Int64_Bounderies, append_043) 9404 { 9405 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 9406 OString expVal( aStrBuf.getStr() ); 9407 sal_Int64 input = kSInt8Max; 9408 sal_Int16 radix = 8; 9409 9410 expVal += OString( "177" ); 9411 aStrBuf.append( input, radix ); 9412 9413 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9414 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[4]"; 9415 9416 } 9417 9418 TEST_F(append_007_Int64_Bounderies, append_044) 9419 { 9420 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 9421 OString expVal( aStrBuf.getStr() ); 9422 sal_Int64 input = kSInt64Max; 9423 sal_Int16 radix = 8; 9424 9425 expVal += OString( "777777777777777777777" ); 9426 aStrBuf.append( input, radix ); 9427 9428 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9429 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_Bounderies_kRadixBinary for arrOUS[4]"; 9430 9431 } 9432 9433 TEST_F(append_007_Int64_Bounderies, append_045) 9434 { 9435 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 9436 OString expVal( aStrBuf.getStr() ); 9437 sal_Int64 input = kSInt8Max; 9438 sal_Int16 radix = 10; 9439 9440 expVal += OString( "127" ); 9441 aStrBuf.append( input, radix ); 9442 9443 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9444 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[4]"; 9445 9446 } 9447 9448 TEST_F(append_007_Int64_Bounderies, append_046) 9449 { 9450 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 9451 OString expVal( aStrBuf.getStr() ); 9452 sal_Int64 input = kSInt64Max; 9453 sal_Int16 radix = 10; 9454 9455 expVal += OString( "9223372036854775807" ); 9456 aStrBuf.append( input, radix ); 9457 9458 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9459 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_Bounderies_kRadixBinary for arrOUS[4]"; 9460 9461 } 9462 9463 TEST_F(append_007_Int64_Bounderies, append_047) 9464 { 9465 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 9466 OString expVal( aStrBuf.getStr() ); 9467 sal_Int64 input = kSInt8Max; 9468 sal_Int16 radix = 16; 9469 9470 expVal += OString( "7f" ); 9471 aStrBuf.append( input, radix ); 9472 9473 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9474 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[4]"; 9475 9476 } 9477 9478 TEST_F(append_007_Int64_Bounderies, append_048) 9479 { 9480 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 9481 OString expVal( aStrBuf.getStr() ); 9482 sal_Int64 input = kSInt64Max; 9483 sal_Int16 radix = 16; 9484 9485 expVal += OString( "7fffffffffffffff" ); 9486 aStrBuf.append( input, radix ); 9487 9488 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9489 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_Bounderies_kRadixBinary for arrOUS[4]"; 9490 9491 } 9492 9493 TEST_F(append_007_Int64_Bounderies, append_049) 9494 { 9495 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 9496 OString expVal( aStrBuf.getStr() ); 9497 sal_Int64 input = kSInt8Max; 9498 sal_Int16 radix = 36; 9499 9500 expVal += OString( "3j" ); 9501 aStrBuf.append( input, radix ); 9502 9503 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9504 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[4]"; 9505 9506 } 9507 9508 TEST_F(append_007_Int64_Bounderies, append_050) 9509 { 9510 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 9511 OString expVal( aStrBuf.getStr() ); 9512 sal_Int64 input = kSInt64Max; 9513 sal_Int16 radix = 36; 9514 9515 expVal += OString( "1y2p0ij32e8e7" ); 9516 aStrBuf.append( input, radix ); 9517 9518 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9519 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_Bounderies_kRadixBinary for arrOUS[4]"; 9520 9521 } 9522 9523 //------------------------------------------------------------------------ 9524 // testing the method append( sal_Int64 i, sal_Int16 radix=2 ) 9525 // for negative value 9526 // testing the method append( sal_Int64 i, sal_Int16 radix=8 ) 9527 // for negative value 9528 // testing the method append( sal_Int64 i, sal_Int16 radix=10 ) 9529 // for negative value 9530 // testing the method append( sal_Int64 i, sal_Int16 radix=16 ) 9531 // for negative value 9532 // testing the method append( sal_Int64 i, sal_Int16 radix=36 ) 9533 // for negative value 9534 //------------------------------------------------------------------------ 9535 class append_007_Int64_Negative : public ::testing::Test 9536 { 9537 protected: 9538 OString* arrOUS[5]; 9539 9540 public: 9541 void SetUp() 9542 { 9543 arrOUS[0] = new OString( kTestStr7 ); 9544 arrOUS[1] = new OString( ); 9545 arrOUS[2] = new OString( kTestStr25 ); 9546 arrOUS[3] = new OString( "\0" ); 9547 arrOUS[4] = new OString( kTestStr28 ); 9548 9549 } 9550 9551 void TearDown() 9552 { 9553 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 9554 delete arrOUS[3]; delete arrOUS[4]; 9555 } 9556 }; 9557 9558 TEST_F(append_007_Int64_Negative, append_001) 9559 { 9560 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9561 OString expVal( aStrBuf.getStr() ); 9562 sal_Int64 input = -0; 9563 sal_Int16 radix = 2; 9564 9565 expVal += OString( "0" ); 9566 aStrBuf.append( input, radix ); 9567 9568 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9569 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[0]"; 9570 9571 } 9572 9573 TEST_F(append_007_Int64_Negative, append_002) 9574 { 9575 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9576 OString expVal( aStrBuf.getStr() ); 9577 sal_Int64 input = -4; 9578 sal_Int16 radix = 2; 9579 9580 expVal += OString( "-" ); 9581 expVal += OString( "100" ); 9582 aStrBuf.append( input, radix ); 9583 9584 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9585 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[0]"; 9586 9587 } 9588 9589 TEST_F(append_007_Int64_Negative, append_003) 9590 { 9591 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9592 OString expVal( aStrBuf.getStr() ); 9593 sal_Int64 input = -8; 9594 sal_Int16 radix = 2; 9595 9596 expVal += OString( "-" ); 9597 expVal += OString( "1000" ); 9598 aStrBuf.append( input, radix ); 9599 9600 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9601 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[0]"; 9602 9603 } 9604 9605 TEST_F(append_007_Int64_Negative, append_004) 9606 { 9607 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9608 OString expVal( aStrBuf.getStr() ); 9609 sal_Int64 input = -15; 9610 sal_Int16 radix = 2; 9611 9612 expVal += OString( "-" ); 9613 expVal += OString( "1111" ); 9614 aStrBuf.append( input, radix ); 9615 9616 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9617 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[0]"; 9618 9619 } 9620 9621 TEST_F(append_007_Int64_Negative, append_005) 9622 { 9623 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9624 OString expVal( aStrBuf.getStr() ); 9625 sal_Int64 input = -0; 9626 sal_Int16 radix = 8; 9627 9628 expVal += OString( "0" ); 9629 aStrBuf.append( input, radix ); 9630 9631 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9632 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[0]"; 9633 9634 } 9635 9636 TEST_F(append_007_Int64_Negative, append_006) 9637 { 9638 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9639 OString expVal( aStrBuf.getStr() ); 9640 sal_Int64 input = -4; 9641 sal_Int16 radix = 8; 9642 9643 expVal += OString( "-" ); 9644 expVal += OString( "4" ); 9645 aStrBuf.append( input, radix ); 9646 9647 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9648 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[0]"; 9649 9650 } 9651 9652 TEST_F(append_007_Int64_Negative, append_007) 9653 { 9654 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9655 OString expVal( aStrBuf.getStr() ); 9656 sal_Int64 input = -8; 9657 sal_Int16 radix = 8; 9658 9659 expVal += OString( "-" ); 9660 expVal += OString( "10" ); 9661 aStrBuf.append( input, radix ); 9662 9663 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9664 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[0]"; 9665 9666 } 9667 9668 TEST_F(append_007_Int64_Negative, append_008) 9669 { 9670 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9671 OString expVal( aStrBuf.getStr() ); 9672 sal_Int64 input = -15; 9673 sal_Int16 radix = 8; 9674 9675 expVal += OString( "-" ); 9676 expVal += OString( "17" ); 9677 aStrBuf.append( input, radix ); 9678 9679 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9680 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[0]"; 9681 9682 } 9683 9684 TEST_F(append_007_Int64_Negative, append_009) 9685 { 9686 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9687 OString expVal( aStrBuf.getStr() ); 9688 sal_Int64 input = -0; 9689 sal_Int16 radix = 10; 9690 9691 expVal += OString( "0" ); 9692 aStrBuf.append( input, radix ); 9693 9694 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9695 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[0]"; 9696 9697 } 9698 9699 TEST_F(append_007_Int64_Negative, append_010) 9700 { 9701 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9702 OString expVal( aStrBuf.getStr() ); 9703 sal_Int64 input = -4; 9704 sal_Int16 radix = 10; 9705 9706 expVal += OString( "-" ); 9707 expVal += OString( "4" ); 9708 aStrBuf.append( input, radix ); 9709 9710 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9711 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[0]"; 9712 9713 } 9714 9715 TEST_F(append_007_Int64_Negative, append_011) 9716 { 9717 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9718 OString expVal( aStrBuf.getStr() ); 9719 sal_Int64 input = -8; 9720 sal_Int16 radix = 10; 9721 9722 expVal += OString( "-" ); 9723 expVal += OString( "8" ); 9724 aStrBuf.append( input, radix ); 9725 9726 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9727 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[0]"; 9728 9729 } 9730 9731 TEST_F(append_007_Int64_Negative, append_012) 9732 { 9733 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9734 OString expVal( aStrBuf.getStr() ); 9735 sal_Int64 input = -15; 9736 sal_Int16 radix = 10; 9737 9738 expVal += OString( "-" ); 9739 expVal += OString( "15" ); 9740 aStrBuf.append( input, radix ); 9741 9742 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9743 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[0]"; 9744 9745 } 9746 9747 TEST_F(append_007_Int64_Negative, append_013) 9748 { 9749 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9750 OString expVal( aStrBuf.getStr() ); 9751 sal_Int64 input = -0; 9752 sal_Int16 radix = 16; 9753 9754 expVal += OString( "0" ); 9755 aStrBuf.append( input, radix ); 9756 9757 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9758 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[0]"; 9759 9760 } 9761 9762 TEST_F(append_007_Int64_Negative, append_014) 9763 { 9764 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9765 OString expVal( aStrBuf.getStr() ); 9766 sal_Int64 input = -4; 9767 sal_Int16 radix = 16; 9768 9769 expVal += OString( "-" ); 9770 expVal += OString( "4" ); 9771 aStrBuf.append( input, radix ); 9772 9773 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9774 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[0]"; 9775 9776 } 9777 9778 TEST_F(append_007_Int64_Negative, append_015) 9779 { 9780 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9781 OString expVal( aStrBuf.getStr() ); 9782 sal_Int64 input = -8; 9783 sal_Int16 radix = 16; 9784 9785 expVal += OString( "-" ); 9786 expVal += OString( "8" ); 9787 aStrBuf.append( input, radix ); 9788 9789 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9790 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[0]"; 9791 9792 } 9793 9794 TEST_F(append_007_Int64_Negative, append_016) 9795 { 9796 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9797 OString expVal( aStrBuf.getStr() ); 9798 sal_Int64 input = -15; 9799 sal_Int16 radix = 16; 9800 9801 expVal += OString( "-" ); 9802 expVal += OString( "f" ); 9803 aStrBuf.append( input, radix ); 9804 9805 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9806 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[0]"; 9807 9808 } 9809 9810 TEST_F(append_007_Int64_Negative, append_017) 9811 { 9812 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9813 OString expVal( aStrBuf.getStr() ); 9814 sal_Int64 input = -0; 9815 sal_Int16 radix = 36; 9816 9817 expVal += OString( "0" ); 9818 aStrBuf.append( input, radix ); 9819 9820 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9821 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[0]"; 9822 9823 } 9824 9825 TEST_F(append_007_Int64_Negative, append_018) 9826 { 9827 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9828 OString expVal( aStrBuf.getStr() ); 9829 sal_Int64 input = -4; 9830 sal_Int16 radix = 36; 9831 9832 expVal += OString( "-" ); 9833 expVal += OString( "4" ); 9834 aStrBuf.append( input, radix ); 9835 9836 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9837 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[0]"; 9838 9839 } 9840 9841 TEST_F(append_007_Int64_Negative, append_019) 9842 { 9843 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9844 OString expVal( aStrBuf.getStr() ); 9845 sal_Int64 input = -8; 9846 sal_Int16 radix = 36; 9847 9848 expVal += OString( "-" ); 9849 expVal += OString( "8" ); 9850 aStrBuf.append( input, radix ); 9851 9852 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9853 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[0]"; 9854 9855 } 9856 9857 TEST_F(append_007_Int64_Negative, append_020) 9858 { 9859 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 9860 OString expVal( aStrBuf.getStr() ); 9861 sal_Int64 input = -35; 9862 sal_Int16 radix = 36; 9863 9864 expVal += OString( "-" ); 9865 expVal += OString( "z" ); 9866 aStrBuf.append( input, radix ); 9867 9868 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9869 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[0]"; 9870 9871 } 9872 9873 TEST_F(append_007_Int64_Negative, append_021) 9874 { 9875 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 9876 OString expVal( aStrBuf.getStr() ); 9877 sal_Int64 input = -0; 9878 sal_Int16 radix = 2; 9879 9880 expVal += OString( "0" ); 9881 aStrBuf.append( input, radix ); 9882 9883 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9884 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[1]"; 9885 9886 } 9887 9888 TEST_F(append_007_Int64_Negative, append_022) 9889 { 9890 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 9891 OString expVal( aStrBuf.getStr() ); 9892 sal_Int64 input = -4; 9893 sal_Int16 radix = 2; 9894 9895 expVal += OString( "-" ); 9896 expVal += OString( "100" ); 9897 aStrBuf.append( input, radix ); 9898 9899 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9900 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[1]"; 9901 9902 } 9903 9904 TEST_F(append_007_Int64_Negative, append_023) 9905 { 9906 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 9907 OString expVal( aStrBuf.getStr() ); 9908 sal_Int64 input = -8; 9909 sal_Int16 radix = 2; 9910 9911 expVal += OString( "-" ); 9912 expVal += OString( "1000" ); 9913 aStrBuf.append( input, radix ); 9914 9915 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9916 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[1]"; 9917 9918 } 9919 9920 TEST_F(append_007_Int64_Negative, append_024) 9921 { 9922 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 9923 OString expVal( aStrBuf.getStr() ); 9924 sal_Int64 input = -15; 9925 sal_Int16 radix = 2; 9926 9927 expVal += OString( "-" ); 9928 expVal += OString( "1111" ); 9929 aStrBuf.append( input, radix ); 9930 9931 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9932 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[1]"; 9933 9934 } 9935 9936 TEST_F(append_007_Int64_Negative, append_025) 9937 { 9938 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 9939 OString expVal( aStrBuf.getStr() ); 9940 sal_Int64 input = -0; 9941 sal_Int16 radix = 8; 9942 9943 expVal += OString( "0" ); 9944 aStrBuf.append( input, radix ); 9945 9946 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9947 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[1]"; 9948 9949 } 9950 9951 TEST_F(append_007_Int64_Negative, append_026) 9952 { 9953 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 9954 OString expVal( aStrBuf.getStr() ); 9955 sal_Int64 input = -4; 9956 sal_Int16 radix = 8; 9957 9958 expVal += OString( "-" ); 9959 expVal += OString( "4" ); 9960 aStrBuf.append( input, radix ); 9961 9962 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9963 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[1]"; 9964 9965 } 9966 9967 TEST_F(append_007_Int64_Negative, append_027) 9968 { 9969 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 9970 OString expVal( aStrBuf.getStr() ); 9971 sal_Int64 input = -8; 9972 sal_Int16 radix = 8; 9973 9974 expVal += OString( "-" ); 9975 expVal += OString( "10" ); 9976 aStrBuf.append( input, radix ); 9977 9978 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9979 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[1]"; 9980 9981 } 9982 9983 TEST_F(append_007_Int64_Negative, append_028) 9984 { 9985 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 9986 OString expVal( aStrBuf.getStr() ); 9987 sal_Int64 input = -15; 9988 sal_Int16 radix = 8; 9989 9990 expVal += OString( "-" ); 9991 expVal += OString( "17" ); 9992 aStrBuf.append( input, radix ); 9993 9994 ASSERT_TRUE(aStrBuf.getStr()== expVal && 9995 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[1]"; 9996 9997 } 9998 9999 TEST_F(append_007_Int64_Negative, append_029) 10000 { 10001 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 10002 OString expVal( aStrBuf.getStr() ); 10003 sal_Int64 input = -0; 10004 sal_Int16 radix = 10; 10005 10006 expVal += OString( "0" ); 10007 aStrBuf.append( input, radix ); 10008 10009 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10010 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[1]"; 10011 10012 } 10013 10014 TEST_F(append_007_Int64_Negative, append_030) 10015 { 10016 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 10017 OString expVal( aStrBuf.getStr() ); 10018 sal_Int64 input = -4; 10019 sal_Int16 radix = 10; 10020 10021 expVal += OString( "-" ); 10022 expVal += OString( "4" ); 10023 aStrBuf.append( input, radix ); 10024 10025 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10026 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[1]"; 10027 10028 } 10029 10030 TEST_F(append_007_Int64_Negative, append_031) 10031 { 10032 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 10033 OString expVal( aStrBuf.getStr() ); 10034 sal_Int64 input = -8; 10035 sal_Int16 radix = 10; 10036 10037 expVal += OString( "-" ); 10038 expVal += OString( "8" ); 10039 aStrBuf.append( input, radix ); 10040 10041 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10042 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[1]"; 10043 10044 } 10045 10046 TEST_F(append_007_Int64_Negative, append_032) 10047 { 10048 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 10049 OString expVal( aStrBuf.getStr() ); 10050 sal_Int64 input = -15; 10051 sal_Int16 radix = 10; 10052 10053 expVal += OString( "-" ); 10054 expVal += OString( "15" ); 10055 aStrBuf.append( input, radix ); 10056 10057 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10058 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[1]"; 10059 10060 } 10061 10062 TEST_F(append_007_Int64_Negative, append_033) 10063 { 10064 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 10065 OString expVal( aStrBuf.getStr() ); 10066 sal_Int64 input = -0; 10067 sal_Int16 radix = 16; 10068 10069 expVal += OString( "0" ); 10070 aStrBuf.append( input, radix ); 10071 10072 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10073 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[1]"; 10074 10075 } 10076 10077 TEST_F(append_007_Int64_Negative, append_034) 10078 { 10079 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 10080 OString expVal( aStrBuf.getStr() ); 10081 sal_Int64 input = -4; 10082 sal_Int16 radix = 16; 10083 10084 expVal += OString( "-" ); 10085 expVal += OString( "4" ); 10086 aStrBuf.append( input, radix ); 10087 10088 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10089 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[1]"; 10090 10091 } 10092 10093 TEST_F(append_007_Int64_Negative, append_035) 10094 { 10095 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 10096 OString expVal( aStrBuf.getStr() ); 10097 sal_Int64 input = -8; 10098 sal_Int16 radix = 16; 10099 10100 expVal += OString( "-" ); 10101 expVal += OString( "8" ); 10102 aStrBuf.append( input, radix ); 10103 10104 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10105 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[1]"; 10106 10107 } 10108 10109 TEST_F(append_007_Int64_Negative, append_036) 10110 { 10111 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 10112 OString expVal( aStrBuf.getStr() ); 10113 sal_Int64 input = -15; 10114 sal_Int16 radix = 16; 10115 10116 expVal += OString( "-" ); 10117 expVal += OString( "f" ); 10118 aStrBuf.append( input, radix ); 10119 10120 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10121 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[1]"; 10122 10123 } 10124 10125 TEST_F(append_007_Int64_Negative, append_037) 10126 { 10127 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 10128 OString expVal( aStrBuf.getStr() ); 10129 sal_Int64 input = -0; 10130 sal_Int16 radix = 36; 10131 10132 expVal += OString( "0" ); 10133 aStrBuf.append( input, radix ); 10134 10135 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10136 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[1]"; 10137 10138 } 10139 10140 TEST_F(append_007_Int64_Negative, append_038) 10141 { 10142 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 10143 OString expVal( aStrBuf.getStr() ); 10144 sal_Int64 input = -4; 10145 sal_Int16 radix = 36; 10146 10147 expVal += OString( "-" ); 10148 expVal += OString( "4" ); 10149 aStrBuf.append( input, radix ); 10150 10151 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10152 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[1]"; 10153 10154 } 10155 10156 TEST_F(append_007_Int64_Negative, append_039) 10157 { 10158 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 10159 OString expVal( aStrBuf.getStr() ); 10160 sal_Int64 input = -8; 10161 sal_Int16 radix = 36; 10162 10163 expVal += OString( "-" ); 10164 expVal += OString( "8" ); 10165 aStrBuf.append( input, radix ); 10166 10167 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10168 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[1]"; 10169 10170 } 10171 10172 TEST_F(append_007_Int64_Negative, append_040) 10173 { 10174 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 10175 OString expVal( aStrBuf.getStr() ); 10176 sal_Int64 input = -35; 10177 sal_Int16 radix = 36; 10178 10179 expVal += OString( "-" ); 10180 expVal += OString( "z" ); 10181 aStrBuf.append( input, radix ); 10182 10183 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10184 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[1]"; 10185 10186 } 10187 10188 TEST_F(append_007_Int64_Negative, append_041) 10189 { 10190 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10191 OString expVal( aStrBuf.getStr() ); 10192 sal_Int64 input = -0; 10193 sal_Int16 radix = 2; 10194 10195 expVal += OString( "0" ); 10196 aStrBuf.append( input, radix ); 10197 10198 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10199 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[2]"; 10200 10201 } 10202 10203 TEST_F(append_007_Int64_Negative, append_042) 10204 { 10205 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10206 OString expVal( aStrBuf.getStr() ); 10207 sal_Int64 input = -4; 10208 sal_Int16 radix = 2; 10209 10210 expVal += OString( "-" ); 10211 expVal += OString( "100" ); 10212 aStrBuf.append( input, radix ); 10213 10214 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10215 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[2]"; 10216 10217 } 10218 10219 TEST_F(append_007_Int64_Negative, append_043) 10220 { 10221 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10222 OString expVal( aStrBuf.getStr() ); 10223 sal_Int64 input = -8; 10224 sal_Int16 radix = 2; 10225 10226 expVal += OString( "-" ); 10227 expVal += OString( "1000" ); 10228 aStrBuf.append( input, radix ); 10229 10230 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10231 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[2]"; 10232 10233 } 10234 10235 TEST_F(append_007_Int64_Negative, append_044) 10236 { 10237 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10238 OString expVal( aStrBuf.getStr() ); 10239 sal_Int64 input = -15; 10240 sal_Int16 radix = 2; 10241 10242 expVal += OString( "-" ); 10243 expVal += OString( "1111" ); 10244 aStrBuf.append( input, radix ); 10245 10246 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10247 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[2]"; 10248 10249 } 10250 10251 TEST_F(append_007_Int64_Negative, append_045) 10252 { 10253 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10254 OString expVal( aStrBuf.getStr() ); 10255 sal_Int64 input = -0; 10256 sal_Int16 radix = 8; 10257 10258 expVal += OString( "0" ); 10259 aStrBuf.append( input, radix ); 10260 10261 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10262 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[2]"; 10263 10264 } 10265 10266 TEST_F(append_007_Int64_Negative, append_046) 10267 { 10268 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10269 OString expVal( aStrBuf.getStr() ); 10270 sal_Int64 input = -4; 10271 sal_Int16 radix = 8; 10272 10273 expVal += OString( "-" ); 10274 expVal += OString( "4" ); 10275 aStrBuf.append( input, radix ); 10276 10277 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10278 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[2]"; 10279 10280 } 10281 10282 TEST_F(append_007_Int64_Negative, append_047) 10283 { 10284 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10285 OString expVal( aStrBuf.getStr() ); 10286 sal_Int64 input = -8; 10287 sal_Int16 radix = 8; 10288 10289 expVal += OString( "-" ); 10290 expVal += OString( "10" ); 10291 aStrBuf.append( input, radix ); 10292 10293 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10294 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[2]"; 10295 10296 } 10297 10298 TEST_F(append_007_Int64_Negative, append_048) 10299 { 10300 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10301 OString expVal( aStrBuf.getStr() ); 10302 sal_Int64 input = -15; 10303 sal_Int16 radix = 8; 10304 10305 expVal += OString( "-" ); 10306 expVal += OString( "17" ); 10307 aStrBuf.append( input, radix ); 10308 10309 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10310 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[2]"; 10311 10312 } 10313 10314 TEST_F(append_007_Int64_Negative, append_049) 10315 { 10316 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10317 OString expVal( aStrBuf.getStr() ); 10318 sal_Int64 input = -0; 10319 sal_Int16 radix = 10; 10320 10321 expVal += OString( "0" ); 10322 aStrBuf.append( input, radix ); 10323 10324 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10325 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[2]"; 10326 10327 } 10328 10329 TEST_F(append_007_Int64_Negative, append_050) 10330 { 10331 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10332 OString expVal( aStrBuf.getStr() ); 10333 sal_Int64 input = -4; 10334 sal_Int16 radix = 10; 10335 10336 expVal += OString( "-" ); 10337 expVal += OString( "4" ); 10338 aStrBuf.append( input, radix ); 10339 10340 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10341 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[2]"; 10342 10343 } 10344 10345 TEST_F(append_007_Int64_Negative, append_051) 10346 { 10347 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10348 OString expVal( aStrBuf.getStr() ); 10349 sal_Int64 input = -8; 10350 sal_Int16 radix = 10; 10351 10352 expVal += OString( "-" ); 10353 expVal += OString( "8" ); 10354 aStrBuf.append( input, radix ); 10355 10356 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10357 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[2]"; 10358 10359 } 10360 10361 TEST_F(append_007_Int64_Negative, append_052) 10362 { 10363 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10364 OString expVal( aStrBuf.getStr() ); 10365 sal_Int64 input = -15; 10366 sal_Int16 radix = 10; 10367 10368 expVal += OString( "-" ); 10369 expVal += OString( "15" ); 10370 aStrBuf.append( input, radix ); 10371 10372 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10373 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[2]"; 10374 10375 } 10376 10377 TEST_F(append_007_Int64_Negative, append_053) 10378 { 10379 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10380 OString expVal( aStrBuf.getStr() ); 10381 sal_Int64 input = -0; 10382 sal_Int16 radix = 16; 10383 10384 expVal += OString( "0" ); 10385 aStrBuf.append( input, radix ); 10386 10387 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10388 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[2]"; 10389 10390 } 10391 10392 TEST_F(append_007_Int64_Negative, append_054) 10393 { 10394 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10395 OString expVal( aStrBuf.getStr() ); 10396 sal_Int64 input = -4; 10397 sal_Int16 radix = 16; 10398 10399 expVal += OString( "-" ); 10400 expVal += OString( "4" ); 10401 aStrBuf.append( input, radix ); 10402 10403 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10404 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[2]"; 10405 10406 } 10407 10408 TEST_F(append_007_Int64_Negative, append_055) 10409 { 10410 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10411 OString expVal( aStrBuf.getStr() ); 10412 sal_Int64 input = -8; 10413 sal_Int16 radix = 16; 10414 10415 expVal += OString( "-" ); 10416 expVal += OString( "8" ); 10417 aStrBuf.append( input, radix ); 10418 10419 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10420 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[2]"; 10421 10422 } 10423 10424 TEST_F(append_007_Int64_Negative, append_056) 10425 { 10426 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10427 OString expVal( aStrBuf.getStr() ); 10428 sal_Int64 input = -15; 10429 sal_Int16 radix = 16; 10430 10431 expVal += OString( "-" ); 10432 expVal += OString( "f" ); 10433 aStrBuf.append( input, radix ); 10434 10435 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10436 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[2]"; 10437 10438 } 10439 10440 TEST_F(append_007_Int64_Negative, append_057) 10441 { 10442 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10443 OString expVal( aStrBuf.getStr() ); 10444 sal_Int64 input = -0; 10445 sal_Int16 radix = 36; 10446 10447 expVal += OString( "0" ); 10448 aStrBuf.append( input, radix ); 10449 10450 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10451 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[2]"; 10452 10453 } 10454 10455 TEST_F(append_007_Int64_Negative, append_058) 10456 { 10457 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10458 OString expVal( aStrBuf.getStr() ); 10459 sal_Int64 input = -4; 10460 sal_Int16 radix = 36; 10461 10462 expVal += OString( "-" ); 10463 expVal += OString( "4" ); 10464 aStrBuf.append( input, radix ); 10465 10466 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10467 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[2]"; 10468 10469 } 10470 10471 TEST_F(append_007_Int64_Negative, append_059) 10472 { 10473 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10474 OString expVal( aStrBuf.getStr() ); 10475 sal_Int64 input = -8; 10476 sal_Int16 radix = 36; 10477 10478 expVal += OString( "-" ); 10479 expVal += OString( "8" ); 10480 aStrBuf.append( input, radix ); 10481 10482 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10483 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[2]"; 10484 10485 } 10486 10487 TEST_F(append_007_Int64_Negative, append_060) 10488 { 10489 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 10490 OString expVal( aStrBuf.getStr() ); 10491 sal_Int64 input = -35; 10492 sal_Int16 radix = 36; 10493 10494 expVal += OString( "-" ); 10495 expVal += OString( "z" ); 10496 aStrBuf.append( input, radix ); 10497 10498 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10499 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[2]"; 10500 10501 } 10502 10503 TEST_F(append_007_Int64_Negative, append_061) 10504 { 10505 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10506 OString expVal( aStrBuf.getStr() ); 10507 sal_Int64 input = -0; 10508 sal_Int16 radix = 2; 10509 10510 expVal += OString( "0" ); 10511 aStrBuf.append( input, radix ); 10512 10513 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10514 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[3]"; 10515 10516 } 10517 10518 TEST_F(append_007_Int64_Negative, append_062) 10519 { 10520 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10521 OString expVal( aStrBuf.getStr() ); 10522 sal_Int64 input = -4; 10523 sal_Int16 radix = 2; 10524 10525 expVal += OString( "-" ); 10526 expVal += OString( "100" ); 10527 aStrBuf.append( input, radix ); 10528 10529 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10530 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[3]"; 10531 10532 } 10533 10534 TEST_F(append_007_Int64_Negative, append_063) 10535 { 10536 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10537 OString expVal( aStrBuf.getStr() ); 10538 sal_Int64 input = -8; 10539 sal_Int16 radix = 2; 10540 10541 expVal += OString( "-" ); 10542 expVal += OString( "1000" ); 10543 aStrBuf.append( input, radix ); 10544 10545 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10546 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[3]"; 10547 10548 } 10549 10550 TEST_F(append_007_Int64_Negative, append_064) 10551 { 10552 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10553 OString expVal( aStrBuf.getStr() ); 10554 sal_Int64 input = -15; 10555 sal_Int16 radix = 2; 10556 10557 expVal += OString( "-" ); 10558 expVal += OString( "1111" ); 10559 aStrBuf.append( input, radix ); 10560 10561 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10562 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[3]"; 10563 10564 } 10565 10566 TEST_F(append_007_Int64_Negative, append_065) 10567 { 10568 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10569 OString expVal( aStrBuf.getStr() ); 10570 sal_Int64 input = -0; 10571 sal_Int16 radix = 8; 10572 10573 expVal += OString( "0" ); 10574 aStrBuf.append( input, radix ); 10575 10576 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10577 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[3]"; 10578 10579 } 10580 10581 TEST_F(append_007_Int64_Negative, append_066) 10582 { 10583 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10584 OString expVal( aStrBuf.getStr() ); 10585 sal_Int64 input = -4; 10586 sal_Int16 radix = 8; 10587 10588 expVal += OString( "-" ); 10589 expVal += OString( "4" ); 10590 aStrBuf.append( input, radix ); 10591 10592 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10593 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[3]"; 10594 10595 } 10596 10597 TEST_F(append_007_Int64_Negative, append_067) 10598 { 10599 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10600 OString expVal( aStrBuf.getStr() ); 10601 sal_Int64 input = -8; 10602 sal_Int16 radix = 8; 10603 10604 expVal += OString( "-" ); 10605 expVal += OString( "10" ); 10606 aStrBuf.append( input, radix ); 10607 10608 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10609 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[3]"; 10610 10611 } 10612 10613 TEST_F(append_007_Int64_Negative, append_068) 10614 { 10615 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10616 OString expVal( aStrBuf.getStr() ); 10617 sal_Int64 input = -15; 10618 sal_Int16 radix = 8; 10619 10620 expVal += OString( "-" ); 10621 expVal += OString( "17" ); 10622 aStrBuf.append( input, radix ); 10623 10624 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10625 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[3]"; 10626 10627 } 10628 10629 TEST_F(append_007_Int64_Negative, append_069) 10630 { 10631 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10632 OString expVal( aStrBuf.getStr() ); 10633 sal_Int64 input = -0; 10634 sal_Int16 radix = 10; 10635 10636 expVal += OString( "0" ); 10637 aStrBuf.append( input, radix ); 10638 10639 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10640 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[3]"; 10641 10642 } 10643 10644 TEST_F(append_007_Int64_Negative, append_070) 10645 { 10646 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10647 OString expVal( aStrBuf.getStr() ); 10648 sal_Int64 input = -4; 10649 sal_Int16 radix = 10; 10650 10651 expVal += OString( "-" ); 10652 expVal += OString( "4" ); 10653 aStrBuf.append( input, radix ); 10654 10655 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10656 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[3]"; 10657 10658 } 10659 10660 TEST_F(append_007_Int64_Negative, append_071) 10661 { 10662 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10663 OString expVal( aStrBuf.getStr() ); 10664 sal_Int64 input = -8; 10665 sal_Int16 radix = 10; 10666 10667 expVal += OString( "-" ); 10668 expVal += OString( "8" ); 10669 aStrBuf.append( input, radix ); 10670 10671 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10672 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[3]"; 10673 10674 } 10675 10676 TEST_F(append_007_Int64_Negative, append_072) 10677 { 10678 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10679 OString expVal( aStrBuf.getStr() ); 10680 sal_Int64 input = -15; 10681 sal_Int16 radix = 10; 10682 10683 expVal += OString( "-" ); 10684 expVal += OString( "15" ); 10685 aStrBuf.append( input, radix ); 10686 10687 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10688 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[3]"; 10689 10690 } 10691 10692 TEST_F(append_007_Int64_Negative, append_073) 10693 { 10694 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10695 OString expVal( aStrBuf.getStr() ); 10696 sal_Int64 input = -0; 10697 sal_Int16 radix = 16; 10698 10699 expVal += OString( "0" ); 10700 aStrBuf.append( input, radix ); 10701 10702 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10703 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[3]"; 10704 10705 } 10706 10707 TEST_F(append_007_Int64_Negative, append_074) 10708 { 10709 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10710 OString expVal( aStrBuf.getStr() ); 10711 sal_Int64 input = -4; 10712 sal_Int16 radix = 16; 10713 10714 expVal += OString( "-" ); 10715 expVal += OString( "4" ); 10716 aStrBuf.append( input, radix ); 10717 10718 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10719 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[3]"; 10720 10721 } 10722 10723 TEST_F(append_007_Int64_Negative, append_075) 10724 { 10725 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10726 OString expVal( aStrBuf.getStr() ); 10727 sal_Int64 input = -8; 10728 sal_Int16 radix = 16; 10729 10730 expVal += OString( "-" ); 10731 expVal += OString( "8" ); 10732 aStrBuf.append( input, radix ); 10733 10734 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10735 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[3]"; 10736 10737 } 10738 10739 TEST_F(append_007_Int64_Negative, append_076) 10740 { 10741 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10742 OString expVal( aStrBuf.getStr() ); 10743 sal_Int64 input = -15; 10744 sal_Int16 radix = 16; 10745 10746 expVal += OString( "-" ); 10747 expVal += OString( "f" ); 10748 aStrBuf.append( input, radix ); 10749 10750 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10751 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[3]"; 10752 10753 } 10754 10755 TEST_F(append_007_Int64_Negative, append_077) 10756 { 10757 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10758 OString expVal( aStrBuf.getStr() ); 10759 sal_Int64 input = -0; 10760 sal_Int16 radix = 36; 10761 10762 expVal += OString( "0" ); 10763 aStrBuf.append( input, radix ); 10764 10765 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10766 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[3]"; 10767 10768 } 10769 10770 TEST_F(append_007_Int64_Negative, append_078) 10771 { 10772 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10773 OString expVal( aStrBuf.getStr() ); 10774 sal_Int64 input = -4; 10775 sal_Int16 radix = 36; 10776 10777 expVal += OString( "-" ); 10778 expVal += OString( "4" ); 10779 aStrBuf.append( input, radix ); 10780 10781 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10782 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[3]"; 10783 10784 } 10785 10786 TEST_F(append_007_Int64_Negative, append_079) 10787 { 10788 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10789 OString expVal( aStrBuf.getStr() ); 10790 sal_Int64 input = -8; 10791 sal_Int16 radix = 36; 10792 10793 expVal += OString( "-" ); 10794 expVal += OString( "8" ); 10795 aStrBuf.append( input, radix ); 10796 10797 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10798 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[3]"; 10799 10800 } 10801 10802 TEST_F(append_007_Int64_Negative, append_080) 10803 { 10804 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 10805 OString expVal( aStrBuf.getStr() ); 10806 sal_Int64 input = -35; 10807 sal_Int16 radix = 36; 10808 10809 expVal += OString( "-" ); 10810 expVal += OString( "z" ); 10811 aStrBuf.append( input, radix ); 10812 10813 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10814 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[3]"; 10815 10816 } 10817 10818 TEST_F(append_007_Int64_Negative, append_081) 10819 { 10820 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 10821 OString expVal( aStrBuf.getStr() ); 10822 sal_Int64 input = -0; 10823 sal_Int16 radix = 2; 10824 10825 expVal += OString( "0" ); 10826 aStrBuf.append( input, radix ); 10827 10828 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10829 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[4]"; 10830 10831 } 10832 10833 TEST_F(append_007_Int64_Negative, append_082) 10834 { 10835 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 10836 OString expVal( aStrBuf.getStr() ); 10837 sal_Int64 input = -4; 10838 sal_Int16 radix = 2; 10839 10840 expVal += OString( "-" ); 10841 expVal += OString( "100" ); 10842 aStrBuf.append( input, radix ); 10843 10844 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10845 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[4]"; 10846 10847 } 10848 10849 TEST_F(append_007_Int64_Negative, append_083) 10850 { 10851 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 10852 OString expVal( aStrBuf.getStr() ); 10853 sal_Int64 input = -8; 10854 sal_Int16 radix = 2; 10855 10856 expVal += OString( "-" ); 10857 expVal += OString( "1000" ); 10858 aStrBuf.append( input, radix ); 10859 10860 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10861 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[4]"; 10862 10863 } 10864 10865 TEST_F(append_007_Int64_Negative, append_084) 10866 { 10867 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 10868 OString expVal( aStrBuf.getStr() ); 10869 sal_Int64 input = -15; 10870 sal_Int16 radix = 2; 10871 10872 expVal += OString( "-" ); 10873 expVal += OString( "1111" ); 10874 aStrBuf.append( input, radix ); 10875 10876 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10877 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 2)_006_negative_kRadixBinary for arrOUS[4]"; 10878 10879 } 10880 10881 TEST_F(append_007_Int64_Negative, append_085) 10882 { 10883 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 10884 OString expVal( aStrBuf.getStr() ); 10885 sal_Int64 input = -0; 10886 sal_Int16 radix = 8; 10887 10888 expVal += OString( "0" ); 10889 aStrBuf.append( input, radix ); 10890 10891 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10892 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[4]"; 10893 10894 } 10895 10896 TEST_F(append_007_Int64_Negative, append_086) 10897 { 10898 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 10899 OString expVal( aStrBuf.getStr() ); 10900 sal_Int64 input = -4; 10901 sal_Int16 radix = 8; 10902 10903 expVal += OString( "-" ); 10904 expVal += OString( "4" ); 10905 aStrBuf.append( input, radix ); 10906 10907 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10908 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[4]"; 10909 10910 } 10911 10912 TEST_F(append_007_Int64_Negative, append_087) 10913 { 10914 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 10915 OString expVal( aStrBuf.getStr() ); 10916 sal_Int64 input = -8; 10917 sal_Int16 radix = 8; 10918 10919 expVal += OString( "-" ); 10920 expVal += OString( "10" ); 10921 aStrBuf.append( input, radix ); 10922 10923 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10924 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[4]"; 10925 10926 } 10927 10928 TEST_F(append_007_Int64_Negative, append_088) 10929 { 10930 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 10931 OString expVal( aStrBuf.getStr() ); 10932 sal_Int64 input = -15; 10933 sal_Int16 radix = 8; 10934 10935 expVal += OString( "-" ); 10936 expVal += OString( "17" ); 10937 aStrBuf.append( input, radix ); 10938 10939 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10940 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 8)_006_negative_kRadixOctol for arrOUS[4]"; 10941 10942 } 10943 10944 TEST_F(append_007_Int64_Negative, append_089) 10945 { 10946 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 10947 OString expVal( aStrBuf.getStr() ); 10948 sal_Int64 input = -0; 10949 sal_Int16 radix = 10; 10950 10951 expVal += OString( "0" ); 10952 aStrBuf.append( input, radix ); 10953 10954 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10955 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[4]"; 10956 10957 } 10958 10959 TEST_F(append_007_Int64_Negative, append_090) 10960 { 10961 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 10962 OString expVal( aStrBuf.getStr() ); 10963 sal_Int64 input = -4; 10964 sal_Int16 radix = 10; 10965 10966 expVal += OString( "-" ); 10967 expVal += OString( "4" ); 10968 aStrBuf.append( input, radix ); 10969 10970 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10971 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[4]"; 10972 10973 } 10974 10975 TEST_F(append_007_Int64_Negative, append_091) 10976 { 10977 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 10978 OString expVal( aStrBuf.getStr() ); 10979 sal_Int64 input = -8; 10980 sal_Int16 radix = 10; 10981 10982 expVal += OString( "-" ); 10983 expVal += OString( "8" ); 10984 aStrBuf.append( input, radix ); 10985 10986 ASSERT_TRUE(aStrBuf.getStr()== expVal && 10987 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[4]"; 10988 10989 } 10990 10991 TEST_F(append_007_Int64_Negative, append_092) 10992 { 10993 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 10994 OString expVal( aStrBuf.getStr() ); 10995 sal_Int64 input = -15; 10996 sal_Int16 radix = 10; 10997 10998 expVal += OString( "-" ); 10999 expVal += OString( "15" ); 11000 aStrBuf.append( input, radix ); 11001 11002 ASSERT_TRUE(aStrBuf.getStr()== expVal && 11003 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 10)_006_negative_kRadixDecimal for arrOUS[4]"; 11004 11005 } 11006 11007 TEST_F(append_007_Int64_Negative, append_093) 11008 { 11009 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 11010 OString expVal( aStrBuf.getStr() ); 11011 sal_Int64 input = -0; 11012 sal_Int16 radix = 16; 11013 11014 expVal += OString( "0" ); 11015 aStrBuf.append( input, radix ); 11016 11017 ASSERT_TRUE(aStrBuf.getStr()== expVal && 11018 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[4]"; 11019 11020 } 11021 11022 TEST_F(append_007_Int64_Negative, append_094) 11023 { 11024 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 11025 OString expVal( aStrBuf.getStr() ); 11026 sal_Int64 input = -4; 11027 sal_Int16 radix = 16; 11028 11029 expVal += OString( "-" ); 11030 expVal += OString( "4" ); 11031 aStrBuf.append( input, radix ); 11032 11033 ASSERT_TRUE(aStrBuf.getStr()== expVal && 11034 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[4]"; 11035 11036 } 11037 11038 TEST_F(append_007_Int64_Negative, append_095) 11039 { 11040 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 11041 OString expVal( aStrBuf.getStr() ); 11042 sal_Int64 input = -8; 11043 sal_Int16 radix = 16; 11044 11045 expVal += OString( "-" ); 11046 expVal += OString( "8" ); 11047 aStrBuf.append( input, radix ); 11048 11049 ASSERT_TRUE(aStrBuf.getStr()== expVal && 11050 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[4]"; 11051 11052 } 11053 11054 TEST_F(append_007_Int64_Negative, append_096) 11055 { 11056 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 11057 OString expVal( aStrBuf.getStr() ); 11058 sal_Int64 input = -15; 11059 sal_Int16 radix = 16; 11060 11061 expVal += OString( "-" ); 11062 expVal += OString( "f" ); 11063 aStrBuf.append( input, radix ); 11064 11065 ASSERT_TRUE(aStrBuf.getStr()== expVal && 11066 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 16)_006_negative_kRadixHexdecimal for arrOUS[4]"; 11067 11068 } 11069 11070 TEST_F(append_007_Int64_Negative, append_097) 11071 { 11072 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 11073 OString expVal( aStrBuf.getStr() ); 11074 sal_Int64 input = -0; 11075 sal_Int16 radix = 36; 11076 11077 expVal += OString( "0" ); 11078 aStrBuf.append( input, radix ); 11079 11080 ASSERT_TRUE(aStrBuf.getStr()== expVal && 11081 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[4]"; 11082 11083 } 11084 11085 TEST_F(append_007_Int64_Negative, append_098) 11086 { 11087 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 11088 OString expVal( aStrBuf.getStr() ); 11089 sal_Int64 input = -4; 11090 sal_Int16 radix = 36; 11091 11092 expVal += OString( "-" ); 11093 expVal += OString( "4" ); 11094 aStrBuf.append( input, radix ); 11095 11096 ASSERT_TRUE(aStrBuf.getStr()== expVal && 11097 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[4]"; 11098 11099 } 11100 11101 TEST_F(append_007_Int64_Negative, append_099) 11102 { 11103 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 11104 OString expVal( aStrBuf.getStr() ); 11105 sal_Int64 input = -8; 11106 sal_Int16 radix = 36; 11107 11108 expVal += OString( "-" ); 11109 expVal += OString( "8" ); 11110 aStrBuf.append( input, radix ); 11111 11112 ASSERT_TRUE(aStrBuf.getStr()== expVal && 11113 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[4]"; 11114 11115 } 11116 11117 TEST_F(append_007_Int64_Negative, append_100) 11118 { 11119 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 11120 OString expVal( aStrBuf.getStr() ); 11121 sal_Int64 input = -35; 11122 sal_Int16 radix = 36; 11123 11124 expVal += OString( "-" ); 11125 expVal += OString( "z" ); 11126 aStrBuf.append( input, radix ); 11127 11128 ASSERT_TRUE(aStrBuf.getStr()== expVal && 11129 aStrBuf.getLength() == expVal.getLength()) << "append(sal_Int64, radix 36)_006_negative_kRadixBase36 for arrOUS[4]"; 11130 11131 } 11132 11133 //------------------------------------------------------------------------ 11134 // testing the method append( sal_Int64 i, sal_Int16 radix ) where radix = -5 11135 //------------------------------------------------------------------------ 11136 class append_007_Int64_WrongRadix : public ::testing::Test 11137 { 11138 protected: 11139 OString* arrOUS[5]; 11140 sal_Int64 intVal; 11141 11142 public: 11143 void SetUp() 11144 { 11145 arrOUS[0] = new OString( kTestStr7 ); 11146 arrOUS[1] = new OString( ); 11147 arrOUS[2] = new OString( kTestStr25 ); 11148 arrOUS[3] = new OString( "\0" ); 11149 arrOUS[4] = new OString( kTestStr28 ); 11150 intVal = 11; 11151 11152 } 11153 11154 void TearDown() 11155 { 11156 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 11157 delete arrOUS[3]; delete arrOUS[4]; 11158 } 11159 }; 11160 11161 TEST_F(append_007_Int64_WrongRadix, append_001) 11162 { 11163 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 11164 OString expVal( kTestStr59 ); 11165 11166 aStrBuf.append( intVal, -5 ); 11167 11168 ASSERT_TRUE(sal_True) << "Appends the WrongRadix to the string buffer arrOUS[0]"; 11169 11170 } 11171 11172 TEST_F(append_007_Int64_WrongRadix, append_002) 11173 { 11174 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 11175 OString expVal( kTestStr60 ); 11176 11177 aStrBuf.append( intVal, -5 ); 11178 11179 ASSERT_TRUE(sal_True) << "Appends the WrongRadix to the string buffer arrOUS[1]"; 11180 11181 } 11182 11183 TEST_F(append_007_Int64_WrongRadix, append_003) 11184 { 11185 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 11186 OString expVal( kTestStr60 ); 11187 11188 aStrBuf.append( intVal, -5 ); 11189 11190 ASSERT_TRUE(sal_True) << "Appends the WrongRadix to the string buffer arrOUS[2]"; 11191 11192 } 11193 11194 TEST_F(append_007_Int64_WrongRadix, append_004) 11195 { 11196 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 11197 OString expVal( kTestStr60 ); 11198 11199 aStrBuf.append( intVal, -5 ); 11200 11201 ASSERT_TRUE(sal_True) << "Appends the WrongRadix to the string buffer arrOUS[3]"; 11202 11203 } 11204 11205 TEST_F(append_007_Int64_WrongRadix, append_005) 11206 { 11207 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 11208 OString expVal( kTestStr61 ); 11209 11210 aStrBuf.append( intVal, -5 ); 11211 11212 ASSERT_TRUE(sal_True) << "Appends the WrongRadix to the string buffer arrOUS[4]"; 11213 11214 } 11215 #ifdef WITH_CORE 11216 TEST_F(append_007_Int64_WrongRadix, append_006) 11217 { 11218 ::rtl::OStringBuffer aStrBuf( kSInt64Max ); 11219 OString expVal( kTestStr60 ); 11220 11221 aStrBuf.append( intVal, -5 ); 11222 11223 ASSERT_TRUE(sal_True) << "Appends the WrongRadix to the string buffer(with INT_MAX)"; 11224 11225 } 11226 #endif 11227 11228 //------------------------------------------------------------------------ 11229 class append_007_Int64_defaultParam : public ::testing::Test 11230 { 11231 protected: 11232 OString* arrOUS[5]; 11233 11234 public: 11235 void SetUp() 11236 { 11237 arrOUS[0] = new OString( kTestStr7 ); 11238 arrOUS[1] = new OString( ); 11239 arrOUS[2] = new OString( kTestStr25 ); 11240 arrOUS[3] = new OString( "\0" ); 11241 arrOUS[4] = new OString( kTestStr28 ); 11242 11243 } 11244 11245 void TearDown() 11246 { 11247 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 11248 delete arrOUS[3]; delete arrOUS[4]; 11249 } 11250 }; 11251 11252 TEST_F(append_007_Int64_defaultParam, append_001) 11253 { 11254 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 11255 OString expVal( kTestStr59 ); 11256 sal_Int64 input = 11; 11257 11258 aStrBuf.append( input ); 11259 11260 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 11 and return OStringBuffer[0]+11"; 11261 11262 } 11263 11264 TEST_F(append_007_Int64_defaultParam, append_002) 11265 { 11266 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 11267 OString expVal( kTestStr62 ); 11268 sal_Int64 input = 0; 11269 11270 aStrBuf.append( input ); 11271 11272 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 0 and return OStringBuffer[0]+0"; 11273 11274 } 11275 11276 TEST_F(append_007_Int64_defaultParam, append_003) 11277 { 11278 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 11279 OString expVal( kTestStr63 ); 11280 sal_Int64 input = -11; 11281 11282 aStrBuf.append( input ); 11283 11284 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 -11 and return OStringBuffer[0]+(-11)"; 11285 11286 } 11287 11288 TEST_F(append_007_Int64_defaultParam, append_004) 11289 { 11290 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 11291 OString expVal( kTestStr116 ); 11292 sal_Int64 input = SAL_CONST_INT64(9223372036854775807); 11293 aStrBuf.append( input ); 11294 11295 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 9223372036854775807 and return OStringBuffer[0]+9223372036854775807"; 11296 11297 } 11298 11299 TEST_F(append_007_Int64_defaultParam, append_005) 11300 { 11301 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 11302 OString expVal( kTestStr117 ); 11303 sal_Int64 input = SAL_MIN_INT64/*-9223372036854775808*/; // LLA: this is not the same :-( kNonSInt64Max; 11304 11305 aStrBuf.append( input ); 11306 11307 sal_Bool bRes = expVal.equals( aStrBuf.getStr() ); 11308 ASSERT_TRUE(bRes && aStrBuf.getLength() == expVal.getLength()) << "input Int64 -9223372036854775808 and return OStringBuffer[0]+(-9223372036854775808)"; 11309 11310 } 11311 11312 TEST_F(append_007_Int64_defaultParam, append_006) 11313 { 11314 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 11315 OString expVal( kTestStr60 ); 11316 sal_Int64 input = 11; 11317 11318 aStrBuf.append( input ); 11319 11320 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 11 and return OStringBuffer[1]+11"; 11321 11322 } 11323 11324 TEST_F(append_007_Int64_defaultParam, append_007) 11325 { 11326 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 11327 OString expVal( kTestStr66 ); 11328 sal_Int64 input = 0; 11329 11330 aStrBuf.append( input ); 11331 11332 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 0 and return OStringBuffer[1]+0"; 11333 11334 } 11335 11336 TEST_F(append_007_Int64_defaultParam, append_008) 11337 { 11338 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 11339 OString expVal( kTestStr67 ); 11340 sal_Int64 input = -11; 11341 11342 aStrBuf.append( input ); 11343 11344 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 -11 and return OStringBuffer[1]+(-11)"; 11345 11346 } 11347 11348 TEST_F(append_007_Int64_defaultParam, append_009) 11349 { 11350 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 11351 OString expVal( kTestStr118 ); 11352 sal_Int64 input = SAL_CONST_INT64(9223372036854775807); 11353 aStrBuf.append( input ); 11354 11355 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 9223372036854775807 and return OStringBuffer[1]+9223372036854775807"; 11356 11357 } 11358 11359 TEST_F(append_007_Int64_defaultParam, append_010) 11360 { 11361 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 11362 OString expVal( kTestStr119 ); 11363 sal_Int64 input = SAL_MIN_INT64; // LLA: this is not the same :-( kNonSInt64Max; 11364 11365 aStrBuf.append( input ); 11366 11367 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 -9223372036854775808 and return OStringBuffer[1]+(-9223372036854775808)"; 11368 11369 } 11370 11371 TEST_F(append_007_Int64_defaultParam, append_011) 11372 { 11373 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 11374 OString expVal( kTestStr60 ); 11375 sal_Int64 input = 11; 11376 11377 aStrBuf.append( input ); 11378 11379 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 11 and return OStringBuffer[2]+11"; 11380 11381 } 11382 11383 TEST_F(append_007_Int64_defaultParam, append_012) 11384 { 11385 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 11386 OString expVal( kTestStr66 ); 11387 sal_Int64 input = 0; 11388 11389 aStrBuf.append( input ); 11390 11391 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 0 and return OUStringBuffer[2]+0"; 11392 11393 } 11394 11395 TEST_F(append_007_Int64_defaultParam, append_013) 11396 { 11397 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 11398 OString expVal( kTestStr67 ); 11399 sal_Int64 input = -11; 11400 11401 aStrBuf.append( input ); 11402 11403 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 -11 and return OUStringBuffer[2]+(-11)"; 11404 11405 } 11406 11407 TEST_F(append_007_Int64_defaultParam, append_014) 11408 { 11409 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 11410 OString expVal( kTestStr118 ); 11411 sal_Int64 input = SAL_CONST_INT64(9223372036854775807); 11412 aStrBuf.append( input ); 11413 11414 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 9223372036854775807 and return OStringBuffer[2]+9223372036854775807"; 11415 11416 } 11417 11418 TEST_F(append_007_Int64_defaultParam, append_015) 11419 { 11420 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 11421 OString expVal( kTestStr119 ); 11422 sal_Int64 input = SAL_MIN_INT64; // LLA: this is not the same :-( kNonSInt64Max; 11423 11424 aStrBuf.append( input ); 11425 11426 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 -9223372036854775808 and return OStringBuffer[2]+(-9223372036854775808)"; 11427 11428 } 11429 11430 TEST_F(append_007_Int64_defaultParam, append_016) 11431 { 11432 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 11433 OString expVal( kTestStr60 ); 11434 sal_Int64 input = 11; 11435 11436 aStrBuf.append( input ); 11437 11438 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 11 and return OStringBuffer[3]+11"; 11439 11440 } 11441 11442 TEST_F(append_007_Int64_defaultParam, append_017) 11443 { 11444 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 11445 OString expVal( kTestStr66 ); 11446 sal_Int64 input = 0; 11447 11448 aStrBuf.append( input ); 11449 11450 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 0 and return OStringBuffer[3]+0"; 11451 11452 } 11453 11454 TEST_F(append_007_Int64_defaultParam, append_018) 11455 { 11456 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 11457 OString expVal( kTestStr67 ); 11458 sal_Int64 input = -11; 11459 11460 aStrBuf.append( input ); 11461 11462 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 -11 and return OStringBuffer[3]+(-11)"; 11463 11464 } 11465 11466 TEST_F(append_007_Int64_defaultParam, append_019) 11467 { 11468 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 11469 OString expVal( kTestStr118 ); 11470 sal_Int64 input = SAL_CONST_INT64(9223372036854775807); 11471 aStrBuf.append( input ); 11472 11473 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 9223372036854775807 and return OStringBuffer[3]+9223372036854775807"; 11474 11475 } 11476 11477 TEST_F(append_007_Int64_defaultParam, append_020) 11478 { 11479 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 11480 OString expVal( kTestStr119 ); 11481 sal_Int64 input = SAL_MIN_INT64; // LLA: this is not the same :-( kNonSInt64Max; 11482 11483 aStrBuf.append( input ); 11484 11485 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 -9223372036854775808 and return OStringBuffer[3]+(-9223372036854775808)"; 11486 11487 } 11488 11489 TEST_F(append_007_Int64_defaultParam, append_021) 11490 { 11491 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 11492 OString expVal( kTestStr61 ); 11493 sal_Int64 input = 11; 11494 11495 aStrBuf.append( input ); 11496 11497 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 11 and return OStringBuffer[4]+11"; 11498 11499 } 11500 11501 TEST_F(append_007_Int64_defaultParam, append_022) 11502 { 11503 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 11504 OString expVal( kTestStr70 ); 11505 sal_Int64 input = 0; 11506 11507 aStrBuf.append( input ); 11508 11509 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 0 and return OStringBuffer[4]+0"; 11510 11511 } 11512 11513 TEST_F(append_007_Int64_defaultParam, append_023) 11514 { 11515 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 11516 OString expVal( kTestStr71 ); 11517 sal_Int64 input = -11; 11518 11519 aStrBuf.append( input ); 11520 11521 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 -11 and return OStringBuffer[4]+(-11)"; 11522 11523 } 11524 11525 TEST_F(append_007_Int64_defaultParam, append_024) 11526 { 11527 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 11528 OString expVal( kTestStr120 ); 11529 sal_Int64 input = SAL_CONST_INT64(9223372036854775807); 11530 aStrBuf.append( input ); 11531 11532 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 9223372036854775807 and return OStringBuffer[4]+9223372036854775807"; 11533 11534 } 11535 11536 TEST_F(append_007_Int64_defaultParam, append_025) 11537 { 11538 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 11539 OString expVal( kTestStr121 ); 11540 sal_Int64 input = SAL_MIN_INT64; // LLA: this is not the same :-( kNonSInt64Max; 11541 11542 aStrBuf.append( input ); 11543 11544 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 -9223372036854775808 and return OStringBuffer[4]+(-9223372036854775808)"; 11545 11546 } 11547 #ifdef WITH_CORE 11548 TEST_F(append_007_Int64_defaultParam, append_026) 11549 { 11550 ::rtl::OStringBuffer aStrBuf( kSInt64Max ); 11551 OString expVal( kTestStr60 ); 11552 sal_Int64 input = 11; 11553 11554 aStrBuf.append( input ); 11555 11556 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 11 and return OStringBuffer(kSInt64Max)+11"; 11557 11558 } 11559 11560 TEST_F(append_007_Int64_defaultParam, append_027) 11561 { 11562 ::rtl::OStringBuffer aStrBuf( kSInt64Max ); 11563 OString expVal( kTestStr66 ); 11564 sal_Int64 input = 0; 11565 11566 aStrBuf.append( input ); 11567 11568 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 0 and return OStringBuffer(kSInt64Max)+0"; 11569 11570 } 11571 11572 TEST_F(append_007_Int64_defaultParam, append_028) 11573 { 11574 ::rtl::OStringBuffer aStrBuf( kSInt64Max ); 11575 OString expVal( kTestStr67 ); 11576 sal_Int64 input = -11; 11577 11578 aStrBuf.append( input ); 11579 11580 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 -11 and return OStringBuffer(kSInt64Max)+(-11)"; 11581 11582 } 11583 11584 TEST_F(append_007_Int64_defaultParam, append_029) 11585 { 11586 ::rtl::OStringBuffer aStrBuf( kSInt64Max ); 11587 OString expVal( kTestStr118 ); 11588 sal_Int64 input = 9223372036854775807; 11589 11590 aStrBuf.append( input ); 11591 11592 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 9223372036854775807 and return OStringBuffer(kSInt64Max)+9223372036854775807"; 11593 11594 } 11595 11596 TEST_F(append_007_Int64_defaultParam, append_030) 11597 { 11598 ::rtl::OStringBuffer aStrBuf( kSInt64Max ); 11599 OString expVal( kTestStr119 ); 11600 sal_Int64 input = SAL_MIN_INT64; // LLA: this is not the same :-( kNonSInt64Max; 11601 11602 aStrBuf.append( input ); 11603 11604 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "input Int64 -9223372036854775808 and return OStringBuffer(kSInt64Max)+(-9223372036854775808)"; 11605 11606 } 11607 #endif 11608 11609 //------------------------------------------------------------------------ 11610 // testing the method append( float f ) 11611 //------------------------------------------------------------------------ 11612 class checkfloat : public ::testing::Test 11613 { 11614 public: 11615 bool checkIfStrBufContainAtPosTheFloat(rtl::OStringBuffer const& _sStrBuf, sal_Int32 _nLen, float _nFloat) 11616 { 11617 OString sFloatValue; 11618 sFloatValue = rtl::OString::valueOf(_nFloat); 11619 11620 OString sBufferString(_sStrBuf.getStr()); 11621 sal_Int32 nPos = sBufferString.indexOf(sFloatValue); 11622 if ( nPos >= 0 && nPos == _nLen) 11623 { 11624 return true; 11625 } 11626 return false; 11627 } 11628 }; 11629 // ----------------------------------------------------------------------------- 11630 class append_008_float : public checkfloat 11631 { 11632 protected: 11633 OString* arrOUS[5]; 11634 11635 public: 11636 void SetUp() 11637 { 11638 arrOUS[0] = new OString( kTestStr7 ); 11639 arrOUS[1] = new OString( ); 11640 arrOUS[2] = new OString( kTestStr25 ); 11641 arrOUS[3] = new OString( "\0" ); 11642 arrOUS[4] = new OString( kTestStr28 ); 11643 11644 } 11645 11646 void TearDown() 11647 { 11648 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 11649 delete arrOUS[3]; delete arrOUS[4]; 11650 } 11651 }; 11652 11653 TEST_F(append_008_float, append_001) 11654 { 11655 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 11656 // LLA: OString expVal( kTestStr74 ); 11657 float input = (float)atof("3.0"); 11658 11659 // LLA: 11660 // the complex problem is here, that a float value is not really what we write. 11661 // So a 3.0 could also be 3 or 3.0 or 3.0000001 or 2.9999999 11662 // this has to be checked. 11663 sal_Int32 nLen = aStrBuf.getLength(); 11664 aStrBuf.append( input ); 11665 11666 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[0] append 3.0"; 11667 11668 } 11669 11670 TEST_F(append_008_float, append_002) 11671 { 11672 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 11673 // LLA: OString expVal( kTestStr75 ); 11674 float input = (float)atof("3.5"); 11675 11676 sal_Int32 nLen = aStrBuf.getLength(); 11677 aStrBuf.append( input ); 11678 11679 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[0] append 3.5"; 11680 11681 } 11682 11683 TEST_F(append_008_float, append_003) 11684 { 11685 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 11686 // LLA: OString expVal( kTestStr76 ); 11687 float input = (float)atof("3.0625"); 11688 11689 sal_Int32 nLen = aStrBuf.getLength(); 11690 aStrBuf.append( input ); 11691 11692 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[0] append 3.0625"; 11693 11694 } 11695 11696 TEST_F(append_008_float, append_004) 11697 { 11698 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 11699 // LLA: OString expVal( kTestStr77 ); 11700 float input = (float)atof("3.502525"); 11701 11702 sal_Int32 nLen = aStrBuf.getLength(); 11703 aStrBuf.append( input ); 11704 11705 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[0] append 3.502525"; 11706 11707 } 11708 11709 TEST_F(append_008_float, append_005) 11710 { 11711 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 11712 // LLA: OString expVal( kTestStr78 ); 11713 float input = (float)atof("3.141592"); 11714 11715 sal_Int32 nLen = aStrBuf.getLength(); 11716 aStrBuf.append( input ); 11717 11718 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[0] append 3.141592"; 11719 11720 } 11721 11722 TEST_F(append_008_float, append_006) 11723 { 11724 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 11725 // LLA: OString expVal( kTestStr79 ); 11726 float input = (float)atof("3.5025255"); 11727 11728 sal_Int32 nLen = aStrBuf.getLength(); 11729 aStrBuf.append( input ); 11730 11731 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[0] append 3.5025255"; 11732 11733 } 11734 11735 TEST_F(append_008_float, append_007) 11736 { 11737 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 11738 // LLA: OString expVal( kTestStr80 ); 11739 float input = (float)atof("3.00390625"); 11740 11741 sal_Int32 nLen = aStrBuf.getLength(); 11742 aStrBuf.append( input ); 11743 11744 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[0] append 3.0039062"; 11745 11746 } 11747 11748 TEST_F(append_008_float, append_008) 11749 { 11750 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 11751 // LLA: OString expVal( kTestStr81 ); 11752 float input = (float)atof("3.0"); 11753 11754 sal_Int32 nLen = aStrBuf.getLength(); 11755 aStrBuf.append( input ); 11756 11757 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[1] append 3.0"; 11758 11759 } 11760 11761 TEST_F(append_008_float, append_009) 11762 { 11763 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 11764 // LLA: OString expVal( kTestStr82 ); 11765 float input = (float)atof("3.5"); 11766 11767 sal_Int32 nLen = aStrBuf.getLength(); 11768 aStrBuf.append( input ); 11769 11770 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[1] append 3.5"; 11771 11772 } 11773 11774 TEST_F(append_008_float, append_010) 11775 { 11776 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 11777 // LLA: OString expVal( kTestStr83 ); 11778 float input = (float)atof("3.0625"); 11779 11780 sal_Int32 nLen = aStrBuf.getLength(); 11781 aStrBuf.append( input ); 11782 11783 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[1] append 3.0625"; 11784 11785 } 11786 11787 TEST_F(append_008_float, append_011) 11788 { 11789 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 11790 // LLA: OString expVal( kTestStr84 ); 11791 float input = (float)atof("3.502525"); 11792 11793 sal_Int32 nLen = aStrBuf.getLength(); 11794 aStrBuf.append( input ); 11795 11796 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[1] append 3.502525"; 11797 11798 } 11799 11800 TEST_F(append_008_float, append_012) 11801 { 11802 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 11803 // LLA: OString expVal( kTestStr85 ); 11804 float input = (float)atof("3.141592"); 11805 11806 sal_Int32 nLen = aStrBuf.getLength(); 11807 aStrBuf.append( input ); 11808 11809 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[1] append 3.141592"; 11810 11811 } 11812 11813 TEST_F(append_008_float, append_013) 11814 { 11815 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 11816 // LLA: OString expVal( kTestStr86 ); 11817 float input = (float)atof("3.5025255"); 11818 11819 sal_Int32 nLen = aStrBuf.getLength(); 11820 aStrBuf.append( input ); 11821 11822 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[1] append 3.5025255"; 11823 11824 } 11825 11826 TEST_F(append_008_float, append_014) 11827 { 11828 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 11829 // LLA: OString expVal( kTestStr87 ); 11830 float input = (float)atof("3.00390625"); 11831 11832 sal_Int32 nLen = aStrBuf.getLength(); 11833 aStrBuf.append( input ); 11834 11835 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[1] append 3.0039062"; 11836 11837 } 11838 11839 TEST_F(append_008_float, append_015) 11840 { 11841 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 11842 // LLA: OString expVal( kTestStr81 ); 11843 float input = (float)atof("3.0"); 11844 11845 sal_Int32 nLen = aStrBuf.getLength(); 11846 aStrBuf.append( input ); 11847 11848 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[2] append 3.0"; 11849 11850 } 11851 11852 TEST_F(append_008_float, append_016) 11853 { 11854 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 11855 // LLA: OString expVal( kTestStr82 ); 11856 float input = (float)atof("3.5"); 11857 11858 sal_Int32 nLen = aStrBuf.getLength(); 11859 aStrBuf.append( input ); 11860 11861 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[2] append 3.5"; 11862 11863 } 11864 11865 TEST_F(append_008_float, append_017) 11866 { 11867 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 11868 // LLA: OString expVal( kTestStr83 ); 11869 float input = (float)atof("3.0625"); 11870 11871 sal_Int32 nLen = aStrBuf.getLength(); 11872 aStrBuf.append( input ); 11873 11874 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[2] append 3.0625"; 11875 11876 } 11877 11878 TEST_F(append_008_float, append_018) 11879 { 11880 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 11881 // LLA: OString expVal( kTestStr84 ); 11882 float input = (float)atof("3.502525"); 11883 11884 sal_Int32 nLen = aStrBuf.getLength(); 11885 aStrBuf.append( input ); 11886 11887 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[2] append 3.502525"; 11888 11889 } 11890 11891 TEST_F(append_008_float, append_019) 11892 { 11893 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 11894 // LLA: OString expVal( kTestStr85 ); 11895 float input = (float)atof("3.141592"); 11896 11897 sal_Int32 nLen = aStrBuf.getLength(); 11898 aStrBuf.append( input ); 11899 11900 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[2] append 3.141592"; 11901 11902 } 11903 11904 TEST_F(append_008_float, append_020) 11905 { 11906 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 11907 // LLA: OString expVal( kTestStr86 ); 11908 float input = (float)atof("3.5025255"); 11909 11910 sal_Int32 nLen = aStrBuf.getLength(); 11911 aStrBuf.append( input ); 11912 11913 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[2] append 3.5025255"; 11914 11915 } 11916 11917 TEST_F(append_008_float, append_021) 11918 { 11919 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 11920 // LLA: OString expVal( kTestStr87 ); 11921 float input = (float)atof("3.00390625"); 11922 11923 sal_Int32 nLen = aStrBuf.getLength(); 11924 aStrBuf.append( input ); 11925 11926 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[2] append 3.0039062"; 11927 11928 } 11929 11930 TEST_F(append_008_float, append_022) 11931 { 11932 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 11933 // LLA: OString expVal( kTestStr81 ); 11934 float input = (float)atof("3.0"); 11935 11936 sal_Int32 nLen = aStrBuf.getLength(); 11937 aStrBuf.append( input ); 11938 11939 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[3] append 3.0"; 11940 11941 } 11942 11943 TEST_F(append_008_float, append_023) 11944 { 11945 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 11946 // LLA: OString expVal( kTestStr82 ); 11947 float input = (float)atof("3.5"); 11948 11949 sal_Int32 nLen = aStrBuf.getLength(); 11950 aStrBuf.append( input ); 11951 11952 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[3] append 3.5"; 11953 11954 } 11955 11956 TEST_F(append_008_float, append_024) 11957 { 11958 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 11959 // LLA: OString expVal( kTestStr83 ); 11960 float input = (float)atof("3.0625"); 11961 11962 sal_Int32 nLen = aStrBuf.getLength(); 11963 aStrBuf.append( input ); 11964 11965 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[3] append 3.0625"; 11966 11967 } 11968 11969 TEST_F(append_008_float, append_025) 11970 { 11971 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 11972 // LLA: OString expVal( kTestStr84 ); 11973 float input = (float)atof("3.502525"); 11974 11975 sal_Int32 nLen = aStrBuf.getLength(); 11976 aStrBuf.append( input ); 11977 11978 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[3] append 3.502525"; 11979 11980 } 11981 11982 TEST_F(append_008_float, append_026) 11983 { 11984 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 11985 // LLA: OString expVal( kTestStr85 ); 11986 float input = (float)atof("3.141592"); 11987 11988 sal_Int32 nLen = aStrBuf.getLength(); 11989 aStrBuf.append( input ); 11990 11991 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[3] append 3.141592"; 11992 11993 } 11994 11995 TEST_F(append_008_float, append_027) 11996 { 11997 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 11998 // LLA: OString expVal( kTestStr86 ); 11999 float input = (float)atof("3.5025255"); 12000 12001 sal_Int32 nLen = aStrBuf.getLength(); 12002 aStrBuf.append( input ); 12003 12004 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[3] append 3.5025255"; 12005 12006 } 12007 12008 TEST_F(append_008_float, append_028) 12009 { 12010 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 12011 // LLA: OString expVal( kTestStr87 ); 12012 float input = (float)atof("3.00390625"); 12013 12014 sal_Int32 nLen = aStrBuf.getLength(); 12015 aStrBuf.append( input ); 12016 12017 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[3] append 3.0039062"; 12018 12019 } 12020 12021 TEST_F(append_008_float, append_029) 12022 { 12023 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 12024 // LLA: OString expVal( kTestStr88 ); 12025 float input = (float)atof("3.0"); 12026 12027 sal_Int32 nLen = aStrBuf.getLength(); 12028 aStrBuf.append( input ); 12029 12030 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[4] append 3.0"; 12031 12032 } 12033 12034 TEST_F(append_008_float, append_030) 12035 { 12036 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 12037 // LLA: OString expVal( kTestStr89 ); 12038 float input = (float)atof("3.5"); 12039 12040 sal_Int32 nLen = aStrBuf.getLength(); 12041 aStrBuf.append( input ); 12042 12043 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[4] append 3.5"; 12044 12045 } 12046 12047 TEST_F(append_008_float, append_031) 12048 { 12049 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 12050 // LLA: OString expVal( kTestStr90 ); 12051 float input = (float)atof("3.0625"); 12052 12053 sal_Int32 nLen = aStrBuf.getLength(); 12054 aStrBuf.append( input ); 12055 12056 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[4] append 3.0625"; 12057 12058 } 12059 12060 TEST_F(append_008_float, append_032) 12061 { 12062 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 12063 // LLA: OString expVal( kTestStr91 ); 12064 float input = (float)atof("3.502525"); 12065 12066 sal_Int32 nLen = aStrBuf.getLength(); 12067 aStrBuf.append( input ); 12068 12069 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[4] append 3.502525"; 12070 12071 } 12072 12073 TEST_F(append_008_float, append_033) 12074 { 12075 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 12076 // LLA: OString expVal( kTestStr92 ); 12077 float input = (float)atof("3.141592"); 12078 12079 sal_Int32 nLen = aStrBuf.getLength(); 12080 aStrBuf.append( input ); 12081 12082 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[4] append 3.141592"; 12083 12084 } 12085 12086 TEST_F(append_008_float, append_034) 12087 { 12088 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 12089 // LLA: OString expVal( kTestStr93 ); 12090 float input = (float)atof("3.5025255"); 12091 12092 sal_Int32 nLen = aStrBuf.getLength(); 12093 aStrBuf.append( input ); 12094 12095 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[4] append 3.5025255"; 12096 12097 } 12098 12099 TEST_F(append_008_float, append_035) 12100 { 12101 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 12102 // LLA: OString expVal( kTestStr94 ); 12103 float input = (float)atof("3.00390625"); 12104 12105 sal_Int32 nLen = aStrBuf.getLength(); 12106 aStrBuf.append( input ); 12107 12108 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[4] append 3.0039062"; 12109 12110 } 12111 #ifdef WITH_CORE 12112 TEST_F(append_008_float, append_036) 12113 { 12114 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 12115 // LLA: OString expVal( kTestStr81 ); 12116 float input = (float)atof("3.0"); 12117 12118 sal_Int32 nLen = aStrBuf.getLength(); 12119 aStrBuf.append( input ); 12120 12121 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "OStringBuffer( kSInt32Max ) append 3.0"; 12122 12123 } 12124 12125 TEST_F(append_008_float, append_037) 12126 { 12127 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 12128 // LLA: OString expVal( kTestStr82 ); 12129 float input = (float)atof("3.5"); 12130 12131 sal_Int32 nLen = aStrBuf.getLength(); 12132 aStrBuf.append( input ); 12133 12134 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "OStringBuffer( kSInt32Max ) append 3.5"; 12135 12136 } 12137 12138 TEST_F(append_008_float, append_038) 12139 { 12140 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 12141 // LLA: OString expVal( kTestStr83 ); 12142 float input = (float)atof("3.0625"); 12143 12144 sal_Int32 nLen = aStrBuf.getLength(); 12145 aStrBuf.append( input ); 12146 12147 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "OStringBuffer( kSInt32Max ) append 3.0625"; 12148 12149 } 12150 12151 TEST_F(append_008_float, append_039) 12152 { 12153 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 12154 // LLA: OString expVal( kTestStr84 ); 12155 float input = (float)atof("3.502525"); 12156 12157 sal_Int32 nLen = aStrBuf.getLength(); 12158 aStrBuf.append( input ); 12159 12160 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "OStringBuffer( kSInt32Max ) append 3.502525"; 12161 12162 } 12163 12164 TEST_F(append_008_float, append_040) 12165 { 12166 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 12167 // LLA: OString expVal( kTestStr85 ); 12168 float input = (float)atof("3.141592"); 12169 12170 sal_Int32 nLen = aStrBuf.getLength(); 12171 aStrBuf.append( input ); 12172 12173 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "OStringBuffer( kSInt32Max ) append 3.141592"; 12174 12175 } 12176 12177 TEST_F(append_008_float, append_041) 12178 { 12179 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 12180 // LLA: OString expVal( kTestStr86 ); 12181 float input = (float)atof("3.5025255"); 12182 12183 sal_Int32 nLen = aStrBuf.getLength(); 12184 aStrBuf.append( input ); 12185 12186 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "OStringBuffer( kSInt32Max ) append 3.5025255"; 12187 12188 } 12189 12190 TEST_F(append_008_float, append_042) 12191 { 12192 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 12193 // LLA: OString expVal( kTestStr87 ); 12194 float input = (float)atof("3.00390625"); 12195 12196 sal_Int32 nLen = aStrBuf.getLength(); 12197 aStrBuf.append( input ); 12198 12199 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "OStringBuffer( kSInt32Max ) append 3.0039062"; 12200 12201 } 12202 #endif 12203 12204 //------------------------------------------------------------------------ 12205 // testing the method append( float f ) for negative value 12206 //------------------------------------------------------------------------ 12207 class append_008_Float_Negative : public checkfloat 12208 { 12209 protected: 12210 OString* arrOUS[5]; 12211 12212 public: 12213 void SetUp() 12214 { 12215 arrOUS[0] = new OString( kTestStr7 ); 12216 arrOUS[1] = new OString( ); 12217 arrOUS[2] = new OString( kTestStr25 ); 12218 arrOUS[3] = new OString( "\0" ); 12219 arrOUS[4] = new OString( kTestStr28 ); 12220 12221 } 12222 12223 void TearDown() 12224 { 12225 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 12226 delete arrOUS[3]; delete arrOUS[4]; 12227 } 12228 }; 12229 12230 TEST_F(append_008_Float_Negative, append_001) 12231 { 12232 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 12233 // LLA: OString expVal( kTestStr95 ); 12234 float input = (float)atof("-3.0"); 12235 12236 sal_Int32 nLen = aStrBuf.getLength(); 12237 aStrBuf.append( input ); 12238 12239 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[0] append -3.0"; 12240 12241 } 12242 12243 TEST_F(append_008_Float_Negative, append_002) 12244 { 12245 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 12246 // LLA: OString expVal( kTestStr96 ); 12247 float input = (float)atof("-3.5"); 12248 12249 sal_Int32 nLen = aStrBuf.getLength(); 12250 aStrBuf.append( input ); 12251 12252 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[0] append -3.5"; 12253 12254 } 12255 12256 TEST_F(append_008_Float_Negative, append_003) 12257 { 12258 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 12259 // LLA: OString expVal( kTestStr97 ); 12260 float input = (float)atof("-3.0625"); 12261 12262 sal_Int32 nLen = aStrBuf.getLength(); 12263 aStrBuf.append( input ); 12264 12265 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[0] append -3.0625"; 12266 12267 } 12268 12269 TEST_F(append_008_Float_Negative, append_004) 12270 { 12271 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 12272 // LLA: OString expVal( kTestStr98 ); 12273 float input = (float)atof("-3.502525"); 12274 12275 sal_Int32 nLen = aStrBuf.getLength(); 12276 aStrBuf.append( input ); 12277 12278 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[0] append -3.502525"; 12279 12280 } 12281 12282 TEST_F(append_008_Float_Negative, append_005) 12283 { 12284 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 12285 // LLA: OString expVal( kTestStr99 ); 12286 float input = (float)atof("-3.141592"); 12287 12288 sal_Int32 nLen = aStrBuf.getLength(); 12289 aStrBuf.append( input ); 12290 12291 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[0] append -3.141592"; 12292 12293 } 12294 12295 TEST_F(append_008_Float_Negative, append_006) 12296 { 12297 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 12298 // LLA: OString expVal( kTestStr100 ); 12299 float input = (float)atof("-3.5025255"); 12300 12301 sal_Int32 nLen = aStrBuf.getLength(); 12302 aStrBuf.append( input ); 12303 12304 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[0] append -3.5025255"; 12305 12306 } 12307 12308 TEST_F(append_008_Float_Negative, append_007) 12309 { 12310 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 12311 // LLA: OString expVal( kTestStr101 ); 12312 float input = (float)atof("-3.00390625"); 12313 12314 sal_Int32 nLen = aStrBuf.getLength(); 12315 aStrBuf.append( input ); 12316 12317 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[0] append -3.0039062"; 12318 12319 } 12320 12321 TEST_F(append_008_Float_Negative, append_008) 12322 { 12323 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 12324 // LLA: OString expVal( kTestStr102 ); 12325 float input = (float)atof("-3.0"); 12326 12327 sal_Int32 nLen = aStrBuf.getLength(); 12328 aStrBuf.append( input ); 12329 12330 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[1] append -3.0"; 12331 12332 } 12333 12334 TEST_F(append_008_Float_Negative, append_009) 12335 { 12336 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 12337 // LLA: OString expVal( kTestStr103 ); 12338 float input = (float)atof("-3.5"); 12339 12340 sal_Int32 nLen = aStrBuf.getLength(); 12341 aStrBuf.append( input ); 12342 12343 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[1] append -3.5"; 12344 12345 } 12346 12347 TEST_F(append_008_Float_Negative, append_010) 12348 { 12349 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 12350 // LLA: OString expVal( kTestStr104 ); 12351 float input = (float)atof("-3.0625"); 12352 12353 sal_Int32 nLen = aStrBuf.getLength(); 12354 aStrBuf.append( input ); 12355 12356 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[1] append -3.0625"; 12357 12358 } 12359 12360 TEST_F(append_008_Float_Negative, append_011) 12361 { 12362 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 12363 // LLA: OString expVal( kTestStr105 ); 12364 float input = (float)atof("-3.502525"); 12365 12366 sal_Int32 nLen = aStrBuf.getLength(); 12367 aStrBuf.append( input ); 12368 12369 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[1] append -3.502525"; 12370 12371 } 12372 12373 TEST_F(append_008_Float_Negative, append_012) 12374 { 12375 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 12376 // LLA: OString expVal( kTestStr106 ); 12377 float input = (float)atof("-3.141592"); 12378 12379 sal_Int32 nLen = aStrBuf.getLength(); 12380 aStrBuf.append( input ); 12381 12382 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[1] append -3.141592"; 12383 12384 } 12385 12386 TEST_F(append_008_Float_Negative, append_013) 12387 { 12388 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 12389 // LLA: OString expVal( kTestStr107 ); 12390 float input = (float)atof("-3.5025255"); 12391 12392 sal_Int32 nLen = aStrBuf.getLength(); 12393 aStrBuf.append( input ); 12394 12395 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[1] append -3.5025255"; 12396 12397 } 12398 12399 TEST_F(append_008_Float_Negative, append_014) 12400 { 12401 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 12402 // LLA: OString expVal( kTestStr108 ); 12403 float input = (float)atof("-3.00390625"); 12404 12405 sal_Int32 nLen = aStrBuf.getLength(); 12406 aStrBuf.append( input ); 12407 12408 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[1] append -3.0039062"; 12409 12410 } 12411 12412 TEST_F(append_008_Float_Negative, append_015) 12413 { 12414 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 12415 // LLA: OString expVal( kTestStr102 ); 12416 float input = (float)atof("-3.0"); 12417 12418 sal_Int32 nLen = aStrBuf.getLength(); 12419 aStrBuf.append( input ); 12420 12421 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[2] append -3.0"; 12422 12423 } 12424 12425 TEST_F(append_008_Float_Negative, append_016) 12426 { 12427 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 12428 // LLA: OString expVal( kTestStr103 ); 12429 float input = (float)atof("-3.5"); 12430 12431 sal_Int32 nLen = aStrBuf.getLength(); 12432 aStrBuf.append( input ); 12433 12434 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[2] append -3.5"; 12435 12436 } 12437 12438 TEST_F(append_008_Float_Negative, append_017) 12439 { 12440 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 12441 // LLA: OString expVal( kTestStr104 ); 12442 float input = (float)atof("-3.0625"); 12443 12444 sal_Int32 nLen = aStrBuf.getLength(); 12445 aStrBuf.append( input ); 12446 12447 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[2] append -3.0625"; 12448 12449 } 12450 12451 TEST_F(append_008_Float_Negative, append_018) 12452 { 12453 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 12454 // LLA: OString expVal( kTestStr105 ); 12455 float input = (float)atof("-3.502525"); 12456 12457 sal_Int32 nLen = aStrBuf.getLength(); 12458 aStrBuf.append( input ); 12459 12460 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[2] append -3.502525"; 12461 12462 } 12463 12464 TEST_F(append_008_Float_Negative, append_019) 12465 { 12466 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 12467 // LLA: OString expVal( kTestStr106 ); 12468 float input = (float)atof("-3.141592"); 12469 12470 sal_Int32 nLen = aStrBuf.getLength(); 12471 aStrBuf.append( input ); 12472 12473 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[2] append -3.141592"; 12474 12475 } 12476 12477 TEST_F(append_008_Float_Negative, append_020) 12478 { 12479 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 12480 // LLA: OString expVal( kTestStr107 ); 12481 float input = (float)atof("-3.5025255"); 12482 12483 sal_Int32 nLen = aStrBuf.getLength(); 12484 aStrBuf.append( input ); 12485 12486 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[2] append -3.5025255"; 12487 12488 } 12489 12490 TEST_F(append_008_Float_Negative, append_021) 12491 { 12492 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 12493 // LLA: OString expVal( kTestStr108 ); 12494 float input = (float)atof("-3.00390625"); 12495 12496 sal_Int32 nLen = aStrBuf.getLength(); 12497 aStrBuf.append( input ); 12498 12499 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[2] append -3.0039062"; 12500 12501 } 12502 12503 TEST_F(append_008_Float_Negative, append_022) 12504 { 12505 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 12506 // LLA: OString expVal( kTestStr102 ); 12507 float input = (float)atof("-3.0"); 12508 12509 sal_Int32 nLen = aStrBuf.getLength(); 12510 aStrBuf.append( input ); 12511 12512 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[3] append -3.0"; 12513 12514 } 12515 12516 TEST_F(append_008_Float_Negative, append_023) 12517 { 12518 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 12519 // LLA: OString expVal( kTestStr103 ); 12520 float input = (float)atof("-3.5"); 12521 12522 sal_Int32 nLen = aStrBuf.getLength(); 12523 aStrBuf.append( input ); 12524 12525 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[3] append -3.5"; 12526 12527 } 12528 12529 TEST_F(append_008_Float_Negative, append_024) 12530 { 12531 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 12532 // LLA: OString expVal( kTestStr104 ); 12533 float input = (float)atof("-3.0625"); 12534 12535 sal_Int32 nLen = aStrBuf.getLength(); 12536 aStrBuf.append( input ); 12537 12538 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[3] append -3.0625"; 12539 12540 } 12541 12542 TEST_F(append_008_Float_Negative, append_025) 12543 { 12544 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 12545 // LLA: OString expVal( kTestStr105 ); 12546 float input = (float)atof("-3.502525"); 12547 12548 sal_Int32 nLen = aStrBuf.getLength(); 12549 aStrBuf.append( input ); 12550 12551 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[3] append -3.502525"; 12552 12553 } 12554 12555 TEST_F(append_008_Float_Negative, append_026) 12556 { 12557 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 12558 // LLA: OString expVal( kTestStr106 ); 12559 float input = (float)atof("-3.141592"); 12560 12561 sal_Int32 nLen = aStrBuf.getLength(); 12562 aStrBuf.append( input ); 12563 12564 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[3] append -3.141592"; 12565 12566 } 12567 12568 TEST_F(append_008_Float_Negative, append_027) 12569 { 12570 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 12571 // LLA: OString expVal( kTestStr107 ); 12572 float input = (float)atof("-3.5025255"); 12573 12574 sal_Int32 nLen = aStrBuf.getLength(); 12575 aStrBuf.append( input ); 12576 12577 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[3] append -3.5025255"; 12578 12579 } 12580 12581 TEST_F(append_008_Float_Negative, append_028) 12582 { 12583 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 12584 // LLA: OString expVal( kTestStr108 ); 12585 float input = (float)atof("-3.00390625"); 12586 12587 sal_Int32 nLen = aStrBuf.getLength(); 12588 aStrBuf.append( input ); 12589 12590 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[3] append -3.0039062"; 12591 12592 } 12593 12594 TEST_F(append_008_Float_Negative, append_029) 12595 { 12596 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 12597 // LLA: OString expVal( kTestStr109 ); 12598 float input = (float)atof("-3.0"); 12599 12600 sal_Int32 nLen = aStrBuf.getLength(); 12601 aStrBuf.append( input ); 12602 12603 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[4] append -3.0"; 12604 12605 } 12606 12607 TEST_F(append_008_Float_Negative, append_030) 12608 { 12609 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 12610 // LLA: OString expVal( kTestStr110 ); 12611 float input = (float)atof("-3.5"); 12612 12613 sal_Int32 nLen = aStrBuf.getLength(); 12614 aStrBuf.append( input ); 12615 12616 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[4] append -3.5"; 12617 12618 } 12619 12620 TEST_F(append_008_Float_Negative, append_031) 12621 { 12622 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 12623 // LLA: OString expVal( kTestStr111 ); 12624 float input = (float)atof("-3.0625"); 12625 12626 sal_Int32 nLen = aStrBuf.getLength(); 12627 aStrBuf.append( input ); 12628 12629 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[4] append -3.0625"; 12630 12631 } 12632 12633 TEST_F(append_008_Float_Negative, append_032) 12634 { 12635 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 12636 // LLA: OString expVal( kTestStr112 ); 12637 float input = (float)atof("-3.502525"); 12638 12639 sal_Int32 nLen = aStrBuf.getLength(); 12640 aStrBuf.append( input ); 12641 12642 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[4] append -3.502525"; 12643 12644 } 12645 12646 TEST_F(append_008_Float_Negative, append_033) 12647 { 12648 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 12649 // LLA: OString expVal( kTestStr113 ); 12650 float input = (float)atof("-3.141592"); 12651 12652 sal_Int32 nLen = aStrBuf.getLength(); 12653 aStrBuf.append( input ); 12654 12655 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[4] append -3.141592"; 12656 12657 } 12658 12659 TEST_F(append_008_Float_Negative, append_034) 12660 { 12661 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 12662 // LLA: OString expVal( kTestStr114 ); 12663 float input = (float)atof("-3.5025255"); 12664 12665 sal_Int32 nLen = aStrBuf.getLength(); 12666 aStrBuf.append( input ); 12667 12668 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[4] append -3.5025255"; 12669 12670 } 12671 12672 TEST_F(append_008_Float_Negative, append_035) 12673 { 12674 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 12675 // LLA: OString expVal( kTestStr115 ); 12676 float input = (float)atof("-3.00390625"); 12677 12678 sal_Int32 nLen = aStrBuf.getLength(); 12679 aStrBuf.append( input ); 12680 12681 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "arrOUS[4] append -3.0039062"; 12682 12683 } 12684 #ifdef WITH_CORE 12685 TEST_F(append_008_Float_Negative, append_036) 12686 { 12687 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 12688 // LLA: OString expVal( kTestStr102 ); 12689 float input = (float)atof("-3.0"); 12690 12691 sal_Int32 nLen = aStrBuf.getLength(); 12692 aStrBuf.append( input ); 12693 12694 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "OStringBuffer( kSInt32Max ) append -3.0"; 12695 12696 } 12697 12698 TEST_F(append_008_Float_Negative, append_037) 12699 { 12700 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 12701 // LLA: OString expVal( kTestStr103 ); 12702 float input = (float)atof("-3.5"); 12703 12704 sal_Int32 nLen = aStrBuf.getLength(); 12705 aStrBuf.append( input ); 12706 12707 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "OStringBuffer( kSInt32Max ) append -3.5"; 12708 12709 } 12710 12711 TEST_F(append_008_Float_Negative, append_038) 12712 { 12713 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 12714 // LLA: OString expVal( kTestStr104 ); 12715 float input = (float)atof("-3.0625"); 12716 12717 sal_Int32 nLen = aStrBuf.getLength(); 12718 aStrBuf.append( input ); 12719 12720 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "OStringBuffer( kSInt32Max ) append -3.0625"; 12721 12722 } 12723 12724 TEST_F(append_008_Float_Negative, append_039) 12725 { 12726 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 12727 // LLA: OString expVal( kTestStr105 ); 12728 float input = (float)atof("-3.502525"); 12729 12730 sal_Int32 nLen = aStrBuf.getLength(); 12731 aStrBuf.append( input ); 12732 12733 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "OStringBuffer( kSInt32Max ) append -3.502525"; 12734 12735 } 12736 12737 TEST_F(append_008_Float_Negative, append_040) 12738 { 12739 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 12740 // LLA: OString expVal( kTestStr106 ); 12741 float input = (float)atof("-3.141592"); 12742 12743 sal_Int32 nLen = aStrBuf.getLength(); 12744 aStrBuf.append( input ); 12745 12746 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "OStringBuffer( kSInt32Max ) append -3.141592"; 12747 12748 } 12749 12750 TEST_F(append_008_Float_Negative, append_041) 12751 { 12752 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 12753 // LLA: OString expVal( kTestStr107 ); 12754 float input = (float)atof("-3.5025255"); 12755 12756 sal_Int32 nLen = aStrBuf.getLength(); 12757 aStrBuf.append( input ); 12758 12759 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "OStringBuffer( kSInt32Max ) append -3.5025255"; 12760 12761 } 12762 12763 TEST_F(append_008_Float_Negative, append_042) 12764 { 12765 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 12766 // LLA: OString expVal( kTestStr108 ); 12767 float input = (float)atof("-3.00390625"); 12768 12769 sal_Int32 nLen = aStrBuf.getLength(); 12770 aStrBuf.append( input ); 12771 12772 ASSERT_TRUE(checkIfStrBufContainAtPosTheFloat(aStrBuf, nLen, input)) << "OStringBuffer( kSInt32Max ) append -3.0039062"; 12773 12774 } 12775 #endif 12776 12777 //------------------------------------------------------------------------ 12778 // testing the method append( double d ) 12779 //------------------------------------------------------------------------ 12780 12781 class checkdouble : public ::testing::Test 12782 { 12783 public: 12784 bool checkIfStrBufContainAtPosTheDouble(rtl::OStringBuffer const& _sStrBuf, sal_Int32 _nLen, double _nDouble) 12785 { 12786 OString sDoubleValue; 12787 sDoubleValue = rtl::OString::valueOf(_nDouble); 12788 12789 OString sBufferString(_sStrBuf.getStr()); 12790 sal_Int32 nPos = sBufferString.indexOf(sDoubleValue); 12791 if ( nPos >= 0 && nPos == _nLen) 12792 { 12793 return true; 12794 } 12795 return false; 12796 } 12797 }; 12798 12799 class append_009_double : public checkdouble 12800 { 12801 protected: 12802 OString* arrOUS[5]; 12803 12804 public: 12805 void SetUp() 12806 { 12807 arrOUS[0] = new OString( kTestStr7 ); 12808 arrOUS[1] = new OString( ); 12809 arrOUS[2] = new OString( kTestStr25 ); 12810 arrOUS[3] = new OString( "\0" ); 12811 arrOUS[4] = new OString( kTestStr28 ); 12812 12813 } 12814 12815 void TearDown() 12816 { 12817 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 12818 delete arrOUS[3]; delete arrOUS[4]; 12819 } 12820 }; 12821 12822 TEST_F(append_009_double, append_001) 12823 { 12824 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 12825 // LLA: OString expVal( kTestStr74 ); 12826 double input = atof("3.0"); 12827 12828 sal_Int32 nLen = aStrBuf.getLength(); 12829 aStrBuf.append( input ); 12830 12831 ASSERT_TRUE(checkIfStrBufContainAtPosTheDouble(aStrBuf, nLen, input)) << "arrOUS[0] append 3.0"; 12832 12833 } 12834 12835 /* 12836 TEST_F(append_009_double, append_002) 12837 { 12838 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 12839 OString expVal( kTestStr75 ); 12840 double input = atof("3.5"); 12841 12842 aStrBuf.append( input ); 12843 12844 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[0] append 3.5"; 12845 12846 } 12847 12848 TEST_F(append_009_double, append_003) 12849 { 12850 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 12851 OString expVal( kTestStr76 ); 12852 double input = atof("3.0625"); 12853 12854 aStrBuf.append( input ); 12855 12856 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[0] append 3.0625"; 12857 12858 } 12859 12860 TEST_F(append_009_double, append_004) 12861 { 12862 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 12863 OString expVal( kTestStr122 ); 12864 double input = atof("3.1415926535"); 12865 12866 aStrBuf.append( input ); 12867 12868 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[0] append 3.1415926535"; 12869 12870 } 12871 12872 TEST_F(append_009_double, append_005) 12873 { 12874 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 12875 OString expVal( kTestStr123 ); 12876 double input = atof("3.141592653589793"); 12877 12878 aStrBuf.append( input ); 12879 12880 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[0] append 3.141592653589793"; 12881 12882 } 12883 12884 TEST_F(append_009_double, append_006) 12885 { 12886 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 12887 OString expVal( kTestStr124 ); 12888 double input = atof("3.14159265358979323"); 12889 12890 aStrBuf.append( input ); 12891 12892 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[0] append 3.14159265358979323"; 12893 12894 } 12895 12896 TEST_F(append_009_double, append_007) 12897 { 12898 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 12899 OString expVal( kTestStr125 ); 12900 double input = atof("3.141592653589793238462643"); 12901 12902 aStrBuf.append( input ); 12903 12904 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[0] append 3.141592653589793238462643"; 12905 12906 } 12907 12908 TEST_F(append_009_double, append_008) 12909 { 12910 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 12911 OString expVal( kTestStr81 ); 12912 double input = atof("3.0"); 12913 12914 aStrBuf.append( input ); 12915 12916 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[1] append 3.0"; 12917 12918 } 12919 12920 TEST_F(append_009_double, append_009) 12921 { 12922 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 12923 OString expVal( kTestStr82 ); 12924 double input = atof("3.5"); 12925 12926 aStrBuf.append( input ); 12927 12928 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[1] append 3.5"; 12929 12930 } 12931 12932 TEST_F(append_009_double, append_010) 12933 { 12934 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 12935 OString expVal( kTestStr83 ); 12936 double input = atof("3.0625"); 12937 12938 aStrBuf.append( input ); 12939 12940 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[1] append 3.0625"; 12941 12942 } 12943 12944 TEST_F(append_009_double, append_011) 12945 { 12946 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 12947 OString expVal( kTestStr126 ); 12948 double input = atof("3.1415926535"); 12949 12950 aStrBuf.append( input ); 12951 12952 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[1] append 3.1415926535"; 12953 12954 } 12955 12956 TEST_F(append_009_double, append_012) 12957 { 12958 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 12959 OString expVal( kTestStr127 ); 12960 double input = atof("3.141592653589793"); 12961 12962 aStrBuf.append( input ); 12963 OString *result = new OString( aStrBuf.getStr()); 12964 double output = result->toDouble(); 12965 OString *final = new OString(); 12966 *final = final->valueOf(output); 12967 t_print("the OStringvalus is:"); 12968 for(int m=0;m<final->getLength();m++) 12969 { 12970 t_print("%c",final->pData->buffer[m]); 12971 } 12972 t_print("\n"); 12973 t_print("the OStringBuffer is %d\n", aStrBuf.getLength()); 12974 t_print("the expVal is %d\n", expVal.getLength()); 12975 t_print("the OStringbuffervalus is:"); 12976 for(int j=0;j<aStrBuf.getLength();j++) 12977 { 12978 t_print("%c",*(aStrBuf.getStr()+j)); 12979 } 12980 t_print("\n"); 12981 t_print("the expVlavalus is:"); 12982 for(int k=0;k<expVal.getLength();k++) 12983 { 12984 t_print("%c",expVal.pData->buffer[k]); 12985 } 12986 t_print("\n"); 12987 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[1] append 3.141592653589793"; 12988 12989 } 12990 12991 TEST_F(append_009_double, append_013) 12992 { 12993 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 12994 OString expVal( kTestStr128 ); 12995 double input = atof("3.14159265358979323"); 12996 12997 aStrBuf.append( input ); 12998 12999 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[1] append 3.14159265358979323"; 13000 13001 } 13002 13003 TEST_F(append_009_double, append_014) 13004 { 13005 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 13006 OString expVal( kTestStr129 ); 13007 double input = atof("3.141592653589793238462643"); 13008 13009 aStrBuf.append( input ); 13010 13011 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[1] append 3.141592653589793238462643"; 13012 13013 } 13014 13015 TEST_F(append_009_double, append_015) 13016 { 13017 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 13018 OString expVal( kTestStr81 ); 13019 double input = atof("3.0"); 13020 13021 aStrBuf.append( input ); 13022 13023 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[2] append 3.0"; 13024 13025 } 13026 13027 TEST_F(append_009_double, append_016) 13028 { 13029 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 13030 OString expVal( kTestStr82 ); 13031 double input = atof("3.5"); 13032 13033 aStrBuf.append( input ); 13034 13035 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[2] append 3.5"; 13036 13037 } 13038 13039 TEST_F(append_009_double, append_017) 13040 { 13041 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 13042 OString expVal( kTestStr83 ); 13043 double input = atof("3.0625"); 13044 13045 aStrBuf.append( input ); 13046 13047 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[2] append 3.0625"; 13048 13049 } 13050 13051 TEST_F(append_009_double, append_018) 13052 { 13053 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 13054 OString expVal( kTestStr126 ); 13055 double input = atof("3.1415926535"); 13056 13057 aStrBuf.append( input ); 13058 13059 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[2] append 3.1415926535"; 13060 13061 } 13062 13063 TEST_F(append_009_double, append_019) 13064 { 13065 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 13066 OString expVal( kTestStr127 ); 13067 double input = atof("3.141592653589793"); 13068 13069 aStrBuf.append( input ); 13070 13071 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[2] append 3.141592653589793"; 13072 13073 } 13074 13075 TEST_F(append_009_double, append_020) 13076 { 13077 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 13078 OString expVal( kTestStr128 ); 13079 double input = atof("3.14159265358979323"); 13080 13081 aStrBuf.append( input ); 13082 13083 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[2] append 3.14159265358979323"; 13084 13085 } 13086 13087 TEST_F(append_009_double, append_021) 13088 { 13089 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 13090 OString expVal( kTestStr129 ); 13091 double input = atof("3.141592653589793238462643"); 13092 13093 aStrBuf.append( input ); 13094 13095 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[2] append 3.141592653589793238462643"; 13096 13097 } 13098 13099 TEST_F(append_009_double, append_022) 13100 { 13101 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 13102 OString expVal( kTestStr81 ); 13103 double input = atof("3.0"); 13104 13105 aStrBuf.append( input ); 13106 13107 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[3] append 3.0"; 13108 13109 } 13110 13111 TEST_F(append_009_double, append_023) 13112 { 13113 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 13114 OString expVal( kTestStr82 ); 13115 double input = atof("3.5"); 13116 13117 aStrBuf.append( input ); 13118 13119 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[3] append 3.5"; 13120 13121 } 13122 13123 TEST_F(append_009_double, append_024) 13124 { 13125 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 13126 OString expVal( kTestStr83 ); 13127 double input = atof("3.0625"); 13128 13129 aStrBuf.append( input ); 13130 13131 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[3] append 3.0625"; 13132 13133 } 13134 13135 TEST_F(append_009_double, append_025) 13136 { 13137 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 13138 OString expVal( kTestStr126 ); 13139 double input = atof("3.1415926535"); 13140 13141 aStrBuf.append( input ); 13142 13143 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[3] append 3.1415926535"; 13144 13145 } 13146 13147 TEST_F(append_009_double, append_026) 13148 { 13149 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 13150 OString expVal( kTestStr127 ); 13151 double input = atof("3.141592653589793"); 13152 13153 aStrBuf.append( input ); 13154 13155 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[3] append 3.141592653589793"; 13156 13157 } 13158 13159 TEST_F(append_009_double, append_027) 13160 { 13161 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 13162 OString expVal( kTestStr128 ); 13163 double input = atof("3.14159265358979323"); 13164 13165 aStrBuf.append( input ); 13166 13167 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[1] append 3.14159265358979323"; 13168 13169 } 13170 13171 TEST_F(append_009_double, append_028) 13172 { 13173 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 13174 OString expVal( kTestStr129 ); 13175 double input = atof("3.141592653589793238462643"); 13176 13177 aStrBuf.append( input ); 13178 13179 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[3] append 3.141592653589793238462643"; 13180 13181 } 13182 13183 TEST_F(append_009_double, append_029) 13184 { 13185 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 13186 OString expVal( kTestStr88 ); 13187 double input = atof("3.0"); 13188 13189 aStrBuf.append( input ); 13190 13191 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[4] append 3.0"; 13192 13193 } 13194 13195 TEST_F(append_009_double, append_030) 13196 { 13197 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 13198 OString expVal( kTestStr89 ); 13199 double input = atof("3.5"); 13200 13201 aStrBuf.append( input ); 13202 13203 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[4] append 3.5"; 13204 13205 } 13206 13207 TEST_F(append_009_double, append_031) 13208 { 13209 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 13210 OString expVal( kTestStr90 ); 13211 double input = atof("3.0625"); 13212 13213 aStrBuf.append( input ); 13214 13215 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[4] append 3.0625"; 13216 13217 } 13218 13219 TEST_F(append_009_double, append_032) 13220 { 13221 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 13222 OString expVal( kTestStr130 ); 13223 double input = atof("3.1415926535"); 13224 13225 aStrBuf.append( input ); 13226 13227 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[4] append 3.1415926535"; 13228 13229 } 13230 13231 TEST_F(append_009_double, append_033) 13232 { 13233 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 13234 OString expVal( kTestStr131 ); 13235 double input = atof("3.141592653589793"); 13236 13237 aStrBuf.append( input ); 13238 13239 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[4] append 3.141592653589793"; 13240 13241 } 13242 13243 TEST_F(append_009_double, append_034) 13244 { 13245 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 13246 OString expVal( kTestStr132 ); 13247 double input = atof("3.14159265358979323"); 13248 13249 aStrBuf.append( input ); 13250 13251 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[4] append 3.14159265358979323"; 13252 13253 } 13254 */ 13255 TEST_F(append_009_double, append_035) 13256 { 13257 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 13258 // LLA: OString expVal( kTestStr133 ); 13259 double input = atof("3.141592653589793238462643"); 13260 13261 sal_Int32 nLen = aStrBuf.getLength(); 13262 aStrBuf.append( input ); 13263 13264 ASSERT_TRUE(checkIfStrBufContainAtPosTheDouble(aStrBuf, nLen, input)) << "arrOUS[4] append 3.141592653589793238462643"; 13265 13266 } 13267 /* 13268 #ifdef WITH_CORE 13269 TEST_F(append_009_double, append_036) 13270 { 13271 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 13272 OString expVal( kTestStr81 ); 13273 double input = atof("3.0"); 13274 13275 aStrBuf.append( input ); 13276 13277 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "OStringBuffer( kSInt32Max ) append 3.0"; 13278 13279 } 13280 13281 TEST_F(append_009_double, append_037) 13282 { 13283 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 13284 OString expVal( kTestStr82 ); 13285 double input = atof("3.5"); 13286 13287 aStrBuf.append( input ); 13288 13289 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "OStringBuffer( kSInt32Max ) append 3.5"; 13290 13291 } 13292 13293 TEST_F(append_009_double, append_038) 13294 { 13295 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 13296 OString expVal( kTestStr83 ); 13297 double input = atof("3.0625"); 13298 13299 aStrBuf.append( input ); 13300 13301 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "OStringBuffer( kSInt32Max ) append 3.0625"; 13302 13303 } 13304 13305 TEST_F(append_009_double, append_039) 13306 { 13307 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 13308 OString expVal( kTestStr126 ); 13309 double input = atof("3.1415926535"); 13310 13311 aStrBuf.append( input ); 13312 13313 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "OStringBuffer( kSInt32Max ) append 3.1415926535"; 13314 13315 } 13316 13317 TEST_F(append_009_double, append_040) 13318 { 13319 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 13320 OString expVal( kTestStr127 ); 13321 double input = atof("3.141592653589793"; 13322 13323 aStrBuf.append( input ); 13324 13325 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "OStringBuffer( kSInt32Max ) append 3.141592653589793"; 13326 13327 } 13328 13329 TEST_F(append_009_double, append_041) 13330 { 13331 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 13332 OString expVal( kTestStr128 ); 13333 double input = atof("3.14159265358979323"); 13334 13335 aStrBuf.append( input ); 13336 13337 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "OStringBuffer( kSInt32Max ) append 3.14159265358979323"; 13338 13339 } 13340 13341 TEST_F(append_009_double, append_042) 13342 { 13343 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 13344 OString expVal( kTestStr129 ); 13345 double input = atof("3.141592653589793238462643"); 13346 13347 aStrBuf.append( input ); 13348 13349 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "OStringBuffer( kSInt32Max ) append 3.141592653589793238462643"; 13350 13351 } 13352 #endif 13353 */ 13354 13355 //------------------------------------------------------------------------ 13356 // testing the method append( double f ) for negative value 13357 //------------------------------------------------------------------------ 13358 class append_009_Double_Negative : public checkdouble 13359 { 13360 protected: 13361 OString* arrOUS[5]; 13362 13363 public: 13364 void SetUp() 13365 { 13366 arrOUS[0] = new OString( kTestStr7 ); 13367 arrOUS[1] = new OString( ); 13368 arrOUS[2] = new OString( kTestStr25 ); 13369 arrOUS[3] = new OString( "\0" ); 13370 arrOUS[4] = new OString( kTestStr28 ); 13371 13372 } 13373 13374 void TearDown() 13375 { 13376 delete arrOUS[0]; delete arrOUS[1]; delete arrOUS[2]; 13377 delete arrOUS[3]; delete arrOUS[4]; 13378 } 13379 }; 13380 13381 TEST_F(append_009_Double_Negative, append_001) 13382 { 13383 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 13384 // LLA: OString expVal( kTestStr95 ); 13385 double input = atof("-3.0"); 13386 13387 sal_Int32 nLen = aStrBuf.getLength(); 13388 aStrBuf.append( input ); 13389 13390 ASSERT_TRUE(checkIfStrBufContainAtPosTheDouble(aStrBuf, nLen, input)) << "arrOUS[0] append -3.0"; 13391 13392 } 13393 /* 13394 TEST_F(append_009_Double_Negative, append_002) 13395 { 13396 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 13397 OString expVal( kTestStr96 ); 13398 double input = atof("-3.5"); 13399 13400 aStrBuf.append( input ); 13401 13402 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[0] append -3.5"; 13403 13404 } 13405 13406 TEST_F(append_009_Double_Negative, append_003) 13407 { 13408 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 13409 OString expVal( kTestStr97 ); 13410 double input = atof("-3.0625"); 13411 13412 aStrBuf.append( input ); 13413 13414 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[0] append -3.0625"; 13415 13416 } 13417 13418 TEST_F(append_009_Double_Negative, append_004) 13419 { 13420 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 13421 OString expVal( kTestStr98 ); 13422 double input = atof("-3.502525"); 13423 13424 aStrBuf.append( input ); 13425 13426 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[0] append -3.502525"; 13427 13428 } 13429 13430 TEST_F(append_009_Double_Negative, append_005) 13431 { 13432 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 13433 OString expVal( kTestStr134 ); 13434 double input = atof("-3.141592653589793"); 13435 13436 aStrBuf.append( input ); 13437 13438 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[0] append -3.141592653589793"; 13439 13440 } 13441 13442 TEST_F(append_009_Double_Negative, append_006) 13443 { 13444 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 13445 OString expVal( kTestStr135 ); 13446 double input = atof("-3.14159265358979323"); 13447 13448 aStrBuf.append( input ); 13449 13450 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[0] append -3.14159265358979323"; 13451 13452 } 13453 13454 TEST_F(append_009_Double_Negative, append_007) 13455 { 13456 ::rtl::OStringBuffer aStrBuf( *arrOUS[0] ); 13457 OString expVal( kTestStr136 ); 13458 double input = atof("-3.141592653589793238462643"); 13459 13460 aStrBuf.append( input ); 13461 13462 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[0] append -3.141592653589793238462643"; 13463 13464 } 13465 13466 TEST_F(append_009_Double_Negative, append_008) 13467 { 13468 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 13469 OString expVal( kTestStr102 ); 13470 double input = atof("-3.0"); 13471 13472 aStrBuf.append( input ); 13473 13474 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[1] append -3.0"; 13475 13476 } 13477 13478 TEST_F(append_009_Double_Negative, append_009) 13479 { 13480 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 13481 OString expVal( kTestStr103 ); 13482 double input = atof("-3.5"); 13483 13484 aStrBuf.append( input ); 13485 13486 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[1] append -3.5"; 13487 13488 } 13489 13490 TEST_F(append_009_Double_Negative, append_010) 13491 { 13492 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 13493 OString expVal( kTestStr104 ); 13494 double input = atof("-3.0625"); 13495 13496 aStrBuf.append( input ); 13497 OString *result = new OString( aStrBuf.getStr()); 13498 double output = result->toDouble(); 13499 OString *final = new OString(); 13500 *final = final->valueOf(output); 13501 t_print("the OStringvalus is:"); 13502 for(int m=0;m<final->getLength();m++) 13503 { 13504 t_print("%c",final->pData->buffer[m]); 13505 } 13506 t_print("\n"); 13507 t_print("the OStringBuffer is %d\n", aStrBuf.getLength()); 13508 t_print("the expVal is %d\n", expVal.getLength()); 13509 t_print("the OStringbuffervalus is:"); 13510 for(int j=0;j<aStrBuf.getLength();j++) 13511 { 13512 t_print("%c",*(aStrBuf.getStr()+j)); 13513 } 13514 t_print("\n"); 13515 t_print("the expVlavalus is:"); 13516 for(int k=0;k<expVal.getLength();k++) 13517 { 13518 t_print("%c",expVal.pData->buffer[k]); 13519 } 13520 t_print("\n"); 13521 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[1] append -3.0625"; 13522 13523 } 13524 13525 TEST_F(append_009_Double_Negative, append_011) 13526 { 13527 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 13528 OString expVal( kTestStr105 ); 13529 double input = atof("-3.502525"); 13530 13531 aStrBuf.append( input ); 13532 13533 double output = atof("-3.50252"); 13534 OString *final = new OString(); 13535 *final = final->valueOf(output); 13536 t_print("the OStringvalus is:"); 13537 for(int m=0;m<final->getLength();m++) 13538 { 13539 t_print("%c",final->pData->buffer[m]); 13540 } 13541 t_print("\n"); 13542 t_print("the OStringBuffer is %d\n", aStrBuf.getLength()); 13543 t_print("the expVal is %d\n", expVal.getLength()); 13544 t_print("the OStringbuffervalus is:"); 13545 for(int j=0;j<aStrBuf.getLength();j++) 13546 { 13547 t_print("%c",*(aStrBuf.getStr()+j)); 13548 } 13549 t_print("\n"); 13550 t_print("the expVlavalus is:"); 13551 for(int k=0;k<expVal.getLength();k++) 13552 { 13553 t_print("%c",expVal.pData->buffer[k]); 13554 } 13555 t_print("\n"); 13556 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[1] append -3.502525"; 13557 13558 } 13559 13560 TEST_F(append_009_Double_Negative, append_012) 13561 { 13562 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 13563 OString expVal( kTestStr137 ); 13564 double input = atof("-3.141592653589793"); 13565 13566 aStrBuf.append( input ); 13567 13568 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[1] append -3.141592653589793"; 13569 13570 } 13571 13572 TEST_F(append_009_Double_Negative, append_013) 13573 { 13574 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 13575 OString expVal( kTestStr138 ); 13576 double input = atof("-3.14159265358979323"); 13577 13578 aStrBuf.append( input ); 13579 13580 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[1] append -3.14159265358979323"; 13581 13582 } 13583 13584 TEST_F(append_009_Double_Negative, append_014) 13585 { 13586 ::rtl::OStringBuffer aStrBuf( *arrOUS[1] ); 13587 OString expVal( kTestStr139 ); 13588 double input = atof("-3.141592653589793238462643"); 13589 13590 aStrBuf.append( input ); 13591 13592 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[1] append -3.141592653589793238462643"; 13593 13594 } 13595 13596 TEST_F(append_009_Double_Negative, append_015) 13597 { 13598 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 13599 OString expVal( kTestStr102 ); 13600 double input = atof("-3.0"); 13601 13602 aStrBuf.append( input ); 13603 13604 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[2] append -3.0"; 13605 13606 } 13607 13608 TEST_F(append_009_Double_Negative, append_016) 13609 { 13610 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 13611 OString expVal( kTestStr103 ); 13612 double input = atof("-3.5"); 13613 13614 aStrBuf.append( input ); 13615 13616 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[2] append -3.5"; 13617 13618 } 13619 13620 TEST_F(append_009_Double_Negative, append_017) 13621 { 13622 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 13623 OString expVal( kTestStr104 ); 13624 double input = atof("-3.0625"); 13625 13626 aStrBuf.append( input ); 13627 13628 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[2] append -3.0625"; 13629 13630 } 13631 13632 TEST_F(append_009_Double_Negative, append_018) 13633 { 13634 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 13635 OString expVal( kTestStr105 ); 13636 double input = atof("-3.502525"); 13637 13638 aStrBuf.append( input ); 13639 13640 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[2] append -3.502525"; 13641 13642 } 13643 13644 TEST_F(append_009_Double_Negative, append_019) 13645 { 13646 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 13647 OString expVal( kTestStr137 ); 13648 double input = atof("-3.141592653589793"); 13649 13650 aStrBuf.append( input ); 13651 13652 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[2] append -3.141592653589793"; 13653 13654 } 13655 13656 TEST_F(append_009_Double_Negative, append_020) 13657 { 13658 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 13659 OString expVal( kTestStr138 ); 13660 double input = atof("-3.14159265358979323"); 13661 13662 aStrBuf.append( input ); 13663 13664 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[2] append -3.14159265358979323"; 13665 13666 } 13667 13668 TEST_F(append_009_Double_Negative, append_021) 13669 { 13670 ::rtl::OStringBuffer aStrBuf( *arrOUS[2] ); 13671 OString expVal( kTestStr139 ); 13672 double input = atof("-3.141592653589793238462643"); 13673 13674 aStrBuf.append( input ); 13675 13676 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[2] append -3.141592653589793238462643"; 13677 13678 } 13679 13680 TEST_F(append_009_Double_Negative, append_022) 13681 { 13682 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 13683 OString expVal( kTestStr102 ); 13684 double input = atof("-3.0"); 13685 13686 aStrBuf.append( input ); 13687 13688 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[3] append -3.0"; 13689 13690 } 13691 13692 TEST_F(append_009_Double_Negative, append_023) 13693 { 13694 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 13695 OString expVal( kTestStr103 ); 13696 double input = atof("-3.5"); 13697 13698 aStrBuf.append( input ); 13699 13700 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[3] append -3.5"; 13701 13702 } 13703 13704 TEST_F(append_009_Double_Negative, append_024) 13705 { 13706 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 13707 OString expVal( kTestStr104 ); 13708 double input = atof("-3.0625"); 13709 13710 aStrBuf.append( input ); 13711 13712 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[3] append -3.0625"; 13713 13714 } 13715 13716 TEST_F(append_009_Double_Negative, append_025) 13717 { 13718 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 13719 OString expVal( kTestStr105 ); 13720 double input = atof("-3.502525"); 13721 13722 aStrBuf.append( input ); 13723 13724 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[3] append -3.502525"; 13725 13726 } 13727 13728 TEST_F(append_009_Double_Negative, append_026) 13729 { 13730 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 13731 OString expVal( kTestStr137 ); 13732 double input = atof("-3.141592653589793"); 13733 13734 aStrBuf.append( input ); 13735 13736 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[3] append -3.141592653589793"; 13737 13738 } 13739 13740 TEST_F(append_009_Double_Negative, append_027) 13741 { 13742 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 13743 OString expVal( kTestStr138 ); 13744 double input = atof("-3.14159265358979323"); 13745 13746 aStrBuf.append( input ); 13747 13748 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[1] append -3.14159265358979323"; 13749 13750 } 13751 13752 TEST_F(append_009_Double_Negative, append_028) 13753 { 13754 ::rtl::OStringBuffer aStrBuf( *arrOUS[3] ); 13755 OString expVal( kTestStr139 ); 13756 double input = atof("-3.141592653589793238462643"); 13757 13758 aStrBuf.append( input ); 13759 13760 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[3] append -3.141592653589793238462643"; 13761 13762 } 13763 13764 TEST_F(append_009_Double_Negative, append_029) 13765 { 13766 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 13767 OString expVal( kTestStr109 ); 13768 double input = atof("-3.0"); 13769 13770 aStrBuf.append( input ); 13771 13772 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[4] append -3.0"; 13773 13774 } 13775 13776 TEST_F(append_009_Double_Negative, append_030) 13777 { 13778 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 13779 OString expVal( kTestStr110 ); 13780 double input = atof("-3.5"); 13781 13782 aStrBuf.append( input ); 13783 13784 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[4] append -3.5"; 13785 13786 } 13787 13788 TEST_F(append_009_Double_Negative, append_031) 13789 { 13790 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 13791 OString expVal( kTestStr111 ); 13792 double input = atof("-3.0625"); 13793 13794 aStrBuf.append( input ); 13795 13796 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[4] append -3.0625"; 13797 13798 } 13799 13800 TEST_F(append_009_Double_Negative, append_032) 13801 { 13802 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 13803 OString expVal( kTestStr112 ); 13804 double input = atof("-3.502525"); 13805 13806 aStrBuf.append( input ); 13807 13808 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[4] append -3.502525"; 13809 13810 } 13811 13812 TEST_F(append_009_Double_Negative, append_033) 13813 { 13814 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 13815 OString expVal( kTestStr140 ); 13816 double input = atof("-3.141592653589793"); 13817 13818 aStrBuf.append( input ); 13819 13820 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[4] append -3.141592653589793"; 13821 13822 } 13823 13824 TEST_F(append_009_Double_Negative, append_034) 13825 { 13826 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 13827 OString expVal( kTestStr141 ); 13828 double input = atof("-3.14159265358979323"); 13829 13830 aStrBuf.append( input ); 13831 13832 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "arrOUS[4] append -3.14159265358979323"; 13833 13834 } 13835 13836 */ 13837 TEST_F(append_009_Double_Negative, append_035) 13838 { 13839 ::rtl::OStringBuffer aStrBuf( *arrOUS[4] ); 13840 // LLA: OString expVal( kTestStr142 ); 13841 double input = atof("-3.141592653589793238462643"); 13842 13843 sal_Int32 nLen = aStrBuf.getLength(); 13844 aStrBuf.append( input ); 13845 13846 ASSERT_TRUE(checkIfStrBufContainAtPosTheDouble(aStrBuf, nLen, input)) << "arrOUS[4] append -3.141592653589793238462643"; 13847 13848 } 13849 /* 13850 #ifdef WITH_CORE 13851 TEST_F(append_009_Double_Negative, append_036) 13852 { 13853 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 13854 OString expVal( kTestStr102 ); 13855 double input = atof("-3.0"); 13856 13857 aStrBuf.append( input ); 13858 13859 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "OStringBuffer( kSInt32Max ) append -3.0"; 13860 13861 } 13862 13863 TEST_F(append_009_Double_Negative, append_037) 13864 { 13865 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 13866 OString expVal( kTestStr103 ); 13867 double input = atof("-3.5"); 13868 13869 aStrBuf.append( input ); 13870 13871 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "OStringBuffer( kSInt32Max ) append -3.5"; 13872 13873 } 13874 13875 TEST_F(append_009_Double_Negative, append_038) 13876 { 13877 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 13878 OString expVal( kTestStr104 ); 13879 double input = atof("-3.0625"); 13880 13881 aStrBuf.append( input ); 13882 13883 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "OStringBuffer( kSInt32Max ) append -3.0625"; 13884 13885 } 13886 13887 TEST_F(append_009_Double_Negative, append_039) 13888 { 13889 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 13890 OString expVal( kTestStr105 ); 13891 double input = atof("-3.502525"); 13892 13893 aStrBuf.append( input ); 13894 13895 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "OStringBuffer( kSInt32Max ) append -3.502525"; 13896 13897 } 13898 13899 TEST_F(append_009_Double_Negative, append_040) 13900 { 13901 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 13902 OString expVal( kTestStr137 ); 13903 double input = atof("-3.141592653589793"); 13904 13905 aStrBuf.append( input ); 13906 13907 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "OStringBuffer( kSInt32Max ) append -3.141592653589793"; 13908 13909 } 13910 13911 TEST_F(append_009_Double_Negative, append_041) 13912 { 13913 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 13914 OString expVal( kTestStr138 ); 13915 double input = atof("-3.14159265358979323"); 13916 13917 aStrBuf.append( input ); 13918 13919 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "OStringBuffer( kSInt32Max ) append -3.14159265358979323"; 13920 13921 } 13922 13923 TEST_F(append_009_Double_Negative, append_042) 13924 { 13925 ::rtl::OStringBuffer aStrBuf( kSInt32Max ); 13926 OString expVal( kTestStr139 ); 13927 double input = atof("-3.141592653589793238462643"); 13928 13929 aStrBuf.append( input ); 13930 13931 ASSERT_TRUE(aStrBuf == expVal && aStrBuf.getLength() == expVal.getLength()) << "OStringBuffer( kSInt32Max ) append -3.141592653589793238462643"; 13932 13933 } 13934 #endif 13935 */ 13936 13937 } // namespace rtl_OStringBuffer 13938 13939 13940 int main(int argc, char **argv) 13941 { 13942 ::testing::InitGoogleTest(&argc, argv); 13943 return RUN_ALL_TESTS(); 13944 } 13945