michael@0: /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "TestPoint.h" michael@0: michael@0: #include "Point.h" michael@0: michael@0: using namespace mozilla::gfx; michael@0: michael@0: TestPoint::TestPoint() michael@0: { michael@0: REGISTER_TEST(TestPoint, Addition); michael@0: REGISTER_TEST(TestPoint, Subtraction); michael@0: } michael@0: michael@0: void michael@0: TestPoint::Addition() michael@0: { michael@0: Point a, b; michael@0: a.x = 2; michael@0: a.y = 2; michael@0: b.x = 5; michael@0: b.y = -5; michael@0: michael@0: a += b; michael@0: michael@0: VERIFY(a.x == 7); michael@0: VERIFY(a.y == -3); michael@0: } michael@0: michael@0: void michael@0: TestPoint::Subtraction() michael@0: { michael@0: Point a, b; michael@0: a.x = 2; michael@0: a.y = 2; michael@0: b.x = 5; michael@0: b.y = -5; michael@0: michael@0: a -= b; michael@0: michael@0: VERIFY(a.x == -3); michael@0: VERIFY(a.y == 7); michael@0: }