Overview Tutorial API reference Examples Build Download ZmqMessage 0.1 - 21 Oct 2011

tests/SimpleTest.cpp File Reference

We check correctness of sending, receiving, iterating multipart messages between threads. More...

#include "pthread.h"
#include <cstddef>
#include <cassert>
#include <cstring>
#include <string>
#include "ZmqMessage.hpp"

Defines

#define ARRAY_LEN(arr)   sizeof(arr)/sizeof((arr)[0])

Functions

void my_free (void *data, void *hint)
template<typename Routing, int socktype>
void * req (void *arg)
template<typename Routing, int socktype>
void * res (void *arg)
template<typename ReqRouting, int reqsocktype, typename ResRouting, int ressocktype>
void test (zmq::context_t &ctx_, const char *name)
void test_time ()
void test_detach ()
int main ()

Variables

const char * endpoint = "inproc://simple-test"
const char * payload = "0123456789"
const size_t payloadsz = 10
const char * req_parts [] = {"part1", "second", "payload", "bin part", "num text part"}
const char * res_parts [] = {"id", "status"}
const char * STATUS = "OK STATUS"
const char * SECOND_PART = "second part"
const int BIN_PART = 567098
const int NUM_TEXT_PART = 196670


Detailed Description

We check correctness of sending, receiving, iterating multipart messages between threads.

Copyright (c) 2010-2011 Phorm, Inc. GNU LGPL v 3.0, see http://www.gnu.org/licenses/lgpl-3.0-standalone.html

Author:
Andrey Skryabin <andrew@zmqmessage.org>, et al.
Test:

We use different types and methods for insertion and extraction of message parts. We use binary and text modes. We use all possible combinations of Routing policies (simple-to-simple, X-to-X, Simple-to-X and X-to-Simple).


Define Documentation

#define ARRAY_LEN ( arr   )     sizeof(arr)/sizeof((arr)[0])


Function Documentation

int main (  ) 

void my_free ( void *  data,
void *  hint 
)

template<typename Routing, int socktype>
void* req ( void *  arg  ) 

template<typename Routing, int socktype>
void* res ( void *  arg  ) 

Examples:
zasync.cpp.

template<typename ReqRouting, int reqsocktype, typename ResRouting, int ressocktype>
void test ( zmq::context_t &  ctx_,
const char *  name 
)

void test_detach (  ) 

void test_time (  ) 


Variable Documentation

const int BIN_PART = 567098

const char* endpoint = "inproc://simple-test"

const int NUM_TEXT_PART = 196670

const char* payload = "0123456789"

const size_t payloadsz = 10

const char* req_parts[] = {"part1", "second", "payload", "bin part", "num text part"}

const char* res_parts[] = {"id", "status"}

const char* SECOND_PART = "second part"

const char* STATUS = "OK STATUS"


ZmqMessage 0.1 — open source software, support@zmqmessage.org