summaryrefslogtreecommitdiffstats
path: root/src/test/test-terminal-util.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:40 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 03:50:40 +0000
commitfc53809803cd2bc2434e312b19a18fa36776da12 (patch)
treeb4b43bd6538f51965ce32856e9c053d0f90919c8 /src/test/test-terminal-util.c
parentAdding upstream version 255.5. (diff)
downloadsystemd-fc53809803cd2bc2434e312b19a18fa36776da12.tar.xz
systemd-fc53809803cd2bc2434e312b19a18fa36776da12.zip
Adding upstream version 256.upstream/256
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/test-terminal-util.c')
-rw-r--r--src/test/test-terminal-util.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/test/test-terminal-util.c b/src/test/test-terminal-util.c
index a2b7101..dbd7654 100644
--- a/src/test/test-terminal-util.c
+++ b/src/test/test-terminal-util.c
@@ -155,7 +155,7 @@ TEST(get_ctty) {
}
/* In almost all cases STDIN will match our controlling TTY. Let's verify that and then compare paths */
- assert_se(fstat(STDIN_FILENO, &st) >= 0);
+ ASSERT_OK_ERRNO(fstat(STDIN_FILENO, &st));
if (S_ISCHR(st.st_mode) && st.st_rdev == devnr) {
_cleanup_free_ char *stdin_name = NULL;
@@ -165,4 +165,15 @@ TEST(get_ctty) {
log_notice("Not invoked with stdin == ctty, cutting get_ctty() test short");
}
+TEST(get_default_background_color) {
+ double red, green, blue;
+ int r;
+
+ r = get_default_background_color(&red, &green, &blue);
+ if (r < 0)
+ log_notice_errno(r, "Can't get terminal default background color: %m");
+ else
+ log_notice("R=%g G=%g B=%g", red, green, blue);
+}
+
DEFINE_TEST_MAIN(LOG_INFO);