src/test/java/de/blau/android/util/GeometryTest.java
/**
     * Test offseting a geometry, the input data is rather trivial
     */
Test offseting a geometry, the input data is rather trivial
Test offseting a geometry the input data is rather trivial
@Test
    public void offsetTest() {
        float[] input = { -5f, 5f, 5f, 5f };
        Geometry.offset(input, input.length, false, 1);
        assertArrayEquals(new float[] { -5f, 4f, 5f, 4f }, input, 0.000001f);
        float[] input2 = { -5f, -5f, 5f, 5f };
        Geometry.offset(input2, input2.length, false, 1);
        assertArrayEquals(new float[] { -4.2928934f, -5.7071066f, 5.7071066f, 4.2928934f }, input2, 0.000001f);
        float[] input3 = { -5f, 5f, 5f, 5f, 5f, 5f, 5f, -5f, 5f, -5f, -5f, -5f, -5f, -5f, -5f, 5f };
        Geometry.offset(input3, input3.length, true, 1);
        assertArrayEquals(new float[] { -4f, 4f, 4f, 4f, 4f, 4f, 4f, -4f, 4f, -4f, -4f, -4f, -4f, -4f, -4f, 4f }, input3, 0.000001f);
    }
@ Test public void offsetTest ( ) { float [ ] input = { - 5f , 5f , 5f , 5f } ; Geometry . offset ( input , input . length , false , 1 ) ; assertArrayEquals ( new float [ ] { - 5f , 4f , 5f , 4f } , input , 0.000001f ) ; float [ ] input2 = { - 5f , - 5f , 5f , 5f } ; Geometry . offset ( input2 , input2 . length , false , 1 ) ; assertArrayEquals ( new float [ ] { - 4.2928934f , - 5.7071066f , 5.7071066f , 4.2928934f } , input2 , 0.000001f ) ; float [ ] input3 = { - 5f , 5f , 5f , 5f , 5f , 5f , 5f , - 5f , 5f , - 5f , - 5f , - 5f , - 5f , - 5f , - 5f , 5f } ; Geometry . offset ( input3 , input3 . length , true , 1 ) ; assertArrayEquals ( new float [ ] { - 4f , 4f , 4f , 4f , 4f , 4f , 4f , - 4f , 4f , - 4f , - 4f , - 4f , - 4f , - 4f , - 4f , 4f } , input3 , 0.000001f ) ; }
Test offseting a geometry, the input data is rather trivial
Test offseting a geometry the input data is rather trivial