VirtualBox

儲存庫 vbox 的更動 18425


忽略:
時間撮記:
2009-3-28 上午01:41:37 (16 年 以前)
作者:
vboxsync
訊息:

tstBitOperations: Use RT_ZERO instead of memset a couple of place so that it has some test coverage.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Runtime/testcase/tstBitOperations.cpp

    r18367 r18425  
    4646
    4747#define NIL_TEST2_ID    0
    48 #define TEST2_ID_LAST   (RT_BIT_32(28) - 1 >> 8)
     48#define TEST2_ID_LAST   ((RT_BIT_32(28) - 1) >> 8)
    4949
    5050struct TestMap2
     
    103103
    104104    /* Some simple tests first. */
    105     memset(&p2->bmChunkId[0],    0, sizeof(p2->bmChunkId));
     105    RT_ZERO(p2->bmChunkId);
    106106    RTTEST_CHECK(hTest, ASMBitFirstSet(&p2->bmChunkId[0], TEST2_ID_LAST + 1) == -1);
    107107    for (uint32_t iBit = 0; iBit <= TEST2_ID_LAST; iBit++)
     
    115115    /* The real test. */
    116116    p2->idChunkPrev = 0;
    117     memset(&p2->bmChunkId[0],    0, sizeof(p2->bmChunkId));
     117    RT_ZERO(p2->bmChunkId);
    118118    ASMBitSet(p2->bmChunkId, NIL_TEST2_ID);
    119119    uint32_t cLeft = TEST2_ID_LAST;
     
    165165#define GUARD_MAP(p)    do {  } while (0)
    166166#define CHECK_GUARD(p)  do {  } while (0)
    167 #define MAP_CLEAR(p)    do { memset(p,    0, sizeof(*(p))); GUARD_MAP(p); } while (0)
     167#define MAP_CLEAR(p)    do { RT_ZERO(*(p)); GUARD_MAP(p); } while (0)
    168168#define MAP_SET(p)      do { memset(p, 0xff, sizeof(*(p))); GUARD_MAP(p); } while (0)
    169169
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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