Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

About testing DeathNoAllocNewHook failures. #937

@cx421774557

Description

@cx421774557

When the compile option is set to -O3, the new int in the following code will be optimized, causing the test case test to fail.
logging_custom_prefix_unittest.cc +346

TEST(DeathNoAllocNewHook, logging) {
  // tests that NewHook used below works
  NewHook new_hook;
  ASSERT_DEATH({
    new int;
  }, "unexpected new");
}

We recommend that you modify the default optimization level of test cases to -O0 to avoid test case failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions