mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-22 11:55:30 +00:00
parent
dde4aaeb2f
commit
630ab6a5c2
13
peglib.h
13
peglib.h
@ -4797,12 +4797,13 @@ inline void enable_profiling(parser &parser, std::ostream &os) {
|
|||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
auto grand_total = total_success + total_fail;
|
auto grand_total = total_success + total_fail;
|
||||||
sprintf(buff, "%4s %10zu %5s %10zu %10zu %s", "", grand_total,
|
snprintf(buff, BUFSIZ, "%4s %10zu %5s %10zu %10zu %s", "",
|
||||||
"", total_success, total_fail, "Total counters");
|
grand_total, "", total_success, total_fail,
|
||||||
|
"Total counters");
|
||||||
os << buff << std::endl;
|
os << buff << std::endl;
|
||||||
|
|
||||||
sprintf(buff, "%4s %10s %5s %10.2f %10.2f %s", "", "", "",
|
snprintf(buff, BUFSIZ, "%4s %10s %5s %10.2f %10.2f %s", "",
|
||||||
total_success * 100.0 / grand_total,
|
"", "", total_success * 100.0 / grand_total,
|
||||||
total_fail * 100.0 / grand_total, "% success/fail");
|
total_fail * 100.0 / grand_total, "% success/fail");
|
||||||
os << buff << std::endl << std::endl;
|
os << buff << std::endl << std::endl;
|
||||||
;
|
;
|
||||||
@ -4811,8 +4812,8 @@ inline void enable_profiling(parser &parser, std::ostream &os) {
|
|||||||
for (auto &[name, success, fail] : stats.items) {
|
for (auto &[name, success, fail] : stats.items) {
|
||||||
auto total = success + fail;
|
auto total = success + fail;
|
||||||
auto ratio = total * 100.0 / stats.total;
|
auto ratio = total * 100.0 / stats.total;
|
||||||
sprintf(buff, "%4zu %10zu %5.2f %10zu %10zu %s", id, total,
|
snprintf(buff, BUFSIZ, "%4zu %10zu %5.2f %10zu %10zu %s",
|
||||||
ratio, success, fail, name.c_str());
|
id, total, ratio, success, fail, name.c_str());
|
||||||
os << buff << std::endl;
|
os << buff << std::endl;
|
||||||
id++;
|
id++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user