VirtualBox

Changeset 93715 in vbox


Ignore:
Timestamp:
Feb 14, 2022 10:34:27 AM (3 years ago)
Author:
vboxsync
Message:

IPRT/hardavl: Renamed lookupMatchingOrSmaller to lookupMatchingOrBelow and lookupMatchingOrLarger to lookupMatchingOrAbove. bugref:10093

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/cpp/hardavlrange.h

    r93712 r93715  
    478478     * @param     a_ppFound     Where to return the pointer to the node.
    479479     */
    480     int lookupMatchingOrSmaller(RTCHardAvlTreeSlabAllocator<NodeType> *a_pAllocator, KeyType a_Key,
    481                                 NodeType **a_ppFound) RT_NOEXCEPT
     480    int lookupMatchingOrBelow(RTCHardAvlTreeSlabAllocator<NodeType> *a_pAllocator, KeyType a_Key,
     481                              NodeType **a_ppFound) RT_NOEXCEPT
    482482    {
    483483        *a_ppFound = NULL;
     
    558558     * @param     a_ppFound     Where to return the pointer to the node.
    559559     */
    560     int lookupMatchingOrLarger(RTCHardAvlTreeSlabAllocator<NodeType> *a_pAllocator, KeyType a_Key,
    561                                NodeType **a_ppFound) RT_NOEXCEPT
     560    int lookupMatchingOrAbove(RTCHardAvlTreeSlabAllocator<NodeType> *a_pAllocator, KeyType a_Key,
     561                              NodeType **a_ppFound) RT_NOEXCEPT
    562562    {
    563563        *a_ppFound = NULL;
  • trunk/src/VBox/Runtime/testcase/tstRTAvl.cpp

    r93712 r93715  
    14191419        /* pre-removal lookup tests */
    14201420        MYTESTNODE *pNode = (MYTESTNODE *)(intptr_t)i;
    1421         int rc = Tree.lookupMatchingOrSmaller(&Allocator, Key, &pNode);
     1421        int rc = Tree.lookupMatchingOrBelow(&Allocator, Key, &pNode);
    14221422        if (rc != VINF_SUCCESS)
    1423             RTTestIFailed("pre-remove lookupMatchingOrSmaller failed: %Rrc, i=%#x, idx=%#x (%RGp ... %RGp)",
     1423            RTTestIFailed("pre-remove lookupMatchingOrBelow failed: %Rrc, i=%#x, idx=%#x (%RGp ... %RGp)",
    14241424                          rc, i, idx, Key, Key + cbStep - 1);
    14251425        else if (pNode->Key != Key)
    1426             RTTestIFailed("pre-remove lookupMatchingOrSmaller returned 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);
    14271427
    14281428        pNode = (MYTESTNODE *)(intptr_t)i;
    1429         rc = Tree.lookupMatchingOrLarger(&Allocator, Key, &pNode);
     1429        rc = Tree.lookupMatchingOrAbove(&Allocator, Key, &pNode);
    14301430        if (rc != VINF_SUCCESS)
    1431             RTTestIFailed("pre-remove lookupMatchingOrLarger failed: %Rrc, i=%#x, idx=%#x (%RGp ... %RGp)",
     1431            RTTestIFailed("pre-remove lookupMatchingOrAbove failed: %Rrc, i=%#x, idx=%#x (%RGp ... %RGp)",
    14321432                          rc, i, idx, Key, Key + cbStep - 1);
    14331433        else if (pNode->Key != Key)
    1434             RTTestIFailed("pre-remove lookupMatchingOrLarger returned 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);
    14351435
    14361436        /* remove */
     
    14681468            /* post-removal lookup tests */
    14691469            pNode = (MYTESTNODE *)(intptr_t)i;
    1470             rc = Tree.lookupMatchingOrSmaller(&Allocator, Key, &pNode);
     1470            rc = Tree.lookupMatchingOrBelow(&Allocator, Key, &pNode);
    14711471            uint32_t idxAbove;
    14721472            if (rc == VINF_SUCCESS)
     
    14761476                idxAbove = (uint32_t)ASMBitNextSet(pbmPresent, cItems, idxRet);
    14771477                if (idxAbove <= idx)
    1478                     RTTestIFailed("post-remove lookupMatchingOrSmaller wrong: idxRet=%#x idx=%#x idxAbove=%#x",
     1478                    RTTestIFailed("post-remove lookupMatchingOrBelow wrong: idxRet=%#x idx=%#x idxAbove=%#x",
    14791479                                  idxRet, idx, idxAbove);
    14801480            }
     
    14831483                idxAbove = (uint32_t)ASMBitFirstSet(pbmPresent, cItems);
    14841484                if (idxAbove <= idx)
    1485                     RTTestIFailed("post-remove lookupMatchingOrSmaller wrong: VERR_NOT_FOUND idx=%#x idxAbove=%#x", idx, idxAbove);
     1485                    RTTestIFailed("post-remove lookupMatchingOrBelow wrong: VERR_NOT_FOUND idx=%#x idxAbove=%#x", idx, idxAbove);
    14861486            }
    14871487            else
    14881488            {
    1489                 RTTestIFailed("post-remove lookupMatchingOrSmaller failed: %Rrc, i=%#x, idx=%#x (%RGp ... %RGp)",
     1489                RTTestIFailed("post-remove lookupMatchingOrBelow failed: %Rrc, i=%#x, idx=%#x (%RGp ... %RGp)",
    14901490                              rc, i, idx, Key, Key + cbStep - 1);
    14911491                idxAbove = (uint32_t)ASMBitNextSet(pbmPresent, cItems, idx);
     
    14931493
    14941494            pNode = (MYTESTNODE *)(intptr_t)i;
    1495             rc = Tree.lookupMatchingOrLarger(&Allocator, Key, &pNode);
     1495            rc = Tree.lookupMatchingOrAbove(&Allocator, Key, &pNode);
    14961496            if (rc == VINF_SUCCESS)
    14971497            {
    14981498                uint32_t idxRet = pNode->Key / cbStep;
    14991499                if (idxRet != idxAbove)
    1500                     RTTestIFailed("post-remove lookupMatchingOrLarger wrong: idxRet=%#x idxAbove=%#x idx=%#x",
     1500                    RTTestIFailed("post-remove lookupMatchingOrAbove wrong: idxRet=%#x idxAbove=%#x idx=%#x",
    15011501                                  idxRet, idxAbove, idx);
    15021502            }
     
    15041504            {
    15051505                if (idxAbove != UINT32_MAX)
    1506                     RTTestIFailed("post-remove lookupMatchingOrLarger wrong: VERR_NOT_FOUND idxAbove=%#x idx=%#x", idxAbove, idx);
     1506                    RTTestIFailed("post-remove lookupMatchingOrAbove wrong: VERR_NOT_FOUND idxAbove=%#x idx=%#x", idxAbove, idx);
    15071507            }
    15081508            else
    15091509            {
    1510                 RTTestIFailed("post-remove lookupMatchingOrLarger failed: %Rrc, i=%#x, idx=%#x (%RGp ... %RGp) idxAbove=%#x",
     1510                RTTestIFailed("post-remove lookupMatchingOrAbove failed: %Rrc, i=%#x, idx=%#x (%RGp ... %RGp) idxAbove=%#x",
    15111511                              rc, i, idx, Key, Key + cbStep - 1, idxAbove);
    15121512            }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette