Skip to content

Commit a9d89f4

Browse files
committed
FIx input detection
1 parent a27f1f8 commit a9d89f4

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

include/data_reader.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ class DataReader {
101101
}
102102
}
103103

104-
// Determine format: explicit inputFormat takes precedence, otherwise detect from extension
105-
bool isCSV = (inputFormat == "csv") || (inputFormat == "json" ? false : FileUtils::isCsvFile(filename));
104+
// Determine format: detect from file extension (inputFormat is only for stdin)
105+
bool isCSV = FileUtils::isCsvFile(filename);
106106

107107
if (tailLines > 0) {
108108
// Use tail mode

tests/test_error_detector.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,11 @@
55
#include <cstdlib>
66
#include <sys/stat.h>
77
#include <cerrno>
8-
9-
#ifdef _WIN32
10-
#include <direct.h>
11-
#define MKDIR(path) _mkdir(path)
12-
#define RMDIR(path) _rmdir(path)
13-
#else
148
#include <unistd.h>
15-
#define MKDIR(path) mkdir(path, 0755)
16-
#define RMDIR(path) rmdir(path)
17-
#endif
189

1910
// Helper to create a directory
2011
bool createDir(const std::string& path) {
21-
return MKDIR(path.c_str()) == 0 || errno == EEXIST;
12+
return mkdir(path.c_str(), 0755) == 0 || errno == EEXIST;
2213
}
2314

2415
// Helper to remove a file
@@ -28,7 +19,7 @@ void removeFile(const std::string& path) {
2819

2920
// Helper to remove a directory
3021
void removeDir(const std::string& path) {
31-
RMDIR(path.c_str());
22+
rmdir(path.c_str());
3223
}
3324

3425
void test_ds18b20_error_detection() {

tests/test_file_collector.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,8 @@
33
#include <iostream>
44
#include <fstream>
55
#include <cstdio>
6-
7-
#ifdef _WIN32
8-
#include <direct.h>
9-
#define mkdir(path, mode) _mkdir(path)
10-
#define rmdir _rmdir
11-
#else
126
#include <sys/stat.h>
137
#include <unistd.h>
14-
#endif
158

169
// Helper to create temp directory structure
1710
class TempTestDir {

0 commit comments

Comments
 (0)