File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 21
21
#include " astutils.h"
22
22
#include " errortypes.h"
23
23
#include " library.h"
24
+ #include " mathlib.h"
24
25
#include " settings.h"
25
26
#include " simplecpp.h"
26
27
#include " symboldatabase.h"
@@ -1801,7 +1802,7 @@ void Token::printValueFlow(bool xml, std::ostream &out) const
1801
1802
break ;
1802
1803
case ValueFlow::Value::ValueType::FLOAT:
1803
1804
outs += " floatvalue=\" " ;
1804
- outs += std::to_string (value.floatValue ); // TODO: should this be MathLib::toString()?
1805
+ outs += MathLib::toString (value.floatValue );
1805
1806
outs += ' \" ' ;
1806
1807
break ;
1807
1808
case ValueFlow::Value::ValueType::MOVED:
@@ -1875,7 +1876,6 @@ void Token::printValueFlow(bool xml, std::ostream &out) const
1875
1876
1876
1877
outs += " />\n " ;
1877
1878
}
1878
-
1879
1879
else {
1880
1880
if (&value != &values->front ())
1881
1881
outs += " ," ;
Original file line number Diff line number Diff line change @@ -3129,8 +3129,8 @@ def test_debug_valueflow_xml(tmp_path): # #13606
3129
3129
value_elem = valueflow_elem [0 ].findall ('values/value' )
3130
3130
assert len (value_elem ) == 3
3131
3131
assert 'floatvalue' in value_elem [0 ].attrib
3132
- assert value_elem [0 ].attrib ['floatvalue' ] == '0.000000 '
3132
+ assert value_elem [0 ].attrib ['floatvalue' ] == '1e-07 '
3133
3133
assert 'floatvalue' in value_elem [1 ].attrib
3134
- assert value_elem [1 ].attrib ['floatvalue' ] == '0.000000 '
3134
+ assert value_elem [1 ].attrib ['floatvalue' ] == '1e-07 '
3135
3135
assert 'floatvalue' in value_elem [2 ].attrib
3136
- assert value_elem [2 ].attrib ['floatvalue' ] == '0.000000 '
3136
+ assert value_elem [2 ].attrib ['floatvalue' ] == '1e-07 '
You can’t perform that action at this time.
0 commit comments