Lines Matching +full:self +full:- +full:test
1 // SPDX-License-Identifier: GPL-2.0
33 .sun_path = "test", in FIXTURE_VARIANT_ADD()
42 .sun_path = "\0test", in FIXTURE_VARIANT_ADD()
51 .sun_path = "test", in FIXTURE_VARIANT_ADD()
60 .sun_path = "\0test", in FIXTURE_VARIANT_ADD()
69 .sun_path = "test", in FIXTURE_VARIANT_ADD()
78 .sun_path = "\0test", in FIXTURE_VARIANT_ADD()
87 .sun_path = "test", in FIXTURE_VARIANT_ADD()
96 .sun_path = "\0test", in FIXTURE_VARIANT_ADD()
104 self->family = AF_UNIX; in FIXTURE_SETUP()
109 close(self->server); in FIXTURE_TEARDOWN()
110 close(self->client); in FIXTURE_TEARDOWN()
112 if (variant->sun_path[0]) in FIXTURE_TEARDOWN()
113 remove("test"); in FIXTURE_TEARDOWN()
116 TEST_F(unix_connect, test) in TEST_F() argument
120 .sun_family = self->family, in TEST_F()
124 self->server = socket(self->family, variant->type, 0); in TEST_F()
125 ASSERT_NE(-1, self->server); in TEST_F()
127 addrlen = offsetof(struct sockaddr_un, sun_path) + variant->len; in TEST_F()
128 memcpy(&addr.sun_path, variant->sun_path, variant->len); in TEST_F()
130 err = bind(self->server, (struct sockaddr *)&addr, addrlen); in TEST_F()
133 if (variant->type == SOCK_STREAM) { in TEST_F()
134 err = listen(self->server, 32); in TEST_F()
138 err = unshare(variant->flags); in TEST_F()
141 self->client = socket(self->family, variant->type, 0); in TEST_F()
142 ASSERT_LT(0, self->client); in TEST_F()
144 err = connect(self->client, (struct sockaddr *)&addr, addrlen); in TEST_F()
145 ASSERT_EQ(variant->err, err == -1 ? errno : 0); in TEST_F()