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

Side by Side Diff: ppapi/tests/test_memory.cc

Issue 915403003: Enable size_t to int truncation warnings in PPAPI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ppapi_unittests win x64 Created 5 years, 10 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
« no previous file with comments | « ppapi/tests/test_host_resolver_private.cc ('k') | ppapi/tests/test_network_monitor.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "ppapi/tests/test_memory.h" 5 #include "ppapi/tests/test_memory.h"
6 6
7 #include "ppapi/c/dev/ppb_memory_dev.h" 7 #include "ppapi/c/dev/ppb_memory_dev.h"
8 #include "ppapi/cpp/instance.h" 8 #include "ppapi/cpp/instance.h"
9 #include "ppapi/cpp/module.h" 9 #include "ppapi/cpp/module.h"
10 #include "ppapi/tests/testing_instance.h" 10 #include "ppapi/tests/testing_instance.h"
(...skipping 12 matching lines...) Expand all
23 return memory_dev_interface_ && CheckTestingInterface(); 23 return memory_dev_interface_ && CheckTestingInterface();
24 } 24 }
25 25
26 void TestMemory::RunTests(const std::string& filter) { 26 void TestMemory::RunTests(const std::string& filter) {
27 RUN_TEST(MemAlloc, filter); 27 RUN_TEST(MemAlloc, filter);
28 RUN_TEST(NullMemFree, filter); 28 RUN_TEST(NullMemFree, filter);
29 } 29 }
30 30
31 std::string TestMemory::TestMemAlloc() { 31 std::string TestMemory::TestMemAlloc() {
32 char* buffer = static_cast<char*>( 32 char* buffer = static_cast<char*>(
33 memory_dev_interface_->MemAlloc(kTestBufferSize)); 33 memory_dev_interface_->MemAlloc(static_cast<uint32_t>(kTestBufferSize)));
34 // Touch a couple of locations. Failure will crash the test. 34 // Touch a couple of locations. Failure will crash the test.
35 buffer[0] = '1'; 35 buffer[0] = '1';
36 buffer[kTestBufferSize - 1] = '1'; 36 buffer[kTestBufferSize - 1] = '1';
37 memory_dev_interface_->MemFree(buffer); 37 memory_dev_interface_->MemFree(buffer);
38 38
39 PASS(); 39 PASS();
40 } 40 }
41 41
42 std::string TestMemory::TestNullMemFree() { 42 std::string TestMemory::TestNullMemFree() {
43 // Failure crashes the test. 43 // Failure crashes the test.
44 memory_dev_interface_->MemFree(NULL); 44 memory_dev_interface_->MemFree(NULL);
45 45
46 PASS(); 46 PASS();
47 } 47 }
48 48
OLDNEW
« no previous file with comments | « ppapi/tests/test_host_resolver_private.cc ('k') | ppapi/tests/test_network_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698