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

Side by Side Diff: tests/GrTBSearchTest.cpp

Issue 150943002: Split GrUnitTests.cpp into two separate unit tests. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « tests/GrBinHashKeyTest.cpp ('k') | tests/GrUnitTests.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 // This is a GPU-backend specific test
9 #if SK_SUPPORT_GPU
10
11 #include "Test.h"
12
13 // If we aren't inheriting these as #defines from elsewhere,
14 // clang demands they be declared before we #include the template
15 // that relies on them.
16 static bool LT(const int& elem, int value) {
17 return elem < value;
18 }
19 static bool EQ(const int& elem, int value) {
20 return elem == value;
21 }
22
23 #include "GrTBSearch.h"
24
25 DEF_TEST(GrTBSearchTest, reporter) {
26 const int array[] = {
27 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99
28 };
29
30 for (int n = 0; n < static_cast<int>(SK_ARRAY_COUNT(array)); ++n) {
31 for (int i = 0; i < n; i++) {
32 int index = GrTBSearch<int, int>(array, n, array[i]);
33 REPORTER_ASSERT(reporter, index == (int) i);
34 index = GrTBSearch<int, int>(array, n, -array[i]);
35 REPORTER_ASSERT(reporter, index < 0);
36 }
37 }
38 }
39
40 #endif
OLDNEW
« no previous file with comments | « tests/GrBinHashKeyTest.cpp ('k') | tests/GrUnitTests.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698