1 2 17 18 package org.apache.poi.hssf.record.formula; 19 20 import junit.framework.TestCase; 21 22 27 28 public class TestFuncPtg extends TestCase 29 { 30 31 public TestFuncPtg( String name ) 32 { 33 super( name ); 34 } 35 36 37 public static void main( java.lang.String [] args ) 38 { 39 junit.textui.TestRunner.run( TestFuncPtg.class ); 40 } 41 42 48 49 public void testLeftOvers() 50 { 51 byte[] fakeData = new byte[4]; 52 53 fakeData[0] = (byte) 0x41; 54 fakeData[1] = (byte) 0x20; fakeData[2] = (byte) 0; 56 fakeData[3] = (byte) 8; 57 58 FuncPtg ptg = new FuncPtg( fakeData, 0 ); 59 assertEquals( "Len formula index is not 32(20H)", (int) 0x20, ptg.getFunctionIndex() ); 60 assertEquals( "Number of operands in the len formula", 1, ptg.getNumberOfOperands() ); 61 assertEquals( "Function Name", "LEN", ptg.getName() ); 62 assertEquals( "Ptg Size", 3, ptg.getSize() ); 63 66 } 67 } 68 69 70 | Popular Tags |