summaryrefslogtreecommitdiff
path: root/src/unittest
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2008-12-03 04:57:54 -0800
committerNathan Binkert <nate@binkert.org>2008-12-03 04:57:54 -0800
commit74f10be5266039fc9d2c1be14c551d1bcefed99c (patch)
tree99bfdb9d3ff33d397f7dc935a97dd5b5968cc06b /src/unittest
parent47e2b0889359877cb9a86c02c4bdf862fbd87338 (diff)
downloadgem5-74f10be5266039fc9d2c1be14c551d1bcefed99c.tar.xz
cprintf: support a configurable width and precision ("*" in printf)
Diffstat (limited to 'src/unittest')
-rw-r--r--src/unittest/cprintftest.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/unittest/cprintftest.cc b/src/unittest/cprintftest.cc
index 1438f194b..6722ce6a3 100644
--- a/src/unittest/cprintftest.cc
+++ b/src/unittest/cprintftest.cc
@@ -167,6 +167,13 @@ main()
cprintf("%c %c\n", 'c', 65);
- cout << '9';
+ cout << '9' << endl;
+
+ cout << endl;
+
+ cprintf("%08.4f\n", 99.99);
+ cprintf("%0*.*f\n", 8, 4, 99.99);
+ cprintf("%07.*f\n", 4, 1.234);
+ cprintf("%#0*x\n", 9, 123412);
return 0;
}