static void l2g_state_free(Las2GhtState *state) { if ( state->header ) { LASHeader_Destroy(state->header); state->header = NULL; } if ( state->reader ) { LASReader_Destroy(state->reader); state->reader = NULL; } if ( state->pj_input ) { pj_free(state->pj_input); state->pj_input = NULL; } if ( state->pj_output ) { pj_free(state->pj_output); state->pj_output = NULL; } if ( state->schema ) { ght_schema_free(state->schema); state->schema = NULL; } }
static int clean_suite(void) { if ( schema ) ght_schema_free(schema); return 0; }
static void test_schema_xml() { char *mystr, *str; GhtErr result; GhtSchema *myschema = NULL; size_t schema_size; result = ght_schema_to_xml_str(schema, &str, &schema_size); CU_ASSERT_EQUAL(result, GHT_OK); result = ght_schema_from_xml_str(str, &myschema); CU_ASSERT_EQUAL(result, GHT_OK); result = ght_schema_to_xml_str(myschema, &mystr, &schema_size); CU_ASSERT_EQUAL(result, GHT_OK); CU_ASSERT_STRING_EQUAL(str, mystr); ght_free(str); ght_free(mystr); ght_schema_free(myschema); }