From 880f99b6da1346bf3721cf5ac23aa9b5e31e70f5 Mon Sep 17 00:00:00 2001 From: Evgeni Raikhel Date: Tue, 17 Apr 2018 09:48:40 +0300 Subject: [PATCH] Fix cmake test download rule Fix parsing of windows-generated files on linux Change-Id: I700fd42d4da72566ce8a4370d3c7dbb3f2a233b2 --- unit-tests/CMakeLists.txt | 2 +- unit-tests/unit-tests-post-processing.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/unit-tests/CMakeLists.txt b/unit-tests/CMakeLists.txt index 3068b48024..d1b04e4901 100644 --- a/unit-tests/CMakeLists.txt +++ b/unit-tests/CMakeLists.txt @@ -71,7 +71,7 @@ foreach(i ${PP_Tests_List}) #Each test comprise of a sequence of frame indexed according to the following foreach(idx ${PP_Test_Sequence_Index_List}) # Calculate the target full path name for deployment - set(Test_File_Name "${Test_Pattern}${ext}") + set(Test_File_Name "${Test_Pattern}${idx}${ext}") set(source ${PP_TESTS_URL}${Test_File_Name}) set(destination ${Deployment_Location}${Test_File_Name}) #message(STATUS "Checking for a required test record ${Test_File_Name}") diff --git a/unit-tests/unit-tests-post-processing.h b/unit-tests/unit-tests-post-processing.h index b7ac8a57a3..1a4fc4b84c 100644 --- a/unit-tests/unit-tests-post-processing.h +++ b/unit-tests/unit-tests-post-processing.h @@ -126,14 +126,15 @@ inline ppf_test_config attrib_from_csv(const std::string& str) std::string line; int invalid_line = 0; + std::string key, value; while (true) { - std::string key, value; - if (!std::getline(data, key, ',')) invalid_line++; std::getline(data, value, '\n'); + std::stringstream ss(value); // trim EOL discrepancies + ss >> value; dict[key] = value; if (invalid_line > 1) // Two or more non-kvp lines designate eof. Note this when creating the attributes