git: 18207579a26b - main - module_test: Fix some assignments to errno intended to be tests.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Mon, 14 Mar 2022 21:05:59 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=18207579a26bca553ec285f97a98fbe45316223b

commit 18207579a26bca553ec285f97a98fbe45316223b
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-03-14 21:05:05 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-03-14 21:05:05 +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
---
 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);