From 8be827761347b7a0a4ce6e7bdfa6fd4585606b21 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Tue, 26 Feb 2013 12:31:00 -0500 Subject: Rewrite QUtil::int_to_string and QUtil::double_to_string Make them safer by avoiding any internal limits and replacing sprintf with std::ostringstream. --- libtests/qtest/qutil/qutil.out | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'libtests/qtest') diff --git a/libtests/qtest/qutil/qutil.out b/libtests/qtest/qutil/qutil.out index a48e6266..c855e98e 100644 --- a/libtests/qtest/qutil/qutil.out +++ b/libtests/qtest/qutil/qutil.out @@ -4,11 +4,10 @@ 3.141590 3.142 1000.123000 -exception 1: Util::int_to_string has been called with a padding value greater than its internal limit -exception 2: Util::int_to_string has been called with a padding value greater than its internal limit -exception 3: Util::int_to_string has been called with a padding value greater than its internal limit -exception 4: Util::double_to_string has been called with a number and a decimal places specification that would break an internal limit -exception 5: Util::double_to_string has been called with a number and a decimal places specification that would break an internal limit +0.12340 +0.00012 +0.12346 +0.00012 one 7 compare okay -- cgit v1.2.3-54-g00ecf