From 69930afa9b63c25baab86ff5fbe632fc02ce5369 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 22 Oct 2019 16:16:10 -0700 Subject: tests: Added GTests for base/str.cc Adding these tests supercedes the unittest/strnumtest.cc and unittest/tokentest.cc tests. They have thereby been removed. Function "to_number" in base/str.hh previously failed to cast negative float/double numbers. This was due to the use of std::numeric_limits::min() instead of std::numeric_limits::lowest() to determine whether a string-to-float/double conversion was "Out of range". Tests "StrTest.ToNumberFloatNegative" and "StrTest.ToNumberDoubleNegative" exposed this bug. It has been fixed. Methods "split_first" and "split_last" in base/str.hh have had their documentation updated to remove abiguity in their functionality. Change-Id: I16e0fe40d884e22dd010db4045857eb6e7f33d4a Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22084 Reviewed-by: Daniel Carvalho Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/unittest/SConscript | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/unittest/SConscript') diff --git a/src/unittest/SConscript b/src/unittest/SConscript index f437a1dda..0ca0702c1 100644 --- a/src/unittest/SConscript +++ b/src/unittest/SConscript @@ -35,10 +35,8 @@ Source('unittest.cc') UnitTest('cprintftime', 'cprintftime.cc') UnitTest('nmtest', 'nmtest.cc') UnitTest('refcnttest', 'refcnttest.cc') -UnitTest('strnumtest', 'strnumtest.cc') stattest_py = PySource('m5', 'stattestmain.py', tags='stattest') UnitTest('stattest', 'stattest.cc', with_tag('stattest'), main=True) UnitTest('symtest', 'symtest.cc') -UnitTest('tokentest', 'tokentest.cc') -- cgit v1.2.3