Changeset 93715 in vbox
- Timestamp:
- Feb 14, 2022 10:34:27 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cpp/hardavlrange.h
r93712 r93715 478 478 * @param a_ppFound Where to return the pointer to the node. 479 479 */ 480 int lookupMatchingOr Smaller(RTCHardAvlTreeSlabAllocator<NodeType> *a_pAllocator, KeyType a_Key,481 480 int lookupMatchingOrBelow(RTCHardAvlTreeSlabAllocator<NodeType> *a_pAllocator, KeyType a_Key, 481 NodeType **a_ppFound) RT_NOEXCEPT 482 482 { 483 483 *a_ppFound = NULL; … … 558 558 * @param a_ppFound Where to return the pointer to the node. 559 559 */ 560 int lookupMatchingOr Larger(RTCHardAvlTreeSlabAllocator<NodeType> *a_pAllocator, KeyType a_Key,561 560 int lookupMatchingOrAbove(RTCHardAvlTreeSlabAllocator<NodeType> *a_pAllocator, KeyType a_Key, 561 NodeType **a_ppFound) RT_NOEXCEPT 562 562 { 563 563 *a_ppFound = NULL; -
trunk/src/VBox/Runtime/testcase/tstRTAvl.cpp
r93712 r93715 1419 1419 /* pre-removal lookup tests */ 1420 1420 MYTESTNODE *pNode = (MYTESTNODE *)(intptr_t)i; 1421 int rc = Tree.lookupMatchingOr Smaller(&Allocator, Key, &pNode);1421 int rc = Tree.lookupMatchingOrBelow(&Allocator, Key, &pNode); 1422 1422 if (rc != VINF_SUCCESS) 1423 RTTestIFailed("pre-remove lookupMatchingOr Smallerfailed: %Rrc, i=%#x, idx=%#x (%RGp ... %RGp)",1423 RTTestIFailed("pre-remove lookupMatchingOrBelow failed: %Rrc, i=%#x, idx=%#x (%RGp ... %RGp)", 1424 1424 rc, i, idx, Key, Key + cbStep - 1); 1425 1425 else if (pNode->Key != Key) 1426 RTTestIFailed("pre-remove lookupMatchingOr Smallerreturned the wrong node: Key=%RGp, expected %RGp", pNode->Key, Key);1426 RTTestIFailed("pre-remove lookupMatchingOrBelow returned the wrong node: Key=%RGp, expected %RGp", pNode->Key, Key); 1427 1427 1428 1428 pNode = (MYTESTNODE *)(intptr_t)i; 1429 rc = Tree.lookupMatchingOr Larger(&Allocator, Key, &pNode);1429 rc = Tree.lookupMatchingOrAbove(&Allocator, Key, &pNode); 1430 1430 if (rc != VINF_SUCCESS) 1431 RTTestIFailed("pre-remove lookupMatchingOr Largerfailed: %Rrc, i=%#x, idx=%#x (%RGp ... %RGp)",1431 RTTestIFailed("pre-remove lookupMatchingOrAbove failed: %Rrc, i=%#x, idx=%#x (%RGp ... %RGp)", 1432 1432 rc, i, idx, Key, Key + cbStep - 1); 1433 1433 else if (pNode->Key != Key) 1434 RTTestIFailed("pre-remove lookupMatchingOr Largerreturned the wrong node: Key=%RGp, expected %RGp", pNode->Key, Key);1434 RTTestIFailed("pre-remove lookupMatchingOrAbove returned the wrong node: Key=%RGp, expected %RGp", pNode->Key, Key); 1435 1435 1436 1436 /* remove */ … … 1468 1468 /* post-removal lookup tests */ 1469 1469 pNode = (MYTESTNODE *)(intptr_t)i; 1470 rc = Tree.lookupMatchingOr Smaller(&Allocator, Key, &pNode);1470 rc = Tree.lookupMatchingOrBelow(&Allocator, Key, &pNode); 1471 1471 uint32_t idxAbove; 1472 1472 if (rc == VINF_SUCCESS) … … 1476 1476 idxAbove = (uint32_t)ASMBitNextSet(pbmPresent, cItems, idxRet); 1477 1477 if (idxAbove <= idx) 1478 RTTestIFailed("post-remove lookupMatchingOr Smallerwrong: idxRet=%#x idx=%#x idxAbove=%#x",1478 RTTestIFailed("post-remove lookupMatchingOrBelow wrong: idxRet=%#x idx=%#x idxAbove=%#x", 1479 1479 idxRet, idx, idxAbove); 1480 1480 } … … 1483 1483 idxAbove = (uint32_t)ASMBitFirstSet(pbmPresent, cItems); 1484 1484 if (idxAbove <= idx) 1485 RTTestIFailed("post-remove lookupMatchingOr Smallerwrong: VERR_NOT_FOUND idx=%#x idxAbove=%#x", idx, idxAbove);1485 RTTestIFailed("post-remove lookupMatchingOrBelow wrong: VERR_NOT_FOUND idx=%#x idxAbove=%#x", idx, idxAbove); 1486 1486 } 1487 1487 else 1488 1488 { 1489 RTTestIFailed("post-remove lookupMatchingOr Smallerfailed: %Rrc, i=%#x, idx=%#x (%RGp ... %RGp)",1489 RTTestIFailed("post-remove lookupMatchingOrBelow failed: %Rrc, i=%#x, idx=%#x (%RGp ... %RGp)", 1490 1490 rc, i, idx, Key, Key + cbStep - 1); 1491 1491 idxAbove = (uint32_t)ASMBitNextSet(pbmPresent, cItems, idx); … … 1493 1493 1494 1494 pNode = (MYTESTNODE *)(intptr_t)i; 1495 rc = Tree.lookupMatchingOr Larger(&Allocator, Key, &pNode);1495 rc = Tree.lookupMatchingOrAbove(&Allocator, Key, &pNode); 1496 1496 if (rc == VINF_SUCCESS) 1497 1497 { 1498 1498 uint32_t idxRet = pNode->Key / cbStep; 1499 1499 if (idxRet != idxAbove) 1500 RTTestIFailed("post-remove lookupMatchingOr Largerwrong: idxRet=%#x idxAbove=%#x idx=%#x",1500 RTTestIFailed("post-remove lookupMatchingOrAbove wrong: idxRet=%#x idxAbove=%#x idx=%#x", 1501 1501 idxRet, idxAbove, idx); 1502 1502 } … … 1504 1504 { 1505 1505 if (idxAbove != UINT32_MAX) 1506 RTTestIFailed("post-remove lookupMatchingOr Largerwrong: VERR_NOT_FOUND idxAbove=%#x idx=%#x", idxAbove, idx);1506 RTTestIFailed("post-remove lookupMatchingOrAbove wrong: VERR_NOT_FOUND idxAbove=%#x idx=%#x", idxAbove, idx); 1507 1507 } 1508 1508 else 1509 1509 { 1510 RTTestIFailed("post-remove lookupMatchingOr Largerfailed: %Rrc, i=%#x, idx=%#x (%RGp ... %RGp) idxAbove=%#x",1510 RTTestIFailed("post-remove lookupMatchingOrAbove failed: %Rrc, i=%#x, idx=%#x (%RGp ... %RGp) idxAbove=%#x", 1511 1511 rc, i, idx, Key, Key + cbStep - 1, idxAbove); 1512 1512 }
Note:
See TracChangeset
for help on using the changeset viewer.