From d3fa5137921158e027c5e0d55c1c456723bdd1e7 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 30 Jun 2007 14:17:17 +0000 Subject: Make test/bbackupd intercept timer tests a little less strict, because object IDs can vary depending on the order that readdir() returns files in. (refs #3) --- test/bbackupd/testbbackupd.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp index 9a4c9919..2b8225cc 100644 --- a/test/bbackupd/testbbackupd.cpp +++ b/test/bbackupd/testbbackupd.cpp @@ -841,7 +841,8 @@ int test_bbackupd() { std::string line; TEST_THAT(reader.GetLine(line)); - TEST_THAT(line == "Receive Success(0xe)"); + std::string comp = "Receive Success(0x"; + TEST_THAT(line.substr(0, comp.size()) == comp); TEST_THAT(reader.GetLine(line)); TEST_THAT(line == "Receiving stream, size 124"); TEST_THAT(reader.GetLine(line)); @@ -850,9 +851,9 @@ int test_bbackupd() TEST_THAT(line == "Receive IsAlive()"); TEST_THAT(reader.GetLine(line)); - std::string comp = "Send StoreFile(0x3,"; + comp = "Send StoreFile(0x3,"; TEST_THAT(line.substr(0, comp.size()) == comp); - comp = ",0xe,\"f1\")"; + comp = ",\"f1\")"; TEST_THAT(line.substr(line.size() - comp.size()) == comp); } @@ -892,7 +893,8 @@ int test_bbackupd() { std::string line; TEST_THAT(reader.GetLine(line)); - TEST_THAT(line == "Receive Success(0xf)"); + std::string comp = "Receive Success(0x"; + TEST_THAT(line.substr(0, comp.size()) == comp); TEST_THAT(reader.GetLine(line)); TEST_THAT(line == "Receiving stream, size 124"); @@ -902,7 +904,7 @@ int test_bbackupd() // so there will be no keepalives. TEST_THAT(reader.GetLine(line)); - std::string comp = "Send StoreFile(0x3,"; + comp = "Send StoreFile(0x3,"; TEST_THAT(line.substr(0, comp.size()) == comp); comp = ",0x0,\"f1\")"; TEST_THAT(line.substr(line.size() - comp.size()) @@ -944,7 +946,8 @@ int test_bbackupd() { std::string line; TEST_THAT(reader.GetLine(line)); - TEST_THAT(line == "Receive Success(0x10)"); + std::string comp = "Receive Success(0x"; + TEST_THAT(line.substr(0, comp.size()) == comp); TEST_THAT(reader.GetLine(line)); TEST_THAT(line == "Receiving stream, size 124"); @@ -964,7 +967,7 @@ int test_bbackupd() TEST_THAT(line == "Receive IsAlive()"); TEST_THAT(reader.GetLine(line)); - std::string comp = "Send StoreFile(0x3,"; + comp = "Send StoreFile(0x3,"; TEST_THAT(line.substr(0, comp.size()) == comp); comp = ",0x0,\"f1\")"; TEST_THAT(line.substr(line.size() - comp.size()) -- cgit v1.2.3