Thanks to visit codestin.com
Credit goes to github.com

Skip to content

api_test failure #532

@nekopsykose

Description

@nekopsykose

When building the same way the CI seems to do, and not passing CMAKE_BUILD_TYPE so it defaults to Release (at the bottom of CMakeLists.txt), cmake adds -DNDEBUG (it also does this for MinSizeRel, for trivia). This makes all assert()s do nothing, and the tests pass.

When explicitly passing another type like =Debug or =None, so -DNDEBUG is not present, the asserts are active, so this test fails:

$ ./api_test/api_test
Assertion failed: b->flags & CMARK_NODE__OPEN (/tmp/mytemp.bcmZP4/src/blocks.c: finalize: 262)
zsh: abort (core dumped)  ./api_test/api_test

I think this is not caught in CI because nothing explicitly sets another type so the asserts are not checked. Or is that intentional?

I can reproduce this with a basic

cmake -B b -G Ninja -DCMAKE_BUILD_TYPE=Debug
ninja -C b
ctest --test-dir b --output-on-failure

on debian/arch at the time of writing, on db0da21.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions