fixed csv, though there is a small memory leak

This commit is contained in:
herbglitch 2024-12-09 02:33:12 -07:00
parent 280a70c6e8
commit 2ef7a93d5a
4 changed files with 103 additions and 34 deletions

View file

@ -21,10 +21,10 @@ ARC_TEST(Parser_ParserCSV_BasicTest){
ARC_ParserCSV_CreateAsParser(&parser, ARC_False, TEST_ParserCSV_CastTypeFn, TEST_ParserCSV_DestroyTypeFn);
const char *tempCString =
"1,1,2,2"
"2,3,4,5"
"4,2,4,1"
"7,7,7,7";
"1,1,2,2\n"
"2,3,4,5\n"
"4,2,4,1\n"
"7,7,7,7\n";
ARC_String *tempString;
ARC_String_CreateWithStrlen(&tempString, (char *)tempCString);
@ -34,10 +34,12 @@ ARC_TEST(Parser_ParserCSV_BasicTest){
ARC_CHECK(arc_errno == 0);
ARC_ParserCSVData *data = (ARC_ParserCSVData *)ARC_Parser_GetData(parser);
for(uint32_t y = 0; y < data->height; y++){
for(uint32_t x = 0; x < data->width; x++){
printf("%u", ((uint32_t *)(data->data[y]))[x]);
printf("%d ", *(int32_t *)(data->data[y][x]));
}
printf("\n");
}
ARC_Parser_Destroy(parser);