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

Unified Diff: tests/TestSize.cpp

Issue 337783007: Rename TestSize.cpp to SkSizeTest.cpp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: name fixes Created 6 years, 6 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 | « tests/SizeTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/TestSize.cpp
diff --git a/tests/TestSize.cpp b/tests/TestSize.cpp
deleted file mode 100644
index 466a628c5c723fef11ba95474b080440410f8c3c..0000000000000000000000000000000000000000
--- a/tests/TestSize.cpp
+++ /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);
-}
« no previous file with comments | « tests/SizeTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698