Search in sources :

Example 6 with CTypeParser

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

the class CTypeParserTest method testSimpleArray.

@Test
public void testSimpleArray() {
    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 7 with CTypeParser

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

the class CTypeParserTest method testSizedArray.

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

Example 8 with CTypeParser

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

the class CTypeParserTest method testVariableSizedArray.

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

Example 9 with CTypeParser

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

the class CTypeParserTest method testTraceExample.

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

Example 10 with CTypeParser

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

the class CTypeParserTest method testConst.

@Test
public void testConst() {
    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)

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