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

Commit 851181bf authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8769705 from 41c311a4 to mainline-media-swcodec-release

Change-Id: Ib4b04248c9461d36a67736d8d611dd6961eb3b6b
parents 9ed03eac 41c311a4
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line Diff line number Diff line
@@ -18,10 +18,14 @@


#include <gtest/gtest-spi.h>
#include <gtest/gtest-spi.h>


#include "resolv_test_base.h"

namespace android {
namespace android {
namespace netdutils {
namespace netdutils {


TEST(OperationLimiter, limits) {
class OperationLimiterTest : public ResolvTestBase {};

TEST_F(OperationLimiterTest, limits) {
    OperationLimiter<int> limiter(3);
    OperationLimiter<int> limiter(3);


    EXPECT_TRUE(limiter.start(42));
    EXPECT_TRUE(limiter.start(42));
@@ -50,7 +54,7 @@ TEST(OperationLimiter, limits) {
    limiter.finish(42);
    limiter.finish(42);
}
}


TEST(OperationLimiter, finishWithoutStart) {
TEST_F(OperationLimiterTest, finishWithoutStart) {
    OperationLimiter<int> limiter(1);
    OperationLimiter<int> limiter(1);


    // Will output a LOG(FATAL_WITHOUT_ABORT), but we have no way to probe this.
    // Will output a LOG(FATAL_WITHOUT_ABORT), but we have no way to probe this.
@@ -61,7 +65,7 @@ TEST(OperationLimiter, finishWithoutStart) {
    EXPECT_FALSE(limiter.start(42));
    EXPECT_FALSE(limiter.start(42));
}
}


TEST(OperationLimiter, destroyWithActiveOperations) {
TEST_F(OperationLimiterTest, destroyWithActiveOperations) {
    // The death message doesn't seem to be captured on Android.
    // The death message doesn't seem to be captured on Android.
    EXPECT_DEBUG_DEATH(
    EXPECT_DEBUG_DEATH(
            {
            {
+5 −9
Original line number Original line Diff line number Diff line
@@ -16,9 +16,6 @@ cc_test_library {
    header_libs: [
    header_libs: [
        "libnetd_resolv_headers",
        "libnetd_resolv_headers",
    ],
    ],
    shared_libs: [
        "libutils",
    ],
    static_libs: [
    static_libs: [
        "netd_aidl_interface-lateststable-ndk",
        "netd_aidl_interface-lateststable-ndk",
        "libnetd_test_dnsresponder_ndk",
        "libnetd_test_dnsresponder_ndk",
@@ -146,7 +143,6 @@ cc_test {
        "libnetd_test_dnsresponder_ndk",
        "libnetd_test_dnsresponder_ndk",
        "libnetd_test_resolv_utils",
        "libnetd_test_resolv_utils",
        "libnetdutils",
        "libnetdutils",
        "libutils",
        "netd_event_listener_interface-lateststable-ndk",
        "netd_event_listener_interface-lateststable-ndk",
        "netd_aidl_interface-lateststable-ndk",
        "netd_aidl_interface-lateststable-ndk",
    ],
    ],
@@ -189,7 +185,7 @@ cc_test {
        "libnetd_test_resolv_utils",
        "libnetd_test_resolv_utils",
        "libnetdutils",
        "libnetdutils",
        "libssl",
        "libssl",
        "libutils",
        "libcutils",
        "netd_aidl_interface-lateststable-ndk",
        "netd_aidl_interface-lateststable-ndk",
        "netd_event_listener_interface-lateststable-ndk",
        "netd_event_listener_interface-lateststable-ndk",
        "libip_checksum",
        "libip_checksum",
@@ -252,7 +248,6 @@ cc_test {
        "libstatslog_resolv",
        "libstatslog_resolv",
        "libstatspush_compat",
        "libstatspush_compat",
        "libsysutils",
        "libsysutils",
        "libutils",
        "resolv_stats_test_utils",
        "resolv_stats_test_utils",
        "server_configurable_flags",
        "server_configurable_flags",
        "stats_proto",
        "stats_proto",
@@ -298,7 +293,10 @@ cc_test {
    test_suites: [
    test_suites: [
        "general-tests",
        "general-tests",
    ],
    ],
    defaults: ["netd_defaults"],
    defaults: [
        "netd_defaults",
        "resolv_test_defaults",
    ],
    header_libs: [
    header_libs: [
        "libnetd_resolv_internal_headers",
        "libnetd_resolv_internal_headers",
    ],
    ],
@@ -307,11 +305,9 @@ cc_test {
        "libcrypto_static",
        "libcrypto_static",
        "libdoh_ffi_for_test",
        "libdoh_ffi_for_test",
        "libgmock",
        "libgmock",
        "liblog",
        "libssl",
        "libssl",
    ],
    ],
    shared_libs: [
    shared_libs: [
        "libnetd_client",
        "libnetd_client",
    ],
    ],
    min_sdk_version: "29",
}
}
+0 −1
Original line number Original line Diff line number Diff line
@@ -19,7 +19,6 @@ cc_test_library {
        "libbinder_ndk",
        "libbinder_ndk",
    ],
    ],
    static_libs: [
    static_libs: [
        "libutils",
        "netd_event_listener_interface-lateststable-ndk",
        "netd_event_listener_interface-lateststable-ndk",
    ],
    ],
}
}
+5 −1
Original line number Original line Diff line number Diff line
@@ -26,6 +26,8 @@
#include <gmock/gmock-matchers.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>


#include "resolv_test_base.h"

static const char* GOOGLE_SERVER_IP = "8.8.8.8";
static const char* GOOGLE_SERVER_IP = "8.8.8.8";
static const int TIMEOUT_MS = 3000;
static const int TIMEOUT_MS = 3000;
constexpr int MAXPACKET = (8 * 1024);
constexpr int MAXPACKET = (8 * 1024);
@@ -35,7 +37,9 @@ std::mutex m;
std::condition_variable cv;
std::condition_variable cv;
unsigned int dnsNetId;
unsigned int dnsNetId;


TEST(DoHFFITest, SmokeTest) {
class DoHFFITest : public ResolvTestBase {};

TEST_F(DoHFFITest, SmokeTest) {
    getNetworkForDns(&dnsNetId);
    getNetworkForDns(&dnsNetId);
    // To ensure that we have a real network.
    // To ensure that we have a real network.
    ASSERT_GE(dnsNetId, MINIMAL_NET_ID) << "No available networks";
    ASSERT_GE(dnsNetId, MINIMAL_NET_ID) << "No available networks";
+6 −2
Original line number Original line Diff line number Diff line
@@ -16,12 +16,16 @@


#include <android-base/strings.h>
#include <android-base/strings.h>
#include <gtest/gtest.h>
#include <gtest/gtest.h>
#include <resolv_stats_test_utils.h>
#include <stats.pb.h>
#include <stats.pb.h>


#include "resolv_stats_test_utils.h"
#include "resolv_test_base.h"

namespace android::net {
namespace android::net {


TEST(ResolvStatsUtils, NetworkDnsEventEq) {
class ResolvStatsUtilsTest : public ResolvTestBase {};

TEST_F(ResolvStatsUtilsTest, NetworkDnsEventEq) {
    NetworkDnsEventReported event1;
    NetworkDnsEventReported event1;
    // Following fields will not be verified during the test in proto NetworkDnsEventReported.
    // Following fields will not be verified during the test in proto NetworkDnsEventReported.
    // So don't need to config those values: event_type, return_code, latency_micros,
    // So don't need to config those values: event_type, return_code, latency_micros,
Loading