wangzhengquan
2020-08-05 c98f3d98b879dff1d05e64155eca669f0f6456fd
commit
4个文件已修改
13 ■■■■ 已修改文件
test_queue/Makefile 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test_queue/test.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
test_queue/test_queue 补丁 | 查看 | 原始文档 | blame | 历史
test_queue/test_queue.c 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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)
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"
test_queue/test_queue
Binary files differ
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;