git: 66b4bdd5addb - stable/13 - module_test: Fix some assignments to errno intended to be tests.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 11 May 2022 18:44:23 UTC
The branch stable/13 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=66b4bdd5addb8bb105db5a4f37852708a82c371e
commit 66b4bdd5addb8bb105db5a4f37852708a82c371e
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-03-14 21:05:05 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-05-11 17:30:09 +0000
module_test: Fix some assignments to errno intended to be tests.
Reported by: vangyzen
Reviewed by: vangyzen, markj
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D34528
(cherry picked from commit 18207579a26bca553ec285f97a98fbe45316223b)
---
tests/sys/kern/module_test.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/sys/kern/module_test.c b/tests/sys/kern/module_test.c
index eaebf7196523..37cbc3b3271a 100644
--- a/tests/sys/kern/module_test.c
+++ b/tests/sys/kern/module_test.c
@@ -43,7 +43,7 @@ ATF_TC_BODY(modfind, tc)
modid = modfind("nonexistent_module");
ATF_REQUIRE(modid == -1);
- ATF_REQUIRE(errno = ENOENT);
+ ATF_REQUIRE(errno == ENOENT);
}
ATF_TC_WITHOUT_HEAD(modnext);
@@ -54,7 +54,7 @@ ATF_TC_BODY(modnext, tc)
/* This assumes -1 is never used as a valid module id. */
modid = modnext(-1);
ATF_REQUIRE(modid == -1);
- ATF_REQUIRE(errno = ENOENT);
+ ATF_REQUIRE(errno == ENOENT);
modid = modnext(0);
ATF_REQUIRE(modid > 0);
@@ -75,11 +75,11 @@ ATF_TC_BODY(modfnext, tc)
/* This assumes -1 is never used as a valid module id. */
modid = modfnext(-1);
ATF_REQUIRE(modid == -1);
- ATF_REQUIRE(errno = ENOENT);
+ ATF_REQUIRE(errno == ENOENT);
modid = modfnext(0);
ATF_REQUIRE(modid == -1);
- ATF_REQUIRE(errno = ENOENT);
+ ATF_REQUIRE(errno == ENOENT);
modid = modnext(0);
ATF_REQUIRE(modid > 0);