summaryrefslogtreecommitdiff
path: root/src/base/cprintftest.cc
AgeCommit message (Collapse)Author
2018-01-29base: Remove the ability to cprintf stringstreams directly.Gabe Black
The cprintf functions don't know ahead of time what format characters are going to be used with what underlying data types, and so any type must be minimally usable with the default specialization of format_integer, format_char, format_float and format_string. All of those functions ultimately print their parameter with out << data except the one which prints stringstreams. That function accesses the buffer of the string stream with .str(), and then prints that instead. That should technically work out ok as long as stringstreams are only printed using %s, but there's no way to guarantee that ahead of time. To avoid that problem, and because gem5 doesn't ever actually use the ability to print stringstreams directly, this change removes that feature and modifies the corresponding part of the unit test. If we ever do want to print the contents of a string stream, it won't be difficult to add a .str() to it. Change-Id: Id902eaff042b96b374efe0183e5e3be9626e8c88 Reviewed-on: https://gem5-review.googlesource.com/7642 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
2017-12-12tests: Move the cprintftest unit test into src/base.Gabe Black
That way it will live alongside the code it tests. Change-Id: I00baad2206870a4619b7cee792a1d4c303dad04d Reviewed-on: https://gem5-review.googlesource.com/6324 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>