Use DEFINE_TESTCLASS_SHORT macro in tests.
The three version of DEFINE_TESTCLASS macro is deprecated and thus just
use the simple, short one.
BUG=None
TEST=out/Debug/tests
R=mtklein@google.com, bsalomon@google.com, robertphillips@google.com
Review URL: https://codereview.chromium.org/100113004
git-svn-id: http://skia.googlecode.com/svn/trunk@12653 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/AnnotationTest.cpp b/tests/AnnotationTest.cpp
index 5429b58..db33afa 100644
--- a/tests/AnnotationTest.cpp
+++ b/tests/AnnotationTest.cpp
@@ -6,6 +6,7 @@
* found in the LICENSE file.
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkAnnotation.h"
#include "SkData.h"
#include "SkCanvas.h"
@@ -24,7 +25,7 @@
return false;
}
-static void test_nodraw(skiatest::Reporter* reporter) {
+DEF_TEST(Annotation_NoDraw, reporter) {
SkBitmap bm;
bm.setConfig(SkBitmap::kARGB_8888_Config, 10, 10);
bm.allocPixels();
@@ -45,7 +46,7 @@
bool expectAnnotations;
};
-static void test_pdf_link_annotations(skiatest::Reporter* reporter) {
+DEF_TEST(Annotation_PdfLink, reporter) {
SkISize size = SkISize::Make(612, 792);
SkMatrix initialTransform;
initialTransform.reset();
@@ -73,7 +74,7 @@
}
}
-static void test_named_destination_annotations(skiatest::Reporter* reporter) {
+DEF_TEST(Annotation_NamedDestination, reporter) {
SkISize size = SkISize::Make(612, 792);
SkMatrix initialTransform;
initialTransform.reset();
@@ -94,12 +95,3 @@
REPORTER_ASSERT(reporter,
ContainsString(rawOutput, out->size(), "/example "));
}
-
-static void TestAnnotation(skiatest::Reporter* reporter) {
- test_nodraw(reporter);
- test_pdf_link_annotations(reporter);
- test_named_destination_annotations(reporter);
-}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Annotation", AnnotationClass, TestAnnotation)
diff --git a/tests/AtomicTest.cpp b/tests/AtomicTest.cpp
index a9ab8d2..b7b13b3 100644
--- a/tests/AtomicTest.cpp
+++ b/tests/AtomicTest.cpp
@@ -5,10 +5,11 @@
* found in the LICENSE file.
*/
+#include "Test.h"
+#include "TestClassDef.h"
#include "SkThread.h"
#include "SkThreadUtils.h"
#include "SkTypes.h"
-#include "Test.h"
struct AddInfo {
int32_t valueToAdd;
@@ -31,7 +32,7 @@
}
}
-static void test_atomicAddTests(skiatest::Reporter* reporter) {
+DEF_TEST(Atomic, reporter) {
int32_t total = base;
SkThread* threads[SK_ARRAY_COUNT(gAdds)];
for (size_t i = 0; i < SK_ARRAY_COUNT(gAdds); i++) {
@@ -55,6 +56,3 @@
const int32_t originalValue = valueToModify;
REPORTER_ASSERT(reporter, originalValue == sk_atomic_add(&valueToModify, 7));
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("AtomicAdd", AtomicAddTestClass, test_atomicAddTests)
diff --git a/tests/BitSetTest.cpp b/tests/BitSetTest.cpp
index 7139495..bdfe997 100644
--- a/tests/BitSetTest.cpp
+++ b/tests/BitSetTest.cpp
@@ -1,14 +1,15 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkBitSet.h"
-static void TestBitSet(skiatest::Reporter* reporter) {
+DEF_TEST(BitSet, reporter) {
SkBitSet set0(65536);
REPORTER_ASSERT(reporter, set0.isBitSet(0) == false);
REPORTER_ASSERT(reporter, set0.isBitSet(32767) == false);
@@ -74,6 +75,3 @@
set2 = set2;
REPORTER_ASSERT(reporter, set2 == set3);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("BitSet", BitSetTest, TestBitSet)
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp
index f61d55e..0df8c06 100644
--- a/tests/BitmapCopyTest.cpp
+++ b/tests/BitmapCopyTest.cpp
@@ -6,6 +6,7 @@
* found in the LICENSE file.
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkBitmap.h"
#include "SkRect.h"
@@ -204,7 +205,7 @@
setPixel(coords[i]->fX, coords[i]->fY, i, bm);
}
-static void TestBitmapCopy(skiatest::Reporter* reporter) {
+DEF_TEST(BitmapCopy, reporter) {
static const Pair gPairs[] = {
{ SkBitmap::kNo_Config, "0000000" },
{ SkBitmap::kA8_Config, "0101010" },
@@ -550,6 +551,3 @@
} // for (size_t copyCase ...
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("BitmapCopy", TestBitmapCopyClass, TestBitmapCopy)
diff --git a/tests/BitmapGetColorTest.cpp b/tests/BitmapGetColorTest.cpp
index 40aa3e2..7fc584f 100644
--- a/tests/BitmapGetColorTest.cpp
+++ b/tests/BitmapGetColorTest.cpp
@@ -6,11 +6,12 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkBitmap.h"
#include "SkRect.h"
#include "SkRandom.h"
-static void TestGetColor(skiatest::Reporter* reporter) {
+DEF_TEST(GetColor, reporter) {
static const struct Rec {
SkBitmap::Config fConfig;
SkColor fInColor;
@@ -45,6 +46,3 @@
REPORTER_ASSERT(reporter, c == gRec[i].fOutColor);
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("GetColor", TestGetColorClass, TestGetColor)
diff --git a/tests/BitmapHeapTest.cpp b/tests/BitmapHeapTest.cpp
index 34a2984..2b5cf83 100644
--- a/tests/BitmapHeapTest.cpp
+++ b/tests/BitmapHeapTest.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2012 Google Inc.
*
@@ -15,6 +14,7 @@
#include "SkRefCnt.h"
#include "SkShader.h"
#include "Test.h"
+#include "TestClassDef.h"
class FlatDictionary : public SkFlatDictionary<SkShader> {
@@ -37,7 +37,7 @@
}
};
-static void TestBitmapHeap(skiatest::Reporter* reporter) {
+DEF_TEST(BitmapHeap, reporter) {
// Create a bitmap shader.
SkBitmap bm;
bm.setConfig(SkBitmap::kARGB_8888_Config, 2, 2);
@@ -91,6 +91,3 @@
REPORTER_ASSERT(reporter, heap.count() == 1);
REPORTER_ASSERT(reporter, SkBitmapHeapTester::GetRefCount(heap.getEntry(0)) == 0);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("BitmapHeap", TestBitmapHeapClass, TestBitmapHeap)
diff --git a/tests/BlitRowTest.cpp b/tests/BlitRowTest.cpp
index 8576110..d0518bf 100644
--- a/tests/BlitRowTest.cpp
+++ b/tests/BlitRowTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkColorPriv.h"
@@ -262,10 +263,7 @@
}
}
-static void TestBlitRow(skiatest::Reporter* reporter) {
+DEF_TEST(BlitRow, reporter) {
test_00_FF(reporter);
test_diagonal(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("BlitRow", TestBlitRowClass, TestBlitRow)
diff --git a/tests/CanvasStateTest.cpp b/tests/CanvasStateTest.cpp
index 7cba71e..8543009 100644
--- a/tests/CanvasStateTest.cpp
+++ b/tests/CanvasStateTest.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2013 Google Inc.
*
@@ -7,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkBitmapDevice.h"
#include "SkCanvas.h"
#include "SkCanvasStateUtils.h"
@@ -227,14 +227,9 @@
SkClearLastError();
}
-////////////////////////////////////////////////////////////////////////////////
-
-static void test_canvas_state_utils(skiatest::Reporter* reporter) {
+DEF_TEST(CanvasState, reporter) {
test_complex_layers(reporter);
test_complex_clips(reporter);
test_draw_filters(reporter);
test_soft_clips(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("CanvasState", TestCanvasStateClass, test_canvas_state_utils)
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index 6d9fa1a..744eafc 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -63,6 +63,7 @@
#include "SkStream.h"
#include "SkTDArray.h"
#include "Test.h"
+#include "TestClassDef.h"
class Canvas2CanvasClipVisitor : public SkCanvas::ClipVisitor {
public:
@@ -901,7 +902,7 @@
}
}
-static void TestCanvas(skiatest::Reporter* reporter) {
+DEF_TEST(Canvas, reporter) {
// Init global here because bitmap pixels cannot be alocated during
// static initialization
kTestBitmap = testBitmap();
@@ -918,6 +919,3 @@
// Explicitly call reset(), so we don't leak the pixels (since kTestBitmap is a global)
kTestBitmap.reset();
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Canvas", TestCanvasClass, TestCanvas)
diff --git a/tests/ClampRangeTest.cpp b/tests/ClampRangeTest.cpp
index 1d6bcd2..a9a59ac 100644
--- a/tests/ClampRangeTest.cpp
+++ b/tests/ClampRangeTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "gradients/SkClampRange.h"
#include "SkRandom.h"
@@ -80,6 +81,7 @@
}
}
+
static void test_range(SkFixed fx, SkFixed dx, int count) {
SkClampRange range;
range.init(fx, dx, count, V0, V1);
@@ -88,8 +90,7 @@
#define ff(x) SkIntToFixed(x)
-void TestClampRange(skiatest::Reporter* reporter);
-void TestClampRange(skiatest::Reporter* reporter) {
+DEF_TEST(ClampRange, reporter) {
gReporter = reporter;
test_range(0, 0, 20);
@@ -126,10 +127,3 @@
test_range(fx, dx, count);
}
}
-
-#ifdef USE_REPORTER
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("ClampRange", ClampRangeClass, TestClampRange)
-
-#endif
diff --git a/tests/ClipCubicTest.cpp b/tests/ClipCubicTest.cpp
index 82eeee3..829b7b6 100644
--- a/tests/ClipCubicTest.cpp
+++ b/tests/ClipCubicTest.cpp
@@ -1,12 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "Test.h"
+#include "TestClassDef.h"
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkCubicClipper.h"
@@ -69,7 +69,7 @@
}
-static void TestCubicClipping(skiatest::Reporter* reporter) {
+DEF_TEST(ClipCubic, reporter) {
static SkPoint crv[4] = {
{ SkIntToScalar(0), SkIntToScalar(0) },
{ SkIntToScalar(2), SkIntToScalar(3) },
@@ -163,9 +163,3 @@
test_giantClip();
}
-
-
-
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("CubicClipper", CubicClippingTestClass, TestCubicClipping)
diff --git a/tests/ClipStackTest.cpp b/tests/ClipStackTest.cpp
index 704aa62..05f9fca 100644
--- a/tests/ClipStackTest.cpp
+++ b/tests/ClipStackTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#if SK_SUPPORT_GPU
#include "GrReducedClip.h"
#endif
@@ -15,7 +16,6 @@
#include "SkRect.h"
#include "SkRegion.h"
-
static void test_assign_and_comparison(skiatest::Reporter* reporter) {
SkClipStack s;
bool doAA = false;
@@ -1159,9 +1159,8 @@
}
#endif
-///////////////////////////////////////////////////////////////////////////////////////////////////
-static void TestClipStack(skiatest::Reporter* reporter) {
+DEF_TEST(ClipStack, reporter) {
SkClipStack stack;
REPORTER_ASSERT(reporter, 0 == stack.getSaveCount());
@@ -1210,6 +1209,3 @@
test_reduced_clip_stack_no_aa_crash(reporter);
#endif
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("ClipStack", TestClipStackClass, TestClipStack)
diff --git a/tests/ClipperTest.cpp b/tests/ClipperTest.cpp
index a81e655..6f2e0af 100644
--- a/tests/ClipperTest.cpp
+++ b/tests/ClipperTest.cpp
@@ -1,16 +1,17 @@
-
/*
* Copyright 2011 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"
-#include "SkPath.h"
-#include "SkLineClipper.h"
-#include "SkEdgeClipper.h"
+#include "Test.h"
+#include "TestClassDef.h"
#include "SkCanvas.h"
+#include "SkEdgeClipper.h"
+#include "SkLineClipper.h"
+#include "SkPath.h"
+
static void test_hairclipping(skiatest::Reporter* reporter) {
SkBitmap bm;
bm.setConfig(SkBitmap::kARGB_8888_Config, 4, 4);
@@ -144,11 +145,8 @@
}
-static void TestClipper(skiatest::Reporter* reporter) {
+DEF_TEST(Clipper, reporter) {
test_intersectline(reporter);
test_edgeclipper();
test_hairclipping(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Clipper", TestClipperClass, TestClipper)
diff --git a/tests/ColorFilterTest.cpp b/tests/ColorFilterTest.cpp
index 544c9f0..8444b73 100644
--- a/tests/ColorFilterTest.cpp
+++ b/tests/ColorFilterTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkColor.h"
#include "SkColorPriv.h"
#include "SkColorFilter.h"
@@ -32,7 +33,7 @@
#define ILLEGAL_MODE ((SkXfermode::Mode)-1)
-static void test_asColorMode(skiatest::Reporter* reporter) {
+DEF_TEST(ColorFilter, reporter) {
SkRandom rand;
for (int mode = 0; mode <= SkXfermode::kLastMode; mode++) {
@@ -93,7 +94,7 @@
///////////////////////////////////////////////////////////////////////////////
-static void test_lumaColorFilter(skiatest::Reporter* reporter) {
+DEF_TEST(LumaColorFilter, reporter) {
SkPMColor in, out;
SkAutoTUnref<SkColorFilter> lf(SkLumaColorFilter::Create());
@@ -125,7 +126,3 @@
REPORTER_ASSERT(reporter, SkGetPackedB32(out) == 0);
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("ColorFilter", ColorFilterTestClass, test_asColorMode)
-DEFINE_TESTCLASS("LumaColorFilter", LumaColorFilterTestClass, test_lumaColorFilter)
diff --git a/tests/ColorTest.cpp b/tests/ColorTest.cpp
index 30dad88..6b1d7d7 100644
--- a/tests/ColorTest.cpp
+++ b/tests/ColorTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkColor.h"
#include "SkColorPriv.h"
#include "SkMathPriv.h"
@@ -76,12 +77,9 @@
}
}
-static void TestColor(skiatest::Reporter* reporter) {
+DEF_TEST(Color, reporter) {
test_premul(reporter);
//test_interp(reporter);
test_fast_interp(reporter);
-// test_565blend();
+ //test_565blend();
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Color", ColorTestClass, TestColor)
diff --git a/tests/DataRefTest.cpp b/tests/DataRefTest.cpp
index c32c455..b31bfcd 100644
--- a/tests/DataRefTest.cpp
+++ b/tests/DataRefTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkData.h"
#include "SkDataTable.h"
#include "SkOrderedReadBuffer.h"
@@ -133,7 +134,7 @@
}
}
-static void TestDataTable(skiatest::Reporter* reporter) {
+DEF_TEST(DataTable, reporter) {
test_emptytable(reporter);
test_simpletable(reporter);
test_vartable(reporter);
@@ -206,7 +207,7 @@
REPORTER_ASSERT(reporter, strncmp(static_cast<const char*>(r2->data()), s, 26) == 0);
}
-static void TestData(skiatest::Reporter* reporter) {
+DEF_TEST(Data, reporter) {
const char* str = "We the people, in order to form a more perfect union.";
const int N = 10;
@@ -234,7 +235,3 @@
test_cstring(reporter);
test_files(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Data", DataTestClass, TestData)
-DEFINE_TESTCLASS("DataTable", DataTableTestClass, TestDataTable)
diff --git a/tests/DequeTest.cpp b/tests/DequeTest.cpp
index 62e8e4d..d3e1c17 100644
--- a/tests/DequeTest.cpp
+++ b/tests/DequeTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkDeque.h"
static void assert_count(skiatest::Reporter* reporter, const SkDeque& deq, int count) {
@@ -161,11 +162,9 @@
assert_blocks(reporter, deq, allocCount);
}
-static void TestDeque(skiatest::Reporter* reporter) {
+DEF_TEST(Deque, reporter) {
// test it once with the default allocation count
TestSub(reporter, 1);
// test it again with a generous allocation count
TestSub(reporter, 10);
}
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Deque", TestDequeClass, TestDeque)
diff --git a/tests/DeviceLooperTest.cpp b/tests/DeviceLooperTest.cpp
index 23e9d15..2dc9410 100644
--- a/tests/DeviceLooperTest.cpp
+++ b/tests/DeviceLooperTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkDeviceLooper.h"
#include "SkRasterClip.h"
@@ -133,10 +134,7 @@
}
}
-static void TestDeviceLooper(skiatest::Reporter* reporter) {
+DEF_TEST(DeviceLooper, reporter) {
test_simple(reporter);
test_complex(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("DeviceLooper", DeviceLooperClass, TestDeviceLooper)
diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp
index 642e2ce..f2e4837 100644
--- a/tests/DrawBitmapRectTest.cpp
+++ b/tests/DrawBitmapRectTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkData.h"
@@ -308,7 +309,7 @@
bm->eraseColor(color);
}
-static void TestDrawBitmapRect(skiatest::Reporter* reporter) {
+DEF_TEST(DrawBitmapRect, reporter) {
SkBitmap src, dst;
create(&src, SkBitmap::kARGB_8888_Config, 0xFFFFFFFF);
@@ -330,6 +331,3 @@
test_treatAsSprite(reporter);
test_faulty_pixelref(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("DrawBitmapRect", TestDrawBitmapRectClass, TestDrawBitmapRect)
diff --git a/tests/DrawPathTest.cpp b/tests/DrawPathTest.cpp
index 40f4a04..9a49adf 100644
--- a/tests/DrawPathTest.cpp
+++ b/tests/DrawPathTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkDashPathEffect.h"
@@ -305,7 +306,7 @@
REPORTER_ASSERT(reporter, filteredPath.isEmpty());
}
-static void TestDrawPath(skiatest::Reporter* reporter) {
+DEF_TEST(DrawPath, reporter) {
test_giantaa();
test_bug533();
test_bigcubic();
@@ -319,6 +320,3 @@
test_crbug_165432(reporter);
test_big_aa_rect(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("DrawPath", TestDrawPathClass, TestDrawPath)
diff --git a/tests/DrawTextTest.cpp b/tests/DrawTextTest.cpp
index b1bb19d..768c936 100644
--- a/tests/DrawTextTest.cpp
+++ b/tests/DrawTextTest.cpp
@@ -4,17 +4,16 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#include "SkTypes.h"
#include "Test.h"
+#include "TestClassDef.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkColor.h"
#include "SkPaint.h"
#include "SkPoint.h"
#include "SkRect.h"
-
-///////////////////////////////////////////////////////////////////////////////
+#include "SkTypes.h"
static const SkColor bgColor = SK_ColorWHITE;
@@ -62,8 +61,7 @@
return true;
}
-static void test_drawText(skiatest::Reporter* reporter) {
-
+DEF_TEST(DrawText, reporter) {
SkPaint paint;
paint.setColor(SK_ColorGRAY);
paint.setTextSize(SkIntToScalar(20));
@@ -110,6 +108,3 @@
}
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("DrawText_DrawPosText", DrawTextTestClass, test_drawText)
diff --git a/tests/DynamicHashTest.cpp b/tests/DynamicHashTest.cpp
index f502dbae..5e92ace 100644
--- a/tests/DynamicHashTest.cpp
+++ b/tests/DynamicHashTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkTDynamicHash.h"
namespace {
@@ -139,12 +140,9 @@
ASSERT(hash.find(5)->value == 3.0);
}
-static void test_dynamic_hash(skiatest::Reporter* reporter) {
+DEF_TEST(DynamicHash, reporter) {
test_growth(reporter);
test_add(reporter);
test_lookup(reporter);
test_remove(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("DynamicHash", DynamicHashTestClass, test_dynamic_hash);
diff --git a/tests/EmptyPathTest.cpp b/tests/EmptyPathTest.cpp
index 153af1f..fa1fd7f 100644
--- a/tests/EmptyPathTest.cpp
+++ b/tests/EmptyPathTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkPath.h"
#include "SkCanvas.h"
@@ -148,9 +149,6 @@
}
}
-static void TestEmptyPath(skiatest::Reporter* reporter) {
+DEF_TEST(EmptyPath, reporter) {
test_emptydrawing(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("EmptyPath", TestEmptyPathClass, TestEmptyPath)
diff --git a/tests/ErrorTest.cpp b/tests/ErrorTest.cpp
index 2d10640..9dca9d8 100644
--- a/tests/ErrorTest.cpp
+++ b/tests/ErrorTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2013 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"
+#include "TestClassDef.h"
#include "SkError.h"
#include "SkPath.h"
#include "SkRect.h"
@@ -27,7 +28,7 @@
REPORTER_ASSERT( context_ptr->fReporter, (*(context_ptr->fIntPointer) == 0xdeadbeef) );
}
-static void ErrorTest(skiatest::Reporter* reporter) {
+DEF_TEST(Error, reporter) {
SkError err;
unsigned int test_value = 0xdeadbeef;
@@ -59,6 +60,3 @@
CHECK(kInvalidArgument_SkError);
CHECK(kNoError_SkError);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Error", ErrorTestClass, ErrorTest)
diff --git a/tests/FillPathTest.cpp b/tests/FillPathTest.cpp
index e0f3cf4..ef0f5bf 100644
--- a/tests/FillPathTest.cpp
+++ b/tests/FillPathTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkRegion.h"
#include "SkPath.h"
#include "SkScan.h"
@@ -26,7 +27,7 @@
// http://code.google.com/p/skia/issues/detail?id=87
// Lines which is not clipped by boundary based clipping,
// but skipped after tessellation, should be cleared by the blitter.
-static void TestFillPathInverse(skiatest::Reporter* reporter) {
+DEF_TEST(FillPathInverse, reporter) {
FakeBlitter blitter;
SkIRect clip;
SkPath path;
@@ -43,6 +44,3 @@
REPORTER_ASSERT(reporter, blitter.m_blitCount == expected_lines);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("FillPath", FillPathTestClass, TestFillPathInverse)
diff --git a/tests/FitsInTest.cpp b/tests/FitsInTest.cpp
index 365d7ea..b66d53b 100644
--- a/tests/FitsInTest.cpp
+++ b/tests/FitsInTest.cpp
@@ -6,14 +6,15 @@
*/
#include "Test.h"
-
+#include "TestClassDef.h"
#include "SkTypes.h"
#include "SkTFitsIn.h"
+
#include <limits>
#define TEST(S, s, D, expected) REPORTER_ASSERT(reporter, (SkTFitsIn<D>((S)(s)) == (expected)))
-static void FitsInTest(skiatest::Reporter* reporter) {
+DEF_TEST(FitsIn, reporter) {
TEST(int32_t, 1, int8_t, true);
TEST(int32_t, -1, int8_t, true);
TEST(int32_t, (int32_t)(std::numeric_limits<int8_t>::max)(), int8_t, true);
@@ -67,6 +68,3 @@
// Uncommenting the following should cause compile failures.
//TEST(float, 1, uint64_t, true);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("FitsIn", FitsInTestClass, FitsInTest)
diff --git a/tests/FlatDataTest.cpp b/tests/FlatDataTest.cpp
index 79f94b3..5393a78 100644
--- a/tests/FlatDataTest.cpp
+++ b/tests/FlatDataTest.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2012 Google Inc.
*
@@ -6,6 +5,8 @@
* found in the LICENSE file.
*/
+#include "Test.h"
+#include "TestClassDef.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkColor.h"
@@ -15,7 +16,6 @@
#include "SkPictureFlat.h"
#include "SkShader.h"
#include "SkXfermode.h"
-#include "Test.h"
static void flattenFlattenableProc(SkOrderedWriteBuffer& buffer,
const void* obj) {
@@ -48,7 +48,7 @@
REPORTER_ASSERT(reporter, *data1 == *data2);
}
-static void Tests(skiatest::Reporter* reporter) {
+DEF_TEST(FlatData, reporter) {
// Test flattening SkShader
SkPoint points[2];
points[0].set(0, 0);
@@ -85,5 +85,3 @@
testCreate(reporter, xfer, &flattenFlattenableProc);
}
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("FlatData", FlatDataClass, Tests)
diff --git a/tests/FlateTest.cpp b/tests/FlateTest.cpp
index 879973f..8d5f015 100644
--- a/tests/FlateTest.cpp
+++ b/tests/FlateTest.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2011 Google Inc.
*
@@ -6,11 +5,11 @@
* found in the LICENSE file.
*/
-
#include <stdlib.h>
#include <string.h>
#include "Test.h"
+#include "TestClassDef.h"
#include "SkData.h"
#include "SkFlate.h"
#include "SkStream.h"
@@ -85,7 +84,7 @@
testData.getLength()) == 0);
}
-static void TestFlateCompression(skiatest::Reporter* reporter) {
+DEF_TEST(Flate, reporter) {
TestFlate(reporter, NULL, 0);
#if defined(SK_ZLIB_INCLUDE) && !defined(SK_DEBUG)
REPORTER_ASSERT(reporter, SkFlate::HaveFlate());
@@ -99,6 +98,3 @@
TestFlate(reporter, &fileStream, 10240);
#endif
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Flate", FlateTestClass, TestFlateCompression)
diff --git a/tests/FontHostStreamTest.cpp b/tests/FontHostStreamTest.cpp
index e15bd5a..b9f39b3 100644
--- a/tests/FontHostStreamTest.cpp
+++ b/tests/FontHostStreamTest.cpp
@@ -4,9 +4,9 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#include "SkTypes.h"
#include "Test.h"
+#include "TestClassDef.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkColor.h"
@@ -17,8 +17,7 @@
#include "SkRect.h"
#include "SkStream.h"
#include "SkTypeface.h"
-
-///////////////////////////////////////////////////////////////////////////////
+#include "SkTypes.h"
static const SkColor bgColor = SK_ColorWHITE;
@@ -66,8 +65,7 @@
return true;
}
-static void test_fontHostStream(skiatest::Reporter* reporter) {
-
+DEF_TEST(FontHostStream, reporter) {
{
SkPaint paint;
paint.setColor(SK_ColorGRAY);
@@ -112,6 +110,3 @@
//Make sure the typeface is deleted and removed.
SkGraphics::PurgeFontCache();
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("FontHost::CreateTypefaceFromStream", FontHostStreamTestClass, test_fontHostStream)
diff --git a/tests/FontHostTest.cpp b/tests/FontHostTest.cpp
index a7ecc5a..500f859 100644
--- a/tests/FontHostTest.cpp
+++ b/tests/FontHostTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkPaint.h"
#include "SkFontStream.h"
#include "SkOSFile.h"
@@ -305,13 +306,10 @@
}
}
-static void TestFontHost(skiatest::Reporter* reporter) {
+DEF_TEST(FontHost, reporter) {
test_tables(reporter);
test_fontstream(reporter);
test_advances(reporter);
}
// need tests for SkStrSearch
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("FontHost", FontHostTestClass, TestFontHost)
diff --git a/tests/FontMgrTest.cpp b/tests/FontMgrTest.cpp
index 9b683f7..8ecdecc 100644
--- a/tests/FontMgrTest.cpp
+++ b/tests/FontMgrTest.cpp
@@ -6,7 +6,7 @@
*/
#include "Test.h"
-
+#include "TestClassDef.h"
#include "SkCommandLineFlags.h"
#include "SkFontMgr.h"
#include "SkTypeface.h"
@@ -77,10 +77,7 @@
DEFINE_bool(verboseFontMgr, false, "run verbose fontmgr tests.");
-static void TestFontMgr(skiatest::Reporter* reporter) {
+DEF_TEST(FontMgr, reporter) {
test_fontiter(reporter, FLAGS_verboseFontMgr);
test_alias_names(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("FontMgr", FontMgrClass, TestFontMgr)
diff --git a/tests/FontNamesTest.cpp b/tests/FontNamesTest.cpp
index 42d9ca9..adbf813 100644
--- a/tests/FontNamesTest.cpp
+++ b/tests/FontNamesTest.cpp
@@ -6,7 +6,7 @@
*/
#include "Test.h"
-
+#include "TestClassDef.h"
#include "SkCommandLineFlags.h"
#include "SkFontMgr.h"
#include "SkOTTable_name.h"
@@ -218,10 +218,7 @@
DEFINE_bool(verboseFontNames, false, "verbose FontNames test.");
-static void TestFontNames(skiatest::Reporter* reporter) {
+DEF_TEST(FontNames, reporter) {
test_synthetic(reporter, FLAGS_verboseFontNames);
test_systemfonts(reporter, FLAGS_verboseFontNames);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("FontNames", FontNamesTestClass, TestFontNames)
diff --git a/tests/FrontBufferedStreamTest.cpp b/tests/FrontBufferedStreamTest.cpp
index 420718f..3693fa5 100644
--- a/tests/FrontBufferedStreamTest.cpp
+++ b/tests/FrontBufferedStreamTest.cpp
@@ -5,11 +5,12 @@
* found in the LICENSE file.
*/
+#include "Test.h"
+#include "TestClassDef.h"
#include "SkFrontBufferedStream.h"
#include "SkRefCnt.h"
#include "SkStream.h"
#include "SkTypes.h"
-#include "Test.h"
static void test_read(skiatest::Reporter* reporter, SkStream* bufferedStream,
const void* expectations, size_t bytesToRead) {
@@ -150,12 +151,9 @@
test_read_beyond_buffer(reporter, bufferSize);
}
-static void TestStreams(skiatest::Reporter* reporter) {
+DEF_TEST(FrontBufferedStream, reporter) {
// Test 6 and 64, which are used by Android, as well as another arbitrary length.
test_buffers(reporter, 6);
test_buffers(reporter, 15);
test_buffers(reporter, 64);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("FrontBufferedStream", FrontBufferedStreamTestClass, TestStreams)
diff --git a/tests/GeometryTest.cpp b/tests/GeometryTest.cpp
index 69d980a..b090c89 100644
--- a/tests/GeometryTest.cpp
+++ b/tests/GeometryTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkGeometry.h"
static bool nearly_equal(const SkPoint& a, const SkPoint& b) {
@@ -33,8 +34,7 @@
}
}
-
-static void TestGeometry(skiatest::Reporter* reporter) {
+DEF_TEST(Geometry, reporter) {
SkPoint pts[3], dst[5];
pts[0].set(0, 0);
@@ -60,6 +60,3 @@
testChopCubic(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Geometry", GeometryTestClass, TestGeometry)
diff --git a/tests/GifTest.cpp b/tests/GifTest.cpp
index 5919b44..c9dac9b 100644
--- a/tests/GifTest.cpp
+++ b/tests/GifTest.cpp
@@ -11,13 +11,14 @@
(!defined(SK_BUILD_FOR_IOS)) && \
(!defined(SK_BUILD_FOR_MAC))
+#include "Test.h"
+#include "TestClassDef.h"
#include "SkBitmap.h"
#include "SkData.h"
#include "SkForceLinking.h"
-#include "SkImageDecoder.h"
#include "SkImage.h"
+#include "SkImageDecoder.h"
#include "SkStream.h"
-#include "Test.h"
__SK_FORCE_IMAGE_DECODER_LINKING;
@@ -147,7 +148,7 @@
GIF files which have been mangled somehow. We want to display as
much of the GIF as possible.
*/
-static void TestGif(skiatest::Reporter* reporter) {
+DEF_TEST(Gif, reporter) {
// test perfectly good images.
test_gif_data(reporter, static_cast<void *>(gifData), sizeof(gifData));
test_interlaced_gif_data(reporter, static_cast<void *>(interlacedGif),
@@ -204,7 +205,4 @@
// "libgif warning [interlace DGifGetLine]"
}
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("GifTest", GifTestClass, TestGif)
-
#endif // !(SK_BUILD_FOR_WIN32||SK_BUILD_FOR_IOS||SK_BUILD_FOR_MAC)
diff --git a/tests/GrMemoryPoolTest.cpp b/tests/GrMemoryPoolTest.cpp
index 3f719e6..9d974ab 100644
--- a/tests/GrMemoryPoolTest.cpp
+++ b/tests/GrMemoryPoolTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
// This is a GPU-backend specific test
#if SK_SUPPORT_GPU
#include "GrMemoryPool.h"
@@ -182,7 +183,7 @@
int fValue;
};
-static void test_memory_pool(skiatest::Reporter* reporter) {
+DEF_TEST(GrMemoryPool, reporter) {
// prealloc and min alloc sizes for the pool
static const size_t gSizes[][2] = {
{0, 0},
@@ -239,7 +240,4 @@
}
}
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("GrMemoryPool", GrMemoryPoolClass, test_memory_pool)
-
#endif
diff --git a/tests/GradientTest.cpp b/tests/GradientTest.cpp
index 24ffb53..1f77fbb 100644
--- a/tests/GradientTest.cpp
+++ b/tests/GradientTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkBitmapDevice.h"
#include "SkColorShader.h"
#include "SkEmptyShader.h"
@@ -192,9 +193,7 @@
}
}
-static void TestGradients(skiatest::Reporter* reporter) {
+DEF_TEST(Gradient, reporter) {
TestGradientShaders(reporter);
TestConstantGradient(reporter);
}
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Gradients", TestGradientsClass, TestGradients)
diff --git a/tests/HashCacheTest.cpp b/tests/HashCacheTest.cpp
index 1a5c470..437a80c 100644
--- a/tests/HashCacheTest.cpp
+++ b/tests/HashCacheTest.cpp
@@ -5,8 +5,8 @@
* found in the LICENSE file.
*/
-
#include "Test.h"
+#include "TestClassDef.h"
// This is a GR test
#if SK_SUPPORT_GPU
@@ -59,9 +59,7 @@
int fKey;
};
-////////////////////////////////////////////////////////////////////////////////
-static void TestHashCache(skiatest::Reporter* reporter) {
-
+DEF_TEST(HashCache, reporter) {
GrTHashTable<HashElement, HashKey, 4> cache;
HashElement negHashElements[10] = {
@@ -154,8 +152,4 @@
}
}
-////////////////////////////////////////////////////////////////////////////////
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("HashCache", HashCacheTestClass, TestHashCache)
-
#endif
diff --git a/tests/ImageCacheTest.cpp b/tests/ImageCacheTest.cpp
index 8f1591f..6087b7f 100644
--- a/tests/ImageCacheTest.cpp
+++ b/tests/ImageCacheTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkDiscardableMemory.h"
#include "SkScaledImageCache.h"
@@ -85,7 +86,7 @@
return gPool->create(bytes);
}
-static void TestImageCache(skiatest::Reporter* reporter) {
+DEF_TEST(ImageCache, reporter) {
static const size_t defLimit = DIM * DIM * 4 * COUNT + 1024; // 1K slop
{
@@ -104,9 +105,6 @@
}
}
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("ImageCache", TestImageCacheClass, TestImageCache)
-
DEF_TEST(ImageCache_doubleAdd, r) {
// Adding the same key twice should be safe.
SkScaledImageCache cache(1024);
diff --git a/tests/ImageDecodingTest.cpp b/tests/ImageDecodingTest.cpp
index be8626f..f840129 100644
--- a/tests/ImageDecodingTest.cpp
+++ b/tests/ImageDecodingTest.cpp
@@ -5,6 +5,8 @@
* found in the LICENSE file.
*/
+#include "Test.h"
+#include "TestClassDef.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkColor.h"
@@ -19,7 +21,6 @@
#include "SkShader.h"
#include "SkStream.h"
#include "SkString.h"
-#include "Test.h"
__SK_FORCE_IMAGE_DECODER_LINKING;
@@ -228,14 +229,10 @@
#endif // SK_DEBUG
-static void test_imageDecodingTests(skiatest::Reporter* reporter) {
+DEF_TEST(ImageDecoding, reporter) {
test_unpremul(reporter);
#ifdef SK_DEBUG
test_stream_life();
test_row_proc_choice();
#endif
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("ImageDecoding", ImageDecodingTestClass,
- test_imageDecodingTests)
diff --git a/tests/InfRectTest.cpp b/tests/InfRectTest.cpp
index 4d957dc..3d964bd 100644
--- a/tests/InfRectTest.cpp
+++ b/tests/InfRectTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkRandom.h"
#include "SkRect.h"
@@ -57,7 +58,7 @@
// Tests that isFinite() will reject any rect with +/-inf values
// as one of its coordinates.
-static void TestInfRect(skiatest::Reporter* reporter) {
+DEF_TEST(InfRect, reporter) {
#ifdef SK_SCALAR_IS_FLOAT
float inf = 1 / make_zero(); // infinity
float nan = inf * 0;
@@ -86,6 +87,3 @@
}
// need tests for SkStrSearch
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("InfRect", InfRectTestClass, TestInfRect)
diff --git a/tests/JpegTest.cpp b/tests/JpegTest.cpp
index ac2ec8a..4d00eec 100644
--- a/tests/JpegTest.cpp
+++ b/tests/JpegTest.cpp
@@ -5,13 +5,14 @@
* found in the LICENSE file.
*/
+#include "Test.h"
+#include "TestClassDef.h"
#include "SkBitmap.h"
#include "SkData.h"
#include "SkForceLinking.h"
#include "SkImageDecoder.h"
#include "SkImage.h"
#include "SkStream.h"
-#include "Test.h"
__SK_FORCE_IMAGE_DECODER_LINKING;
@@ -417,7 +418,7 @@
Jpeg files which have been mangled somehow. We want to display as
much of the jpeg as possible.
*/
-static void TestJpeg(skiatest::Reporter* reporter) {
+DEF_TEST(Jpeg, reporter) {
size_t len = sizeof(goodJpegImage) / 2;
// I am explicitly not putting the entire image into the
// DecodeMemory. This simulates a network error.
@@ -447,6 +448,3 @@
SkASSERT(writeSuccess);
#endif
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("JpegTest", JpegTestClass, TestJpeg)
diff --git a/tests/LListTest.cpp b/tests/LListTest.cpp
index 128b11e..dc7b377 100644
--- a/tests/LListTest.cpp
+++ b/tests/LListTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkRandom.h"
#include "SkTInternalLList.h"
#include "SkTLList.h"
@@ -310,10 +311,7 @@
}
}
-static void test_llists(skiatest::Reporter* reporter) {
+DEF_TEST(LList, reporter) {
TestTInternalLList(reporter);
TestTLList(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("LList", TestLListClass, test_llists)
diff --git a/tests/LayerDrawLooperTest.cpp b/tests/LayerDrawLooperTest.cpp
index 11ac488..01ebca1 100644
--- a/tests/LayerDrawLooperTest.cpp
+++ b/tests/LayerDrawLooperTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkBitmap.h"
#include "SkBitmapDevice.h"
#include "SkCanvas.h"
@@ -145,11 +146,8 @@
REPORTER_ASSERT(reporter, !looper->next(&canvas, &paint));
}
-static void TestLayerDrawLooper(skiatest::Reporter* reporter) {
+DEF_TEST(LayerDrawLooper, reporter) {
test_frontToBack(reporter);
test_backToFront(reporter);
test_mixed(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("LayerDrawLooper", TestLayerDrawLooperClass, TestLayerDrawLooper)
diff --git a/tests/MD5Test.cpp b/tests/MD5Test.cpp
index 9b9e756..ed9f69c 100644
--- a/tests/MD5Test.cpp
+++ b/tests/MD5Test.cpp
@@ -4,7 +4,9 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
#include "Test.h"
+#include "TestClassDef.h"
#include "SkMD5.h"
static bool digests_equal(const SkMD5::Digest& expectedDigest, const SkMD5::Digest& computedDigest) {
@@ -58,11 +60,8 @@
{ "12345678901234567890123456789012345678901234567890123456789012345678901234567890", {{ 0x57, 0xed, 0xf4, 0xa2, 0x2b, 0xe3, 0xc9, 0x55, 0xac, 0x49, 0xda, 0x2e, 0x21, 0x07, 0xb6, 0x7a }} },
};
-static void TestMD5(skiatest::Reporter* reporter) {
+DEF_TEST(MD5, reporter) {
for (size_t i = 0; i < SK_ARRAY_COUNT(md5_tests); ++i) {
md5_test(md5_tests[i].message, md5_tests[i].digest, reporter);
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("MD5", MD5TestClass, TestMD5)
diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp
index f5c61cb..22680c1 100644
--- a/tests/MathTest.cpp
+++ b/tests/MathTest.cpp
@@ -1,17 +1,19 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
+#include "SkColorPriv.h"
+#include "SkEndian.h"
#include "SkFloatBits.h"
#include "SkFloatingPoint.h"
#include "SkMathPriv.h"
#include "SkPoint.h"
#include "SkRandom.h"
-#include "SkColorPriv.h"
static void test_clz(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, 32 == SkCLZ(0));
@@ -430,7 +432,7 @@
}
}
-static void TestMath(skiatest::Reporter* reporter) {
+DEF_TEST(Math, reporter) {
int i;
int32_t x;
SkRandom rand;
@@ -646,19 +648,12 @@
test_clz(reporter);
}
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Math", MathTestClass, TestMath)
-
-///////////////////////////////////////////////////////////////////////////////
-
-#include "SkEndian.h"
-
template <typename T> struct PairRec {
T fYin;
T fYang;
};
-static void TestEndian(skiatest::Reporter* reporter) {
+DEF_TEST(TestEndian, reporter) {
static const PairRec<uint16_t> g16[] = {
{ 0x0, 0x0 },
{ 0xFFFF, 0xFFFF },
@@ -690,8 +685,6 @@
}
}
-DEFINE_TESTCLASS("Endian", EndianTestClass, TestEndian)
-
template <typename T>
static void test_divmod(skiatest::Reporter* r) {
const struct {
diff --git a/tests/Matrix44Test.cpp b/tests/Matrix44Test.cpp
index 51a6e7f..afd2762 100644
--- a/tests/Matrix44Test.cpp
+++ b/tests/Matrix44Test.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkMatrix44.h"
static bool nearly_equal_double(double a, double b) {
@@ -528,7 +529,7 @@
REPORTER_ASSERT(reporter, nearly_equal_scalar(vec4transformed[3], vec4transformed2[3]));
}
-static void TestMatrix44(skiatest::Reporter* reporter) {
+DEF_TEST(Matrix44, reporter) {
SkMatrix44 mat(SkMatrix44::kUninitialized_Constructor);
SkMatrix44 inverse(SkMatrix44::kUninitialized_Constructor);
SkMatrix44 iden1(SkMatrix44::kUninitialized_Constructor);
@@ -634,6 +635,3 @@
test_map2(reporter);
test_3x3_conversion(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Matrix44", Matrix44TestClass, TestMatrix44)
diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp
index 9f4babf..a6d4eda 100644
--- a/tests/MatrixTest.cpp
+++ b/tests/MatrixTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkMath.h"
#include "SkMatrix.h"
#include "SkMatrixUtils.h"
@@ -689,7 +690,7 @@
}
-static void TestMatrix(skiatest::Reporter* reporter) {
+DEF_TEST(Matrix, reporter) {
SkMatrix mat, inverse, iden1, iden2;
mat.reset();
@@ -812,6 +813,3 @@
test_matrix_decomposition(reporter);
test_matrix_homogeneous(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Matrix", MatrixTestClass, TestMatrix)
diff --git a/tests/MemsetTest.cpp b/tests/MemsetTest.cpp
index 9da7850..36d0f0a 100644
--- a/tests/MemsetTest.cpp
+++ b/tests/MemsetTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkChunkAlloc.h"
#include "SkUtils.h"
@@ -115,12 +116,9 @@
* For performance considerations, implementations may take different paths
* depending on the alignment of the dst, and/or the size of the count.
*/
-static void TestMemset(skiatest::Reporter* reporter) {
+DEF_TEST(Memset, reporter) {
test_16(reporter);
test_32(reporter);
test_chunkalloc(reporter);
-};
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Memset", TestMemsetClass, TestMemset)
+}
diff --git a/tests/MetaDataTest.cpp b/tests/MetaDataTest.cpp
index 4390652..4512045 100644
--- a/tests/MetaDataTest.cpp
+++ b/tests/MetaDataTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkMetaData.h"
static void test_ptrs(skiatest::Reporter* reporter) {
@@ -34,7 +35,7 @@
REPORTER_ASSERT(reporter, 1 == ref.getRefCnt());
}
-static void TestMetaData(skiatest::Reporter* reporter) {
+DEF_TEST(MetaData, reporter) {
SkMetaData m1;
REPORTER_ASSERT(reporter, !m1.findS32("int"));
@@ -114,6 +115,3 @@
test_ptrs(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("MetaData", TestMetaDataClass, TestMetaData)
diff --git a/tests/MipMapTest.cpp b/tests/MipMapTest.cpp
index 3988273..ed62219 100644
--- a/tests/MipMapTest.cpp
+++ b/tests/MipMapTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkMipMap.h"
#include "SkBitmap.h"
#include "SkRandom.h"
@@ -20,7 +21,7 @@
bm->eraseColor(SK_ColorWHITE);
}
-static void TestMipMap(skiatest::Reporter* reporter) {
+DEF_TEST(MipMap, reporter) {
SkBitmap bm;
SkRandom rand;
@@ -54,6 +55,3 @@
}
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("MipMap", MipMapTestClass, TestMipMap)
diff --git a/tests/OSPathTest.cpp b/tests/OSPathTest.cpp
index 5ae32eb..e0d7b9d 100644
--- a/tests/OSPathTest.cpp
+++ b/tests/OSPathTest.cpp
@@ -5,9 +5,10 @@
* found in the LICENSE file.
*/
+#include "Test.h"
+#include "TestClassDef.h"
#include "SkString.h"
#include "SkOSFile.h"
-#include "Test.h"
/**
* Test SkPathJoin and SkBasename.
@@ -50,7 +51,7 @@
REPORTER_ASSERT(reporter, basename.equals(filename));
}
-static void test_os_path_utils_tests(skiatest::Reporter* reporter) {
+DEF_TEST(OSPath, reporter) {
SkString dir("dir");
SkString filename("file");
test_dir_with_file(reporter, dir, filename);
@@ -83,6 +84,3 @@
REPORTER_ASSERT(reporter, emptyPath.size() == 1);
REPORTER_ASSERT(reporter, emptyPath.contains(SkPATH_SEPARATOR));
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("OSPath", OSPathTestClass, test_os_path_utils_tests)
diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp
index 0d623a1..9b9569d 100644
--- a/tests/PDFPrimitivesTest.cpp
+++ b/tests/PDFPrimitivesTest.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2010 The Android Open Source Project
*
@@ -7,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkData.h"
@@ -346,7 +346,7 @@
doc.emitPDF(&stream);
}
-static void TestPDFPrimitives(skiatest::Reporter* reporter) {
+DEF_TEST(PDFPrimitives, reporter) {
SkAutoTUnref<SkPDFInt> int42(new SkPDFInt(42));
SimpleCheckObjectOutput(reporter, int42.get(), "42");
@@ -432,6 +432,3 @@
TestImages(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("PDFPrimitives", PDFPrimitivesTestClass, TestPDFPrimitives)
diff --git a/tests/PackBitsTest.cpp b/tests/PackBitsTest.cpp
index f7d4b8e..8a6ed88 100644
--- a/tests/PackBitsTest.cpp
+++ b/tests/PackBitsTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkPackBits.h"
static const uint16_t gTest0[] = { 0, 0, 1, 1 };
@@ -125,10 +126,7 @@
}
}
-static void TestPackBits(skiatest::Reporter* reporter) {
+DEF_TEST(PackBits, reporter) {
test_pack8(reporter);
test_pack16(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("PackBits", PackBitsTestClass, TestPackBits)
diff --git a/tests/PaintTest.cpp b/tests/PaintTest.cpp
index 03c93d4..eed9de3 100644
--- a/tests/PaintTest.cpp
+++ b/tests/PaintTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkBlurMask.h"
#include "SkBlurMaskFilter.h"
#include "SkLayerDrawLooper.h"
@@ -235,7 +236,7 @@
REPORTER_ASSERT(reporter, r.isEmpty());
}
-static void TestPaint(skiatest::Reporter* reporter) {
+DEF_TEST(Paint, reporter) {
// TODO add general paint tests
test_copy(reporter);
@@ -251,6 +252,3 @@
test_cmap(reporter);
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Paint", TestPaintClass, TestPaint)
diff --git a/tests/ParsePathTest.cpp b/tests/ParsePathTest.cpp
index 4d0fdba..3ade1a7 100644
--- a/tests/ParsePathTest.cpp
+++ b/tests/ParsePathTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkParsePath.h"
static void test_to_from(skiatest::Reporter* reporter, const SkPath& path) {
@@ -38,7 +39,7 @@
6, 6.5f } }
};
-static void TestParsePath(skiatest::Reporter* reporter) {
+DEF_TEST(ParsePath, reporter) {
for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); i++) {
SkPath path;
bool success = SkParsePath::FromSVGString(gRec[i].fStr, &path);
@@ -60,6 +61,3 @@
p.addRoundRect(r, 4, 4.5f);
test_to_from(reporter, p);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("ParsePath", ParsePathClass, TestParsePath)
diff --git a/tests/PathCoverageTest.cpp b/tests/PathCoverageTest.cpp
index 97708bb..ede1fdc 100644
--- a/tests/PathCoverageTest.cpp
+++ b/tests/PathCoverageTest.cpp
@@ -1,14 +1,15 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkMath.h"
#include "SkPoint.h"
#include "SkScalar.h"
-#include "Test.h"
/*
Duplicates lots of code from gpu/src/GrPathUtils.cpp
@@ -160,10 +161,7 @@
one_d_pe(gRibbon, SK_ARRAY_COUNT(gRibbon), reporter);
}
-static void TestPathCoverage(skiatest::Reporter* reporter) {
+DEF_TEST(PathCoverage, reporter) {
TestQuadPointCount(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("PathCoverage", PathCoverageTestClass, TestPathCoverage)
diff --git a/tests/PathMeasureTest.cpp b/tests/PathMeasureTest.cpp
index c9acb7e..5c92ca1 100644
--- a/tests/PathMeasureTest.cpp
+++ b/tests/PathMeasureTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkPathMeasure.h"
static void test_small_segment3() {
@@ -79,7 +80,7 @@
#endif
}
-static void TestPathMeasure(skiatest::Reporter* reporter) {
+DEF_TEST(PathMeasure, reporter) {
SkPath path;
path.moveTo(0, 0);
@@ -207,6 +208,3 @@
test_small_segment2();
test_small_segment3();
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("PathMeasure", PathMeasureTestClass, TestPathMeasure)
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index 06ecff6..bea3ea5 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkPath.h"
@@ -3179,7 +3180,7 @@
}
};
-static void TestPath(skiatest::Reporter* reporter) {
+DEF_TEST(Path, reporter) {
SkTSize<SkScalar>::Make(3,4);
SkPath p, empty;
@@ -3298,6 +3299,3 @@
test_contains(reporter);
PathTest_Private::TestPathTo(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Path", PathTestClass, TestPath)
diff --git a/tests/PathUtilsTest.cpp b/tests/PathUtilsTest.cpp
index fad5cae..a147487 100644
--- a/tests/PathUtilsTest.cpp
+++ b/tests/PathUtilsTest.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2013 Google Inc.
*
@@ -6,13 +5,13 @@
* found in the LICENSE file.
*/
-#include "SkPathUtils.h"
-
+#include "Test.h"
+#include "TestClassDef.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
+#include "SkPathUtils.h"
#include "SkRandom.h"
#include "SkTime.h"
-#include "Test.h"
const int kNumIt = 100;
@@ -130,7 +129,7 @@
test_path_eq(reporter, &path, truth, w, h);
}
-static void TestPathUtils(skiatest::Reporter* reporter) {
+DEF_TEST(PathUtils, reporter) {
const int w[] = {4, 8, 12, 16};
const int h = 8, rowBytes = 4;
@@ -154,6 +153,3 @@
}
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("PathUtils", PathUtils, TestPathUtils)
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 9ef4bb0..4971797 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -4,7 +4,9 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
#include "Test.h"
+#include "TestClassDef.h"
#include "SkBitmapDevice.h"
#include "SkCanvas.h"
#include "SkColorPriv.h"
@@ -651,7 +653,7 @@
REPORTER_ASSERT(reporter, parentWBWB.willPlayBackBitmaps()); // 2
}
-static void TestPicture(skiatest::Reporter* reporter) {
+DEF_TEST(Picture, reporter) {
#ifdef SK_DEBUG
test_deleting_empty_playback();
test_serializing_empty_picture();
@@ -666,6 +668,3 @@
test_clip_expansion(reporter);
test_hierarchical(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Pictures", PictureTestClass, TestPicture)
diff --git a/tests/PictureUtilsTest.cpp b/tests/PictureUtilsTest.cpp
index bb01bc9..65771c3 100644
--- a/tests/PictureUtilsTest.cpp
+++ b/tests/PictureUtilsTest.cpp
@@ -4,7 +4,9 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
#include "Test.h"
+#include "TestClassDef.h"
#include "picture_utils.h"
#include "SkString.h"
@@ -45,10 +47,7 @@
#endif
}
-static void TestPictureUtils(skiatest::Reporter* reporter) {
+DEF_TEST(PictureUtils, reporter) {
test_filepath_creation(reporter);
test_get_basename(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("PictureUtils", PictureUtilsTestClass, TestPictureUtils)
diff --git a/tests/PipeTest.cpp b/tests/PipeTest.cpp
index acf288a..e18b3ae 100644
--- a/tests/PipeTest.cpp
+++ b/tests/PipeTest.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2012 Google Inc.
*
@@ -6,13 +5,14 @@
* found in the LICENSE file.
*/
+#include "Test.h"
+#include "TestClassDef.h"
#include "SamplePipeControllers.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
#include "SkGPipe.h"
#include "SkPaint.h"
#include "SkShader.h"
-#include "Test.h"
// Ensures that the pipe gracefully handles drawing an invalid bitmap.
static void testDrawingBadBitmap(SkCanvas* pipeCanvas) {
@@ -43,7 +43,7 @@
pipeCanvas->drawBitmap(bm, 0, 0);
}
-static void test_pipeTests(skiatest::Reporter*) {
+DEF_TEST(Pipe, reporter) {
SkBitmap bitmap;
bitmap.setConfig(SkBitmap::kARGB_8888_Config, 64, 64);
SkCanvas canvas(bitmap);
@@ -56,6 +56,3 @@
testDrawingAfterEndRecording(&canvas);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("PipeTest", PipeTestClass, test_pipeTests)
diff --git a/tests/QuickRejectTest.cpp b/tests/QuickRejectTest.cpp
index 9d87bff..d9e555d 100644
--- a/tests/QuickRejectTest.cpp
+++ b/tests/QuickRejectTest.cpp
@@ -5,9 +5,10 @@
* found in the LICENSE file.
*/
+#include "Test.h"
+#include "TestClassDef.h"
#include "SkCanvas.h"
#include "SkDrawLooper.h"
-#include "Test.h"
/*
* Subclass of looper that just draws once, with an offset in X.
@@ -76,9 +77,6 @@
REPORTER_ASSERT(reporter, 0xFFFFFFFF == *dst.getAddr32(5, 5));
}
-static void test(skiatest::Reporter* reporter) {
+DEF_TEST(QuickReject, reporter) {
test_drawBitmap(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("QuickReject", QuickRejectClass, test)
diff --git a/tests/RTreeTest.cpp b/tests/RTreeTest.cpp
index a907d6d..beff03c 100644
--- a/tests/RTreeTest.cpp
+++ b/tests/RTreeTest.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2012 Google Inc.
*
@@ -7,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkRandom.h"
#include "SkRTree.h"
#include "SkTSort.h"
@@ -139,7 +139,7 @@
}
}
-static void test_rtree(skiatest::Reporter* reporter) {
+DEF_TEST(RTree, reporter) {
SkRTree* rtree = SkRTree::Create(MIN_CHILDREN, MAX_CHILDREN);
SkAutoUnref au(rtree);
rtree_test_main(rtree, reporter);
@@ -149,7 +149,3 @@
SkAutoUnref auo(unsortedRtree);
rtree_test_main(unsortedRtree, reporter);
}
-
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("RTree", RTreeTestClass, test_rtree)
diff --git a/tests/RandomTest.cpp b/tests/RandomTest.cpp
index c9fee4a..536e388 100644
--- a/tests/RandomTest.cpp
+++ b/tests/RandomTest.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2013 Google Inc.
*
@@ -7,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkRandom.h"
#include "SkTSort.h"
@@ -178,7 +178,7 @@
REPORTER_ASSERT(reporter, chi_square_test(bins, 10000));
}
-static void TestRandom(skiatest::Reporter* reporter) {
+DEF_TEST(Random, reporter) {
// check uniform distributions of each byte in 32-bit word
test_random_byte(reporter, 0);
test_random_byte(reporter, 8);
@@ -191,6 +191,3 @@
test_range(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Random", RandomTestClass, TestRandom)
diff --git a/tests/Reader32Test.cpp b/tests/Reader32Test.cpp
index d81287b..b7a7c6d 100644
--- a/tests/Reader32Test.cpp
+++ b/tests/Reader32Test.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2011 Google Inc.
*
@@ -6,10 +5,9 @@
* found in the LICENSE file.
*/
-
-
-#include "SkReader32.h"
#include "Test.h"
+#include "TestClassDef.h"
+#include "SkReader32.h"
static void assert_eof(skiatest::Reporter* reporter, const SkReader32& reader) {
REPORTER_ASSERT(reporter, reader.eof());
@@ -35,7 +33,7 @@
assert_start(reporter, reader);
}
-static void Tests(skiatest::Reporter* reporter) {
+DEF_TEST(Reader32, reporter) {
SkReader32 reader;
assert_empty(reporter, reader);
REPORTER_ASSERT(reporter, NULL == reader.base());
@@ -82,6 +80,3 @@
REPORTER_ASSERT(reporter, NULL == reader.base());
REPORTER_ASSERT(reporter, NULL == reader.peek());
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Reader32", Reader32Class, Tests)
diff --git a/tests/RefCntTest.cpp b/tests/RefCntTest.cpp
index ed771e7..d844596 100644
--- a/tests/RefCntTest.cpp
+++ b/tests/RefCntTest.cpp
@@ -5,15 +5,13 @@
* found in the LICENSE file.
*/
-#include "SkTypes.h"
#include "Test.h"
-
+#include "TestClassDef.h"
#include "SkRefCnt.h"
-#include "SkThreadUtils.h"
-#include "SkWeakRefCnt.h"
#include "SkTRefArray.h"
-
-///////////////////////////////////////////////////////////////////////////////
+#include "SkThreadUtils.h"
+#include "SkTypes.h"
+#include "SkWeakRefCnt.h"
class InstCounterClass {
public:
@@ -143,11 +141,8 @@
ref->unref();
}
-static void test_refCntTests(skiatest::Reporter* reporter) {
+DEF_TEST(RefCnt, reporter) {
test_refCnt(reporter);
test_weakRefCnt(reporter);
test_refarray(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("RefCnt", RefCntTestClass, test_refCntTests)
diff --git a/tests/RefDictTest.cpp b/tests/RefDictTest.cpp
index 7d33f9b..96492ea 100644
--- a/tests/RefDictTest.cpp
+++ b/tests/RefDictTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkRefDict.h"
class TestRC : public SkRefCnt {
@@ -15,7 +16,7 @@
typedef SkRefCnt INHERITED;
};
-static void TestRefDict(skiatest::Reporter* reporter) {
+DEF_TEST(RefDict, reporter) {
TestRC data0, data1;
SkRefDict dict;
@@ -72,6 +73,3 @@
// be sure d's destructor lowered data0's owner count back to 1
REPORTER_ASSERT(reporter, 1 == data0.getRefCnt());
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("RefDict", RefDictTestClass, TestRefDict)
diff --git a/tests/RegionTest.cpp b/tests/RegionTest.cpp
index 5d3946e..4d423db 100644
--- a/tests/RegionTest.cpp
+++ b/tests/RegionTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkRegion.h"
#include "SkRandom.h"
@@ -222,7 +223,7 @@
return true;
}
-static void TestRegion(skiatest::Reporter* reporter) {
+DEF_TEST(Region, reporter) {
const SkIRect r2[] = {
{ 0, 0, 1, 1 },
{ 2, 2, 3, 3 },
@@ -254,6 +255,3 @@
test_empties(reporter);
test_fromchrome(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Region", RegionTestClass, TestRegion)
diff --git a/tests/RoundRectTest.cpp b/tests/RoundRectTest.cpp
index 7cadf01..57c93ae 100644
--- a/tests/RoundRectTest.cpp
+++ b/tests/RoundRectTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkMatrix.h"
#include "SkRRect.h"
@@ -553,7 +554,7 @@
}
}
-static void TestRoundRect(skiatest::Reporter* reporter) {
+DEF_TEST(RoundRect, reporter) {
test_round_rect_basic(reporter);
test_round_rect_rects(reporter);
test_round_rect_ovals(reporter);
@@ -563,6 +564,3 @@
test_round_rect_contains_rect(reporter);
test_round_rect_transform(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("RoundRect", TestRoundRectClass, TestRoundRect)
diff --git a/tests/SHA1Test.cpp b/tests/SHA1Test.cpp
index dde828c..87849b2 100644
--- a/tests/SHA1Test.cpp
+++ b/tests/SHA1Test.cpp
@@ -4,7 +4,9 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
#include "Test.h"
+#include "TestClassDef.h"
#include "SkSHA1.h"
static bool digests_equal(const SkSHA1::Digest& expectedDigest, const SkSHA1::Digest& computedDigest) {
@@ -45,11 +47,8 @@
REPORTER_ASSERT(reporter, digests_equal(test.digest, digest));
}
-static void TestSHA1(skiatest::Reporter* reporter) {
+DEF_TEST(SHA1, reporter) {
for (size_t i = 0; i < SK_ARRAY_COUNT(sha1_tests); ++i) {
sha1_test(sha1_tests[i], reporter);
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("SHA1", SHA1TestClass, TestSHA1)
diff --git a/tests/ScalarTest.cpp b/tests/ScalarTest.cpp
index 8a16645..47d3226 100644
--- a/tests/ScalarTest.cpp
+++ b/tests/ScalarTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkFloatingPoint.h"
#include "SkMath.h"
#include "SkPoint.h"
@@ -187,9 +188,6 @@
#pragma warning ( pop )
#endif
-static void TestScalar(skiatest::Reporter* reporter) {
+DEF_TEST(Scalar, reporter) {
test_isfinite(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Scalar", TestScalarClass, TestScalar)
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp
index 7ae06d7..bb05432 100644
--- a/tests/SerializationTest.cpp
+++ b/tests/SerializationTest.cpp
@@ -5,6 +5,8 @@
* found in the LICENSE file.
*/
+#include "Test.h"
+#include "TestClassDef.h"
#include "SkBitmapDevice.h"
#include "SkBitmapSource.h"
#include "SkCanvas.h"
@@ -12,7 +14,6 @@
#include "SkOrderedWriteBuffer.h"
#include "SkValidatingReadBuffer.h"
#include "SkXfermodeImageFilter.h"
-#include "Test.h"
static const uint32_t kArraySize = 64;
@@ -232,7 +233,7 @@
}
}
-static void Tests(skiatest::Reporter* reporter) {
+DEF_TEST(Serialization, reporter) {
// Test matrix serialization
{
SkMatrix matrix = SkMatrix::I();
@@ -316,6 +317,3 @@
TestBitmapSerialization(validBitmap, invalidBitmap2, false, reporter);
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Serialization", SerializationClass, Tests)
diff --git a/tests/ShaderImageFilterTest.cpp b/tests/ShaderImageFilterTest.cpp
index 49fc6e0..f0a17ac 100644
--- a/tests/ShaderImageFilterTest.cpp
+++ b/tests/ShaderImageFilterTest.cpp
@@ -1,17 +1,18 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkCanvas.h"
#include "SkShader.h"
#include "SkRectShaderImageFilter.h"
#include "SkGradientShader.h"
-static void test_asShaderMode(skiatest::Reporter* reporter) {
+DEF_TEST(ShaderImageFilter, reporter) {
int w = 10, h = 10;
SkRect r = SkRect::MakeWH(SkIntToScalar(w), SkIntToScalar(h)); // Make small 10x10 gradient
@@ -61,6 +62,3 @@
}
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("ShaderImageFilter", ShaderImageFilterTestClass, test_asShaderMode)
diff --git a/tests/ShaderOpacityTest.cpp b/tests/ShaderOpacityTest.cpp
index c3dc888..d514516 100644
--- a/tests/ShaderOpacityTest.cpp
+++ b/tests/ShaderOpacityTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkShader.h"
#include "SkGradientShader.h"
#include "SkColorShader.h"
@@ -108,12 +109,8 @@
REPORTER_ASSERT(reporter, colorShader4.isOpaque());
}
-static void test_shader_opacity(skiatest::Reporter* reporter)
-{
+DEF_TEST(ShaderOpacity, reporter) {
test_gradient(reporter);
test_color(reporter);
test_bitmap(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("ShaderOpacity", ShaderOpacityTestClass, test_shader_opacity)
diff --git a/tests/Sk64Test.cpp b/tests/Sk64Test.cpp
index 50b7ec7..9af32b1 100644
--- a/tests/Sk64Test.cpp
+++ b/tests/Sk64Test.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkRandom.h"
#include <math.h>
@@ -31,7 +32,7 @@
}
#endif
-static void TestSk64(skiatest::Reporter* reporter) {
+DEF_TEST(Sk64Test, reporter) {
enum BoolTests {
kZero_BoolTest,
kPos_BoolTest,
@@ -198,6 +199,3 @@
}
#endif
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Sk64", Sk64TestClass, TestSk64)
diff --git a/tests/SortTest.cpp b/tests/SortTest.cpp
index 28c6e68..ceca409 100644
--- a/tests/SortTest.cpp
+++ b/tests/SortTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkRandom.h"
#include "SkTSort.h"
@@ -32,7 +33,7 @@
}
}
-static void TestSort(skiatest::Reporter* reporter) {
+DEF_TEST(Sort, reporter) {
/** An array of random numbers to be sorted. */
int randomArray[500];
/** The reference sort of the random numbers. */
@@ -61,6 +62,3 @@
}
// need tests for SkStrSearch
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Sort", SortTestClass, TestSort)
diff --git a/tests/SrcOverTest.cpp b/tests/SrcOverTest.cpp
index d1e65a9..ae01d0c 100644
--- a/tests/SrcOverTest.cpp
+++ b/tests/SrcOverTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkColorPriv.h"
#include "SkXfermode.h"
@@ -24,7 +25,7 @@
return alpha + SkMulDiv255Round(dst, 255 - alpha);
}
-static void test_srcover_hack(skiatest::Reporter* reporter) {
+DEF_TEST(SrcOver, reporter) {
/* Here's the idea. Can we ensure that when we blend on top of an opaque
dst, that the result always stay's opaque (i.e. exactly 255)?
*/
@@ -74,6 +75,3 @@
}
}
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("SrcOver", SrcOverTestClass, test_srcover_hack)
diff --git a/tests/StreamTest.cpp b/tests/StreamTest.cpp
index 29d74fe..16978d5 100644
--- a/tests/StreamTest.cpp
+++ b/tests/StreamTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkRandom.h"
#include "SkOSFile.h"
#include "SkStream.h"
@@ -187,11 +188,8 @@
}
-static void TestStreams(skiatest::Reporter* reporter) {
+DEF_TEST(Stream, reporter) {
TestWStream(reporter);
TestPackedUInt(reporter);
TestNullData();
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Stream", StreamTestClass, TestStreams)
diff --git a/tests/StringTest.cpp b/tests/StringTest.cpp
index c8c10e1..04e0470 100644
--- a/tests/StringTest.cpp
+++ b/tests/StringTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkString.h"
#include <stdarg.h>
#include <stdio.h>
@@ -32,9 +33,7 @@
ARGS_TO_BUFFER(format, buffer, size);
}
-
-
-static void TestString(skiatest::Reporter* reporter) {
+DEF_TEST(String, reporter) {
SkString a;
SkString b((size_t)0);
SkString c("");
@@ -190,9 +189,6 @@
}
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("String", StringTestClass, TestString)
-
DEF_TEST(String_SkStrSplit, r) {
SkTArray<SkString> results;
diff --git a/tests/StrokeTest.cpp b/tests/StrokeTest.cpp
index 9336bed..1278bd4 100644
--- a/tests/StrokeTest.cpp
+++ b/tests/StrokeTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkRect.h"
@@ -55,9 +56,6 @@
}
}
-static void TestStroke(skiatest::Reporter* reporter) {
+DEF_TEST(Stroke, reporter) {
test_strokerect(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Stroke", TestStrokeClass, TestStroke)
diff --git a/tests/TLSTest.cpp b/tests/TLSTest.cpp
index d31a09f..6a423a5 100644
--- a/tests/TLSTest.cpp
+++ b/tests/TLSTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkGraphics.h"
#include "SkPaint.h"
#include "SkTLS.h"
@@ -67,7 +68,7 @@
SkTLS::Get(FakeCreateTLS, FakeDeleteTLS);
}
-static void TestTLS(skiatest::Reporter* reporter) {
+DEF_TEST(TLS, reporter) {
// TODO: Disabled for now to work around
// http://code.google.com/p/skia/issues/detail?id=619
// ('flaky segfault in TLS test on Shuttle_Ubuntu12 buildbots')
@@ -78,6 +79,3 @@
test_threads(&testTLSDestructor);
REPORTER_ASSERT(reporter, 0 == gCounter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("TLS", TLSClass, TestTLS)
diff --git a/tests/TSetTest.cpp b/tests/TSetTest.cpp
index 8f276f7..4026c6a 100644
--- a/tests/TSetTest.cpp
+++ b/tests/TSetTest.cpp
@@ -4,7 +4,9 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
#include "Test.h"
+#include "TestClassDef.h"
#include "SkTSet.h"
// Tests the SkTSet<T> class template.
@@ -127,11 +129,8 @@
#endif
}
-static void TestTSet(skiatest::Reporter* reporter) {
+DEF_TEST(TSet, reporter) {
TestTSet_basic(reporter);
TestTSet_advanced(reporter);
TestTSet_merge(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("TSet", TSetTest, TestTSet)
diff --git a/tests/TestSize.cpp b/tests/TestSize.cpp
index 6a9a887..475517a 100644
--- a/tests/TestSize.cpp
+++ b/tests/TestSize.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkSize.h"
static void TestISize(skiatest::Reporter* reporter) {
@@ -30,7 +31,7 @@
a.fWidth == b.fWidth && a.fHeight == b.fHeight);
}
-static void TestSize(skiatest::Reporter* reporter) {
+DEF_TEST(Size, reporter) {
TestISize(reporter);
SkSize a, b;
@@ -61,7 +62,4 @@
ia.set(ix, iy);
a.set(x, y);
REPORTER_ASSERT(reporter, a.toRound() == ia);
-};
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Size", TestSizeClass, TestSize)
+}
diff --git a/tests/ToUnicode.cpp b/tests/ToUnicode.cpp
index d518432..d6ca3da 100644
--- a/tests/ToUnicode.cpp
+++ b/tests/ToUnicode.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2010 The Android Open Source Project
*
@@ -6,8 +5,8 @@
* found in the LICENSE file.
*/
-
#include "Test.h"
+#include "TestClassDef.h"
#include "SkData.h"
#include "SkPDFTypes.h"
#include "SkPDFFont.h"
@@ -32,7 +31,7 @@
uint16_t firstGlypthID,
uint16_t lastGlypthID);
-static void TestToUnicode(skiatest::Reporter* reporter) {
+DEF_TEST(ToUnicode, reporter) {
SkTDArray<SkUnichar> glyphToUnicode;
SkTDArray<uint16_t> glyphsInSubset;
SkPDFGlyphSet subset;
@@ -180,6 +179,3 @@
REPORTER_ASSERT(reporter, stream_equals(buffer2, 0, expectedResult2,
buffer2.getOffset()));
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("ToUnicode", ToUnicodeTestClass, TestToUnicode)
diff --git a/tests/Typeface.cpp b/tests/Typeface.cpp
index 76fde7a..d589f23 100644
--- a/tests/Typeface.cpp
+++ b/tests/Typeface.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2013 Google Inc.
*
@@ -7,9 +6,10 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
#include "SkTypeface.h"
-static void TestDefaultTypeface(skiatest::Reporter* reporter) {
+DEF_TEST(Typeface, reporter) {
SkAutoTUnref<SkTypeface> t1(SkTypeface::CreateFromName(NULL, SkTypeface::kNormal));
SkAutoTUnref<SkTypeface> t2(SkTypeface::RefDefault(SkTypeface::kNormal));
@@ -25,6 +25,3 @@
REPORTER_ASSERT(reporter, NULL == t3.get());
#endif
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Typeface", TypefaceTestClass, TestDefaultTypeface)
diff --git a/tests/UnicodeTest.cpp b/tests/UnicodeTest.cpp
index ec9a8bc..68f0ecf 100644
--- a/tests/UnicodeTest.cpp
+++ b/tests/UnicodeTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkPaint.h"
#include "SkUtils.h"
@@ -77,10 +78,7 @@
REPORTER_ASSERT(reporter, !memcmp(glyphs8, glyphs32, count8 * sizeof(uint16_t)));
}
-static void TestUnicode(skiatest::Reporter* reporter) {
+DEF_TEST(Unicode, reporter) {
test_uvs(reporter);
test_textencodings(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Unicode", TestUnicodeClass, TestUnicode)
diff --git a/tests/UnitTestTest.cpp b/tests/UnitTestTest.cpp
index e3e1b97..f01b53d 100644
--- a/tests/UnitTestTest.cpp
+++ b/tests/UnitTestTest.cpp
@@ -5,14 +5,12 @@
* found in the LICENSE file.
*/
-#include "SkRTConf.h"
#include "Test.h"
+#include "TestClassDef.h"
+#include "SkRTConf.h"
-static void test_runUnitTests(skiatest::Reporter* reporter) {
+DEF_TEST(UnitTest, reporter) {
#ifdef SK_SUPPORT_UNITTEST
SkRTConfRegistry::UnitTest();
#endif
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("UnitTest", UnitTestTestClass, test_runUnitTests)
diff --git a/tests/UtilsTest.cpp b/tests/UtilsTest.cpp
index d7d67c2..dfd0a2f 100644
--- a/tests/UtilsTest.cpp
+++ b/tests/UtilsTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkRandom.h"
#include "SkRefCnt.h"
#include "SkTSearch.h"
@@ -183,7 +184,7 @@
}
}
-static void TestUTF(skiatest::Reporter* reporter) {
+DEF_TEST(Utils, reporter) {
static const struct {
const char* fUtf8;
SkUnichar fUni;
@@ -219,6 +220,3 @@
test_autounref(reporter);
test_autostarray(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Utils", UtfTestClass, TestUTF)
diff --git a/tests/WArrayTest.cpp b/tests/WArrayTest.cpp
index 6017862..020953f 100644
--- a/tests/WArrayTest.cpp
+++ b/tests/WArrayTest.cpp
@@ -6,6 +6,7 @@
*/
#include "Test.h"
+#include "TestClassDef.h"
// Include the implementation so we can make an appropriate template instance.
#include "SkAdvancedTypefaceMetrics.h"
@@ -173,7 +174,7 @@
}
};
-static void TestWArray(skiatest::Reporter* reporter) {
+DEF_TEST(WArray, reporter) {
TestWData(reporter, data1, SK_ARRAY_COUNT(data1), NULL, 0, expected1);
TestWData(reporter, data2, SK_ARRAY_COUNT(data2), NULL, 0, expected2);
TestWData(reporter, data3, SK_ARRAY_COUNT(data3), NULL, 0, expected3);
@@ -205,6 +206,3 @@
TestWData(reporter, data14, SK_ARRAY_COUNT(data14), subset14,
SK_ARRAY_COUNT(subset14), expectedSubset14);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("WArray", WArrayTest, TestWArray)
diff --git a/tests/Writer32Test.cpp b/tests/Writer32Test.cpp
index 1521837..2032fef 100644
--- a/tests/Writer32Test.cpp
+++ b/tests/Writer32Test.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2011 Google Inc.
*
@@ -6,12 +5,11 @@
* found in the LICENSE file.
*/
-
-
+#include "Test.h"
+#include "TestClassDef.h"
#include "SkRandom.h"
#include "SkReader32.h"
#include "SkWriter32.h"
-#include "Test.h"
static void check_contents(skiatest::Reporter* reporter, const SkWriter32& writer,
const void* expected, size_t size) {
@@ -188,7 +186,7 @@
}
}
-static void Tests(skiatest::Reporter* reporter) {
+DEF_TEST(Writer32, reporter) {
// dynamic allocator
{
SkWriter32 writer(256 * 4);
@@ -252,6 +250,3 @@
test_ptr(reporter);
test_rewind(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Writer32", Writer32Class, Tests)
diff --git a/tests/XfermodeTest.cpp b/tests/XfermodeTest.cpp
index 7d23b85..8f4d65a 100644
--- a/tests/XfermodeTest.cpp
+++ b/tests/XfermodeTest.cpp
@@ -1,11 +1,12 @@
-
/*
* Copyright 2011 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"
+#include "TestClassDef.h"
#include "SkColor.h"
#include "SkXfermode.h"
@@ -63,10 +64,7 @@
}
}
-static void test_xfermodes(skiatest::Reporter* reporter) {
+DEF_TEST(Xfermode, reporter) {
test_asMode(reporter);
test_IsMode(reporter);
}
-
-#include "TestClassDef.h"
-DEFINE_TESTCLASS("Xfermode", XfermodeTestClass, test_xfermodes)