~ubuntu-branches/ubuntu/wily/zeromq3/wily-proposed

« back to all changes in this revision

Viewing changes to tests/test_last_endpoint.cpp

  • Committer: Package Import Robot
  • Author(s): Alessandro Ghedini
  • Date: 2014-03-16 14:02:28 UTC
  • mfrom: (1.1.6) (6.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20140316140228-ig1sgh7czk59m9ux
Tags: 4.0.4+dfsg-1
* QA upload; orphan the package
  - Upload to unstable
* New upstream release
* Update repack.stub script
* Drop 02_fix-exported-symbols.patch and 03_fix-s390-rdtsc.patch
  (merged upstream)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
    Copyright (c) 2007-2012 iMatix Corporation
3
 
    Copyright (c) 2011 250bpm s.r.o.
4
 
    Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file
 
2
    Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
5
3
 
6
4
    This file is part of 0MQ.
7
5
 
19
17
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
18
*/
21
19
 
22
 
#include "../include/zmq.h"
23
 
#include <string.h>
24
 
 
25
 
#undef NDEBUG
26
 
#include <assert.h>
 
20
#include "testutil.hpp"
27
21
 
28
22
static void do_bind_and_verify (void *s, const char *endpoint)
29
23
{
37
31
 
38
32
int main (void)
39
33
{
 
34
    setup_test_environment();
40
35
    //  Create the infrastructure
41
 
    void *ctx = zmq_init (1);
 
36
    void *ctx = zmq_ctx_new ();
42
37
    assert (ctx);
43
38
 
44
39
    void *sb = zmq_socket (ctx, ZMQ_ROUTER);
45
40
    assert (sb);
 
41
    int val = 0;
 
42
    int rc = zmq_setsockopt (sb, ZMQ_LINGER, &val, sizeof (val));
 
43
    assert (rc == 0);
46
44
 
47
45
    do_bind_and_verify (sb, "tcp://127.0.0.1:5560");
48
46
    do_bind_and_verify (sb, "tcp://127.0.0.1:5561");
49
 
    do_bind_and_verify (sb, "ipc:///tmp/testep");
50
47
 
51
 
    int rc = zmq_close (sb);
 
48
    rc = zmq_close (sb);
52
49
    assert (rc == 0);
53
50
    
54
 
    rc = zmq_term (ctx);
 
51
    rc = zmq_ctx_term (ctx);
55
52
    assert (rc == 0);
56
53
 
57
 
    return 0;
 
54
    return 0 ;
58
55
}
59
56