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: tests/ImageCacheTest.cpp

Issue 800993002: Even more win64 warning fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more Created 6 years 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 | « src/utils/SkTextureCompressor_R11EAC.cpp ('k') | tests/PackBitsTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkDiscardableMemory.h" 8 #include "SkDiscardableMemory.h"
9 #include "SkResourceCache.h" 9 #include "SkResourceCache.h"
10 #include "Test.h" 10 #include "Test.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 REPORTER_ASSERT(reporter, -1 == value); 49 REPORTER_ASSERT(reporter, -1 == value);
50 50
51 cache.add(SkNEW_ARGS(TestingRec, (key, i))); 51 cache.add(SkNEW_ARGS(TestingRec, (key, i)));
52 52
53 REPORTER_ASSERT(reporter, cache.find(key, TestingRec::Visitor, &value)); 53 REPORTER_ASSERT(reporter, cache.find(key, TestingRec::Visitor, &value));
54 REPORTER_ASSERT(reporter, i == value); 54 REPORTER_ASSERT(reporter, i == value);
55 } 55 }
56 56
57 if (testPurge) { 57 if (testPurge) {
58 // stress test, should trigger purges 58 // stress test, should trigger purges
59 for (size_t i = 0; i < COUNT * 100; ++i) { 59 for (int i = 0; i < COUNT * 100; ++i) {
60 TestingKey key(i); 60 TestingKey key(i);
61 cache.add(SkNEW_ARGS(TestingRec, (key, i))); 61 cache.add(SkNEW_ARGS(TestingRec, (key, i)));
62 } 62 }
63 } 63 }
64 64
65 // test the originals after all that purging 65 // test the originals after all that purging
66 for (int i = 0; i < COUNT; ++i) { 66 for (int i = 0; i < COUNT; ++i) {
67 intptr_t value; 67 intptr_t value;
68 (void)cache.find(TestingKey(i), TestingRec::Visitor, &value); 68 (void)cache.find(TestingKey(i), TestingRec::Visitor, &value);
69 } 69 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 TestingKey key(1); 106 TestingKey key(1);
107 107
108 cache.add(SkNEW_ARGS(TestingRec, (key, 2))); 108 cache.add(SkNEW_ARGS(TestingRec, (key, 2)));
109 cache.add(SkNEW_ARGS(TestingRec, (key, 3))); 109 cache.add(SkNEW_ARGS(TestingRec, (key, 3)));
110 110
111 // Lookup can return either value. 111 // Lookup can return either value.
112 intptr_t value = -1; 112 intptr_t value = -1;
113 REPORTER_ASSERT(r, cache.find(key, TestingRec::Visitor, &value)); 113 REPORTER_ASSERT(r, cache.find(key, TestingRec::Visitor, &value));
114 REPORTER_ASSERT(r, 2 == value || 3 == value); 114 REPORTER_ASSERT(r, 2 == value || 3 == value);
115 } 115 }
OLDNEW
« no previous file with comments | « src/utils/SkTextureCompressor_R11EAC.cpp ('k') | tests/PackBitsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698