Changeset 93944 in vbox for trunk/src/VBox/Devices/Audio/testcase
- Timestamp:
- Feb 24, 2022 9:15:14 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 150173
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp
r93115 r93944 159 159 /* DrvAudioHlpClearBuf: */ 160 160 uint8_t *pbPage; 161 int rc = RTTestGuardedAlloc(hTest, PAGE_SIZE, 0, false /*fHead*/, (void **)&pbPage);161 int rc = RTTestGuardedAlloc(hTest, HOST_PAGE_SIZE, 0, false /*fHead*/, (void **)&pbPage); 162 162 RTTESTI_CHECK_RC_OK_RETV(rc); 163 163 164 memset(pbPage, 0x42, PAGE_SIZE);165 PDMAudioPropsClearBuffer(&Cfg441StereoS16, pbPage, PAGE_SIZE,PAGE_SIZE / 4);166 RTTESTI_CHECK(ASMMemIsZero(pbPage, PAGE_SIZE));167 168 memset(pbPage, 0x42, PAGE_SIZE);169 PDMAudioPropsClearBuffer(&Cfg441StereoU16, pbPage, PAGE_SIZE,PAGE_SIZE / 4);170 for (uint32_t off = 0; off < PAGE_SIZE; off += 2)164 memset(pbPage, 0x42, HOST_PAGE_SIZE); 165 PDMAudioPropsClearBuffer(&Cfg441StereoS16, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE / 4); 166 RTTESTI_CHECK(ASMMemIsZero(pbPage, HOST_PAGE_SIZE)); 167 168 memset(pbPage, 0x42, HOST_PAGE_SIZE); 169 PDMAudioPropsClearBuffer(&Cfg441StereoU16, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE / 4); 170 for (uint32_t off = 0; off < HOST_PAGE_SIZE; off += 2) 171 171 RTTESTI_CHECK_MSG(pbPage[off] == 0 && pbPage[off + 1] == 0x80, ("off=%#x: %#x %x\n", off, pbPage[off], pbPage[off + 1])); 172 172 173 memset(pbPage, 0x42, PAGE_SIZE);174 PDMAudioPropsClearBuffer(&Cfg441StereoU32, pbPage, PAGE_SIZE,PAGE_SIZE / 8);175 for (uint32_t off = 0; off < PAGE_SIZE; off += 4)173 memset(pbPage, 0x42, HOST_PAGE_SIZE); 174 PDMAudioPropsClearBuffer(&Cfg441StereoU32, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE / 8); 175 for (uint32_t off = 0; off < HOST_PAGE_SIZE; off += 4) 176 176 RTTESTI_CHECK(pbPage[off] == 0 && pbPage[off + 1] == 0 && pbPage[off + 2] == 0 && pbPage[off + 3] == 0x80); 177 177 178 178 179 179 RTTestDisableAssertions(hTest); 180 memset(pbPage, 0x42, PAGE_SIZE);181 PDMAudioPropsClearBuffer(&Cfg441StereoS16, pbPage, PAGE_SIZE,PAGE_SIZE); /* should adjust down the frame count. */182 RTTESTI_CHECK(ASMMemIsZero(pbPage, PAGE_SIZE));183 184 memset(pbPage, 0x42, PAGE_SIZE);185 PDMAudioPropsClearBuffer(&Cfg441StereoU16, pbPage, PAGE_SIZE,PAGE_SIZE); /* should adjust down the frame count. */186 for (uint32_t off = 0; off < PAGE_SIZE; off += 2)180 memset(pbPage, 0x42, HOST_PAGE_SIZE); 181 PDMAudioPropsClearBuffer(&Cfg441StereoS16, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE); /* should adjust down the frame count. */ 182 RTTESTI_CHECK(ASMMemIsZero(pbPage, HOST_PAGE_SIZE)); 183 184 memset(pbPage, 0x42, HOST_PAGE_SIZE); 185 PDMAudioPropsClearBuffer(&Cfg441StereoU16, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE); /* should adjust down the frame count. */ 186 for (uint32_t off = 0; off < HOST_PAGE_SIZE; off += 2) 187 187 RTTESTI_CHECK_MSG(pbPage[off] == 0 && pbPage[off + 1] == 0x80, ("off=%#x: %#x %x\n", off, pbPage[off], pbPage[off + 1])); 188 188 189 memset(pbPage, 0x42, PAGE_SIZE);190 PDMAudioPropsClearBuffer(&Cfg441StereoU32, pbPage, PAGE_SIZE,PAGE_SIZE); /* should adjust down the frame count. */191 for (uint32_t off = 0; off < PAGE_SIZE; off += 4)189 memset(pbPage, 0x42, HOST_PAGE_SIZE); 190 PDMAudioPropsClearBuffer(&Cfg441StereoU32, pbPage, HOST_PAGE_SIZE, HOST_PAGE_SIZE); /* should adjust down the frame count. */ 191 for (uint32_t off = 0; off < HOST_PAGE_SIZE; off += 4) 192 192 RTTESTI_CHECK(pbPage[off] == 0 && pbPage[off + 1] == 0 && pbPage[off + 2] == 0 && pbPage[off + 3] == 0x80); 193 193 RTTestRestoreAssertions(hTest);
Note:
See TracChangeset
for help on using the changeset viewer.