diff options
author | Bobby R. Bruce <bbruce@ucdavis.edu> | 2019-10-22 16:16:10 -0700 |
---|---|---|
committer | Bobby R. Bruce <bbruce@ucdavis.edu> | 2019-10-24 16:25:09 +0000 |
commit | 69930afa9b63c25baab86ff5fbe632fc02ce5369 (patch) | |
tree | b26df22c0621a2ab274a36a3ce332accdac1441d /src/base/SConscript | |
parent | f60383d060ed82400526a47a1ba3182253e9f2f5 (diff) | |
download | gem5-69930afa9b63c25baab86ff5fbe632fc02ce5369.tar.xz |
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<T>::min() instead of std::numeric_limits<T>::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 <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/base/SConscript')
-rw-r--r-- | src/base/SConscript | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/base/SConscript b/src/base/SConscript index ca8182203..d6615be13 100644 --- a/src/base/SConscript +++ b/src/base/SConscript @@ -71,6 +71,7 @@ if env['TARGET_ISA'] != 'null': Source('socket.cc') Source('statistics.cc') Source('str.cc') +GTest('str.test', 'str.test.cc', 'str.cc') Source('time.cc') Source('trace.cc') GTest('trie.test', 'trie.test.cc') |