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

Side by Side Diff: base/process_util_unittest.cc

Issue 431034: linux: fix a warning in the process_util unittest... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 | no next file » | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #define _CRT_SECURE_NO_WARNINGS 5 #define _CRT_SECURE_NO_WARNINGS
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/eintr_wrapper.h" 10 #include "base/eintr_wrapper.h"
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 408
409 TEST_F(OutOfMemoryTest, Pvalloc) { 409 TEST_F(OutOfMemoryTest, Pvalloc) {
410 ASSERT_DEATH(value_ = pvalloc(test_size_), ""); 410 ASSERT_DEATH(value_ = pvalloc(test_size_), "");
411 } 411 }
412 412
413 TEST_F(OutOfMemoryTest, Memalign) { 413 TEST_F(OutOfMemoryTest, Memalign) {
414 ASSERT_DEATH(value_ = memalign(4, test_size_), ""); 414 ASSERT_DEATH(value_ = memalign(4, test_size_), "");
415 } 415 }
416 416
417 TEST_F(OutOfMemoryTest, Posix_memalign) { 417 TEST_F(OutOfMemoryTest, Posix_memalign) {
418 // The (void) is to prevent a gcc warning about unused return values. 418 // Grab the return value of posix_memalign to silence a compiler warning
419 // We don't actually care about the return value, since we're 419 // about unused return values. We don't actually care about the return
420 // asserting death. 420 // value, since we're asserting death.
421 ASSERT_DEATH((void) posix_memalign(&value_, 8, test_size_), ""); 421 ASSERT_DEATH(EXPECT_EQ(ENOMEM, posix_memalign(&value_, 8, test_size_)), "");
willchan no longer on Chromium 2009/11/24 21:12:43 Don't you need to #include <errno.h> for ENOMEM?
422 } 422 }
423 423
424 extern "C" { 424 extern "C" {
425 425
426 void* __libc_malloc(size_t size); 426 void* __libc_malloc(size_t size);
427 void* __libc_realloc(void* ptr, size_t size); 427 void* __libc_realloc(void* ptr, size_t size);
428 void* __libc_calloc(size_t nmemb, size_t size); 428 void* __libc_calloc(size_t nmemb, size_t size);
429 void* __libc_valloc(size_t size); 429 void* __libc_valloc(size_t size);
430 void* __libc_pvalloc(size_t size); 430 void* __libc_pvalloc(size_t size);
431 void* __libc_memalign(size_t alignment, size_t size); 431 void* __libc_memalign(size_t alignment, size_t size);
(...skipping 20 matching lines...) Expand all
452 ASSERT_DEATH(value_ = __libc_pvalloc(test_size_), ""); 452 ASSERT_DEATH(value_ = __libc_pvalloc(test_size_), "");
453 } 453 }
454 454
455 TEST_F(OutOfMemoryTest, __libc_memalign) { 455 TEST_F(OutOfMemoryTest, __libc_memalign) {
456 ASSERT_DEATH(value_ = __libc_memalign(4, test_size_), ""); 456 ASSERT_DEATH(value_ = __libc_memalign(4, test_size_), "");
457 } 457 }
458 458
459 #endif // defined(OS_LINUX) 459 #endif // defined(OS_LINUX)
460 460
461 } // namespace base 461 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698