From c98f3d98b879dff1d05e64155eca669f0f6456fd Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期三, 05 八月 2020 20:21:15 +0800
Subject: [PATCH] commit
---
test_queue/test.h | 1 +
test_queue/Makefile | 4 ++--
test_queue/test_queue.c | 8 ++++----
test_queue/test_queue | 0
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/test_queue/Makefile b/test_queue/Makefile
index 1a3a201..bcb18b2 100755
--- a/test_queue/Makefile
+++ b/test_queue/Makefile
@@ -4,7 +4,7 @@
ROOT=..
LDLIBS+=-Wl,-rpath=$(ROOT)/lib:$(ROOT)/build/lib
# 寮�婧愬伐鍏峰寘璺緞
-LDDIR += -L$(ROOT)/lib -L$(ROOT)/build/lib
+LDDIR += -L$(ROOT)/build/lib
# 寮�婧愬伐鍏峰寘
LDLIBS += -lshm_queue -lusgcommon -lpthread
@@ -14,7 +14,7 @@
include $(ROOT)/Make.defines.$(PLATFORM)
-PROGS = test
+PROGS = test_queue
build: $(PROGS)
diff --git a/test_queue/test.h b/test_queue/test.h
index 25a3215..b9cf391 100644
--- a/test_queue/test.h
+++ b/test_queue/test.h
@@ -1,6 +1,7 @@
#include "usg_common.h"
#include "usg_typedef.h"
#include "shm_queue.h"
+#include "shm_queue_wrapper.h"
#include "shm_allocator.h"
#include <sstream>
//#include "queue_factory.h"
diff --git a/test_queue/test_queue b/test_queue/test_queue
index 13e6b2a..e80c123 100755
--- a/test_queue/test_queue
+++ b/test_queue/test_queue
Binary files differ
diff --git a/test_queue/test_queue.c b/test_queue/test_queue.c
index 3ae812a..6ddf1b8 100644
--- a/test_queue/test_queue.c
+++ b/test_queue/test_queue.c
@@ -47,11 +47,11 @@
std::ostringstream outstr;
int key = 2;
- shmstring item;
+ std::string item;
size_t qsize = 16;
//LockFreeQueue<struct Item> *queue = QueueFactory::createQueue<struct Item> (key, qsize);
- SHMQueue<shmstring> *queue = new SHMQueue<shmstring>(key, 16);
+ SHMQueue<std::string> *queue = new SHMQueue<std::string>(key, 16);
// LockFreeQueue<struct Item> queue(16);
for(i = 0; i < qsize; i++) {
outstr.seekp(0);
@@ -69,7 +69,7 @@
// cout << "i=" << i << ":" << item << endl;
// }
-
+ shm_remove_queue(key);
struct timespec timeout = {1, 0};
@@ -121,7 +121,7 @@
int main () {
mm_init(512);
// testArr(12);
- testStruct();
+ testString();
mm_destroy();
return 0;
--
Gitblit v1.8.0