Search in sources :

Example 16 with CTypeParser

use of com.ibm.j9ddr.CTypeParser in project openj9 by eclipse.

the class CTypeParserTest method testUserTypeContainingConst.

@Test
public void testUserTypeContainingConst() {
    CTypeParser sut = new CTypeParser("struct myconst");
    assertEquals("", sut.getPrefix());
    assertEquals("struct myconst", sut.getCoreType());
    assertEquals("", sut.getSuffix());
}
Also used : CTypeParser(com.ibm.j9ddr.CTypeParser) Test(org.junit.Test)

Example 17 with CTypeParser

use of com.ibm.j9ddr.CTypeParser in project openj9 by eclipse.

the class CTypeParserTest method testFunnySpaces.

@Test
public void testFunnySpaces() {
    CTypeParser sut = new CTypeParser("   const   int [ ] [] [ ]");
    assertEquals("const ", sut.getPrefix());
    assertEquals("int", sut.getCoreType());
    assertEquals("[][][]", sut.getSuffix());
}
Also used : CTypeParser(com.ibm.j9ddr.CTypeParser) Test(org.junit.Test)

Example 18 with CTypeParser

use of com.ibm.j9ddr.CTypeParser in project openj9 by eclipse.

the class CTypeParserTest method testSimpleArray2.

@Test
public void testSimpleArray2() {
    CTypeParser sut = new CTypeParser("int []");
    assertEquals("", sut.getPrefix());
    assertEquals("int", sut.getCoreType());
    assertEquals("[]", sut.getSuffix());
}
Also used : CTypeParser(com.ibm.j9ddr.CTypeParser) Test(org.junit.Test)

Example 19 with CTypeParser

use of com.ibm.j9ddr.CTypeParser in project openj9 by eclipse.

the class CTypeParserTest method testUserTypeContainingVolatile.

@Test
public void testUserTypeContainingVolatile() {
    CTypeParser sut = new CTypeParser("struct myvolatile");
    assertEquals("", sut.getPrefix());
    assertEquals("struct myvolatile", sut.getCoreType());
    assertEquals("", sut.getSuffix());
}
Also used : CTypeParser(com.ibm.j9ddr.CTypeParser) Test(org.junit.Test)

Example 20 with CTypeParser

use of com.ibm.j9ddr.CTypeParser in project openj9 by eclipse.

the class CTypeParserTest method testFunnySpaces2.

@Test
public void testFunnySpaces2() {
    CTypeParser sut = new CTypeParser("   const   int *   const    * volatile      *    *");
    assertEquals("const ", sut.getPrefix());
    assertEquals("int", sut.getCoreType());
    assertEquals("* const * volatile **", sut.getSuffix());
}
Also used : CTypeParser(com.ibm.j9ddr.CTypeParser) Test(org.junit.Test)

Aggregations

CTypeParser (com.ibm.j9ddr.CTypeParser)20 Test (org.junit.Test)16 FieldDescriptor (com.ibm.j9ddr.StructureReader.FieldDescriptor)1 U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)1