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

Commit 235d6d66 authored by Anton Ivanov's avatar Anton Ivanov
Browse files

Remove flags from cppflags of libgui_test.

Also fix tests that depend on them.

Rationale: libgui_test currently suffers from ODR violations due to a)
including statically built sources of libgui via the defaults, and b)
loading libgui at runtime via transitive shared library dependency.

The flags set via cppflags affect only a), and this blocks fixing the
ODR violation, which would be done by removing a) and standardizing on
b).  Since flags can be in different stagges of rollout, tests need to
be resilient to encountering either value of the flags.

Flag: EXEMPT refactor
Test: presubmit
Bug: 399711310
Change-Id: I3780eae83facf272f885dc0187c64c13d58e4cdf
parent 0c638dc9
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -51,11 +51,6 @@ cc_test {
        "-Werror",
        "-Wextra",
        "-Wthread-safety",
        "-DCOM_ANDROID_GRAPHICS_LIBGUI_FLAGS_BQ_SETFRAMERATE=true",
        "-DCOM_ANDROID_GRAPHICS_LIBGUI_FLAGS_BQ_EXTENDEDALLOCATE=true",
        "-DCOM_ANDROID_GRAPHICS_LIBGUI_FLAGS_WB_CONSUMER_BASE_OWNS_BQ=true",
        "-DCOM_ANDROID_GRAPHICS_LIBGUI_FLAGS_WB_PLATFORM_API_IMPROVEMENTS=true",
        "-DCOM_ANDROID_GRAPHICS_LIBGUI_FLAGS_WB_UNLIMITED_SLOTS=true",
    ],

    srcs: [
+8 −7
Original line number Diff line number Diff line
@@ -1452,10 +1452,6 @@ TEST_F(BufferQueueTest, TestProducerConnectDisconnect) {
    ASSERT_EQ(NO_INIT, mProducer->disconnect(NATIVE_WINDOW_API_CPU));
}

TEST_F(BufferQueueTest, TestBqSetFrameRateFlagBuildTimeIsSet) {
    ASSERT_EQ(flags::bq_setframerate(), COM_ANDROID_GRAPHICS_LIBGUI_FLAGS(BQ_SETFRAMERATE));
}

struct BufferItemConsumerSetFrameRateListener : public BufferItemConsumer {
    BufferItemConsumerSetFrameRateListener() : BufferItemConsumer(GRALLOC_USAGE_SW_READ_OFTEN, 1) {}

@@ -1561,9 +1557,14 @@ TEST_F(BufferQueueTest, TestAdditionalOptions) {
            {.name = "android.hardware.graphics.common.Dataspace", ADATASPACE_DISPLAY_P3},
    }};

    ASSERT_EQ(NO_INIT,
              native_window_set_buffers_additional_options(surface.get(), extras.data(),
                                                           extras.size()));
    auto status = native_window_set_buffers_additional_options(surface.get(), extras.data(),
                                                               extras.size());
    if (flags::bq_extendedallocate()) {
        ASSERT_EQ(NO_INIT, status);
    } else {
        ASSERT_EQ(INVALID_OPERATION, status);
        GTEST_SKIP() << "Flag bq_extendedallocate not enabled";
    }

    if (!IsCuttlefish()) {
        GTEST_SKIP() << "Not cuttlefish";