Skip to content

Couple of ABI tests failed upon enabling JSON_Diagnostic_Positions cmake option #4571

@hnampally

Description

@hnampally

Description

ABI tests are failed when 'JSON_Diagnostic_Positions' cmake option is enabled.
./tests/abi/config/abi_config_default & ./tests/abi/config/abi_config_noversion are missing the Diagnostic Positions related expected namespace string in the test cases.

Reproduction steps

  1. Turn on the cmake option in CMakelists.txt; "option(JSON_Diagnostic_Positions "Enable diagnostic positions." ON)"
  2. mkdir build
  3. cd build
  4. cmake .. DBUILD_TESTING=ON
  5. cmake --build .
  6. run ./tests/abi/config/abi_config_default & ./tests/abi/config/abi_config_noversion
    Step 6 fails

Expected vs. actual results

Expected results:
Both tests pass.

Actual results:

➜  build git:(issue4569-compilation-fix) ✗ ./tests/abi/config/abi_config_default  
[doctest] doctest version is "2.4.11"
[doctest] run with "--help" for options
===============================================================================
/home/hnampall/json/tests/abi/config/default.cpp:15:
TEST CASE:  default namespace
  namespace matches expectation

/home/hnampall/json/tests/abi/config/default.cpp:38: ERROR: CHECK( namespace_name<nlohmann::json>(ns) == expected ) is NOT correct!
  values: CHECK( nlohmann::json_abi_diag_dp_v3_11_3::basic_json == nlohmann::json_abi_diag_v3_11_3::basic_json )

===============================================================================
[doctest] test cases: 1 | 0 passed | 1 failed | 0 skipped
[doctest] assertions: 2 | 1 passed | 1 failed |
[doctest] Status: FAILURE!
➜  build git:(issue4569-compilation-fix) ✗ ./tests/abi/config/abi_config_noversion 
[doctest] doctest version is "2.4.11"
[doctest] run with "--help" for options
===============================================================================
/home/hnampall/json/tests/abi/config/noversion.cpp:16:
TEST CASE:  default namespace without version component
  namespace matches expectation

/home/hnampall/json/tests/abi/config/noversion.cpp:37: ERROR: CHECK( namespace_name<nlohmann::json>(ns) == expected ) is NOT correct!
  values: CHECK( nlohmann::json_abi_diag_dp::basic_json == nlohmann::json_abi_diag::basic_json )

===============================================================================
[doctest] test cases: 1 | 0 passed | 1 failed | 0 skipped
[doctest] assertions: 2 | 1 passed | 1 failed |
[doctest] Status: FAILURE!

Minimal code example

No response

Error messages

/home/hnampall/json/tests/abi/config/default.cpp:38: ERROR: CHECK( namespace_name<nlohmann::json>(ns) == expected ) is NOT correct!
  values: CHECK( nlohmann::json_abi_diag_dp_v3_11_3::basic_json == nlohmann::json_abi_diag_v3_11_3::basic_json )

/home/hnampall/json/tests/abi/config/noversion.cpp:37: ERROR: CHECK( namespace_name<nlohmann::json>(ns) == expected ) is NOT correct!
  values: CHECK( nlohmann::json_abi_diag_dp::basic_json == nlohmann::json_abi_diag::basic_json )

Compiler and operating system

gcc 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2) on Ubuntu 20.0.1 - focal

Library version

develop branch

Validation

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugsolution: proposed fixa fix for the issue has been proposed and waits for confirmation

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions