2 * Copyright 2011 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
12 DEF_TEST(ISize, reporter) {
16 REPORTER_ASSERT(reporter, a.isEmpty());
18 REPORTER_ASSERT(reporter, a.isEmpty());
20 REPORTER_ASSERT(reporter, a.isEmpty());
22 REPORTER_ASSERT(reporter, a == b);
25 REPORTER_ASSERT(reporter, !a.isEmpty());
27 REPORTER_ASSERT(reporter, !b.isEmpty());
28 REPORTER_ASSERT(reporter, a == b);
29 REPORTER_ASSERT(reporter, !(a != b));
30 REPORTER_ASSERT(reporter,
31 a.fWidth == b.fWidth && a.fHeight == b.fHeight);
34 DEF_TEST(Size, reporter) {
38 SkScalar x = SkIntToScalar(ix);
39 SkScalar y = SkIntToScalar(iy);
42 REPORTER_ASSERT(reporter, a.isEmpty());
44 REPORTER_ASSERT(reporter, a.isEmpty());
46 REPORTER_ASSERT(reporter, a.isEmpty());
48 REPORTER_ASSERT(reporter, a == b);
51 REPORTER_ASSERT(reporter, !a.isEmpty());
53 REPORTER_ASSERT(reporter, !b.isEmpty());
54 REPORTER_ASSERT(reporter, a == b);
55 REPORTER_ASSERT(reporter, !(a != b));
56 REPORTER_ASSERT(reporter,
57 a.fWidth == b.fWidth && a.fHeight == b.fHeight);
62 REPORTER_ASSERT(reporter, a.toRound() == ia);