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

Commit 4c254cfe authored by Yi Kong's avatar Yi Kong
Browse files

Fix another string-compare warning

packages/modules/DnsResolver/tests/resolv_integration_test.cpp:4695:25: error: result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Werror,-Wstring-compare]
            if (dnsMode == "STRICT") parcel.tlsName = kDefaultPrivateDnsHostName;
                        ^  ~~~~~~~~
packages/modules/DnsResolver/tests/resolv_integration_test.cpp:4708:29: error: result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Werror,-Wstring-compare]
                    dnsMode == "STRICT" ? expectAnswersNotValid(fd, -ETIMEDOUT)
                            ^  ~~~~~~~~
packages/modules/DnsResolver/tests/resolv_integration_test.cpp:4725:25: error: result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Werror,-Wstring-compare]
            if (dnsMode == "STRICT" && config.asyncHandshake &&
                        ^  ~~~~~~~~
packages/modules/DnsResolver/tests/resolv_integration_test.cpp:4769:25: error: result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Werror,-Wstring-compare]
            if (dnsMode == "STRICT") parcel.tlsName = kDefaultPrivateDnsHostName;
                        ^  ~~~~~~~~
packages/modules/DnsResolver/tests/resolv_integration_test.cpp:4784:25: error: result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Werror,-Wstring-compare]
            if (dnsMode == "STRICT" && queryTimeoutMs != INFINITE_QUERY_TIMEOUT) {
                        ^  ~~~~~~~~

Test: presubmit
Bug: 153764102
Change-Id: I7de355469c5fb18261194af346e8760369342b44
parent 46164a7c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@
#include <chrono>
#include <iterator>
#include <numeric>
#include <string_view>
#include <thread>
#include <unordered_set>

@@ -4677,7 +4678,7 @@ TEST_F(ResolverTest, ConnectTlsServerTimeout_ConcurrentQueries) {
        ScopedSystemProperties sp6(kDotRevalidationThresholdFlag, "-1");
        resetNetwork();

        for (const auto& dnsMode : {"OPPORTUNISTIC", "STRICT"}) {
        for (const std::string_view dnsMode : {"OPPORTUNISTIC", "STRICT"}) {
            SCOPED_TRACE(fmt::format("testConfig: [{}, {}]", testConfigCount, dnsMode));

            // Because a DnsTlsTransport lasts at least 5 minutes in spite of network
@@ -4747,7 +4748,7 @@ TEST_F(ResolverTest, QueryTlsServerTimeout) {
    };

    for (const int queryTimeoutMs : {INFINITE_QUERY_TIMEOUT, 1000}) {
        for (const auto& dnsMode : {"OPPORTUNISTIC", "STRICT"}) {
        for (const std::string_view dnsMode : {"OPPORTUNISTIC", "STRICT"}) {
            SCOPED_TRACE(fmt::format("testConfig: [{}] [{}]", dnsMode, queryTimeoutMs));

            const std::string addr = getUniqueIPv4Address();