Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TYPE_TO_STRING does not work inside a TEST_SUITE / namespace #847

Open
anton-potapov opened this issue Mar 11, 2024 · 1 comment
Open

TYPE_TO_STRING does not work inside a TEST_SUITE / namespace #847

anton-potapov opened this issue Mar 11, 2024 · 1 comment

Comments

@anton-potapov
Copy link

Description

usage of macro fails with an error:
error: ‘String’ does not name a type

Steps to reproduce

reproducer:

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include "doctest.h"

TEST_SUITE(""){

TYPE_TO_STRING(short);
// TYPE_TO_STRING_AS("Int", int);

}

live at godbolt.org

Extra information

  • doctest version: v2.4.11
  • Operating System: Ubuntu 22.04.3 LTS
  • Compiler+version: gcc version 12.3.0 (Ubuntu 12.3.0-1ubuntu1~22.04)
@anton-potapov anton-potapov changed the title TYPE_TO_STRING does not work inside a TEST_SUITE / namespace TYPE_TO_STRING does not work inside a TEST_SUITE / namespace Mar 11, 2024
@anton-potapov anton-potapov changed the title TYPE_TO_STRING does not work inside a TEST_SUITE / namespace TYPE_TO_STRING does not work inside a TEST_SUITE / namespace Mar 11, 2024
@onqtam
Copy link
Member

onqtam commented Mar 14, 2024

Why would you not use it in global scope - as it's meant to be used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants