diff options
Diffstat (limited to 'gruel/src/lib/pmt/qa_pmt_prims.cc')
-rw-r--r-- | gruel/src/lib/pmt/qa_pmt_prims.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gruel/src/lib/pmt/qa_pmt_prims.cc b/gruel/src/lib/pmt/qa_pmt_prims.cc index 985361f13..7dec30d56 100644 --- a/gruel/src/lib/pmt/qa_pmt_prims.cc +++ b/gruel/src/lib/pmt/qa_pmt_prims.cc @@ -23,6 +23,7 @@ #include <qa_pmt_prims.h> #include <cppunit/TestAssert.h> #include <gruel/msg_passing.h> +#include <boost/format.hpp> #include <cstdio> #include <cstring> #include <sstream> @@ -54,9 +55,8 @@ qa_pmt_prims::test_symbols() // generate a bunch of symbols for (int i = 0; i < N; i++){ - char buf[100]; - snprintf(buf, sizeof(buf), "test-%d", i); - v1[i] = mp(buf); + std::string buf = str(boost::format("test-%d") % i); + v1[i] = mp(buf.c_str()); } // confirm that they are all unique @@ -66,9 +66,8 @@ qa_pmt_prims::test_symbols() // generate the same symbols again for (int i = 0; i < N; i++){ - char buf[100]; - snprintf(buf, sizeof(buf), "test-%d", i); - v2[i] = mp(buf); + std::string buf = str(boost::format("test-%d") % i); + v2[i] = mp(buf.c_str()); } // confirm that we get the same ones back |