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

Unified Diff: tests/GrBinHashKeyTest.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, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrTBSearch.h ('k') | tests/GrTBSearchTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/GrBinHashKeyTest.cpp
diff --git a/tests/GrUnitTests.cpp b/tests/GrBinHashKeyTest.cpp
similarity index 56%
rename from tests/GrUnitTests.cpp
rename to tests/GrBinHashKeyTest.cpp
index 4c605d6051d45bf8b44b70c423d7f4ae33bf16e3..96b851f8b0079460a5e7f71a954bdffc12389e42 100644
--- a/tests/GrUnitTests.cpp
+++ b/tests/GrBinHashKeyTest.cpp
@@ -1,47 +1,18 @@
-
/*
* Copyright 2010 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#include "Test.h"
// This is a GPU-backend specific test
#if SK_SUPPORT_GPU
-#include "GrBinHashKey.h"
-#include "GrDrawTarget.h"
-#include "GrRedBlackTree.h"
-#include "SkMatrix.h"
-
-// If we aren't inheriting these as #defines from elsewhere,
-// clang demands they be declared before we #include the template
-// that relies on them.
-static bool LT(const int& elem, int value) {
- return elem < value;
-}
-static bool EQ(const int& elem, int value) {
- return elem == value;
-}
-#include "GrTBSearch.h"
+#include "GrBinHashKey.h"
-DEF_TEST(GrUnitTests_bsearch, reporter) {
- const int array[] = {
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99
- };
-
- for (int n = 0; n < static_cast<int>(GR_ARRAY_COUNT(array)); ++n) {
- for (int i = 0; i < n; i++) {
- int index = GrTBSearch<int, int>(array, n, array[i]);
- REPORTER_ASSERT(reporter, index == (int) i);
- index = GrTBSearch<int, int>(array, n, -array[i]);
- REPORTER_ASSERT(reporter, index < 0);
- }
- }
-}
+#include "Test.h"
-DEF_TEST(GrUnitTests_binHashKey, reporter) {
+DEF_TEST(GrBinHashKeyTest, reporter) {
const char* testStringA_ = "abcdABCD";
const char* testStringB_ = "abcdBBCD";
const uint32_t* testStringA = reinterpret_cast<const uint32_t*>(testStringA_);
@@ -67,5 +38,4 @@ DEF_TEST(GrUnitTests_binHashKey, reporter) {
REPORTER_ASSERT(reporter, keyA.getHash() != keyB.getHash());
}
-
#endif
« no previous file with comments | « src/gpu/GrTBSearch.h ('k') | tests/GrTBSearchTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698