// create a standard format path, coordinates are floats (VG_PATH_DATATYPE_F) path0 = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, 0, 0, VG_PATH_CAPABILITY_ALL); // append some degenerative data to path pathSegs[0] = VG_MOVE_TO_ABS; pathData[0] = -2.0f; pathData[1] = 1.0f; pathSegs[1] = VG_MOVE_TO_ABS; pathData[2] = 5.0f; pathData[3] = 3.0f; pathSegs[2] = VG_LINE_TO_ABS; pathData[4] = 5.0f; pathData[5] = 3.0f; pathSegs[3] = VG_QUAD_TO_ABS; pathData[6] = 5.0f; pathData[7] = 3.0f; pathData[8] = 7.0f; pathData[9] = 0.0f; pathSegs[4] = VG_LCWARC_TO_ABS; pathData[10] = 2.0f; pathData[11] = 0.0f; pathData[12] = 0.0f; pathData[13] = 10.0f; pathData[14] = 2.0f; pathSegs[5] = VG_LCCWARC_TO_ABS; pathData[15] = 0.0f; pathData[16] = 0.0f; pathData[17] = 0.0f; pathData[18] = 5.0f; pathData[19] = 5.0f; pathSegs[6] = VG_SCCWARC_TO_ABS; pathData[20] = 1.0f; pathData[21] = 2.0f; pathData[22] = 0.0f; pathData[23] = 5.0f; pathData[24] = 5.0f; pathSegs[7] = VG_SCWARC_TO_ABS; pathData[25] = 1.5f; pathData[26] = 1.0f; pathData[27] = -135.0f; pathData[28] = 3.0f; pathData[29] = 3.0f; pathSegs[8] = VG_CLOSE_PATH; vgAppendPathData(path0, 9, pathSegs, pathData); // it must return an error code, because of an invalid handle vgAppendPath(path0, 0); writeInt(f, vgGetError(), "vgAppendPath(path0, NULL)"); vgAppendPathData(0, 1, pathSegs, pathData); writeInt(f, vgGetError(), "vgAppendPathData(NULL, 1, pathSegs, pathData)"); vgTransformPath(0, path0); writeInt(f, vgGetError(), "vgTransformPath(NULL, path)"); vgTransformPath(path0, 0); writeInt(f, vgGetError(), "vgTransformPath(path0, NULL)"); vgInterpolatePath(path0, 0, 0, 0.5f); writeInt(f, vgGetError(), "vgInterpolatePath(path0, 0, 0, 0.5f)"); vgInterpolatePath(0, path0, path0, 0.5f); writeInt(f, vgGetError(), "vgInterpolatePath(0, path0, path0, 0.5f)"); // it must return an error code, because of illegal arguments vgAppendPathData(path0, 1, NULL, pathData); writeInt(f, vgGetError(), "vgAppendPathData(path0, 1, NULL, pathData)"); vgAppendPathData(path0, 1, pathSegs, NULL); writeInt(f, vgGetError(), "vgAppendPathData(path0, 1, pathSegs, NULL)"); vgAppendPathData(path0, -10, pathSegs, pathData); writeInt(f, vgGetError(), "vgAppendPathData(path0, -10, pathSegs, pathData)"); vgModifyPathCoords(path0, 0, 2, NULL); writeInt(f, vgGetError(), "vgModifyPathCoords(path0, 0, 2, NULL)"); vgModifyPathCoords(path0, -2, 2, pathData); writeInt(f, vgGetError(), "vgModifyPathCoords(path0, -2, 2, pathData)"); vgModifyPathCoords(path0, 0, -2, pathData); writeInt(f, vgGetError(), "vgModifyPathCoords(path0, 0, -2, pathData)"); vgModifyPathCoords(path0, 0, 2, NULL); writeInt(f, vgGetError(), "vgModifyPathCoords(path0, 0, 2, NULL)"); vgPathLength(path0, -1, 1); writeInt(f, vgGetError(), "vgPathLength(path0, -1, 1)"); vgPathLength(path0, 0, 0); writeInt(f, vgGetError(), "vgPathLength(path0, 0, 0)"); vgPathLength(path0, 0, 99); writeInt(f, vgGetError(), "vgPathLength(path0, 0, 99)"); vgPathBounds(path0, 0, &minY, &width, &height); writeInt(f, vgGetError(), "vgPathBounds(path0, 0, minY, width, height)"); vgPathBounds(path0, &minX, 0, &width, &height); writeInt(f, vgGetError(), "vgPathBounds(path0, minX, 0, width, height)"); vgPathBounds(path0, &minX, &minY, 0, &height); writeInt(f, vgGetError(), "vgPathBounds(path0, minX, minY, 0, height)"); vgPathBounds(path0, &minX, &minY, &width, 0); writeInt(f, vgGetError(), "vgPathBounds(path0, minX, minY, width, 0)"); vgPathTransformedBounds(path0, 0, &minY, &width, &height); writeInt(f, vgGetError(), "vgPathTransformedBounds(path0, 0, minY, width, height)"); vgPathTransformedBounds(path0, &minX, 0, &width, &height); writeInt(f, vgGetError(), "vgPathTransformedBounds(path0, minX, 0, width, height)"); vgPathTransformedBounds(path0, &minX, &minY, 0, &height); writeInt(f, vgGetError(), "vgPathTransformedBounds(path0, minX, minY, 0, height)"); vgPathTransformedBounds(path0, &minX, &minY, &width, 0); writeInt(f, vgGetError(), "vgPathTransformedBounds(path0, minX, minY, width, 0)"); // destroy path vgDestroyPath(path0);