~ubuntu-branches/ubuntu/vivid/ncbi-tools6/vivid

« back to all changes in this revision

Viewing changes to connect/test/test_ncbi_socket_connector.c

  • Committer: Package Import Robot
  • Author(s): Aaron M. Ucko, Andreas Tille
  • Date: 2012-06-24 22:54:29 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20120624225429-y81u0gzrppi3fhyf
Tags: 6.1.20120620-2
[ Andreas Tille ]
debian/upstream: Strings containing ': ' need to be quoted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: test_ncbi_socket_connector.c,v 6.13 2010/02/05 20:35:05 kazimird Exp $
 
1
/* $Id: test_ncbi_socket_connector.c,v 6.14 2012/04/19 20:34:32 kazimird Exp $
2
2
 * ===========================================================================
3
3
 *
4
4
 *                            PUBLIC DOMAIN NOTICE
42
42
#define TEST_MAX_TRY 2
43
43
#define TEST_TIMEOUT 5.123456
44
44
 
45
 
#define MIN_PORT 4096
46
 
 
47
 
#define _STR(n)      #n
48
 
#define STRINGIFY(n) _STR(n)
 
45
#define _STR(n)     #n
 
46
#define  STR(n) _STR(n)
49
47
 
50
48
 
51
49
/*ARGSUSED*/
56
54
        if      (strcasecmp(REG_CONN_HOST,    name) == 0)
57
55
            *value = '\0';
58
56
        if      (strcasecmp(REG_CONN_MAX_TRY, name) == 0)
59
 
            strncpy0(value, STRINGIFY(TEST_MAX_TRY), value_size);
 
57
            strncpy0(value, STR(TEST_MAX_TRY), value_size);
60
58
        else if (strcasecmp(REG_CONN_TIMEOUT, name) == 0)
61
 
            strncpy0(value, STRINGIFY(TEST_TIMEOUT), value_size);
 
59
            strncpy0(value, STR(TEST_TIMEOUT), value_size);
62
60
    }
63
61
}
64
62
 
112
110
    }
113
111
 
114
112
    /* bad args? -- Usage */
115
 
    if (!*net_info->host  ||  net_info->port < MIN_PORT) {
 
113
    if (!*net_info->host  ||  !net_info->port) {
116
114
        fprintf(stderr,
117
 
                "Usage: %s <host> <port> [max_try [timeout]]\n"
118
 
                "where <port> not less than %s; timeout is a float(in sec)\n",
119
 
                argv[0], STRINGIFY(MIN_PORT));
 
115
                "Usage: %s <host> <port> [max_try [timeout]]\n\n",
 
116
                argv[0]);
120
117
        return 1/*error*/;
121
118
    }
122
119