Lines Matching refs:a2
179 static bool address_equal(const Address *a1, const Address *a2) { in address_equal() argument
180 if (a1 == a2) in address_equal()
183 if (!a1 || !a2) in address_equal()
186 return address_compare_func(a1, a2) == 0; in address_equal()
190 _cleanup_(address_freep) Address *a1 = NULL, *a2 = NULL; in test_address_equality()
193 assert_se(address_new(&a2) >= 0); in test_address_equality()
197 assert_se(!address_equal(NULL, a2)); in test_address_equality()
198 assert_se(address_equal(a1, a2)); in test_address_equality()
201 assert_se(!address_equal(a1, a2)); in test_address_equality()
203 a2->family = AF_INET; in test_address_equality()
204 assert_se(address_equal(a1, a2)); in test_address_equality()
207 assert_se(!address_equal(a1, a2)); in test_address_equality()
208 assert_se(in_addr_from_string(AF_INET, "192.168.3.9", &a2->in_addr) >= 0); in test_address_equality()
209 assert_se(address_equal(a1, a2)); in test_address_equality()
211 assert_se(!address_equal(a1, a2)); in test_address_equality()
212 assert_se(in_addr_from_string(AF_INET, "192.168.3.11", &a2->in_addr_peer) >= 0); in test_address_equality()
213 assert_se(!address_equal(a1, a2)); in test_address_equality()
214 assert_se(in_addr_from_string(AF_INET, "192.168.3.10", &a2->in_addr_peer) >= 0); in test_address_equality()
215 assert_se(address_equal(a1, a2)); in test_address_equality()
217 assert_se(!address_equal(a1, a2)); in test_address_equality()
218 a2->prefixlen = 10; in test_address_equality()
219 assert_se(address_equal(a1, a2)); in test_address_equality()
222 assert_se(!address_equal(a1, a2)); in test_address_equality()
224 a2->family = AF_INET6; in test_address_equality()
226 assert_se(in_addr_from_string(AF_INET6, "2001:4ca0:4f01::2", &a2->in_addr) >= 0); in test_address_equality()
227 assert_se(address_equal(a1, a2)); in test_address_equality()
229 a2->prefixlen = 8; in test_address_equality()
230 assert_se(!address_equal(a1, a2)); in test_address_equality()
232 a2->prefixlen = 10; in test_address_equality()
233 assert_se(in_addr_from_string(AF_INET6, "2001:4ca0:4f01::1", &a2->in_addr) >= 0); in test_address_equality()
234 assert_se(!address_equal(a1, a2)); in test_address_equality()