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

Side by Side Diff: tests/GrBinHashKeyTest.cpp

Issue 345753007: Preprend Test to test function name generated by DEF_TEST() macro. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: test_ Created 6 years, 6 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 | « no previous file | tests/GrContextFactoryTest.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 2010 Google Inc. 2 * Copyright 2010 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 // This is a GPU-backend specific test 8 // This is a GPU-backend specific test
9 #if SK_SUPPORT_GPU 9 #if SK_SUPPORT_GPU
10 10
11 #include "GrBinHashKey.h" 11 #include "GrBinHashKey.h"
12 12
13 #include "Test.h" 13 #include "Test.h"
14 14
15 DEF_TEST(GrBinHashKeyTest, reporter) { 15 DEF_TEST(GrBinHashKey, reporter) {
16 const char* testStringA_ = "abcdABCD"; 16 const char* testStringA_ = "abcdABCD";
17 const char* testStringB_ = "abcdBBCD"; 17 const char* testStringB_ = "abcdBBCD";
18 const uint32_t* testStringA = reinterpret_cast<const uint32_t*>(testStringA_ ); 18 const uint32_t* testStringA = reinterpret_cast<const uint32_t*>(testStringA_ );
19 const uint32_t* testStringB = reinterpret_cast<const uint32_t*>(testStringB_ ); 19 const uint32_t* testStringB = reinterpret_cast<const uint32_t*>(testStringB_ );
20 enum { 20 enum {
21 kDataLenUsedForKey = 8 21 kDataLenUsedForKey = 8
22 }; 22 };
23 23
24 GrBinHashKey<kDataLenUsedForKey> keyA; 24 GrBinHashKey<kDataLenUsedForKey> keyA;
25 keyA.setKeyData(testStringA); 25 keyA.setKeyData(testStringA);
26 // test copy constructor and comparison 26 // test copy constructor and comparison
27 GrBinHashKey<kDataLenUsedForKey> keyA2(keyA); 27 GrBinHashKey<kDataLenUsedForKey> keyA2(keyA);
28 REPORTER_ASSERT(reporter, keyA == keyA2); 28 REPORTER_ASSERT(reporter, keyA == keyA2);
29 REPORTER_ASSERT(reporter, keyA.getHash() == keyA2.getHash()); 29 REPORTER_ASSERT(reporter, keyA.getHash() == keyA2.getHash());
30 // test re-init 30 // test re-init
31 keyA2.setKeyData(testStringA); 31 keyA2.setKeyData(testStringA);
32 REPORTER_ASSERT(reporter, keyA == keyA2); 32 REPORTER_ASSERT(reporter, keyA == keyA2);
33 REPORTER_ASSERT(reporter, keyA.getHash() == keyA2.getHash()); 33 REPORTER_ASSERT(reporter, keyA.getHash() == keyA2.getHash());
34 // test sorting 34 // test sorting
35 GrBinHashKey<kDataLenUsedForKey> keyB; 35 GrBinHashKey<kDataLenUsedForKey> keyB;
36 keyB.setKeyData(testStringB); 36 keyB.setKeyData(testStringB);
37 REPORTER_ASSERT(reporter, keyA < keyB); 37 REPORTER_ASSERT(reporter, keyA < keyB);
38 REPORTER_ASSERT(reporter, keyA.getHash() != keyB.getHash()); 38 REPORTER_ASSERT(reporter, keyA.getHash() != keyB.getHash());
39 } 39 }
40 40
41 #endif 41 #endif
OLDNEW
« no previous file with comments | « no previous file | tests/GrContextFactoryTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698