aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar tfarina <tfarina@chromium.org>2014-06-24 06:50:39 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-06-24 06:50:39 -0700
commit9ea53f93e79ba312c4b3943923450a8b4aa57c82 (patch)
tree37140bde4084f957bfdf98c742a307b50cb792b1 /tests
parent5da2fa436e62609153b990ef317733ade912f171 (diff)
Preprend Test to test function name generated by DEF_TEST() macro.
That way when declaring a test with DEF_TEST() macro, you don't have to uniquify the test name because it might colide with the class it is being testing. For example, if you are testing SkBase64 and do: DEF_TEST(SkBase64, reporter) { } That will generate an error because the macro will declare a function named SkBase64 which colides with the type SkBase64. By adding Test to the function name we avoid this problem. Fixed the entries found with the following command line: $ git grep "Test, r" | grep DEF BUG=None TEST=make tests && out/Debug/tests R=mtklein@google.com Author: tfarina@chromium.org Review URL: https://codereview.chromium.org/345753007
Diffstat (limited to 'tests')
-rw-r--r--tests/GrBinHashKeyTest.cpp2
-rw-r--r--tests/GrContextFactoryTest.cpp2
-rw-r--r--tests/GrOrderedSetTest.cpp2
-rw-r--r--tests/GrRedBlackTreeTest.cpp2
-rw-r--r--tests/GrSurfaceTest.cpp2
-rw-r--r--tests/GrTBSearchTest.cpp2
-rw-r--r--tests/ImageFilterTest.cpp8
-rw-r--r--tests/RecordingTest.cpp2
-rw-r--r--tests/SkBase64Test.cpp2
-rw-r--r--tests/Test.h66
-rw-r--r--tests/UnitTestTest.cpp2
11 files changed, 45 insertions, 47 deletions
diff --git a/tests/GrBinHashKeyTest.cpp b/tests/GrBinHashKeyTest.cpp
index 96b851f8b0..fbcf4822a7 100644
--- a/tests/GrBinHashKeyTest.cpp
+++ b/tests/GrBinHashKeyTest.cpp
@@ -12,7 +12,7 @@
#include "Test.h"
-DEF_TEST(GrBinHashKeyTest, reporter) {
+DEF_TEST(GrBinHashKey, reporter) {
const char* testStringA_ = "abcdABCD";
const char* testStringB_ = "abcdBBCD";
const uint32_t* testStringA = reinterpret_cast<const uint32_t*>(testStringA_);
diff --git a/tests/GrContextFactoryTest.cpp b/tests/GrContextFactoryTest.cpp
index 461a57a6d6..0191f1add8 100644
--- a/tests/GrContextFactoryTest.cpp
+++ b/tests/GrContextFactoryTest.cpp
@@ -10,7 +10,7 @@
#include "GrContextFactory.h"
#include "Test.h"
-DEF_GPUTEST(GrContextFactoryTest, reporter, factory) {
+DEF_GPUTEST(GrContextFactory, reporter, factory) {
// Reset in case some other test has been using it first.
factory->destroyContexts();
diff --git a/tests/GrOrderedSetTest.cpp b/tests/GrOrderedSetTest.cpp
index e449fa2937..7b3db9d679 100644
--- a/tests/GrOrderedSetTest.cpp
+++ b/tests/GrOrderedSetTest.cpp
@@ -14,7 +14,7 @@
typedef GrOrderedSet<int> Set;
typedef GrOrderedSet<const char*, GrStrLess> Set2;
-DEF_TEST(GrOrderedSetTest, reporter) {
+DEF_TEST(GrOrderedSet, reporter) {
Set set;
REPORTER_ASSERT(reporter, set.empty());
diff --git a/tests/GrRedBlackTreeTest.cpp b/tests/GrRedBlackTreeTest.cpp
index bb0fa156fa..c517cf2b87 100644
--- a/tests/GrRedBlackTreeTest.cpp
+++ b/tests/GrRedBlackTreeTest.cpp
@@ -14,7 +14,7 @@
typedef GrRedBlackTree<int> Tree;
-DEF_TEST(GrRedBlackTreeTest, reporter) {
+DEF_TEST(GrRedBlackTree, reporter) {
Tree tree;
SkRandom r;
diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp
index b73adc0b1e..ff67b1b672 100644
--- a/tests/GrSurfaceTest.cpp
+++ b/tests/GrSurfaceTest.cpp
@@ -14,7 +14,7 @@
#include "SkTypes.h"
#include "Test.h"
-DEF_GPUTEST(GrSurfaceTest, reporter, factory) {
+DEF_GPUTEST(GrSurface, reporter, factory) {
GrContext* context = factory->get(GrContextFactory::kNull_GLContextType);
if (NULL != context) {
GrTextureDesc desc;
diff --git a/tests/GrTBSearchTest.cpp b/tests/GrTBSearchTest.cpp
index 70a24d3197..d05780778b 100644
--- a/tests/GrTBSearchTest.cpp
+++ b/tests/GrTBSearchTest.cpp
@@ -22,7 +22,7 @@ static bool EQ(const int& elem, int value) {
#include "GrTBSearch.h"
-DEF_TEST(GrTBSearchTest, reporter) {
+DEF_TEST(GrTBSearch, reporter) {
const int array[] = {
1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99
};
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index cd6d235dc5..3a38eea483 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -464,7 +464,7 @@ DEF_TEST(ImageFilterCropRect, reporter) {
test_crop_rects(&device, reporter);
}
-DEF_TEST(ImageFilterMatrixTest, reporter) {
+DEF_TEST(ImageFilterMatrix, reporter) {
SkBitmap temp;
temp.allocN32Pixels(100, 100);
SkBitmapDevice device(temp);
@@ -494,8 +494,7 @@ DEF_TEST(ImageFilterMatrixTest, reporter) {
canvas.drawPicture(picture);
}
-DEF_TEST(ImageFilterPictureImageFilterTest, reporter) {
-
+DEF_TEST(ImageFilterPictureImageFilter, reporter) {
SkRTreeFactory factory;
SkPictureRecorder recorder;
SkCanvas* recordingCanvas = recorder.beginRecording(1, 1, &factory, 0);
@@ -554,8 +553,7 @@ DEF_TEST(ImageFilterPictureImageFilterTest, reporter) {
REPORTER_ASSERT(reporter, pixel != SK_ColorGREEN);
}
-DEF_TEST(ImageFilterEmptySaveLayerTest, reporter) {
-
+DEF_TEST(ImageFilterEmptySaveLayer, reporter) {
// Even when there's an empty saveLayer()/restore(), ensure that an image
// filter or color filter which affects transparent black still draws.
diff --git a/tests/RecordingTest.cpp b/tests/RecordingTest.cpp
index 8de52da7ec..0066556002 100644
--- a/tests/RecordingTest.cpp
+++ b/tests/RecordingTest.cpp
@@ -11,7 +11,7 @@
// Minimally exercise the public SkRecording API.
-DEF_TEST(RecordingTest, r) {
+DEF_TEST(SkRecording, r) {
EXPERIMENTAL::SkRecording recording(1920, 1080);
// Some very exciting commands here.
diff --git a/tests/SkBase64Test.cpp b/tests/SkBase64Test.cpp
index 217e2ca56d..14ff1f7717 100644
--- a/tests/SkBase64Test.cpp
+++ b/tests/SkBase64Test.cpp
@@ -9,7 +9,7 @@
#include "Test.h"
-DEF_TEST(SkBase64Test, reporter) {
+DEF_TEST(SkBase64, reporter) {
char all[256];
for (int index = 0; index < 256; ++index) {
all[index] = (signed char) (index + 1);
diff --git a/tests/Test.h b/tests/Test.h
index fc1890096e..72b0bee126 100644
--- a/tests/Test.h
+++ b/tests/Test.h
@@ -138,38 +138,38 @@ namespace skiatest {
(reporter)->reportFailed(desc); \
} while(0)
-#define DEF_TEST(name, reporter) \
- static void name(skiatest::Reporter*); \
- namespace skiatest { \
- class name##Class : public Test { \
- public: \
- static Test* Factory(void*) { return SkNEW(name##Class); } \
- protected: \
- virtual void onGetName(SkString* name) SK_OVERRIDE { \
- name->set(#name); \
- } \
- virtual void onRun(Reporter* r) SK_OVERRIDE { name(r); } \
- }; \
- static TestRegistry gReg_##name##Class(name##Class::Factory); \
- } \
- static void name(skiatest::Reporter* reporter)
-
-#define DEF_GPUTEST(name, reporter, factory) \
- static void name(skiatest::Reporter*, GrContextFactory*); \
- namespace skiatest { \
- class name##Class : public GpuTest { \
- public: \
- static Test* Factory(void*) { return SkNEW(name##Class); } \
- protected: \
- virtual void onGetName(SkString* name) SK_OVERRIDE { \
- name->set(#name); \
- } \
- virtual void onRun(Reporter* r) SK_OVERRIDE { \
- name(r, fGrContextFactory); \
- } \
- }; \
- static TestRegistry gReg_##name##Class(name##Class::Factory); \
- } \
- static void name(skiatest::Reporter* reporter, GrContextFactory* factory)
+#define DEF_TEST(name, reporter) \
+ static void test_##name(skiatest::Reporter*); \
+ namespace skiatest { \
+ class name##Class : public Test { \
+ public: \
+ static Test* Factory(void*) { return SkNEW(name##Class); } \
+ protected: \
+ virtual void onGetName(SkString* name) SK_OVERRIDE { \
+ name->set(#name); \
+ } \
+ virtual void onRun(Reporter* r) SK_OVERRIDE { test_##name(r); } \
+ }; \
+ static TestRegistry gReg_##name##Class(name##Class::Factory); \
+ } \
+ static void test_##name(skiatest::Reporter* reporter)
+
+#define DEF_GPUTEST(name, reporter, factory) \
+ static void test_##name(skiatest::Reporter*, GrContextFactory*); \
+ namespace skiatest { \
+ class name##Class : public GpuTest { \
+ public: \
+ static Test* Factory(void*) { return SkNEW(name##Class); } \
+ protected: \
+ virtual void onGetName(SkString* name) SK_OVERRIDE { \
+ name->set(#name); \
+ } \
+ virtual void onRun(Reporter* r) SK_OVERRIDE { \
+ test_##name(r, fGrContextFactory); \
+ } \
+ }; \
+ static TestRegistry gReg_##name##Class(name##Class::Factory); \
+ } \
+ static void test_##name(skiatest::Reporter* reporter, GrContextFactory* factory)
#endif
diff --git a/tests/UnitTestTest.cpp b/tests/UnitTestTest.cpp
index 35432cd91d..f42281fa22 100644
--- a/tests/UnitTestTest.cpp
+++ b/tests/UnitTestTest.cpp
@@ -8,7 +8,7 @@
#include "SkRTConf.h"
#include "Test.h"
-DEF_TEST(UnitTest, reporter) {
+DEF_TEST(SkRTConfRegistry, reporter) {
#ifdef SK_SUPPORT_UNITTEST
SkRTConfRegistry::UnitTest();
#endif