diff options
author | Sage Weil <sage.weil@dreamhost.com> | 2012-03-28 06:32:12 -0700 |
---|---|---|
committer | Sage Weil <sage.weil@dreamhost.com> | 2012-03-28 06:32:12 -0700 |
commit | 37cdbcd4b490c838cbf5a0eb5d4457454f75702c (patch) | |
tree | a865e2f979284a363698e50cd891e27bee426bbd /src/log | |
parent | 36c2f27dde7fab92299fb58c8df774cf57864661 (diff) | |
download | ceph-37cdbcd4b490c838cbf5a0eb5d4457454f75702c.tar.gz |
log: fix up unittest
Fewer entries; compile.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
Diffstat (limited to 'src/log')
-rw-r--r-- | src/log/Entry.h | 5 | ||||
-rw-r--r-- | src/log/test.cc | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/log/Entry.h b/src/log/Entry.h index 138d1221832..9b6d15f9eb7 100644 --- a/src/log/Entry.h +++ b/src/log/Entry.h @@ -38,6 +38,11 @@ struct Entry { } } + void set_str(const std::string s) { + ostream os(&m_streambuf); + os << s; + } + std::string get_str() const { return m_streambuf.get_str(); } diff --git a/src/log/test.cc b/src/log/test.cc index e6bb8581722..85e9ebc01bd 100644 --- a/src/log/test.cc +++ b/src/log/test.cc @@ -43,7 +43,7 @@ TEST(Log, Simple) log.stop(); } -int many = 10000000; +int many = 10000; TEST(Log, ManyNoGather) { @@ -95,7 +95,7 @@ TEST(Log, ManyGatherLogStringAssign) Entry *e = new Entry(ceph_clock_now(NULL), pthread_self(), l, 1); ostringstream oss; oss << "this i a long stream asdf asdf asdf asdf asdf asdf asdf asdf asdf as fd"; - e->m_str = oss.str(); + e->set_str(oss.str()); log.submit_entry(e); } } @@ -117,7 +117,7 @@ TEST(Log, ManyGatherLogStringAssignWithReserve) ostringstream oss; oss.str().reserve(80); oss << "this i a long stream asdf asdf asdf asdf asdf asdf asdf asdf asdf as fd"; - e->m_str = oss.str(); + e->set_str(oss.str()); log.submit_entry(e); } } |