Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 260874 Details for
Bug 491402
Enhancement for Angle (getDeltaCW/CCW and isClockwise)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Test cases for Angle.getDeltaCCW, getDeltaCW and isClockwise
angle-deltacw-test.patch (text/plain), 2.39 KB, created by
Colin Sharples
on 2016-04-11 17:35:33 EDT
(
hide
)
Description:
Test cases for Angle.getDeltaCCW, getDeltaCW and isClockwise
Filename:
MIME Type:
Creator:
Colin Sharples
Created:
2016-04-11 17:35:33 EDT
Size:
2.39 KB
patch
obsolete
>diff --git a/org.eclipse.gef4.geometry.tests/src/org/eclipse/gef4/geometry/tests/AngleTests.java b/org.eclipse.gef4.geometry.tests/src/org/eclipse/gef4/geometry/tests/AngleTests.java >index 03f5eb7..00c3565 100644 >--- a/org.eclipse.gef4.geometry.tests/src/org/eclipse/gef4/geometry/tests/AngleTests.java >+++ b/org.eclipse.gef4.geometry.tests/src/org/eclipse/gef4/geometry/tests/AngleTests.java >@@ -1,14 +1,14 @@ > /******************************************************************************* > * Copyright (c) 2011, 2014 itemis AG and others. >- * >+ * > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html >- * >+ * > * Contributors: > * Matthias Wienand (itemis AG) - initial API and implementation >- * >+ * > *******************************************************************************/ > package org.eclipse.gef4.geometry.tests; > >@@ -92,6 +92,24 @@ > } > > @Test >+ public void test_getDeltaCCW() throws Exception { >+ Angle alpha = Angle.fromDeg(270); >+ assertEquals(Angle.fromDeg(60), alpha.getDeltaCCW(Angle.fromDeg(210))); >+ assertEquals(Angle.fromDeg(210), alpha.getDeltaCCW(Angle.fromDeg(60))); >+ alpha = Angle.fromDeg(90); >+ assertEquals(Angle.fromDeg(120), alpha.getDeltaCCW(Angle.fromDeg(330))); >+ } >+ >+ @Test >+ public void test_getDeltaCW() throws Exception { >+ Angle alpha = Angle.fromDeg(90); >+ assertEquals(Angle.fromDeg(60), alpha.getDeltaCW(Angle.fromDeg(150))); >+ assertEquals(Angle.fromDeg(210), alpha.getDeltaCW(Angle.fromDeg(300))); >+ alpha = Angle.fromDeg(270); >+ assertEquals(Angle.fromDeg(120), alpha.getDeltaCW(Angle.fromDeg(30))); >+ } >+ >+ @Test > public void test_getMultiplied() { > Angle alpha = Angle.fromDeg(180); > >@@ -99,6 +117,18 @@ > } > > @Test >+ public void test_isClockwise() throws Exception { >+ Angle alpha = Angle.fromDeg(90); >+ assertTrue(alpha.isClockwise(Angle.fromDeg(180))); >+ assertFalse(alpha.isClockwise(Angle.fromDeg(0))); >+ alpha = Angle.fromDeg(300); >+ assertTrue(alpha.isClockwise(Angle.fromDeg(60))); >+ assertFalse(alpha.isClockwise(Angle.fromDeg(140))); >+ // edge case - exactly 180 degrees is true >+ assertTrue(alpha.isClockwise(Angle.fromDeg(120))); >+ } >+ >+ @Test > public void test_norm() { > Angle alpha = Angle.fromDeg(361); > Angle beta = Angle.fromDeg(1);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
nyssen
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 491402
:
260832
| 260874