-
-
Notifications
You must be signed in to change notification settings - Fork 768
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix problem with opening XYZ files containing negative positions (#2649)
- Loading branch information
Showing
8 changed files
with
83 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...rm-surfacescanner/src/test/java/com/willwinder/ugs/platform/surfacescanner/UtilsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.willwinder.ugs.platform.surfacescanner; | ||
|
||
import com.willwinder.universalgcodesender.model.Position; | ||
import com.willwinder.universalgcodesender.model.UnitUtils; | ||
import static org.junit.Assert.*; | ||
import org.junit.Test; | ||
|
||
import java.util.List; | ||
|
||
public class UtilsTest { | ||
@Test | ||
public void getMaxPosition_shouldReturnTheMaxPositionEvenIfNegative() { | ||
Position maxPosition = Utils.getMaxPosition( | ||
List.of( | ||
new Position(-1, -2, -3, UnitUtils.Units.MM), | ||
new Position(-3, -2, -1, UnitUtils.Units.MM))); | ||
|
||
assertEquals(new Position(-1, -2, -1, UnitUtils.Units.MM), maxPosition); | ||
} | ||
|
||
@Test | ||
public void getMinPosition_shouldReturnTheMinPositionEvenIfNegative() { | ||
Position minPosition = Utils.getMinPosition( | ||
List.of( | ||
new Position(-1, -2, -3, UnitUtils.Units.MM), | ||
new Position(-3, -2, -1, UnitUtils.Units.MM))); | ||
|
||
assertEquals(new Position(-3, -2, -3, UnitUtils.Units.MM), minPosition); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters