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

Side by Side Diff: gpu/command_buffer/client/fenced_allocator_test.cc

Issue 13454036: Rewrite scoped_array<T> to scoped_ptr<T[]> in gpu/, Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Yikes Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | gpu/command_buffer/client/mapped_memory_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file contains the tests for the FencedAllocator class. 5 // This file contains the tests for the FencedAllocator class.
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "gpu/command_buffer/client/cmd_buffer_helper.h" 10 #include "gpu/command_buffer/client/cmd_buffer_helper.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 virtual void TearDown() { 410 virtual void TearDown() {
411 // If the GpuScheduler posts any tasks, this forces them to run. 411 // If the GpuScheduler posts any tasks, this forces them to run.
412 MessageLoop::current()->RunUntilIdle(); 412 MessageLoop::current()->RunUntilIdle();
413 413
414 EXPECT_TRUE(allocator_->CheckConsistency()); 414 EXPECT_TRUE(allocator_->CheckConsistency());
415 415
416 BaseFencedAllocatorTest::TearDown(); 416 BaseFencedAllocatorTest::TearDown();
417 } 417 }
418 418
419 scoped_ptr<FencedAllocatorWrapper> allocator_; 419 scoped_ptr<FencedAllocatorWrapper> allocator_;
420 scoped_array<char> buffer_; 420 scoped_ptr<char[]> buffer_;
421 }; 421 };
422 422
423 // Checks basic alloc and free. 423 // Checks basic alloc and free.
424 TEST_F(FencedAllocatorWrapperTest, TestBasic) { 424 TEST_F(FencedAllocatorWrapperTest, TestBasic) {
425 allocator_->CheckConsistency(); 425 allocator_->CheckConsistency();
426 426
427 const unsigned int kSize = 16; 427 const unsigned int kSize = 16;
428 void *pointer = allocator_->Alloc(kSize); 428 void *pointer = allocator_->Alloc(kSize);
429 ASSERT_TRUE(pointer); 429 ASSERT_TRUE(pointer);
430 EXPECT_LE(buffer_.get(), static_cast<char *>(pointer)); 430 EXPECT_LE(buffer_.get(), static_cast<char *>(pointer));
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 EXPECT_LE(token, GetToken()); 543 EXPECT_LE(token, GetToken());
544 544
545 // Free up everything. 545 // Free up everything.
546 for (unsigned int i = 0; i < kAllocCount; ++i) { 546 for (unsigned int i = 0; i < kAllocCount; ++i) {
547 allocator_->Free(pointers[i]); 547 allocator_->Free(pointers[i]);
548 EXPECT_TRUE(allocator_->CheckConsistency()); 548 EXPECT_TRUE(allocator_->CheckConsistency());
549 } 549 }
550 } 550 }
551 551
552 } // namespace gpu 552 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/client/mapped_memory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698