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

Commit c02603c5 authored by Bernie Innocenti's avatar Bernie Innocenti Committed by android-build-merger
Browse files

Merge "Rename expected_errorno to expected_eai_error in resolver unit test"

am: 86581aa9fd

Change-Id: Ic8833ac5cb036ecf89cfbb0478dd1cd560a461f4
parents d5f25593 13f72c57
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -131,7 +131,8 @@ TEST_F(GetAddrInfoForNetContextTest, InvalidParameters) {
        char* ai_canonname;
        struct sockaddr* ai_addr;
        struct addrinfo* ai_next;
        int expected_errorno;  // expected result

        int expected_eai_error;

        std::string asParameters() const {
            return StringPrintf("0x%x/%u/%s/%p/%p", ai_flags, ai_addrlen,
@@ -167,7 +168,7 @@ TEST_F(GetAddrInfoForNetContextTest, InvalidParameters) {

        rv = android_getaddrinfofornetcontext("localhost", nullptr /*servname*/, &hints,
                                              &mNetcontext, &result);
        EXPECT_EQ(config.expected_errorno, rv);
        EXPECT_EQ(config.expected_eai_error, rv);

        if (result) {
            freeaddrinfo(result);
@@ -256,7 +257,8 @@ TEST_F(GetAddrInfoForNetContextTest, InvalidParameters_PortNameAndNumber) {
        int ai_family;
        int ai_socktype;
        const char* servname;
        int expected_errorno;  // expected result

        int expected_eai_error;

        std::string asParameters() const {
            return StringPrintf("0x%x/%d/%d/%s", ai_flags, ai_family, ai_socktype,
@@ -320,7 +322,7 @@ TEST_F(GetAddrInfoForNetContextTest, InvalidParameters_PortNameAndNumber) {
        struct addrinfo* result = nullptr;
        int rv = android_getaddrinfofornetcontext("localhost", config.servname, &hints,
                                                  &mNetcontext, &result);
        EXPECT_EQ(config.expected_errorno, rv);
        EXPECT_EQ(config.expected_eai_error, rv);

        if (result) freeaddrinfo(result);
    }
@@ -398,7 +400,7 @@ TEST_F(GetAddrInfoForNetContextTest, ServerResponseError) {

    static const struct TestConfig {
        ns_rcode rcode;
        int expected_errorno;  // expected result
        int expected_eai_error;

        // Only test failure RCODE [1..5] in RFC 1035 section 4.1.1 and skip successful RCODE 0
        // which means no error.
@@ -429,7 +431,7 @@ TEST_F(GetAddrInfoForNetContextTest, ServerResponseError) {
        const struct addrinfo hints = {.ai_family = AF_UNSPEC};
        int rv =
                android_getaddrinfofornetcontext(host_name, nullptr, &hints, &mNetcontext, &result);
        EXPECT_EQ(config.expected_errorno, rv);
        EXPECT_EQ(config.expected_eai_error, rv);

        if (result) freeaddrinfo(result);
    }
@@ -523,7 +525,7 @@ TEST_F(GetHostByNameForNetContextTest, ServerResponseError) {

    static const struct TestConfig {
        ns_rcode rcode;
        int expected_errorno;  // expected result
        int expected_eai_error;  // expected result

        // Only test failure RCODE [1..5] in RFC 1035 section 4.1.1 and skip successful RCODE 0
        // which means no error. Note that the return error codes aren't mapped by rcode in the
@@ -555,7 +557,7 @@ TEST_F(GetHostByNameForNetContextTest, ServerResponseError) {
        struct hostent* hp = nullptr;
        int rv = android_gethostbynamefornetcontext(host_name, AF_INET, &mNetcontext, &hp);
        EXPECT_TRUE(hp == nullptr);
        EXPECT_EQ(config.expected_errorno, rv);
        EXPECT_EQ(config.expected_eai_error, rv);
    }
}