| 519 | } |
| 520 | |
| 521 | void QStack1(QStack<int> intStackArg) |
| 522 | { |
| 523 | for (int i = 0; i <= intStackArg.size(); ++i) { |
| 524 | // cppcheck-suppress stlOutOfBounds |
| 525 | intStackArg[i] = 1; |
| 526 | } |
| 527 | // cppcheck-suppress containerOutOfBoundsIndexExpression |
| 528 | intStackArg[intStackArg.length()] = 5; |
| 529 | // cppcheck-suppress containerOutOfBoundsIndexExpression |
| 530 | intStackArg[intStackArg.count()] = 10; |
| 531 | // cppcheck-suppress containerOutOfBoundsIndexExpression |
| 532 | printf("val: %d\n", intStackArg[intStackArg.size()]); |
| 533 | |
| 534 | QStack<QString> qstringStack1; |
| 535 | qstringStack1.push("one"); |
| 536 | qstringStack1.push("two"); |
| 537 | (void)qstringStack1[1]; |
| 538 | |
| 539 | QStack<QString> qstringStack2; |
| 540 | qstringStack2 << "one" << "two"; |
| 541 | (void)qstringStack2[1]; |
| 542 | // FIXME: The following should have a containerOutOfBounds suppression #9242 |
| 543 | (void)qstringStack2[3]; |
| 544 | // cppcheck-suppress ignoredReturnValue |
| 545 | qstringStack2.startsWith("one"); |
| 546 | // cppcheck-suppress ignoredReturnValue |
| 547 | qstringStack2.endsWith("one"); |
| 548 | // cppcheck-suppress ignoredReturnValue |
| 549 | qstringStack2.count(); |
| 550 | // cppcheck-suppress ignoredReturnValue |
| 551 | qstringStack2.length(); |
| 552 | // cppcheck-suppress ignoredReturnValue |
| 553 | qstringStack2.size(); |
| 554 | // cppcheck-suppress ignoredReturnValue |
| 555 | qstringStack2.at(5); |
| 556 | // cppcheck-suppress invalidFunctionArg |
| 557 | (void)qstringStack2.at(-5); |
| 558 | } |
| 559 | |
| 560 | QStack<int>::iterator QStack2() |
| 561 | { |
nothing calls this directly
no test coverage detected