From a5e7b19431f1ab9753ace51f90d41f44f50bc08e Mon Sep 17 00:00:00 2001 From: Stephane Gouache Date: Mon, 16 Sep 2024 13:28:55 +0200 Subject: [PATCH] Fix open mode binary (windows bug) --- src/drivertest.cpp | 2 +- test/drivertest.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/drivertest.cpp b/src/drivertest.cpp index 04c57c6..7e6c0da 100644 --- a/src/drivertest.cpp +++ b/src/drivertest.cpp @@ -537,7 +537,7 @@ void compareSize(const char *file_name_output, long long int filesize) { void compareFiles(std::string local_file_path, std::string gcs_uri) { // Lire le fichier local - std::ifstream local_file(local_file_path); + std::ifstream local_file(local_file_path, std::ios::binary); if (!local_file) { std::cerr << "Failure reading local file" << std::endl; global_error = 1; diff --git a/test/drivertest.cpp b/test/drivertest.cpp index 1b23165..af5b4d5 100644 --- a/test/drivertest.cpp +++ b/test/drivertest.cpp @@ -450,7 +450,7 @@ int compareSize(const char *file_name_output, long long int filesize) { int compareFiles(std::string local_file_path, std::string gcs_uri) { // Lire le fichier local - std::ifstream local_file(local_file_path); + std::ifstream local_file(local_file_path, std::ios::binary); if (!local_file) { std::cerr << "Erreur lors de l'ouverture du fichier local." << std::endl; return false; @@ -480,4 +480,4 @@ int compareFiles(std::string local_file_path, std::string gcs_uri) { // Comparer les contenus return local_content == gcs_data ? kSuccess : kFailure; -} \ No newline at end of file +}