Index: gpu/command_buffer/client/fenced_allocator_test.cc |
diff --git a/gpu/command_buffer/client/fenced_allocator_test.cc b/gpu/command_buffer/client/fenced_allocator_test.cc |
index 381237bbe48fd4672a1d5c95cab5b7ea20f2cfba..44fb851e3498d09cdd75974c0f8d33265481e26f 100644 |
--- a/gpu/command_buffer/client/fenced_allocator_test.cc |
+++ b/gpu/command_buffer/client/fenced_allocator_test.cc |
@@ -126,6 +126,14 @@ TEST_F(FencedAllocatorTest, TestBasic) { |
EXPECT_TRUE(allocator_->CheckConsistency()); |
} |
+// Test alloc 0 fails. |
+TEST_F(FencedAllocatorTest, TestAllocZero) { |
+ FencedAllocator::Offset offset = allocator_->Alloc(0); |
+ EXPECT_EQ(FencedAllocator::kInvalidOffset, offset); |
+ EXPECT_FALSE(allocator_->InUse()); |
+ EXPECT_TRUE(allocator_->CheckConsistency()); |
+} |
+ |
// Checks out-of-memory condition. |
TEST_F(FencedAllocatorTest, TestOutOfMemory) { |
EXPECT_TRUE(allocator_->CheckConsistency()); |
@@ -446,6 +454,15 @@ TEST_F(FencedAllocatorWrapperTest, TestBasic) { |
allocator_->Free(pointer_uint); |
} |
+// Test alloc 0 fails. |
+TEST_F(FencedAllocatorWrapperTest, TestAllocZero) { |
+ allocator_->CheckConsistency(); |
+ |
+ void *pointer = allocator_->Alloc(0); |
+ ASSERT_FALSE(pointer); |
+ EXPECT_TRUE(allocator_->CheckConsistency()); |
+} |
+ |
// Checks out-of-memory condition. |
TEST_F(FencedAllocatorWrapperTest, TestOutOfMemory) { |
allocator_->CheckConsistency(); |