/*
* Copyright 2015 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.tom_roush.pdfbox.util;
import com.tom_roush.pdfbox.cos.COSArray;
import com.tom_roush.pdfbox.cos.COSFloat;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* @author Tilman Hausherr
*/
public class MatrixTest
{
/**
* Test of PDFBOX-2872 bug
*/
@Test
public void testPdfbox2872()
{
Matrix m = new Matrix(2, 4, 5, 8, 2, 0);
COSArray toCOSArray = m.toCOSArray();
assertEquals(new COSFloat(2), toCOSArray.get(0));
assertEquals(new COSFloat(4), toCOSArray.get(1));
assertEquals(new COSFloat(5), toCOSArray.get(2));
assertEquals(new COSFloat(8), toCOSArray.get(3));
assertEquals(new COSFloat(2), toCOSArray.get(4));
assertEquals(new COSFloat(0), toCOSArray.get(5));
}
}