forked from wohaopa/GTNHModify
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug fix for incorrect minComputation special value calculation
- updated dependencies to GTNH 2.7.0
- Loading branch information
Showing
13 changed files
with
107 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
test { | ||
useJUnitPlatform() | ||
} |
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
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
// Add any additional repositories for your dependencies here. | ||
|
||
repositories { | ||
|
||
maven { | ||
url = "https://jitpack.io" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import cn.elytra.gtnh.cutcorners.strate.util.ResearchStationHelper; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
/** | ||
* Test cases for complicated special values. | ||
*/ | ||
public class TestSpecialValueAccessors { | ||
|
||
@Test | ||
public void testResearchStationSV() { | ||
int value = 0; | ||
|
||
Assertions.assertEquals(0, ResearchStationHelper.getAmp(value)); | ||
Assertions.assertEquals(0, ResearchStationHelper.getMinComputation(value)); | ||
|
||
value += 100 << 16; // set 100 to min computation | ||
|
||
Assertions.assertEquals(0, ResearchStationHelper.getAmp(value)); | ||
Assertions.assertEquals(100, ResearchStationHelper.getMinComputation(value)); | ||
|
||
value += 200; | ||
|
||
Assertions.assertEquals(200, ResearchStationHelper.getAmp(value)); | ||
Assertions.assertEquals(100, ResearchStationHelper.getMinComputation(value)); | ||
|
||
// value = (minComp) 100 & (amp) 200 | ||
|
||
Assertions.assertEquals((((value >> 16) << 16) + 12), ResearchStationHelper.getSpecialValueAtAmp(value, 12)); | ||
Assertions.assertEquals(((99 << 16) | 200), ResearchStationHelper.getSpecialValueAtMinComputation(value, 99)); | ||
} | ||
|
||
} |