Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c60ec30 authored by Greg Hackmann's avatar Greg Hackmann
Browse files

libcutils: fix socket type in SocketsTest.TestGetLocalPort



With -Wall enabled locally, clang points out that the second parameter
to socket_inaddr_any_server() was accidentally hard-coded:

system/core/libcutils/tests/sockets_test.cpp:103:18: warning: unused variable 'type' [-Wunused-variable]
        for (int type : {SOCK_DGRAM, SOCK_STREAM}) {
                 ^

Bug: 26936282
Test: mmm system/core/libcutils/tests
Test: adb shell /data/nativetest/libcutils_test/libcutils_test32 \
	--gtest_filter=SocketsTest.TestGetLocalPort (on hikey)
Test: adb shell /data/nativetest64/libcutils_test/libcutils_test64 \
        --gtest_filter=SocketsTest.TestGetLocalPort (on hikey)

Change-Id: Ib0fa24fb02a5ee14db0afd6591a62089e43bbec0
Signed-off-by: default avatarGreg Hackmann <ghackmann@google.com>
parent 6d90fdc5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ TEST(SocketsTest, TestGetLocalPort) {
    // should always be able to read its port.
    for (int port : {10000, 12345, 15999, 20202, 25000}) {
        for (int type : {SOCK_DGRAM, SOCK_STREAM}) {
            server = socket_inaddr_any_server(port, SOCK_DGRAM);
            server = socket_inaddr_any_server(port, type);
            if (server != INVALID_SOCKET) {
                EXPECT_EQ(port, socket_get_local_port(server));
            }