- Timestamp:
- Sep 11, 2018 11:38:01 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstRTCRest-1.cpp
r74193 r74194 1535 1535 RTTESTI_CHECK_RC(Arr2.insert(2, new MyRestInt16(2)), VINF_SUCCESS); 1536 1536 verifyArray(Arr2, __LINE__, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9); 1537 RTTESTI_CHECK_MSG(MyRestInt16::s_cInstances == Arr2.size(), ("%zu vs %zu\n", MyRestInt16::s_cInstances, Arr2.size())); 1537 1538 1538 1539 RTTESTI_CHECK(Arr2.size() == 10); … … 1541 1542 { 1542 1543 MyRestInt16 *pCur = Arr2.at(i); 1543 RTTESTI_CHECK(pCur->m_iValue == i);1544 RTTESTI_CHECK(pCur->m_iValue == (int16_t)i); 1544 1545 1545 1546 MyRestInt16 const *pCur2 = pConstArr2->at(i); 1546 RTTESTI_CHECK(pCur2->m_iValue == i);1547 RTTESTI_CHECK(pCur2->m_iValue == (int16_t)i); 1547 1548 } 1548 1549 … … 1558 1559 RTTESTI_CHECK_RC(Arr2.replaceCopy(2, MyRestInt16(2)), VWRN_ALREADY_EXISTS); 1559 1560 verifyArray(Arr2, __LINE__, 11, 0, 1, 2, 3, 4, 5, 6, 77, 8, 9, 10); 1561 RTTESTI_CHECK_MSG(MyRestInt16::s_cInstances == Arr2.size(), ("%zu vs %zu\n", MyRestInt16::s_cInstances, Arr2.size())); 1560 1562 1561 1563 /* copy constructor: */ … … 1565 1567 } 1566 1568 verifyArray(Arr2, __LINE__, 11, 0, 1, 2, 3, 4, 5, 6, 77, 8, 9, 10); 1569 RTTESTI_CHECK_MSG(MyRestInt16::s_cInstances == Arr2.size(), ("%zu vs %zu\n", MyRestInt16::s_cInstances, Arr2.size())); 1567 1570 1568 1571 { … … 1573 1576 } 1574 1577 verifyArray(Arr2, __LINE__, 11, 0, 1, 2, 3, 4, 5, 6, 77, 8, 9, 10); 1575 1576 /* copy method: */ 1578 RTTESTI_CHECK_MSG(MyRestInt16::s_cInstances == Arr2.size(), ("%zu vs %zu\n", MyRestInt16::s_cInstances, Arr2.size())); 1579 1580 /* copy method + clear: */ 1577 1581 { 1578 1582 RTCRestArray<MyRestInt16> Arr2Copy3; … … 1586 1590 } 1587 1591 verifyArray(Arr2, __LINE__, 11, 0, 1, 2, 3, 4, 5, 6, 77, 8, 9, 10); 1592 RTTESTI_CHECK_MSG(MyRestInt16::s_cInstances == Arr2.size(), ("%zu vs %zu\n", MyRestInt16::s_cInstances, Arr2.size())); 1593 1594 /* Check setNull and resetToDefaults with copies: */ 1595 { 1596 RTCRestArray<MyRestInt16> Arr2Copy4(Arr2); 1597 verifyArray(Arr2Copy4, __LINE__, 11, 0, 1, 2, 3, 4, 5, 6, 77, 8, 9, 10); 1598 1599 RTTESTI_CHECK_RC(Arr2Copy4.setNull(), VINF_SUCCESS); 1600 verifyArray(Arr2Copy4, __LINE__, 0); 1601 RTTESTI_CHECK_MSG(MyRestInt16::s_cInstances == Arr2.size(), ("%zu vs %zu\n", MyRestInt16::s_cInstances, Arr2.size())); 1602 RTTESTI_CHECK(Arr2Copy4.isNull() == true); 1603 1604 RTTESTI_CHECK_RC(Arr2Copy4.resetToDefault(), VINF_SUCCESS); 1605 RTTESTI_CHECK(Arr2Copy4.isNull() == false); 1606 verifyArray(Arr2Copy4, __LINE__, 0); 1607 } 1608 verifyArray(Arr2, __LINE__, 11, 0, 1, 2, 3, 4, 5, 6, 77, 8, 9, 10); 1609 { 1610 RTCRestArray<MyRestInt16> Arr2Copy5(Arr2); 1611 verifyArray(Arr2Copy5, __LINE__, 11, 0, 1, 2, 3, 4, 5, 6, 77, 8, 9, 10); 1612 1613 RTTESTI_CHECK_RC(Arr2Copy5.resetToDefault(), VINF_SUCCESS); 1614 verifyArray(Arr2Copy5, __LINE__, 0); 1615 RTTESTI_CHECK_MSG(MyRestInt16::s_cInstances == Arr2.size(), ("%zu vs %zu\n", MyRestInt16::s_cInstances, Arr2.size())); 1616 RTTESTI_CHECK(Arr2Copy5.isNull() == false); 1617 1618 RTTESTI_CHECK_RC(Arr2Copy5.setNull(), VINF_SUCCESS); 1619 RTTESTI_CHECK(Arr2Copy5.isNull() == true); 1620 1621 RTTESTI_CHECK_RC(Arr2Copy5.append(new MyRestInt16(100)), VINF_SUCCESS); 1622 RTTESTI_CHECK(Arr2Copy5.isNull() == false); 1623 verifyArray(Arr2Copy5, __LINE__, 1, 100); 1624 RTTESTI_CHECK_MSG(MyRestInt16::s_cInstances == Arr2.size() + 1, ("%zu vs %zu\n", MyRestInt16::s_cInstances, Arr2.size() + 1)); 1625 } 1626 verifyArray(Arr2, __LINE__, 11, 0, 1, 2, 3, 4, 5, 6, 77, 8, 9, 10); 1627 1588 1628 RTTESTI_CHECK_MSG(MyRestInt16::s_cInstances == Arr2.size(), ("%zu vs %zu\n", MyRestInt16::s_cInstances, Arr2.size())); 1589 1629 } … … 1640 1680 RTTESTI_CHECK_RC(Arr3.removeAt(i), VINF_SUCCESS); 1641 1681 cElements--; 1642 RTTESTI_CHECK( Arr3.size() == cElements);1682 RTTESTI_CHECK((ssize_t)Arr3.size() == cElements); 1643 1683 } 1644 1684
Note:
See TracChangeset
for help on using the changeset viewer.