summaryrefslogtreecommitdiff
path: root/src/unittest
diff options
context:
space:
mode:
Diffstat (limited to 'src/unittest')
-rw-r--r--src/unittest/cprintftest.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/unittest/cprintftest.cc b/src/unittest/cprintftest.cc
index 7fb10375c..1438f194b 100644
--- a/src/unittest/cprintftest.cc
+++ b/src/unittest/cprintftest.cc
@@ -34,6 +34,7 @@
#include <sstream>
#include "base/cprintf.hh"
+#include "base/misc.hh"
using namespace std;
@@ -43,6 +44,14 @@ main()
char foo[] = "foo";
cprintf("%s\n", foo);
+ string _bar = "asdfkhasdlkfjhasdlkfhjalksdjfhalksdjhfalksdjfhalksdjhf";
+ int length = 11;
+ char bar[length + 1];
+ bar[length] = 0;
+
+ memcpy(bar, _bar.c_str(), length);
+ warn("%s\n", bar);
+
cprintf("%d\n", 'A');
cprintf("%shits%%s + %smisses%%s\n", "test", "test");
cprintf("%%s%-10s %c he went home \'\"%d %#o %#x %1.5f %1.2E\n",