Rename TestSize.cpp to SizeTest.cpp
authortfarina <tfarina@chromium.org>
Wed, 25 Jun 2014 17:39:00 +0000 (10:39 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 25 Jun 2014 17:39:02 +0000 (10:39 -0700)
It is the only file where Test is the prefix rather than the sufix.
 This patch fixes that so it matches with the rest of the files
 under tests/ directory.

And separate SkISize test into its own DEF_TEST().

BUG=None
TEST=make tests && out/Debug/tests
R=mtklein@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/337783007

gyp/tests.gypi
tests/SizeTest.cpp [new file with mode: 0644]
tests/TestSize.cpp [deleted file]

index 9876f18a44faf1968261a0ec3391f514fbf6c12d..35431bd30b61ae53b353b841bb469eb0ac4a47f7 100644 (file)
     '../tests/RoundRectTest.cpp',
     '../tests/RuntimeConfigTest.cpp',
     '../tests/SHA1Test.cpp',
+    '../tests/SListTest.cpp',
     '../tests/ScalarTest.cpp',
     '../tests/SerializationTest.cpp',
     '../tests/ShaderImageFilterTest.cpp',
     '../tests/ShaderOpacityTest.cpp',
+    '../tests/SizeTest.cpp',
     '../tests/SkBase64Test.cpp',
-    '../tests/SListTest.cpp',
     '../tests/SmallAllocatorTest.cpp',
     '../tests/SortTest.cpp',
     '../tests/SrcOverTest.cpp',
     '../tests/TArrayTest.cpp',
     '../tests/TLSTest.cpp',
     '../tests/TSetTest.cpp',
-    '../tests/TestSize.cpp',
     '../tests/TextureCompressionTest.cpp',
     '../tests/TileGridTest.cpp',
     '../tests/ToUnicodeTest.cpp',
diff --git a/tests/SizeTest.cpp b/tests/SizeTest.cpp
new file mode 100644 (file)
index 0000000..9800aa2
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * 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 "SkSize.h"
+
+#include "Test.h"
+
+DEF_TEST(ISize, reporter) {
+    SkISize  a, b;
+
+    a.set(0, 0);
+    REPORTER_ASSERT(reporter, a.isEmpty());
+    a.set(5, -5);
+    REPORTER_ASSERT(reporter, a.isEmpty());
+    a.clampNegToZero();
+    REPORTER_ASSERT(reporter, a.isEmpty());
+    b.set(5, 0);
+    REPORTER_ASSERT(reporter, a == b);
+
+    a.set(3, 5);
+    REPORTER_ASSERT(reporter, !a.isEmpty());
+    b = a;
+    REPORTER_ASSERT(reporter, !b.isEmpty());
+    REPORTER_ASSERT(reporter, a == b);
+    REPORTER_ASSERT(reporter, !(a != b));
+    REPORTER_ASSERT(reporter,
+                    a.fWidth == b.fWidth && a.fHeight == b.fHeight);
+}
+
+DEF_TEST(Size, reporter) {
+    SkSize a, b;
+    int ix = 5;
+    int iy = 3;
+    SkScalar x = SkIntToScalar(ix);
+    SkScalar y = SkIntToScalar(iy);
+
+    a.set(0, 0);
+    REPORTER_ASSERT(reporter, a.isEmpty());
+    a.set(x, -x);
+    REPORTER_ASSERT(reporter, a.isEmpty());
+    a.clampNegToZero();
+    REPORTER_ASSERT(reporter, a.isEmpty());
+    b.set(x, 0);
+    REPORTER_ASSERT(reporter, a == b);
+
+    a.set(y, x);
+    REPORTER_ASSERT(reporter, !a.isEmpty());
+    b = a;
+    REPORTER_ASSERT(reporter, !b.isEmpty());
+    REPORTER_ASSERT(reporter, a == b);
+    REPORTER_ASSERT(reporter, !(a != b));
+    REPORTER_ASSERT(reporter,
+                    a.fWidth == b.fWidth && a.fHeight == b.fHeight);
+
+    SkISize ia;
+    ia.set(ix, iy);
+    a.set(x, y);
+    REPORTER_ASSERT(reporter, a.toRound() == ia);
+}
diff --git a/tests/TestSize.cpp b/tests/TestSize.cpp
deleted file mode 100644 (file)
index 466a628..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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 "SkSize.h"
-#include "Test.h"
-
-static void TestISize(skiatest::Reporter* reporter) {
-    SkISize  a, b;
-
-    a.set(0, 0);
-    REPORTER_ASSERT(reporter, a.isEmpty());
-    a.set(5, -5);
-    REPORTER_ASSERT(reporter, a.isEmpty());
-    a.clampNegToZero();
-    REPORTER_ASSERT(reporter, a.isEmpty());
-    b.set(5, 0);
-    REPORTER_ASSERT(reporter, a == b);
-
-    a.set(3, 5);
-    REPORTER_ASSERT(reporter, !a.isEmpty());
-    b = a;
-    REPORTER_ASSERT(reporter, !b.isEmpty());
-    REPORTER_ASSERT(reporter, a == b);
-    REPORTER_ASSERT(reporter, !(a != b));
-    REPORTER_ASSERT(reporter,
-                    a.fWidth == b.fWidth && a.fHeight == b.fHeight);
-}
-
-DEF_TEST(Size, reporter) {
-    TestISize(reporter);
-
-    SkSize a, b;
-    int ix = 5;
-    int iy = 3;
-    SkScalar x = SkIntToScalar(ix);
-    SkScalar y = SkIntToScalar(iy);
-
-    a.set(0, 0);
-    REPORTER_ASSERT(reporter, a.isEmpty());
-    a.set(x, -x);
-    REPORTER_ASSERT(reporter, a.isEmpty());
-    a.clampNegToZero();
-    REPORTER_ASSERT(reporter, a.isEmpty());
-    b.set(x, 0);
-    REPORTER_ASSERT(reporter, a == b);
-
-    a.set(y, x);
-    REPORTER_ASSERT(reporter, !a.isEmpty());
-    b = a;
-    REPORTER_ASSERT(reporter, !b.isEmpty());
-    REPORTER_ASSERT(reporter, a == b);
-    REPORTER_ASSERT(reporter, !(a != b));
-    REPORTER_ASSERT(reporter,
-                    a.fWidth == b.fWidth && a.fHeight == b.fHeight);
-
-    SkISize ia;
-    ia.set(ix, iy);
-    a.set(x, y);
-    REPORTER_ASSERT(reporter, a.toRound() == ia);
-}