public void checkParserState(
        XmlPullParser xpp,
        int depth,
        int type,
        String name,
        String text,
        boolean isEmpty,
        int attribCount
    ) throws XmlPullParserException, IOException
    {
        assertTrue("line number must be -1 or >= 1 not "+xpp.getLineNumber(),
                   xpp.getLineNumber() == -1 || xpp.getLineNumber() >= 1);
        assertTrue("column number must be -1 or >= 0 not "+xpp.getColumnNumber(),
                   xpp.getColumnNumber() == -1 || xpp.getColumnNumber() >= 0);

        assertEquals("PROCESS_NAMESPACES", false, xpp.getFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES));
        assertEquals("TYPES[getType()]", XmlPullParser.TYPES[type], XmlPullParser.TYPES[xpp.getEventType()]);
        assertEquals("getType()", type, xpp.getEventType());
        assertEquals("getDepth()", depth, xpp.getDepth());
        assertEquals("getPrefix()", null, xpp.getPrefix());
        assertEquals("getNamespacesCount(getDepth())", 0, xpp.getNamespaceCount(depth));
        if(xpp.getEventType() == XmlPullParser.START_TAG || xpp.getEventType() == XmlPullParser.END_TAG) {
            assertEquals("getNamespace()", "", xpp.getNamespace());
        } else {
            assertEquals("getNamespace()", null, xpp.getNamespace());
        }
        assertEquals("getName()", name, xpp.getName());

        if(xpp.getEventType() != XmlPullParser.START_TAG && xpp.getEventType() != XmlPullParser.END_TAG) {
            assertEquals("getText()", printable(text), printable(xpp.getText()));

            int [] holderForStartAndLength = new int[2];
            char[] buf = xpp.getTextCharacters(holderForStartAndLength);
            if(buf != null) {
                String s = new String(buf, holderForStartAndLength[0], holderForStartAndLength[1]);
                assertEquals("getText(holder)", printable(text), printable(s));
            } else {
                assertEquals("getTextCharacters()", null, text);
            }
        }
        if(type == XmlPullParser.START_TAG) {
            assertEquals("isEmptyElementTag()", isEmpty, xpp.isEmptyElementTag());
        } else {
            try {
                xpp.isEmptyElementTag();
                fail("isEmptyElementTag() must throw exception if parser not on START_TAG");
            } catch(XmlPullParserException ex) {
            }
        }
        assertEquals("getAttributeCount()", attribCount, xpp.getAttributeCount());
    }