mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-15 12:40:35 +00:00
Improve handling of tainted data
This commit is contained in:
parent
9b5907b62d
commit
f2ff936fd0
@ -25,6 +25,7 @@
|
|||||||
#include <iostream> // for operator<<, basic_ostream, endl, char...
|
#include <iostream> // for operator<<, basic_ostream, endl, char...
|
||||||
#include <fstream> // IWYU pragma: keep
|
#include <fstream> // IWYU pragma: keep
|
||||||
#include <map> // for map, map<>::iterator, _Rb_tree_iterator
|
#include <map> // for map, map<>::iterator, _Rb_tree_iterator
|
||||||
|
#include <sstream> // for stringstream
|
||||||
#include <string> // for string, operator<<
|
#include <string> // for string, operator<<
|
||||||
#include <utility> // for pair
|
#include <utility> // for pair
|
||||||
#include <vector> // for vector
|
#include <vector> // for vector
|
||||||
@ -48,15 +49,16 @@ int main(int argc, char* argv[])
|
|||||||
std::vector<volk_gnsssdr_test_results_t> results;
|
std::vector<volk_gnsssdr_test_results_t> results;
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
{
|
{
|
||||||
const size_t len = std::char_traits<char>::length(argv[1]);
|
std::stringstream ss;
|
||||||
if (len == 0 || len > 2046)
|
ss << argv[1];
|
||||||
|
if (ss.fail())
|
||||||
{
|
{
|
||||||
std::cerr << "Test name is too long." << std::endl;
|
std::cerr << "Test name not correctly set." << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
for (unsigned int ii = 0; ii < test_cases.size(); ++ii)
|
for (unsigned int ii = 0; ii < test_cases.size(); ++ii)
|
||||||
{
|
{
|
||||||
if (std::string(argv[1]) == test_cases[ii].name())
|
if (ss.str() == test_cases[ii].name())
|
||||||
{
|
{
|
||||||
volk_gnsssdr_test_case_t test_case = test_cases[ii];
|
volk_gnsssdr_test_case_t test_case = test_cases[ii];
|
||||||
if (run_volk_gnsssdr_tests(test_case.desc(), test_case.kernel_ptr(),
|
if (run_volk_gnsssdr_tests(test_case.desc(), test_case.kernel_ptr(),
|
||||||
|
Loading…
Reference in New Issue
Block a user