Lines Matching defs:port
93 in_port_t port;
97 test_assert(net_str2hostport("[1::4]", 0, &host, &port) == 0 &&
98 strcmp(host, "1::4") == 0 && port == 0);
99 test_assert(net_str2hostport("[1::4]", 1234, &host, &port) == 0 &&
100 strcmp(host, "1::4") == 0 && port == 1234);
101 test_assert(net_str2hostport("[1::4]:78", 1234, &host, &port) == 0 &&
102 strcmp(host, "1::4") == 0 && port == 78);
104 test_assert(net_str2hostport("[1::4]:", 1234, &host, &port) < 0 && host == NULL);
105 test_assert(net_str2hostport("[1::4]:0", 1234, &host, &port) < 0 && host == NULL);
106 test_assert(net_str2hostport("[1::4]:x", 1234, &host, &port) < 0 && host == NULL);
108 test_assert(net_str2hostport("1::4", 0, &host, &port) == 0 &&
109 strcmp(host, "1::4") == 0 && port == 0);
110 test_assert(net_str2hostport("1::4", 1234, &host, &port) == 0 &&
111 strcmp(host, "1::4") == 0 && port == 1234);
113 test_assert(net_str2hostport("foo", 0, &host, &port) == 0 &&
114 strcmp(host, "foo") == 0 && port == 0);
115 test_assert(net_str2hostport("foo", 1234, &host, &port) == 0 &&
116 strcmp(host, "foo") == 0 && port == 1234);
117 test_assert(net_str2hostport("foo:78", 1234, &host, &port) == 0 &&
118 strcmp(host, "foo") == 0 && port == 78);
120 test_assert(net_str2hostport("foo:", 1234, &host, &port) < 0 && host == NULL);
121 test_assert(net_str2hostport("foo:0", 1234, &host, &port) < 0 && host == NULL);
122 test_assert(net_str2hostport("foo:x", 1234, &host, &port) < 0 && host == NULL);
125 test_assert(net_str2hostport("foo::78", 1234, &host, &port) == 0 &&
126 strcmp(host, "foo::78") == 0 && port == 1234);
127 test_assert(net_str2hostport("::foo:78", 1234, &host, &port) == 0 &&
128 strcmp(host, "::foo:78") == 0 && port == 1234);
129 test_assert(net_str2hostport("[::foo]:78", 1234, &host, &port) == 0 &&
130 strcmp(host, "::foo") == 0 && port == 78);
131 test_assert(net_str2hostport("[::::]", 1234, &host, &port) == 0 &&
132 strcmp(host, "::::") == 0 && port == 1234);
133 test_assert(net_str2hostport("[::::]:78", 1234, &host, &port) == 0 &&
134 strcmp(host, "::::") == 0 && port == 78);