Skip to content

Commit

Permalink
Merge branch 'master' into windows_binary_packages
Browse files Browse the repository at this point in the history
  • Loading branch information
qris committed Nov 28, 2017
2 parents 447c2cd + 24aca3f commit ed55e2b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 30 deletions.
2 changes: 1 addition & 1 deletion bin/bbstored/bbstored-certs.in
Expand Up @@ -288,7 +288,7 @@ sub get_csr_common_name
my $subject;
while(<CSRTEXT>)
{
$subject = $1 if m/Subject:.+?CN=([-\.\w]+)/
$subject = $1 if m/Subject:.+?CN\s?=\s?([-\.\w]+)/;
}
close CSRTEXT;

Expand Down
2 changes: 0 additions & 2 deletions lib/bbackupd/BackupDaemon.cpp
Expand Up @@ -922,8 +922,6 @@ std::auto_ptr<BackupClientContext> BackupDaemon::GetNewContext
// it, let it be destroyed and close the connection.
std::auto_ptr<BackupClientContext> BackupDaemon::RunSyncNow()
{
Timers::AssertInitialised();

// Delete the serialised store object file,
// so that we don't try to reload it after a
// partially completed backup
Expand Down
21 changes: 0 additions & 21 deletions lib/common/Timer.cpp
Expand Up @@ -120,26 +120,6 @@ void Timers::Cleanup(bool throw_exception_if_not_initialised)
spTimers = NULL;
}

// --------------------------------------------------------------------------
//
// Function
// Name: static void Timers::AssertInitialised()
// Purpose: Throw an assertion error if timers are not ready
// NOW. It's a common mistake (for me) when writing
// tests to forget to initialise timers first.
// Created: 15/05/2014
//
// --------------------------------------------------------------------------

void Timers::AssertInitialised()
{
if (!spTimers)
{
THROW_EXCEPTION(CommonException, TimersNotInitialised);
}
ASSERT(spTimers);
}

// --------------------------------------------------------------------------
//
// Function
Expand Down Expand Up @@ -340,7 +320,6 @@ void Timers::Reschedule()
// --------------------------------------------------------------------------
void Timers::SignalHandler(int unused)
{
// ASSERT(spTimers);
Timers::RequestReschedule();
}

Expand Down
1 change: 0 additions & 1 deletion lib/common/Timer.h
Expand Up @@ -44,7 +44,6 @@ class Timers
public:
static void Init();
static void Cleanup(bool throw_exception_if_not_initialised = true);
static void AssertInitialised();
static void Add (Timer& rTimer);
static void Remove(Timer& rTimer);
static void RequestReschedule();
Expand Down
12 changes: 7 additions & 5 deletions test/common/testcommon.cpp
Expand Up @@ -313,16 +313,18 @@ int test(int argc, const char *argv[])
// throws an assertion failure. Can only do this in debug mode
#ifndef BOX_RELEASE_BUILD
{
TEST_CHECK_THROWS(Timers::Cleanup(), CommonException,
AssertFailed);

Timer tim(0, "tim");
TEST_CHECK_THROWS(Timers::Add(tim), CommonException, AssertFailed);
Timers::Remove(tim);
}
#endif

// TEST_CHECK_THROWS(Timers::Signal(), CommonException, AssertFailed);
#ifndef BOX_RELEASE_BUILD
TEST_CHECK_THROWS(Timers::Cleanup(), CommonException,
TEST_CHECK_THROWS(Timer t1(900, "t1"), CommonException,
AssertFailed);

// TEST_CHECK_THROWS(Timers::Signal(), CommonException, AssertFailed);
}
#endif

// Check that we can initialise the timers
Expand Down

0 comments on commit ed55e2b

Please sign in to comment.