@@ -42,25 +42,32 @@ int main(void) {
42
42
43
43
str = _z_string_alias_str ("" );
44
44
assert (_z_locator_from_string (& lc , & str ) == _Z_ERR_CONFIG_LOCATOR_INVALID );
45
+ _z_locator_clear (& lc );
45
46
46
47
str = _z_string_alias_str ("/" );
47
48
assert (_z_locator_from_string (& lc , & str ) == _Z_ERR_CONFIG_LOCATOR_INVALID );
49
+ _z_locator_clear (& lc );
48
50
49
51
str = _z_string_alias_str ("tcp" );
50
52
assert (_z_locator_from_string (& lc , & str ) == _Z_ERR_CONFIG_LOCATOR_INVALID );
53
+ _z_locator_clear (& lc );
51
54
52
55
str = _z_string_alias_str ("tcp/" );
53
56
assert (_z_locator_from_string (& lc , & str ) == _Z_ERR_CONFIG_LOCATOR_INVALID );
57
+ _z_locator_clear (& lc );
54
58
55
59
str = _z_string_alias_str ("127.0.0.1:7447" );
56
60
assert (_z_locator_from_string (& lc , & str ) == _Z_ERR_CONFIG_LOCATOR_INVALID );
61
+ _z_locator_clear (& lc );
57
62
58
63
str = _z_string_alias_str ("tcp/127.0.0.1:7447?" );
59
64
assert (_z_locator_from_string (& lc , & str ) == _Z_RES_OK );
65
+ _z_locator_clear (& lc );
60
66
61
67
// No metadata defined so far... but this is a valid syntax in principle
62
68
str = _z_string_alias_str ("tcp/127.0.0.1:7447?invalid=ctrl" );
63
69
assert (_z_locator_from_string (& lc , & str ) == _Z_RES_OK );
70
+ _z_locator_clear (& lc );
64
71
65
72
// Endpoint
66
73
printf (">>> Testing endpoints...\n" );
@@ -80,25 +87,32 @@ int main(void) {
80
87
81
88
str = _z_string_alias_str ("" );
82
89
assert (_z_endpoint_from_string (& ep , & str ) == _Z_ERR_CONFIG_LOCATOR_INVALID );
90
+ _z_endpoint_clear (& ep );
83
91
84
92
str = _z_string_alias_str ("/" );
85
93
assert (_z_endpoint_from_string (& ep , & str ) == _Z_ERR_CONFIG_LOCATOR_INVALID );
94
+ _z_endpoint_clear (& ep );
86
95
87
96
str = _z_string_alias_str ("tcp" );
88
97
assert (_z_endpoint_from_string (& ep , & str ) == _Z_ERR_CONFIG_LOCATOR_INVALID );
98
+ _z_endpoint_clear (& ep );
89
99
90
100
str = _z_string_alias_str ("tcp/" );
91
101
assert (_z_endpoint_from_string (& ep , & str ) == _Z_ERR_CONFIG_LOCATOR_INVALID );
102
+ _z_endpoint_clear (& ep );
92
103
93
104
str = _z_string_alias_str ("127.0.0.1:7447" );
94
105
assert (_z_endpoint_from_string (& ep , & str ) == _Z_ERR_CONFIG_LOCATOR_INVALID );
106
+ _z_endpoint_clear (& ep );
95
107
96
108
str = _z_string_alias_str ("tcp/127.0.0.1:7447?" );
97
109
assert (_z_endpoint_from_string (& ep , & str ) == _Z_RES_OK );
110
+ _z_endpoint_clear (& ep );
98
111
99
112
// No metadata defined so far... but this is a valid syntax in principle
100
113
str = _z_string_alias_str ("tcp/127.0.0.1:7447?invalid=ctrl" );
101
114
assert (_z_endpoint_from_string (& ep , & str ) == _Z_RES_OK );
115
+ _z_endpoint_clear (& ep );
102
116
103
117
str = _z_string_alias_str ("udp/127.0.0.1:7447#iface=eth0" );
104
118
assert (_z_endpoint_from_string (& ep , & str ) == _Z_RES_OK );
@@ -116,12 +130,15 @@ int main(void) {
116
130
117
131
str = _z_string_alias_str ("udp/127.0.0.1:7447#invalid=eth0" );
118
132
assert (_z_endpoint_from_string (& ep , & str ) == _Z_RES_OK );
133
+ _z_endpoint_clear (& ep );
119
134
120
135
str = _z_string_alias_str ("udp/127.0.0.1:7447?invalid=ctrl#iface=eth0" );
121
136
assert (_z_endpoint_from_string (& ep , & str ) == _Z_RES_OK );
137
+ _z_endpoint_clear (& ep );
122
138
123
139
str = _z_string_alias_str ("udp/127.0.0.1:7447?invalid=ctrl#invalid=eth0" );
124
140
assert (_z_endpoint_from_string (& ep , & str ) == _Z_RES_OK );
141
+ _z_endpoint_clear (& ep );
125
142
126
143
return 0 ;
127
144
}
0 commit comments