rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ding...@apache.org
Subject [rocketmq-client-cpp] branch master updated: fix test case issue :environmental anomaly (#125)
Date Thu, 04 Apr 2019 07:11:11 GMT
This is an automated email from the ASF dual-hosted git repository.

dinglei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-cpp.git


The following commit(s) were added to refs/heads/master by this push:
     new 5cf3e33  fix test case issue :environmental anomaly (#125)
5cf3e33 is described below

commit 5cf3e330275b5561ad86a11e76998617596dcd09
Author: githublaohu <2372554140@qq.com>
AuthorDate: Thu Apr 4 15:11:06 2019 +0800

    fix test case issue :environmental anomaly (#125)
---
 test/src/extern/CProducerTest.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/test/src/extern/CProducerTest.cpp b/test/src/extern/CProducerTest.cpp
index 5ee71e6..ccfdc64 100644
--- a/test/src/extern/CProducerTest.cpp
+++ b/test/src/extern/CProducerTest.cpp
@@ -77,6 +77,7 @@ TEST(cProducer, SendMessageAsync) {
     EXPECT_CALL(*mockProducer, send(_, _)).Times(1);
     EXPECT_EQ(SendMessageAsync(cProducer, msg, cSendSuccessCallback, cSendExceptionCallback),
OK);
     Mock::AllowLeak(mockProducer);
+    DestroyMessage(msg);
 }
 
 TEST(cProducer, sendMessageOrderly) {
@@ -97,6 +98,8 @@ TEST(cProducer, sendMessageOrderly) {
         .WillOnce(Return(SendResult(SendStatus::SEND_OK, "3", "offset1", messageQueue, 14)));
     // EXPECT_EQ(SendMessageOrderly(cProducer, msg, callback, msg, 1, result), OK);
     Mock::AllowLeak(mockProducer);
+    DestroyMessage(msg);
+    // free(result);
 }
 
 TEST(cProducer, sendOneway) {
@@ -110,6 +113,7 @@ TEST(cProducer, sendOneway) {
     EXPECT_CALL(*mockProducer, sendOneway(_, _)).Times(1);
     EXPECT_EQ(SendMessageOneway(cProducer, msg), OK);
     Mock::AllowLeak(mockProducer);
+    DestroyMessage(msg);
 }
 
 TEST(cProducer, sendMessageSync) {
@@ -150,7 +154,8 @@ TEST(cProducer, sendMessageSync) {
     EXPECT_EQ(SendMessageSync(cProducer, msg, result), OK);
     EXPECT_EQ(result->sendStatus, E_SEND_OK);
     Mock::AllowLeak(mockProducer);
-    delete mqMessage;
+    DestroyMessage(msg);
+    free(result);
 }
 
 TEST(cProducer, infoMock) {


Mime
View raw message