Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Unified Diff: gpu/command_buffer/client/mapped_memory_unittest.cc

Issue 282513003: gpu: Assert that FencedAllocator is empty in destructor (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed 64 bit only test Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/mapped_memory_unittest.cc
diff --git a/gpu/command_buffer/client/mapped_memory_unittest.cc b/gpu/command_buffer/client/mapped_memory_unittest.cc
index a7dcf9e901130b33453da413e3f55a8c2cde1ffd..2f3a9e73c65abe71c59a6757ee3d9336a6114add 100644
--- a/gpu/command_buffer/client/mapped_memory_unittest.cc
+++ b/gpu/command_buffer/client/mapped_memory_unittest.cc
@@ -268,16 +268,6 @@ TEST_F(MappedMemoryManagerTest, FreePendingToken) {
}
}
-// Check if we don't free we don't crash.
-TEST_F(MappedMemoryManagerTest, DontFree) {
- const unsigned int kSize = 1024;
- // Check we can alloc.
- int32 id1 = -1;
- unsigned int offset1 = 0xFFFFFFFFU;
- void* mem1 = manager_->Alloc(kSize, &id1, &offset1);
- ASSERT_TRUE(mem1);
-}
-
TEST_F(MappedMemoryManagerTest, FreeUnused) {
int32 id = -1;
unsigned int offset = 0xFFFFFFFFU;
@@ -321,6 +311,10 @@ TEST_F(MappedMemoryManagerTest, ChunkSizeMultiple) {
EXPECT_EQ(0u, offset1);
EXPECT_EQ(kSize, offset2);
EXPECT_EQ(0u, offset3);
+
+ manager_->Free(mem1);
+ manager_->Free(mem2);
+ manager_->Free(mem3);
}
TEST_F(MappedMemoryManagerTest, UnusedMemoryLimit) {
@@ -350,6 +344,9 @@ TEST_F(MappedMemoryManagerTest, UnusedMemoryLimit) {
// Expect two chunks to be allocated, exceeding the limit,
// since all memory is in use.
EXPECT_EQ(2 * kChunkSize, manager_->allocated_memory());
+
+ manager_->Free(mem1);
+ manager_->Free(mem2);
}
TEST_F(MappedMemoryManagerTest, MemoryLimitWithReuse) {
@@ -400,6 +397,9 @@ TEST_F(MappedMemoryManagerTest, MemoryLimitWithReuse) {
// Expect one chunk to be allocated
EXPECT_EQ(1 * kChunkSize, manager_->allocated_memory());
+
+ manager_->Free(mem1);
+ manager_->Free(mem3);
}
namespace {
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698