Overpass API regression suite coverage (Saxony) / overpass_api/frontend/console_output.cc

overpass_api/frontend/console_output.cc

35 of 49 instrumented lines run by the suite (71.4%) at 8edf11b0419c (this file on GitHub).

runnever runcolumns: line, executions, queries (click for the queries that run the line)

1/** Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Roland Olbricht et al.
2 *
3 * This file is part of Overpass_API.
4 *
5 * Overpass_API is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Affero General Public License as
7 * published by the Free Software Foundation, either version 3 of the
8 * License, or (at your option) any later version.
9 *
10 * Overpass_API is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with Overpass_API. If not, see <http://www.gnu.org/licenses/>.
17 */
19#include <iomanip>
20#include <iostream>
21#include <string>
23#include "console_output.h"
26void Console_Output::add_encoding_error(const std::string& error)
270{
280 if (log_level != Error_Output::QUIET)
290 std::cerr<<"encoding error: "<<error<<'\n';
300 encoding_errors = true;
310}
33void Console_Output::add_parse_error(const std::string& error, int line_number)
3425133 q{
3525133 q if (log_level != Error_Output::QUIET)
3625133 q std::cerr<<"line "<<line_number<<": parse error: "<<error<<'\n';
3725133 q parse_errors = true;
3825133 q}
40void Console_Output::add_static_error(const std::string& error, int line_number)
42165 q if (log_level != Error_Output::QUIET)
43165 q std::cerr<<"line "<<line_number<<": static error: "<<error<<'\n';
44165 q static_errors = true;
47void Console_Output::add_encoding_remark(const std::string& error)
482800692 q{
492800692 q if (log_level >= Error_Output::ASSISTING)
502800692 q std::cerr<<"encoding remark: "<<error<<'\n';
512800692 q}
53void Console_Output::add_parse_remark(const std::string& error, int line_number)
540{
550 if (log_level >= Error_Output::ASSISTING)
560 std::cerr<<"line "<<line_number<<": parse remark: "<<error<<'\n';
570}
59void Console_Output::add_static_remark(const std::string& error, int line_number)
600{
610 if (log_level >= Error_Output::ASSISTING)
620 std::cerr<<"line "<<line_number<<": static remark: "<<error<<'\n';
630}
65void Console_Output::runtime_error(const std::string& error)
6755 q if (log_level != Error_Output::QUIET)
6855 q std::cerr<<"runtime error: "<<error<<'\n';
71void Console_Output::runtime_remark(const std::string& error)
73673673 q if (log_level >= Error_Output::ASSISTING)
74673673 q std::cerr<<"runtime remark: "<<error<<'\n';
77void Console_Output::display_statement_progress
78 (uint timer, const std::string& name, int progress, int line_number,
79 const std::vector< std::pair< uint, uint > >& stack)
8111 q if (log_level < Error_Output::PROGRESS)
820 return;
8311 q std::cerr<<"After "<<timer/3600<<"h"<<timer/60%60<<"m"<<timer%60<<"s: "
8411 q <<"in \""<<name<<"\", part "<<progress<<", on line "<<line_number<<".";
8511 q if (!stack.empty())
8711 q std::cerr<<" Stack:";
8811 q for (std::vector< std::pair< uint, uint > >::const_iterator it(stack.begin());
8921 q it != stack.end(); ++it)
9011 q std::cerr<<" "<<it->first<<" of "<<it->second;
9211 q std::cerr<<'\n';