From 7d9aa55df071b415a18cd6b94c187fee14158924 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 12 Jun 2024 21:43:55 +0000 Subject: [PATCH] termios_test.cpp: move signedness cast. Cast the constant (which should probably be unsigned in the kernel headers, but isn't), rather than the already [correctly] unsigned expression involving `c_cflag`. This came up when there was a suggestion on the linux-api mailing list [https://lore.kernel.org/linux-api/be31d737-8263-4e59-8b30-7221ee0549fc@cs.ucla.edu/T/#mdd466d7eaefe8805de7b0cecf013c5cddb04c660] to maybe change the signedness of the constants; this was the only build breakage that would result in AOSP from doing so. Change-Id: I64aeee0a8f5d2edd54a9a9352b1aa2b9e3aa245e --- tests/termios_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/termios_test.cpp b/tests/termios_test.cpp index 480f3afb3..19e9bfe71 100644 --- a/tests/termios_test.cpp +++ b/tests/termios_test.cpp @@ -96,7 +96,7 @@ TEST(termios, cfmakeraw) { EXPECT_EQ(0U, (t.c_oflag & OPOST)); EXPECT_EQ(0U, (t.c_lflag & (ECHO|ECHONL|ICANON|ISIG|IEXTEN))); EXPECT_EQ(0U, (t.c_cflag & PARENB)); - EXPECT_EQ(CS8, static_cast(t.c_cflag & CSIZE)); + EXPECT_EQ(static_cast(CS8), (t.c_cflag & CSIZE)); EXPECT_EQ(1, t.c_cc[VMIN]); EXPECT_EQ(0, t.c_cc[VTIME]); }