two tests fixes

Signed-off-by: raver119 <raver119@gmail.com>
master
raver119 2020-01-24 15:26:46 +03:00
parent 5d69069177
commit 99cfb88933
2 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,7 @@ TEST_F(DataBufferTests, test_alloc_limit_1) {
auto odUse = MemoryCounter::getInstance()->allocatedDevice(deviceId);
auto ogUse = MemoryCounter::getInstance()->allocatedGroup(MemoryType::HOST);
auto limitSize = 150 * 1024 * 1024;
auto limitSize = odUse + (150 * 1024 * 1024);
auto allocSize = 100000000;
MemoryCounter::getInstance()->setDeviceLimit(deviceId, odLimit + limitSize);

View File

@ -51,7 +51,7 @@ TEST_F(DataBufferTestsCuda, test_alloc_limit_1) {
auto opUse = MemoryCounter::getInstance()->allocatedGroup(MemoryType::HOST);
auto osUse = MemoryCounter::getInstance()->allocatedGroup(MemoryType::DEVICE);
auto limitSize = 150000000;
auto limitSize = odUse + 150000000;
auto allocSize = 100000000;
MemoryCounter::getInstance()->setDeviceLimit(deviceId, odLimit + limitSize);
@ -72,7 +72,7 @@ TEST_F(DataBufferTestsCuda, test_alloc_limit_1) {
// this allocation should fail, since we're allocating too much
try {
DataBuffer bufferFailed(allocSize, DataType::INT32);
DataBuffer bufferFailed(allocSize + 1, DataType::INT32);
ASSERT_TRUE(false);
} catch (allocation_exception &e) {
// we expect exception here