Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108558827
D44075.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D44075.diff
View Options
diff --git a/lib/libc/tests/sys/Makefile b/lib/libc/tests/sys/Makefile
--- a/lib/libc/tests/sys/Makefile
+++ b/lib/libc/tests/sys/Makefile
@@ -7,6 +7,7 @@
ATF_TESTS_C+= brk_test
.endif
ATF_TESTS_C+= cpuset_test
+ATF_TESTS_C+= errno_test
ATF_TESTS_C+= queue_test
ATF_TESTS_C+= sendfile_test
diff --git a/lib/libc/tests/sys/errno_test.c b/lib/libc/tests/sys/errno_test.c
new file mode 100644
--- /dev/null
+++ b/lib/libc/tests/sys/errno_test.c
@@ -0,0 +1,36 @@
+/*-
+ * Copyright (c) 2024 The FreeBSD Foundation
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * This software were developed by Konstantin Belousov <kib@FreeBSD.org>
+ * under sponsorship from the FreeBSD Foundation.
+ */
+
+#include <errno.h>
+#include <unistd.h>
+
+#include <atf-c.h>
+
+ATF_TC(errno_basic);
+ATF_TC_HEAD(errno_basic, tc)
+{
+ atf_tc_set_md_var(tc, "descr",
+ "Verify basic functionality of errno");
+}
+
+ATF_TC_BODY(errno_basic, tc)
+{
+ int res;
+
+ res = unlink("/non/existent/file");
+ ATF_REQUIRE(res == -1);
+ ATF_REQUIRE(errno == ENOENT);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+ ATF_TP_ADD_TC(tp, errno_basic);
+
+ return (atf_no_error());
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 27, 8:14 AM (2 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16191209
Default Alt Text
D44075.diff (1 KB)
Attached To
Mode
D44075: libc/sys: add errno test
Attached
Detach File
Event Timeline
Log In to Comment