Showing the changes to test/encoder/EncUT_MemoryAlloc.cpp (1 of 8 files). Show all
Unified · Split
| @@ -6,8 +6,7 @@ · 5 unmodified lines | |||
| 6 | using namespace WelsSVCEnc; | 6 | using namespace WelsSVCEnc; |
| 7 | 7 | ||
| 8 | //Tests of WelsGetCacheLineSize Begin | 8 | //Tests of WelsGetCacheLineSize Begin |
| 9 | TEST(MemoryAlignTest, GetCacheLineSize_LoopWithin16K) | 9 | TEST(MemoryAlignTest, GetCacheLineSize_LoopWithin16K) { |
| 10 | { | ||
| 11 | const unsigned int kuiTestBoundary16K = 16 * 1024; | 10 | const unsigned int kuiTestBoundary16K = 16 * 1024; |
| 12 | unsigned int uiTargetAlign = 1; | 11 | unsigned int uiTargetAlign = 1; |
| 13 | while (uiTargetAlign < kuiTestBoundary16K) { | 12 | while (uiTargetAlign < kuiTestBoundary16K) { |
| @@ -17,20 +16,17 @@ TEST(MemoryAlignTest, GetCacheLineSize_LoopWithin16K) · 3 unmodified lines | |||
| 17 | } | 16 | } |
| 18 | } | 17 | } |
| 19 | 18 | ||
| 20 | TEST(MemoryAlignTest, GetCacheLineSize_Zero) | 19 | TEST(MemoryAlignTest, GetCacheLineSize_Zero) { |
| 21 | { | ||
| 22 | CMemoryAlign cTestMa(0); | 20 | CMemoryAlign cTestMa(0); |
| 23 | ASSERT_EQ( 16, cTestMa.WelsGetCacheLineSize() ); | 21 | ASSERT_EQ( 16, cTestMa.WelsGetCacheLineSize() ); |
| 24 | } | 22 | } |
| 25 | TEST(MemoryAlignTest, GetCacheLineSize_MaxUINT) | 23 | TEST(MemoryAlignTest, GetCacheLineSize_MaxUINT) { |
| 26 | { | ||
| 27 | CMemoryAlign cTestMa(0xFFFFFFFF); | 24 | CMemoryAlign cTestMa(0xFFFFFFFF); |
| 28 | ASSERT_EQ( 16, cTestMa.WelsGetCacheLineSize() ); | 25 | ASSERT_EQ( 16, cTestMa.WelsGetCacheLineSize() ); |
| 29 | } | 26 | } |
| 30 | //Tests of WelsGetCacheLineSize End | 27 | //Tests of WelsGetCacheLineSize End |
| 31 | //Tests of WelsMallocAndFree Begin | 28 | //Tests of WelsMallocAndFree Begin |
| 32 | TEST(MemoryAlignTest, WelsMallocAndFreeOnceFunctionVerify) | 29 | TEST(MemoryAlignTest, WelsMallocAndFreeOnceFunctionVerify) { |
| 33 | { | ||
| 34 | const uint32_t kuiTargetAlignSize[4] = {32, 16, 64, 8}; | 30 | const uint32_t kuiTargetAlignSize[4] = {32, 16, 64, 8}; |
| 35 | srand((uint32_t)time(NULL)); | 31 | srand((uint32_t)time(NULL)); |
| 36 | 32 | ||
| @@ -59,5 +55,3 @@ TEST(MemoryAlignTest, WelsMallocAndFreeOnceFunctionVerify) · 22 unmodified lines | |||
| 59 | } | 55 | } |
| 60 | } | 56 | } |
| 61 | } | 57 | } |
| 62 | |||
| 63 | |||