diff --git a/test/data/message/queue1.mqd b/test/data/message/queue1.mqd deleted file mode 100644 index cdde9232..00000000 Binary files a/test/data/message/queue1.mqd and /dev/null differ diff --git a/test/mqmessagetest b/test/mqmessagetest index ad232ffe..6f2ab61e 100755 Binary files a/test/mqmessagetest and b/test/mqmessagetest differ diff --git a/test/mqmessagetest.cpp b/test/mqmessagetest.cpp index e2e2ee40..881499fc 100644 --- a/test/mqmessagetest.cpp +++ b/test/mqmessagetest.cpp @@ -16,6 +16,7 @@ class BindingTest : public testing::Environment // mmp->clear(); info(XuMQ::logger, "清理完成"); } + }; // TEST(message_test, insert_test) @@ -72,28 +73,33 @@ class BindingTest : public testing::Environment // // ASSERT_EQ(mmp->waitAckCount("queue1"), 5); // } -TEST(message_test, delete_test) -{ - XuMQ::MessagePtr msg1 = mmp->front("queue1"); - - ASSERT_NE(msg1.get(), nullptr); - ASSERT_EQ(msg1->payload().body(), std::string("hello xu 2")); - // ASSERT_EQ(mmp->durableCount("queue1"), 9); - // ASSERT_EQ(mmp->availableCount("queue1"), 9); - // ASSERT_EQ(mmp->totalCount("queue1"), 9); - // XuMQ::MessagePtr msg1 = mmp->front("queue1"); - // ASSERT_EQ(mmp->durableCount("queue1"), 9); - - // ASSERT_NE(msg1.get(), nullptr); - // ASSERT_EQ(msg1->payload().body(), std::string("hello xu 1")); - // ASSERT_EQ(mmp->availableCount("queue1"), 8); - // ASSERT_EQ(mmp->waitAckCount("queue1"), 1); - // mmp->ack("queue1", msg1->payload().properties().id()); - // ASSERT_EQ(mmp->availableCount("queue1"), 8); - // ASSERT_EQ(mmp->waitAckCount("queue1"), 0); - // ASSERT_EQ(mmp->durableCount("queue1"), 8); - // ASSERT_EQ(mmp->totalCount("queue1"), 9); +// TEST(message_test, delete_test) +// { +// XuMQ::MessagePtr msg1 = mmp->front("queue1"); + +// ASSERT_NE(msg1.get(), nullptr); +// ASSERT_EQ(msg1->payload().body(), std::string("hello xu 2")); +// // ASSERT_EQ(mmp->durableCount("queue1"), 9); +// // ASSERT_EQ(mmp->availableCount("queue1"), 9); +// // ASSERT_EQ(mmp->totalCount("queue1"), 9); +// // XuMQ::MessagePtr msg1 = mmp->front("queue1"); +// // ASSERT_EQ(mmp->durableCount("queue1"), 9); + +// // ASSERT_NE(msg1.get(), nullptr); +// // ASSERT_EQ(msg1->payload().body(), std::string("hello xu 1")); +// // ASSERT_EQ(mmp->availableCount("queue1"), 8); +// // ASSERT_EQ(mmp->waitAckCount("queue1"), 1); +// // mmp->ack("queue1", msg1->payload().properties().id()); +// // ASSERT_EQ(mmp->availableCount("queue1"), 8); +// // ASSERT_EQ(mmp->waitAckCount("queue1"), 0); +// // ASSERT_EQ(mmp->durableCount("queue1"), 8); +// // ASSERT_EQ(mmp->totalCount("queue1"), 9); +// } + +TEST(message_test, destroy_test) +{ + mmp->destroyQueueMessage("queue1"); } int main(int argc, char *argv[])