one can dream about a well defined framework

This commit is contained in:
rusefillc 2021-06-19 09:56:08 -04:00
parent f72581b1d7
commit a222a3961a
1 changed files with 6 additions and 3 deletions

View File

@ -5,23 +5,26 @@
* @author Andrey Belomutskiy, (c) 2012-2021 * @author Andrey Belomutskiy, (c) 2012-2021
*/ */
#define _POSIX_C_SOURCE 200809L
#define _GNU_SOURCE
#include "engine_test_helper.h" #include "engine_test_helper.h"
TEST(cranking, realNA) { TEST(cranking, realNA) {
FILE *fp = fopen("tests/trigger/recourses/cranking_na_3.csv", "r"); FILE *fp = fopen("tests/trigger/recourses/cranking_na_3.csv", "r");
char *line = nullptr;
size_t len = 0;
ssize_t read; ssize_t read;
char buffer[255];
int index = -1; int index = -1;
while ((read = getline(&line, &len, fp)) != -1) { while (fgets(buffer, sizeof(buffer), fp)) {
index++; index++;
if (index == 0) { if (index == 0) {
// skip header // skip header
continue; continue;
} }
const char s[2] = ","; const char s[2] = ",";
char *line = buffer;
char *token; char *token;