use of org.apache.flink.graph.drivers.transform.GraphKeyTypeTransform.UnsignedFloatToLongValueWithProperHashCode in project flink by apache.
the class GraphKeyTypeTransformTest method testFromFloat.
@Test
public void testFromFloat() throws Exception {
TranslateFunction<Float, LongValueWithProperHashCode> translator = new UnsignedFloatToLongValueWithProperHashCode();
Assert.assertEquals(new LongValueWithProperHashCode(0L), translator.translate(Float.intBitsToFloat(0), longValueWithProperHashCode));
Assert.assertEquals(new LongValueWithProperHashCode((long) Integer.MAX_VALUE + 1), translator.translate(Float.intBitsToFloat(Integer.MIN_VALUE), longValueWithProperHashCode));
Assert.assertEquals(new LongValueWithProperHashCode(LongValueToUnsignedFloat.MAX_VERTEX_COUNT - 1), translator.translate(Float.intBitsToFloat(-1), longValueWithProperHashCode));
}
Aggregations