Page MenuHomeFreeBSD

D55781.diff
No OneTemporary

D55781.diff

diff --git a/tests/sys/kern/ssl_sendfile.c b/tests/sys/kern/ssl_sendfile.c
--- a/tests/sys/kern/ssl_sendfile.c
+++ b/tests/sys/kern/ssl_sendfile.c
@@ -285,6 +285,14 @@
return (rv);
}
+static void
+require_sbytes(struct ctx *c, ssize_t expect)
+{
+ ATF_REQUIRE(pthread_mutex_lock(&c->mtx) == 0);
+ ATF_REQUIRE(c->sbytes == expect);
+ ATF_REQUIRE(pthread_mutex_unlock(&c->mtx) == 0);
+}
+
ATF_TC_WITHOUT_HEAD(basic);
ATF_TC_BODY(basic, tc)
{
@@ -302,7 +310,7 @@
nread += n;
}
ATF_REQUIRE(nread == FSIZE);
- ATF_REQUIRE(c.sbytes == FSIZE);
+ require_sbytes(&c, FSIZE);
common_cleanup(&c);
}
@@ -332,7 +340,7 @@
nread += n;
}
ATF_REQUIRE(nread == expect);
- ATF_REQUIRE(c.sbytes == (ssize_t)expect);
+ require_sbytes(&c, (ssize_t)expect);
}
common_cleanup(&c);
@@ -367,9 +375,7 @@
nread += n;
}
ATF_REQUIRE(nread == TRUNC);
- ATF_REQUIRE(pthread_mutex_lock(&c.mtx) == 0);
- ATF_REQUIRE(c.sbytes == TRUNC);
- ATF_REQUIRE(pthread_mutex_unlock(&c.mtx) == 0);
+ require_sbytes(&c, TRUNC);
common_cleanup(&c);
}
@@ -418,9 +424,7 @@
nread += n;
}
ATF_REQUIRE(nread == GROW);
- ATF_REQUIRE(pthread_mutex_lock(&c.mtx) == 0);
- ATF_REQUIRE(c.sbytes == FSIZE + GROW);
- ATF_REQUIRE(pthread_mutex_unlock(&c.mtx) == 0);
+ require_sbytes(&c, FSIZE + GROW);
common_cleanup(&c);
}

File Metadata

Mime Type
text/plain
Expires
Sun, Apr 19, 8:11 PM (17 m, 6 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29545632
Default Alt Text
D55781.diff (1 KB)

Event Timeline