mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-05-27 00:00:02 -04:00
#865 TIFF: Half decoding fix, now uses standard conversion.
This commit is contained in:
+12
-5
@@ -1,16 +1,16 @@
|
||||
package com.twelvemonkeys.imageio.metadata.tiff;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import com.twelvemonkeys.io.FastByteArrayOutputStream;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.util.Random;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.twelvemonkeys.io.FastByteArrayOutputStream;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* HalfTest.
|
||||
@@ -36,6 +36,13 @@ public class HalfTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExactEncoding() {
|
||||
for (short half = -2048; half < 2048; half++) {
|
||||
assertEquals(String.valueOf(half), half, Half.shortBitsToFloat(Half.floatToShortBits(half)), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRoundTripBack() {
|
||||
for (int i = 0; i < 1024; i++) {
|
||||
|
||||
Reference in New Issue
Block a user