-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(incr): decrease lasting time threshold deadline from 1000ms to 1…
…00ms
- Loading branch information
THAVEAU Alexis
committed
Nov 24, 2023
1 parent
70fda5d
commit ba4d62a
Showing
4 changed files
with
53 additions
and
5 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
46 changes: 46 additions & 0 deletions
46
src/test/java/io/github/grrolland/hcshm/ShmValueTestCase.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,46 @@ | ||
package io.github.grrolland.hcshm; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
/*** | ||
* ShmValue test case | ||
*/ | ||
public class ShmValueTestCase { | ||
|
||
@Test | ||
public void getValue() { | ||
ShmValue shmValue = new ShmValue("X", 0); | ||
assertEquals("X", shmValue.getValue()); | ||
} | ||
|
||
@Test | ||
public void getLastingTime() { | ||
ShmValue shmValue = new ShmValue("X", 0); | ||
assertEquals(0, shmValue.getLastingTime()); | ||
} | ||
|
||
@Test | ||
public void getLastingTimeExpired() { | ||
ShmValue shmValue = new ShmValue("X", 99); | ||
assertEquals(-1, shmValue.getLastingTime()); | ||
} | ||
|
||
@Test | ||
public void getLastingTimeNotExpired() { | ||
ShmValue shmValue = new ShmValue("X", 150); | ||
assertTrue(shmValue.getLastingTime() > 100); | ||
} | ||
|
||
@Test | ||
public void expire() { | ||
ShmValue shmValue = new ShmValue("X", 0); | ||
assertEquals(0, shmValue.getLastingTime()); | ||
shmValue.expire(150); | ||
assertTrue(shmValue.getLastingTime() > 100); | ||
shmValue.expire(99); | ||
assertEquals(-1, shmValue.getLastingTime()); | ||
} | ||
} |