Skip to content

Commit

Permalink
added back some enums
Browse files Browse the repository at this point in the history
  • Loading branch information
kenhuuu committed Aug 14, 2024
1 parent dc947b1 commit c5e284c
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,19 @@ public void shouldReadWriteNegativeInfinityDouble() throws Exception {
assertEquals(resource, recycled);
}

@Test
public void shouldReadWriteNegativeZeroDouble() throws Exception {
final String resourceName = "neg-zero-double";

final Double resource = findModelEntryObject(resourceName);
final Double fromStatic = read(readFromResource(resourceName), Double.class);
final Double recycled = read(write(fromStatic, Double.class, resourceName), Double.class);
assertNotSame(fromStatic, recycled);
assertEquals(fromStatic, recycled);
assertEquals(resource, fromStatic);
assertEquals(resource, recycled);
}

@Test
public void shouldReadWriteZeroDuration() throws Exception {
final String resourceName = "zero-duration";
Expand Down Expand Up @@ -433,6 +446,19 @@ public void shouldReadWriteNegativeInfinityFloat() throws Exception {
assertEquals(resource, recycled);
}

@Test
public void shouldReadWriteNegativeZeroFloat() throws Exception {
final String resourceName = "neg-zero-float";

final Float resource = findModelEntryObject(resourceName);
final Float fromStatic = read(readFromResource(resourceName), Float.class);
final Float recycled = read(write(fromStatic, Float.class, resourceName), Float.class);
assertNotSame(fromStatic, recycled);
assertEquals(fromStatic, recycled);
assertEquals(resource, fromStatic);
assertEquals(resource, recycled);
}

@Test
public void shouldReadWriteMaxInteger() throws Exception {
final String resourceName = "max-int";
Expand Down Expand Up @@ -827,4 +853,29 @@ public void shouldReadWriteSetVertexProperty() throws Exception {
assertVertexProperty(resource, recycled);
assertVertexProperty(resource, fromStatic);
}

@Test
public void shouldReadWriteIdT() throws Exception {
final String resourceName = "id-t";

final T resource = findModelEntryObject(resourceName);
final T fromStatic = read(readFromResource(resourceName), T.class);
final T recycled = read(write(fromStatic, T.class, resourceName), T.class);
assertEquals(fromStatic, recycled);
assertEquals(resource, fromStatic);
assertEquals(resource, recycled);
}

@Test
public void shouldReadWriteOutDirection() throws Exception {
final String resourceName = "out-direction";

final Direction resource = findModelEntryObject(resourceName);
final Direction fromStatic = read(readFromResource(resourceName), Direction.class);
final Direction recycled = read(write(fromStatic, Direction.class, resourceName), Direction.class);
assertEquals(fromStatic, recycled);
assertEquals(resource, fromStatic);
assertEquals(resource, recycled);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ private Model() {
addCoreEntry(Double.NaN, "nan-double");
addCoreEntry(Double.POSITIVE_INFINITY, "pos-inf-double");
addCoreEntry(Double.NEGATIVE_INFINITY, "neg-inf-double");
addCoreEntry(-0.0, "neg-zero-double");

addCoreEntry(Float.MAX_VALUE, "max-float");
addCoreEntry(Float.MIN_VALUE, "min-float");
Expand All @@ -127,6 +128,7 @@ private Model() {
addCoreEntry(Float.NaN, "nan-float");
addCoreEntry(Float.POSITIVE_INFINITY, "pos-inf-float");
addCoreEntry(Float.NEGATIVE_INFINITY, "neg-inf-float");
addCoreEntry(-0.0f, "neg-zero-float");

addCoreEntry(Integer.MAX_VALUE, "max-int");
addCoreEntry(Integer.MIN_VALUE, "min-int");
Expand Down Expand Up @@ -205,6 +207,9 @@ private Model() {

addExtendedEntry(Short.MIN_VALUE, "min-short", "");
addExtendedEntry(Short.MAX_VALUE, "max-short", "");

addGraphProcessEntry(Direction.OUT, "out-direction", "");
addGraphProcessEntry(T.id, "id-t", "");
}

public static Model instance() {
Expand Down

0 comments on commit c5e284c

Please sign in to comment.