From: Igor Fedotov Date: Thu, 11 Feb 2016 17:43:51 +0000 (+0300) Subject: Log: Adding UT to catch an issue with huge line logging X-Git-Tag: v10.1.0~308^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d8675cf49b8b3132f48abde9bb8ce71166e3257d;p=ceph.git Log: Adding UT to catch an issue with huge line logging Signed-off-by: Igor Fedotov --- diff --git a/src/log/test.cc b/src/log/test.cc index a2df608665c..4e94addcbb6 100644 --- a/src/log/test.cc +++ b/src/log/test.cc @@ -210,3 +210,21 @@ TEST(Log, InternalSegv) { ASSERT_DEATH(do_segv(), ".*"); } + +TEST(Log, LargeLog) +{ + SubsystemMap subs; + subs.add(1, "foo", 20, 10); + Log log(&subs); + log.start(); + log.set_log_file("/tmp/big"); + log.reopen_log_file(); + int l = 10; + Entry *e = new Entry(ceph_clock_now(NULL), pthread_self(), l, 1); + + std::string msg(10000000, 0); + e->set_str(msg); + log.submit_entry(e); + log.flush(); + log.stop(); +}