[-] known botnet and malware
This commit is contained in:
parent
d8fa9a1fdd
commit
81309782f1
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@ -1 +0,0 @@
|
||||
github: marzer
|
98
.github/ISSUE_TEMPLATE/bug_report.md
vendored
98
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -1,98 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Regular ol' bugs.
|
||||
title: ''
|
||||
labels: [ "bug" ]
|
||||
assignees: marzer
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Replace the HTML comments below with the requested information.
|
||||
|
||||
Please be as thorough as possible, and don't delete this template and roll your own.
|
||||
I'm a human being with a busy life and concerns of my own - if you force me to jump through many
|
||||
information-gathering hoops without first making an effort yourself, there's a high chance I'll
|
||||
summarily close your issue as 'not a bug'.
|
||||
|
||||
Also please *don't* paste screenshots of logs, compiler messages, et cetera. Paste their actual text.
|
||||
I can't copy/paste/search text from an image.
|
||||
|
||||
Thanks for contributing!
|
||||
-->
|
||||
|
||||
|
||||
|
||||
## Environment
|
||||
**toml++ version and/or commit hash:**
|
||||
<!--
|
||||
If you're using the single-header version of the library, the version number is right at the top of the file.
|
||||
Otherwise you can find it by opening toml++/impl/version.h; it'll be represented by three defines -
|
||||
TOML_LIB_MAJOR, TOML_LIB_MINOR and TOML_LIB_PATCH.
|
||||
|
||||
If you're not using any particular release and have just cloned the repository directly,
|
||||
please also include the the commit hash.
|
||||
-->
|
||||
|
||||
|
||||
**Compiler:**
|
||||
<!--
|
||||
The compiler & version, e.g. "Clang 9"
|
||||
-->
|
||||
|
||||
|
||||
|
||||
**C++ standard mode:**
|
||||
<!--
|
||||
The C++ standard level you were targeting, e.g. 17, 20, 'latest'
|
||||
-->
|
||||
|
||||
|
||||
|
||||
**Target arch:**
|
||||
<!--
|
||||
The architecture you were targeting, e.g. x86, x64, ARM
|
||||
-->
|
||||
|
||||
|
||||
|
||||
**Library configuration overrides:**
|
||||
<!--
|
||||
If you've explicitly set any of the library configuration macros,
|
||||
list them here (e.g. TOML_EXCEPTIONS=0, TOML_ENABLE_UNRELEASED_FEATURES=1, etc.)
|
||||
-->
|
||||
|
||||
|
||||
|
||||
**Relevant compilation flags:**
|
||||
<!--
|
||||
Any relevant compilation flags that might help me reproduce your issue exactly (e.g. -fno-exceptions).
|
||||
-->
|
||||
|
||||
|
||||
|
||||
## Describe the bug
|
||||
<!--
|
||||
A clear and concise description of the bug goes here.
|
||||
|
||||
Please include compiler error messages as appropriate.
|
||||
|
||||
*DON'T PASTE SCREENSHOTS*
|
||||
-->
|
||||
|
||||
|
||||
|
||||
## Steps to reproduce (or a small repro code sample)
|
||||
<!--
|
||||
As above. If you feel that the information you've already given covers it sufficiently and you don't
|
||||
need this section, you can delete it.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
## Additional information
|
||||
<!--
|
||||
Any post-scripts, addendums, or additional pieces of context, as necessary.
|
||||
|
||||
*DON'T PASTE SCREENSHOTS*
|
||||
-->
|
1
.github/ISSUE_TEMPLATE/config.yml
vendored
1
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1 +0,0 @@
|
||||
blank_issues_enabled: false
|
38
.github/ISSUE_TEMPLATE/feature_request.md
vendored
38
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -1,38 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Want to see something added or improved? Tell me all about it.
|
||||
title: ''
|
||||
labels: feature
|
||||
assignees: marzer
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Replace the HTML comments below with the requested information.
|
||||
Please don't delete this template and roll your own!
|
||||
|
||||
Thanks for contributing!
|
||||
-->
|
||||
|
||||
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
<!--
|
||||
"I'd like a way to Fooify all Bars in one go. Currently I have to iterate through them and
|
||||
do it individually myself, which is cumbersome.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
**Describe the solution you'd like**
|
||||
<!--
|
||||
A helper function like fooify_all_bars() would be great.
|
||||
-->
|
||||
|
||||
|
||||
|
||||
|
||||
**Additional context**
|
||||
<!--
|
||||
Add any other context or screenshots about the feature request here.
|
||||
-->
|
55
.github/ISSUE_TEMPLATE/spec_bug_report.md
vendored
55
.github/ISSUE_TEMPLATE/spec_bug_report.md
vendored
@ -1,55 +0,0 @@
|
||||
---
|
||||
name: TOML spec conformance bug
|
||||
about: Bugs relating to the library's TOML spec conformance (or lack thereof).
|
||||
title: ''
|
||||
labels: [ "bug", "TOML spec" ]
|
||||
assignees: marzer
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Replace the HTML/TOML comments below with the requested information.
|
||||
Please don't delete this template and roll your own!
|
||||
|
||||
Thanks for contributing!
|
||||
-->
|
||||
|
||||
|
||||
## The non-conforming TOML snippet
|
||||
```toml
|
||||
|
||||
# your TOML here
|
||||
|
||||
```
|
||||
|
||||
|
||||
## What you expected
|
||||
<!--
|
||||
e.g. a link to, or snippet from, the TOML spec, or some reasonable description thereof
|
||||
-->
|
||||
|
||||
|
||||
## What you got
|
||||
<!--
|
||||
e.g toml-test output
|
||||
-->
|
||||
|
||||
|
||||
## Environment
|
||||
**toml++ version and/or commit hash:**
|
||||
<!--
|
||||
If you're using the single-header version of the library, the version number is right at the top of the file.
|
||||
Otherwise you can find it by opening toml++/impl/version.h; it'll be represented by three defines -
|
||||
TOML_LIB_MAJOR, TOML_LIB_MINOR and TOML_LIB_PATCH.
|
||||
|
||||
If you're not using any particular release and are instead just living large at HEAD of master, the commit hash
|
||||
would be super helpful too, though it's not critical.
|
||||
|
||||
-->
|
||||
|
||||
**Any other useful information:**
|
||||
<!--
|
||||
Anything else you think will help me fix the issue. Since this report is for general spec conformance handling
|
||||
you probably don't need to worry about compiler versions, compilation flags, et cetera, though include them if
|
||||
you feel they're relevant.
|
||||
-->
|
38
.github/pull_request_template.md
vendored
38
.github/pull_request_template.md
vendored
@ -1,38 +0,0 @@
|
||||
<!--
|
||||
Please replace the HTML comments below with the requested information.
|
||||
Thanks for contributing!
|
||||
-->
|
||||
|
||||
**What does this change do?**
|
||||
|
||||
<!--
|
||||
Changes all Foos to Bars.
|
||||
--->
|
||||
|
||||
**Is it related to an exisiting bug report or feature request?**
|
||||
|
||||
<!--
|
||||
Fixes #69.
|
||||
--->
|
||||
|
||||
**Pre-merge checklist**
|
||||
|
||||
<!--
|
||||
Not all of these will necessarily apply, particularly if you're not making a code change (e.g. fixing documentation).
|
||||
That's OK. Tick the ones that do by placing an x in them, e.g. [x]
|
||||
--->
|
||||
|
||||
- [ ] I've read [CONTRIBUTING.md]
|
||||
- [ ] I've rebased my changes against the current HEAD of `origin/master` (if necessary)
|
||||
- [ ] I've added new test cases to verify my change
|
||||
- [ ] I've regenerated toml.hpp ([how-to])
|
||||
- [ ] I've updated any affected documentation
|
||||
- [ ] I've rebuilt and run the tests with at least one of:
|
||||
- [ ] Clang 8 or higher
|
||||
- [ ] GCC 8 or higher
|
||||
- [ ] MSVC 19.20 (Visual Studio 2019) or higher
|
||||
- [ ] I've added my name to the list of contributors in [README.md](https://github.com/marzer/tomlplusplus/blob/master/README.md)
|
||||
|
||||
[CONTRIBUTING.md]: https://github.com/marzer/tomlplusplus/blob/master/CONTRIBUTING.md
|
||||
[how-to]: https://github.com/marzer/tomlplusplus/blob/master/CONTRIBUTING.md#regenerating-tomlhpp
|
||||
[README.md]: https://github.com/marzer/tomlplusplus/blob/master/README.md
|
191
.github/workflows/ci.yaml
vendored
191
.github/workflows/ci.yaml
vendored
@ -1,191 +0,0 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- "gh-pages"
|
||||
paths:
|
||||
- "**.h"
|
||||
- "**.hpp"
|
||||
- "**.cpp"
|
||||
- "**.inl"
|
||||
- "**.py"
|
||||
- "**/meson.build"
|
||||
- "**/workflows/**.yaml"
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- "gh-pages"
|
||||
paths:
|
||||
- "**.h"
|
||||
- "**.hpp"
|
||||
- "**.cpp"
|
||||
- "**.inl"
|
||||
- "**.py"
|
||||
- "**/meson.build"
|
||||
- "**/workflows/**.yaml"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
clang_version: "14"
|
||||
gcc_version: "11"
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
compiler:
|
||||
- "clang"
|
||||
- "gcc"
|
||||
linker:
|
||||
- "lld"
|
||||
type:
|
||||
- "debug"
|
||||
- "release"
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- name: Install base dependencies
|
||||
run: |
|
||||
sudo apt -y update
|
||||
sudo apt -y install --no-install-recommends git python3 python3-pip ninja-build libstdc++-${{ env.gcc_version }}-dev locales-all
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install python dependencies
|
||||
run: |
|
||||
sudo -H pip3 install --no-cache-dir --upgrade meson
|
||||
sudo -H pip3 install --no-cache-dir --upgrade -r tools/requirements.txt
|
||||
|
||||
- name: Check toml.hpp
|
||||
run: |
|
||||
cd tools
|
||||
python3 ci_single_header_check.py
|
||||
|
||||
- name: Install lld
|
||||
if: ${{ startsWith(matrix.linker, 'lld') }}
|
||||
run: |
|
||||
sudo apt -y install --no-install-recommends lld-${{ env.clang_version }}
|
||||
sudo update-alternatives --install /usr/bin/ld.lld ld.lld /usr/bin/ld.lld-${{ env.clang_version }} 1000
|
||||
|
||||
- name: Install clang
|
||||
if: ${{ startsWith(matrix.compiler, 'clang') }}
|
||||
run: |
|
||||
sudo apt -y install --no-install-recommends clang-${{ env.clang_version }}
|
||||
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-${{ env.clang_version }} 1000
|
||||
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang-${{ env.clang_version }} 1000
|
||||
|
||||
- name: Install gcc
|
||||
if: ${{ startsWith(matrix.compiler, 'gcc') }}
|
||||
run: |
|
||||
sudo apt -y install --no-install-recommends gcc-${{ env.gcc_version }} g++-${{ env.gcc_version }}
|
||||
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-${{ env.gcc_version }} 1000
|
||||
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-${{ env.gcc_version }} 1000
|
||||
|
||||
- name: Configure locales
|
||||
run: |
|
||||
sudo locale-gen 'en_US.utf8' 'ja_JP.utf8' 'de_DE.utf8' 'it_IT.utf8' 'tr_TR.utf8' 'fi_FI.utf8' 'fr_FR.utf8' 'zh_CN.utf8'
|
||||
|
||||
- name: Configure Meson
|
||||
run: |
|
||||
CXX=c++ CXX_LD=${{ matrix.linker }} meson setup build --buildtype=${{ matrix.type }} -Ddevel=true -Db_lto=false
|
||||
|
||||
- name: Build
|
||||
run: meson compile -C build
|
||||
|
||||
- name: Test
|
||||
run: meson test -C build --verbose
|
||||
|
||||
windows:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
type:
|
||||
- "debug"
|
||||
- "release"
|
||||
|
||||
runs-on: windows-2022
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: cmd
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python3 -m pip install -U pip
|
||||
pip3 install meson ninja
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Configure Meson
|
||||
run: meson setup build --vsenv --buildtype=${{ matrix.type }} -Ddevel=true -Db_lto=false
|
||||
|
||||
- name: Build
|
||||
run: meson compile -C build
|
||||
|
||||
- name: Test
|
||||
run: meson test -C build --verbose
|
||||
# tipi-build-linux:
|
||||
# name: tipi.build project build and dependency resolution
|
||||
# runs-on: ubuntu-latest
|
||||
# if: github.ref == 'refs/heads/master'
|
||||
# container: tipibuild/tipi-ubuntu
|
||||
#
|
||||
# env:
|
||||
# HOME: /root
|
||||
#
|
||||
# steps:
|
||||
# - uses: actions/checkout@v3
|
||||
# - run: mkdir -p ~/.tipi
|
||||
#
|
||||
# # checking if the tomlplusplus project builds and passes tests
|
||||
# - name: Build as project target linux-cxx17 (run tests 'odr_test_1' and 'main')
|
||||
# run: tipi . --dont-upgrade --verbose -t linux-cxx17 --test "odr_test_1|main"
|
||||
#
|
||||
# - name: Build as project target linux-cxx20 (run tests 'odr_test_1' and 'main')
|
||||
# run: tipi . --dont-upgrade --verbose -t linux-cxx20 --test "odr_test_1|main"
|
||||
#
|
||||
# - name: Cleanup project builds
|
||||
# run: rm -r ./build
|
||||
#
|
||||
# - name: "Get branch name and save to env"
|
||||
# env:
|
||||
# IS_PR: ${{ github.EVENT_NAME == 'pull_request' }}
|
||||
# run: |
|
||||
# if ${IS_PR}; then
|
||||
# BRANCH_NAME="${GITHUB_HEAD_REF}"
|
||||
# else
|
||||
# BRANCH_NAME="${GITHUB_REF##*/}"
|
||||
# fi
|
||||
# echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
|
||||
#
|
||||
# # trying if pulling the dependency with tipi works properly
|
||||
# - name: Build as dependency
|
||||
# run: |
|
||||
# cd examples/
|
||||
#
|
||||
# # create test directory and copy the simple_parser.cpp in there
|
||||
# mkdir test-as-dep
|
||||
# cp examples.h test-as-dep/.
|
||||
# cp simple_parser.cpp test-as-dep/.
|
||||
# cd test-as-dep/
|
||||
#
|
||||
# # create a deps file referencing the commit that triggered this build as dependency
|
||||
# mkdir .tipi
|
||||
# echo '{ "requires": { "${{ github.event.repository.full_name }}": { "@": "${{ env.BRANCH_NAME }}" } } }' > .tipi/deps
|
||||
#
|
||||
# # build
|
||||
# tipi . --dont-upgrade --verbose -t linux-cxx17
|
||||
# ./build/linux-cxx17/bin/simple_parser ../example.toml
|
39
.github/workflows/cifuzz.yml
vendored
39
.github/workflows/cifuzz.yml
vendored
@ -1,39 +0,0 @@
|
||||
name: CIFuzz
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
permissions: {}
|
||||
jobs:
|
||||
Fuzzing:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
security-events: write
|
||||
steps:
|
||||
- name: Build Fuzzers
|
||||
id: build
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'tomlplusplus'
|
||||
language: c++
|
||||
- name: Run Fuzzers
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'tomlplusplus'
|
||||
language: c++
|
||||
fuzz-seconds: 800
|
||||
output-sarif: true
|
||||
- name: Upload Crash
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure() && steps.build.outcome == 'success'
|
||||
with:
|
||||
name: artifacts
|
||||
path: ./out/artifacts
|
||||
- name: Upload Sarif
|
||||
if: always() && steps.build.outcome == 'success'
|
||||
uses: github/codeql-action/upload-sarif@v2
|
||||
with:
|
||||
# Path to SARIF file relative to the root of the repository
|
||||
sarif_file: cifuzz-sarif/results.sarif
|
||||
checkout_path: cifuzz-sarif
|
42
.github/workflows/gh-pages.yaml
vendored
42
.github/workflows/gh-pages.yaml
vendored
@ -1,42 +0,0 @@
|
||||
name: gh-pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- "**.h"
|
||||
- "**.hpp"
|
||||
- "**.dox"
|
||||
- "**.md"
|
||||
- "docs/**"
|
||||
- "**/gh-pages.yaml"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
gh-pages:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt -y update
|
||||
sudo apt -y install --no-install-recommends git python3 python3-pip doxygen
|
||||
sudo -H pip3 install --upgrade poxy
|
||||
|
||||
- name: Generate docs
|
||||
run: |
|
||||
cd docs
|
||||
poxy --verbose
|
||||
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./docs/html
|
20
.runsettings
20
.runsettings
@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RunSettings>
|
||||
<!-- Configurations that affect the Test Framework -->
|
||||
<RunConfiguration>
|
||||
<MaxCpuCount>0</MaxCpuCount>
|
||||
<ResultsDirectory>build\TestResults</ResultsDirectory><!-- Path relative to solution directory -->
|
||||
<TestSessionTimeout>60000</TestSessionTimeout><!-- Milliseconds -->
|
||||
</RunConfiguration>
|
||||
|
||||
<!-- Adapter Specific sections -->
|
||||
<Catch2Adapter>
|
||||
<DiscoverCommandLine>--verbosity high --list-tests *</DiscoverCommandLine>
|
||||
<DiscoverTimeout>500</DiscoverTimeout><!-- Milliseconds -->
|
||||
<FilenameFilter>(?i:test)</FilenameFilter>
|
||||
<WorkingDirectoryRoot>Solution</WorkingDirectoryRoot>
|
||||
<WorkingDirectory>tests\</WorkingDirectory>
|
||||
<MessageFormat>AdditionalInfo</MessageFormat>
|
||||
</Catch2Adapter>
|
||||
|
||||
</RunSettings>
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"requires": {}
|
||||
}
|
11
Aurora.json
Normal file
11
Aurora.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "tomlplusplus",
|
||||
"type": "generic",
|
||||
"sourcePaths": "src",
|
||||
"include": "include",
|
||||
"noLink": true,
|
||||
"defines": [
|
||||
"TOML_HEADER_ONLY=1",
|
||||
"TOML_OPTIONAL_TYPE=AuOptional"
|
||||
]
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
project(
|
||||
tomlplusplus
|
||||
VERSION 3.4.0
|
||||
DESCRIPTION "Header-only TOML config file parser and serializer for C++17"
|
||||
HOMEPAGE_URL "https://marzer.github.io/tomlplusplus/"
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
include(cmake/project-is-top-level.cmake)
|
||||
include(cmake/variables.cmake)
|
||||
|
||||
# ---- Declare library ----
|
||||
|
||||
add_library(tomlplusplus_tomlplusplus INTERFACE)
|
||||
add_library(tomlplusplus::tomlplusplus ALIAS tomlplusplus_tomlplusplus)
|
||||
|
||||
set_property(
|
||||
TARGET tomlplusplus_tomlplusplus PROPERTY
|
||||
EXPORT_NAME tomlplusplus
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
tomlplusplus_tomlplusplus
|
||||
${tomlplusplus_warning_guard} # unquoted for list expansion
|
||||
INTERFACE
|
||||
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
|
||||
)
|
||||
|
||||
target_compile_features(tomlplusplus_tomlplusplus INTERFACE cxx_std_17)
|
||||
|
||||
# ---- Install rules, examples, and fuzzing ----
|
||||
if(PROJECT_IS_TOP_LEVEL)
|
||||
include(cmake/install-rules.cmake)
|
||||
option(BUILD_EXAMPLES "Build examples tree." OFF)
|
||||
option(BUILD_FUZZER "Build fuzzer." OFF)
|
||||
if(BUILD_EXAMPLES)
|
||||
add_subdirectory(examples)
|
||||
endif()
|
||||
if(BUILD_FUZZER AND DEFINED ENV{LIB_FUZZING_ENGINE})
|
||||
add_subdirectory(fuzzing)
|
||||
endif()
|
||||
endif()
|
@ -1,76 +0,0 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at mark.gillard@outlook.com.au. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
https://www.contributor-covenant.org/faq
|
@ -1,80 +0,0 @@
|
||||
# Contributing to toml++
|
||||
|
||||
Contributions are very welcome! Either by [reporting issues] or submitting pull requests.
|
||||
If you wish to submit a PR, please be aware that:
|
||||
|
||||
- The single-header `toml.hpp` at the repository root is generated by a script, so don't change it directly; make your
|
||||
changes in the files in `include`.
|
||||
- Your changes should compile warning-free on at least one of:
|
||||
- GCC 8 or higher
|
||||
- Clang 8 or higher
|
||||
- MSVC 19.2X (Visual Studio 2019) or higher
|
||||
- You should regenerate the single-header version of `toml.hpp` as part of your PR (a CI check will fail if you don't).
|
||||
|
||||
<br>
|
||||
|
||||
## Regenerating the single-header toml.hpp
|
||||
|
||||
1. Make your changes as necessary
|
||||
- If you've added a new header file that isn't going to be transitively included by one of the
|
||||
others, add an include directive to `include/toml++/toml.hpp`
|
||||
2. Install the prerequisite python packages: `pip3 install -r tools/requirements.txt`
|
||||
3. Run `tools/generate_single_header.py`
|
||||
|
||||
<br>
|
||||
|
||||
## Building and running the tests
|
||||
|
||||
Testing is done using [Catch2].
|
||||
|
||||
### Testing on Windows with Visual Studio
|
||||
|
||||
Install [Visual Studio] and [Test Adapter for Catch2], then open `toml++.sln` and build the
|
||||
projects in the `tests` solution folder. Visual Studio's Test Explorer should pick these up and
|
||||
allow you to run the tests directly.
|
||||
|
||||
If test discovery fails you can usually fix it by enabling
|
||||
`Auto Detect runsettings Files` (settings gear icon > `Configure Run Settings`).
|
||||
|
||||
### Testing on Linux (and WSL)
|
||||
|
||||
```bash
|
||||
# install ninja, meson, locales (first time only)
|
||||
sudo apt update && sudo apt install -y locales python3 python3-pip ninja-build
|
||||
sudo pip3 install meson
|
||||
sudo locale-gen 'en_US.utf8' \
|
||||
'ja_JP.utf8' \
|
||||
'de_DE.utf8' \
|
||||
'it_IT.utf8' \
|
||||
'tr_TR.utf8' \
|
||||
'fi_FI.utf8' \
|
||||
'fr_FR.utf8' \
|
||||
'zh_CN.utf8'
|
||||
|
||||
# create the build configs (first time only)
|
||||
meson setup build-debug --buildtype=debug -Ddevel=true
|
||||
meson setup build-release --buildtype=release -Ddevel=true
|
||||
|
||||
# run the tests
|
||||
cd build-debug && ninja && ninja test \
|
||||
&& cd ../build-release && ninja && ninja test \
|
||||
&& cd ..
|
||||
```
|
||||
|
||||
> ℹ️ Pass `-Duse_vendored_libs=false` to Meson if you wish to use the system-installed version
|
||||
> of Catch2 rather than the vendored one.
|
||||
|
||||
<br>
|
||||
|
||||
## Testing with the [toml-test] suite
|
||||
|
||||
As an optional extra you may wish to test against the official test TOML test suite, [toml-test]. See the
|
||||
instructions at [toml-test/README](./toml-test/README.md). Note that the toml++ tests already consume tests from the
|
||||
offical suite via a C++ code-generation script so you are not expected to take this extra step as part of contributing
|
||||
to the library.
|
||||
|
||||
[visual studio]: https://visualstudio.microsoft.com/vs/
|
||||
[test adapter for catch2]: https://marketplace.visualstudio.com/items?itemName=JohnnyHendriks.ext01
|
||||
[reporting issues]: https://github.com/marzer/tomlplusplus/issues
|
||||
[catch2]: https://github.com/catchorg/Catch2
|
||||
[toml-test]: https://github.com/toml-lang/toml-test
|
@ -1,52 +0,0 @@
|
||||
include(CMakePackageConfigHelpers)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
install(
|
||||
FILES "${PROJECT_SOURCE_DIR}/toml++.natvis" "${PROJECT_SOURCE_DIR}/cpp.hint"
|
||||
DESTINATION "${CMAKE_INSTALL_DATADIR}/tomlplusplus"
|
||||
COMPONENT tomlplusplus_Development
|
||||
)
|
||||
|
||||
install(
|
||||
DIRECTORY "${PROJECT_SOURCE_DIR}/include/"
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
COMPONENT tomlplusplus_Development
|
||||
)
|
||||
|
||||
install(
|
||||
TARGETS tomlplusplus_tomlplusplus
|
||||
EXPORT tomlplusplusTargets
|
||||
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
)
|
||||
|
||||
write_basic_package_version_file(
|
||||
tomlplusplusConfigVersion.cmake
|
||||
COMPATIBILITY SameMajorVersion
|
||||
ARCH_INDEPENDENT
|
||||
)
|
||||
|
||||
set(
|
||||
tomlplusplus_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/tomlplusplus"
|
||||
CACHE STRING "CMake package config location relative to the install prefix"
|
||||
)
|
||||
|
||||
mark_as_advanced(tomlplusplus_INSTALL_CMAKEDIR)
|
||||
|
||||
install(
|
||||
FILES
|
||||
"${PROJECT_SOURCE_DIR}/cmake/tomlplusplusConfig.cmake"
|
||||
"${PROJECT_BINARY_DIR}/tomlplusplusConfigVersion.cmake"
|
||||
DESTINATION "${tomlplusplus_INSTALL_CMAKEDIR}"
|
||||
COMPONENT tomlplusplus_Development
|
||||
)
|
||||
|
||||
install(
|
||||
EXPORT tomlplusplusTargets
|
||||
NAMESPACE tomlplusplus::
|
||||
DESTINATION "${tomlplusplus_INSTALL_CMAKEDIR}"
|
||||
COMPONENT tomlplusplus_Development
|
||||
)
|
||||
|
||||
if(PROJECT_IS_TOP_LEVEL)
|
||||
include(CPack)
|
||||
endif()
|
@ -1,6 +0,0 @@
|
||||
# This variable is set by project() in CMake 3.21+
|
||||
string(
|
||||
COMPARE EQUAL
|
||||
"${CMAKE_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}"
|
||||
PROJECT_IS_TOP_LEVEL
|
||||
)
|
@ -1 +0,0 @@
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/tomlplusplusTargets.cmake)
|
@ -1,29 +0,0 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
# If tomlplusplus::tomlplusplus target is not defined it will be included
|
||||
if(NOT TARGET tomlplusplus::tomlplusplus)
|
||||
|
||||
if (@compile_library@)
|
||||
set(imported_type UNKNOWN)
|
||||
else()
|
||||
set(imported_type INTERFACE)
|
||||
endif()
|
||||
|
||||
# Import tomlplusplus interface library
|
||||
add_library(tomlplusplus::tomlplusplus ${imported_type} IMPORTED)
|
||||
set_target_properties(tomlplusplus::tomlplusplus PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${PACKAGE_PREFIX_DIR}/@includedir@")
|
||||
|
||||
# Require C++17
|
||||
target_compile_features(tomlplusplus::tomlplusplus INTERFACE cxx_std_17)
|
||||
|
||||
# Set the path to the installed library so that users can link to it
|
||||
if (@compile_library@)
|
||||
set_target_properties(tomlplusplus::tomlplusplus PROPERTIES
|
||||
IMPORTED_LOCATION "${PACKAGE_PREFIX_DIR}/@libdir@/@lib_name@"
|
||||
)
|
||||
# compile_options not quoted on purpose
|
||||
target_compile_options(tomlplusplus::tomlplusplus INTERFACE @compile_options@)
|
||||
endif()
|
||||
|
||||
endif()
|
@ -1,48 +0,0 @@
|
||||
# This is a basic version file for the Config-mode of find_package().
|
||||
# It is used by write_basic_package_version_file() as input file for configure_file()
|
||||
# to create a version-file which can be installed along a config.cmake file.
|
||||
#
|
||||
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
|
||||
# the requested version string are exactly the same and it sets
|
||||
# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version.
|
||||
# The variable CVF_VERSION must be set before calling configure_file().
|
||||
|
||||
set(PACKAGE_VERSION "@version@")
|
||||
|
||||
if (PACKAGE_FIND_VERSION_RANGE)
|
||||
# Package version must be in the requested version range
|
||||
if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN)
|
||||
OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX)
|
||||
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX)))
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
endif()
|
||||
else()
|
||||
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION_EXACT TRUE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# if the installed project requested no architecture check, don't perform the check
|
||||
if("True")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
|
||||
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
|
||||
return()
|
||||
endif()
|
||||
|
||||
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
|
||||
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
|
||||
math(EXPR installedBits "8 * 8")
|
||||
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
|
||||
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||
endif()
|
@ -1,18 +0,0 @@
|
||||
# ---- Warning guard ----
|
||||
|
||||
# target_include_directories with the SYSTEM modifier will request the compiler
|
||||
# to omit warnings from the provided paths, if the compiler supports that
|
||||
# This is to provide a user experience similar to find_package when
|
||||
# add_subdirectory or FetchContent is used to consume this project
|
||||
set(tomlplusplus_warning_guard "")
|
||||
if(NOT PROJECT_IS_TOP_LEVEL)
|
||||
option(
|
||||
tomlplusplus_INCLUDES_WITH_SYSTEM
|
||||
"Use SYSTEM modifier for tomlplusplus's includes, disabling warnings"
|
||||
ON
|
||||
)
|
||||
mark_as_advanced(tomlplusplus_INCLUDES_WITH_SYSTEM)
|
||||
if(tomlplusplus_INCLUDES_WITH_SYSTEM)
|
||||
set(tomlplusplus_warning_guard SYSTEM)
|
||||
endif()
|
||||
endif()
|
39
cpp.hint
39
cpp.hint
@ -1,39 +0,0 @@
|
||||
#define TOML_ABI_NAMESPACE_BOOL(...) static_assert(true)
|
||||
#define TOML_ABI_NAMESPACE_END static_assert(true)
|
||||
#define TOML_ABSTRACT_INTERFACE
|
||||
#define TOML_ALWAYS_INLINE inline
|
||||
#define TOML_ANON_NAMESPACE_END static_assert(true)
|
||||
#define TOML_ANON_NAMESPACE_START namespace
|
||||
#define TOML_API
|
||||
#define TOML_ATTR(...)
|
||||
#define TOML_CLOSED_ENUM
|
||||
#define TOML_CLOSED_FLAGS_ENUM
|
||||
#define TOML_CONST_GETTER
|
||||
#define TOML_CONST_INLINE_GETTER inline
|
||||
#define TOML_CONSTRAINED_TEMPLATE(cond, ...) template <__VA_ARGS__>
|
||||
#define TOML_EMPTY_BASES
|
||||
#define TOML_EXPORTED_CLASS
|
||||
#define TOML_EXPORTED_FREE_FUNCTION
|
||||
#define TOML_EXPORTED_MEMBER_FUNCTION
|
||||
#define TOML_EXPORTED_STATIC_FUNCTION
|
||||
#define TOML_EXTERNAL_LINKAGE
|
||||
#define TOML_FLAGS_ENUM
|
||||
#define TOML_HIDDEN_CONSTRAINT(cond, ...) template <__VA_ARGS__>
|
||||
#define TOML_IMPL_NAMESPACE_END static_assert(true)
|
||||
#define TOML_IMPL_NAMESPACE_START namespace toml::impl
|
||||
#define TOML_INTERNAL_LINKAGE static
|
||||
#define TOML_LIKELY(...) (__VA_ARGS__)
|
||||
#define TOML_LIKELY_CASE
|
||||
#define TOML_NAMESPACE_END static_assert(true)
|
||||
#define TOML_NAMESPACE_START namespace toml
|
||||
#define TOML_NEVER_INLINE
|
||||
#define TOML_NODISCARD
|
||||
#define TOML_NODISCARD_CTOR
|
||||
#define TOML_OPEN_ENUM
|
||||
#define TOML_OPEN_FLAGS_ENUM
|
||||
#define TOML_PURE_GETTER
|
||||
#define TOML_PURE_INLINE_GETTER inline
|
||||
#define TOML_RETURNS_BY_THROWING
|
||||
#define TOML_TRIVIAL_ABI
|
||||
#define TOML_UNLIKELY(...) (__VA_ARGS__)
|
||||
#define TOML_UNLIKELY_CASE
|
@ -1,31 +0,0 @@
|
||||
# Utilized by OSSFuzz to build the harness(es) for continuous fuzz-testing
|
||||
# OSSFuzz defines the following environment variables, that this target relies upon:
|
||||
# CXX, CFLAGS, LIB_FUZZING_ENGINE, OUT
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
project(Fuzzer LANGUAGES CXX)
|
||||
|
||||
include(../cmake/project-is-top-level.cmake)
|
||||
|
||||
add_definitions(-DNDEBUG) # Do not want assertions
|
||||
|
||||
if (DEFINED ENV{CFLAGS})
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} $ENV{CFLAGS}")
|
||||
endif ()
|
||||
if (DEFINED ENV{CXXFLAGS})
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} $ENV{CXXFLAGS}")
|
||||
endif ()
|
||||
|
||||
if(PROJECT_IS_TOP_LEVEL)
|
||||
find_package(tomlplusplus REQUIRED)
|
||||
endif()
|
||||
|
||||
add_executable(toml_fuzzer toml_fuzzer.cpp)
|
||||
target_link_libraries(toml_fuzzer PRIVATE tomlplusplus::tomlplusplus $ENV{LIB_FUZZING_ENGINE})
|
||||
target_compile_features(toml_fuzzer PRIVATE cxx_std_17)
|
||||
|
||||
if (DEFINED ENV{OUT})
|
||||
install(TARGETS toml_fuzzer DESTINATION $ENV{OUT})
|
||||
else ()
|
||||
message(WARNING "Cannot install if $OUT is not defined!")
|
||||
endif ()
|
@ -1,8 +0,0 @@
|
||||
cd $SRC/tomlplusplus
|
||||
mkdir -p build
|
||||
cmake -S . -B build -DBUILD_FUZZER=ON && cmake --build build --target install
|
||||
|
||||
# Build the corpus using the existing toml files in the source
|
||||
mkdir -p corpus
|
||||
find $SRC/tomlplusplus -name "*.toml" -exec cp {} corpus \;
|
||||
zip -q $OUT/toml_fuzzer_seed_corpus.zip corpus/*
|
@ -1,41 +0,0 @@
|
||||
#include <cstdint>
|
||||
#include <fuzzer/FuzzedDataProvider.h>
|
||||
|
||||
#include <toml++/toml.hpp>
|
||||
|
||||
enum class SerializationTest
|
||||
{
|
||||
NONE = 0,
|
||||
JSON,
|
||||
YAML,
|
||||
TOML,
|
||||
kMaxValue = TOML
|
||||
};
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t* data, const std::size_t size)
|
||||
{
|
||||
FuzzedDataProvider fdp{data, size};
|
||||
try
|
||||
{
|
||||
const toml::table tbl = toml::parse(fdp.ConsumeRandomLengthString());
|
||||
|
||||
switch (fdp.ConsumeEnum<SerializationTest>())
|
||||
{
|
||||
case SerializationTest::JSON:
|
||||
static_cast<void>(toml::json_formatter{tbl});
|
||||
break;
|
||||
case SerializationTest::YAML:
|
||||
static_cast<void>(toml::yaml_formatter{tbl});
|
||||
break;
|
||||
case SerializationTest::TOML:
|
||||
static_cast<void>(toml::toml_formatter{tbl});
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (const toml::parse_error&)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
# This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
# Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
include_dir = include_directories('.')
|
||||
|
||||
if not is_subproject
|
||||
install_subdir('toml++', install_dir: get_option('includedir'))
|
||||
endif
|
||||
|
||||
if not build_lib # header-only mode
|
||||
|
||||
tomlplusplus_dep = declare_dependency(include_directories: include_dir)
|
||||
|
||||
if not is_subproject
|
||||
import('pkgconfig').generate(
|
||||
name: meson.project_name(),
|
||||
description: 'Header-only TOML config file parser and serializer for C++',
|
||||
install_dir: get_option('datadir')/'pkgconfig',
|
||||
url: 'https://marzer.github.io/tomlplusplus'
|
||||
)
|
||||
endif
|
||||
|
||||
# cmake
|
||||
if get_option('generate_cmake_config') and not is_subproject and not is_devel
|
||||
cmake = import('cmake')
|
||||
# Can't use until Meson 0.62.0, see https://github.com/mesonbuild/meson/pull/9916
|
||||
# and https://github.com/marzer/tomlplusplus/issues/140
|
||||
#cmake.write_basic_package_version_file(
|
||||
# name: meson.project_name(),
|
||||
# version: meson.project_version(),
|
||||
# install_dir: get_option('datadir')/'cmake'/meson.project_name(),
|
||||
# arch_independent: true
|
||||
#)
|
||||
# In the meantime, install a pre-generated Package Version file
|
||||
configure_file(
|
||||
configuration: {'version': meson.project_version()},
|
||||
input: '..'/'cmake'/'tomlplusplusConfigVersion.cmake.meson.in',
|
||||
output: 'tomlplusplusConfigVersion.cmake',
|
||||
install_dir: get_option('datadir')/'cmake'/meson.project_name()
|
||||
)
|
||||
|
||||
cmake.configure_package_config_file(
|
||||
name: meson.project_name(),
|
||||
input: '..'/'cmake'/'tomlplusplusConfig.cmake.meson.in',
|
||||
configuration: configuration_data({'includedir': get_option('includedir')}),
|
||||
install_dir: get_option('datadir')/'cmake'/meson.project_name(),
|
||||
)
|
||||
endif
|
||||
|
||||
endif
|
207
meson.build
207
meson.build
@ -1,207 +0,0 @@
|
||||
# This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
# Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
project(
|
||||
'tomlplusplus',
|
||||
'cpp',
|
||||
license: 'MIT',
|
||||
version: '3.4.0',
|
||||
meson_version: '>=0.61.0',
|
||||
default_options: [
|
||||
# https://mesonbuild.com/Builtin-options.html
|
||||
# core options
|
||||
'buildtype=release',
|
||||
'default_library=shared',
|
||||
# base options
|
||||
'b_lto=false',
|
||||
'b_ndebug=if-release',
|
||||
# compiler options
|
||||
'cpp_std=c++17'
|
||||
]
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
# global vars + imports
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
compiler = meson.get_compiler('cpp')
|
||||
message('target cpu_family: @0@'.format(host_machine.cpu_family()))
|
||||
message('target cpu: @0@'.format(host_machine.cpu()))
|
||||
message('target system: @0@'.format(host_machine.system()))
|
||||
message('target endian: @0@'.format(host_machine.endian()))
|
||||
|
||||
is_devel = get_option('devel')
|
||||
is_debug = get_option('debug')
|
||||
is_release = not is_debug
|
||||
is_pedantic = get_option('pedantic') or is_devel
|
||||
is_windows = host_machine.system() == 'windows'
|
||||
is_x64 = host_machine.cpu_family() == 'x86_64'
|
||||
is_subproject = meson.is_subproject()
|
||||
|
||||
cpp = meson.get_compiler('cpp')
|
||||
is_gcc = cpp.get_id() == 'gcc'
|
||||
is_clang = cpp.get_id() == 'clang'
|
||||
is_msvc = cpp.get_id() == 'msvc'
|
||||
is_icc_cl = cpp.get_id() == 'intel-cl'
|
||||
is_icc = is_icc_cl or cpp.get_id() == 'intel'
|
||||
is_lld = cpp.get_linker_id() == 'ld.lld'
|
||||
has_exceptions = get_option('cpp_eh') != 'none'
|
||||
unreleased_features = get_option('unreleased_features')
|
||||
|
||||
build_tests = (get_option('build_tests') or is_devel) and not is_subproject
|
||||
build_examples = (get_option('build_examples') or is_devel) and not is_subproject
|
||||
build_tt = (get_option('build_tt') or is_devel) and not is_subproject and has_exceptions and not unreleased_features
|
||||
build_lib = get_option('build_lib') or get_option('compile_library') or build_tests or build_examples or build_tt
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
# global_args
|
||||
#
|
||||
# these are the arguments common to everything in the project
|
||||
# *** they are not forwarded to dependents when using this as a submodule. ***
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
global_args = cpp.get_supported_arguments(
|
||||
# clang/gcc
|
||||
'-ferror-limit=5',
|
||||
'-fmax-errors=5',
|
||||
'-Wno-unused-command-line-argument',
|
||||
'-Wno-reserved-macro-identifier',
|
||||
'-Wno-init-list-lifetime',
|
||||
'-fchar8_t',
|
||||
# msvc
|
||||
'/bigobj',
|
||||
'/Gy', # function-level linking
|
||||
'/GF', # string pooling
|
||||
'/openmp-',
|
||||
'/permissive-',
|
||||
'/utf-8',
|
||||
'/volatile:iso',
|
||||
'/Zc:__cplusplus',
|
||||
'/Zc:inline',
|
||||
'/Zc:externConstexpr',
|
||||
'/Zc:preprocessor'
|
||||
)
|
||||
if has_exceptions
|
||||
global_args += cpp.get_supported_arguments('/Zc:throwingNew', '-D_HAS_EXCEPTIONS=1')
|
||||
else
|
||||
global_args += cpp.get_supported_arguments('-D_HAS_EXCEPTIONS=0')
|
||||
endif
|
||||
if is_pedantic
|
||||
global_args += cpp.get_supported_arguments(
|
||||
# clang
|
||||
'-Weverything',
|
||||
# gcc
|
||||
'-Wcast-align',
|
||||
'-Wcast-qual',
|
||||
'-Wctor-dtor-privacy',
|
||||
'-Wdisabled-optimization',
|
||||
'-Wfloat-equal',
|
||||
'-Wimport',
|
||||
'-Winit-self',
|
||||
'-Wlogical-op',
|
||||
'-Wmissing-declarations',
|
||||
'-Wmissing-field-initializers',
|
||||
'-Wmissing-format-attribute',
|
||||
'-Wmissing-include-dirs',
|
||||
'-Wmissing-noreturn',
|
||||
'-Wold-style-cast',
|
||||
'-Woverloaded-virtual',
|
||||
'-Wpacked',
|
||||
'-Wpointer-arith',
|
||||
'-Wredundant-decls',
|
||||
'-Wshadow',
|
||||
'-Wsign-conversion',
|
||||
'-Wsign-promo',
|
||||
'-Wstack-protector',
|
||||
'-Wstrict-null-sentinel',
|
||||
'-Wswitch-default',
|
||||
'-Wswitch-enum',
|
||||
'-Wundef',
|
||||
'-Wunreachable-code',
|
||||
'-Wunused',
|
||||
'-Wunused-parameter',
|
||||
'-Wuseless-cast',
|
||||
'-Wvariadic-macros',
|
||||
'-Wwrite-strings',
|
||||
'-Wmissing-noreturn'
|
||||
)
|
||||
endif
|
||||
# unnecessary pedantry:
|
||||
global_args += cpp.get_supported_arguments(
|
||||
'-Wno-c++98-compat',
|
||||
'-Wno-c++98-compat-pedantic',
|
||||
'-Wno-documentation',
|
||||
'-Wno-documentation-unknown-command',
|
||||
'-Wno-switch-enum',
|
||||
'-Wno-covered-switch-default',
|
||||
'-Wno-padded',
|
||||
'-Wno-float-equal'
|
||||
)
|
||||
if get_option('time_trace')
|
||||
global_args += cpp.get_supported_arguments('-ftime-trace')
|
||||
endif
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
# global_link_args
|
||||
#
|
||||
# these are the linker arguments common to everything in the projectwhen compiling shared libraries and executables.
|
||||
# *** they are not forwarded to dependents when using this as a submodule. ***
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
global_link_args = []
|
||||
|
||||
if is_release
|
||||
global_link_args += cpp.get_supported_link_arguments(
|
||||
# msvc
|
||||
'/OPT:REF,ICF=3',
|
||||
'/INCREMENTAL:NO',
|
||||
)
|
||||
endif
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
# global_overrides
|
||||
#
|
||||
# these are the meson overrides common to everything in the project
|
||||
# *** they are not forwarded to dependents when using this as a submodule. ***
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
global_overrides = [ ]
|
||||
if is_pedantic
|
||||
global_overrides += [
|
||||
'warning_level=3',
|
||||
'werror=true',
|
||||
]
|
||||
endif
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
# subdirectories + files
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public_headers = []
|
||||
internal_headers = []
|
||||
|
||||
# Empty dependency that will be filled either in src/ or include/
|
||||
tomlplusplus_dep = dependency('', required: false)
|
||||
|
||||
subdir('include')
|
||||
|
||||
if build_lib
|
||||
subdir('src')
|
||||
endif
|
||||
|
||||
if build_tests
|
||||
subdir('tests')
|
||||
endif
|
||||
|
||||
if build_examples
|
||||
subdir('examples')
|
||||
endif
|
||||
|
||||
if build_tt
|
||||
subdir('toml-test')
|
||||
endif
|
||||
|
||||
# Allow subproject usage
|
||||
meson.override_dependency(meson.project_name(), tomlplusplus_dep)
|
@ -1,14 +0,0 @@
|
||||
option('devel', type: 'boolean', value: false, description: 'Tell meson whether or not it is a development build. (default: false)')
|
||||
option('build_lib', type: 'boolean', value: false, description: 'Compile the library, rather than consuming it in header-only mode. (default: false) (implied by devel)')
|
||||
option('build_examples', type: 'boolean', value: false, description: 'Build the examples (default: false) (implied by devel)')
|
||||
option('build_tests', type: 'boolean', value: false, description: 'Build tests (default: false) (implied by devel)')
|
||||
option('build_tt', type: 'boolean', value: false, description: 'Enable to build the toml-test encoder and decoder. (default: false) (implied by devel) (disabled by unreleased_features)')
|
||||
option('pedantic', type: 'boolean', value: false, description: 'Enable as many compiler warnings as possible (default: false) (implied by devel)')
|
||||
option('time_trace', type: 'boolean', value: false, description: 'Enable the -ftime-trace option (Clang only)')
|
||||
option('unreleased_features', type: 'boolean', value: false, description: 'Enable TOML_UNRELEASED_FEATURES=1 (default: false) (only relevant when compiling the library)')
|
||||
|
||||
option('generate_cmake_config', type: 'boolean', value: true, description: 'Generate a cmake package config file (default: true - no effect when included as a subproject)')
|
||||
option('use_vendored_libs', type: 'boolean', value: true, description: 'Use the libs from the vendor dir when building tests.')
|
||||
|
||||
option('compile_library', type: 'boolean', deprecated: true)
|
||||
option('float16', type: 'boolean', deprecated: true)
|
@ -1,88 +0,0 @@
|
||||
# This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
# Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
assert(build_lib) # not header-only mode
|
||||
|
||||
# These are the arguments needed to compile and consume the library, and
|
||||
# are exposed to users with the `compile_args` kwarg of declare_dependency()
|
||||
lib_args = cpp.get_supported_arguments('-DTOML_HEADER_ONLY=0')
|
||||
if get_option('default_library') != 'static'
|
||||
lib_args += cpp.get_supported_arguments('-DTOML_SHARED_LIB=1')
|
||||
endif
|
||||
if unreleased_features
|
||||
lib_args += cpp.get_supported_arguments('-DTOML_ENABLE_UNRELEASED_FEATURES=1')
|
||||
endif
|
||||
|
||||
# these are the _internal_ args, just for compiling the lib
|
||||
lib_internal_args = []
|
||||
lib_internal_args += global_args
|
||||
lib_internal_args += lib_args
|
||||
if is_pedantic and is_release
|
||||
lib_internal_args += cpp.get_supported_arguments(
|
||||
'-Wsuggest-attribute=const',
|
||||
'-Wsuggest-attribute=pure'
|
||||
)
|
||||
endif
|
||||
|
||||
tomlplusplus_lib = library(
|
||||
meson.project_name(),
|
||||
files('toml.cpp'),
|
||||
cpp_args: lib_internal_args,
|
||||
gnu_symbol_visibility: get_option('default_library') == 'static' ? '' : 'hidden',
|
||||
include_directories: include_dir,
|
||||
install: not is_subproject,
|
||||
version: meson.project_version(),
|
||||
override_options: global_overrides
|
||||
)
|
||||
|
||||
tomlplusplus_dep = declare_dependency(
|
||||
compile_args: lib_args,
|
||||
include_directories: include_dir,
|
||||
link_with: tomlplusplus_lib
|
||||
)
|
||||
|
||||
if not is_subproject
|
||||
import('pkgconfig').generate(
|
||||
tomlplusplus_lib,
|
||||
description: 'TOML config file parser and serializer for C++',
|
||||
extra_cflags: lib_args,
|
||||
url: 'https://marzer.github.io/tomlplusplus'
|
||||
)
|
||||
endif
|
||||
|
||||
# cmake
|
||||
if get_option('generate_cmake_config') and not is_subproject and not is_devel
|
||||
cmake = import('cmake')
|
||||
cmake.write_basic_package_version_file(
|
||||
name: meson.project_name(),
|
||||
version: meson.project_version(),
|
||||
)
|
||||
|
||||
# This gets the full path of the library, then considers just the last
|
||||
# component (i.e. the actual file name), and finally removes the
|
||||
# version suffix from it, because users _should_ link against the .so
|
||||
# file, as opposed to the .so.x.y.z one.
|
||||
lib_name = tomlplusplus_lib.full_path().split('/')[-1]
|
||||
lib_name = lib_name.replace('.' + meson.project_version(), '')
|
||||
|
||||
# CMake needs space-separated values since it doesn't have types
|
||||
cmake_compile_options = ''
|
||||
foreach arg : lib_args
|
||||
cmake_compile_options += arg + ' '
|
||||
endforeach
|
||||
cmake_compile_options = cmake_compile_options.strip()
|
||||
|
||||
cmake.configure_package_config_file(
|
||||
name: meson.project_name(),
|
||||
input: '..'/'cmake'/'tomlplusplusConfig.cmake.meson.in',
|
||||
configuration: configuration_data({
|
||||
'compile_library': true,
|
||||
'compile_options': cmake_compile_options,
|
||||
'includedir': get_option('includedir'),
|
||||
'libdir': get_option('libdir'),
|
||||
'lib_name': lib_name
|
||||
})
|
||||
)
|
||||
endif
|
13
src/toml.cpp
13
src/toml.cpp
@ -1,13 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#ifndef TOML_IMPLEMENTATION
|
||||
#define TOML_IMPLEMENTATION
|
||||
#endif
|
||||
#ifndef TOML_HEADER_ONLY
|
||||
#define TOML_HEADER_ONLY 0
|
||||
#endif
|
||||
|
||||
#include <toml++/toml.hpp>
|
@ -1,119 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
|
||||
TEST_CASE("at_path")
|
||||
{
|
||||
// clang-format off
|
||||
|
||||
const auto tbl = table
|
||||
{
|
||||
{ ""sv, 0 }, // blank key
|
||||
{ "a"sv, 1 },
|
||||
{
|
||||
"b"sv,
|
||||
array
|
||||
{
|
||||
2,
|
||||
array{ 3 },
|
||||
table { { "c", 4 } }
|
||||
},
|
||||
},
|
||||
{ "d", table{ {"e", 5, }, {""sv, -1 } } }
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
/*
|
||||
|
||||
# equivalent to the following TOML:
|
||||
|
||||
"" = 0
|
||||
a = 1
|
||||
b = [
|
||||
2,
|
||||
[ 3 ],
|
||||
{ "c" = 4 }
|
||||
]
|
||||
d = { "e" = 5, "" = -1 }
|
||||
|
||||
*/
|
||||
|
||||
SECTION("table")
|
||||
{
|
||||
// this section uses the free function version of at_path
|
||||
|
||||
CHECK(tbl[""]);
|
||||
CHECK(tbl[""] == at_path(tbl, ""));
|
||||
|
||||
CHECK(tbl["a"]);
|
||||
CHECK(tbl["a"] == at_path(tbl, "a"));
|
||||
CHECK(tbl["a"] != at_path(tbl, ".a")); // equivalent to ""."a"
|
||||
CHECK(!at_path(tbl, ".a"));
|
||||
|
||||
CHECK(tbl["b"]);
|
||||
CHECK(tbl["b"] == at_path(tbl, "b"));
|
||||
|
||||
CHECK(tbl["b"][0]);
|
||||
CHECK(tbl["b"][0] == at_path(tbl, "b[0]"));
|
||||
CHECK(tbl["b"][0] == at_path(tbl, "b[0] "));
|
||||
CHECK(tbl["b"][0] == at_path(tbl, "b[ 0\t]")); // whitespace is allowed inside indexer
|
||||
|
||||
CHECK(tbl["b"][1]);
|
||||
CHECK(tbl["b"][1] != tbl["b"][0]);
|
||||
CHECK(tbl["b"][1] == at_path(tbl, "b[1]"));
|
||||
|
||||
CHECK(tbl["b"][1][0]);
|
||||
CHECK(tbl["b"][1][0] == at_path(tbl, "b[1][0]"));
|
||||
CHECK(tbl["b"][1][0] == at_path(tbl, "b[1] \t [0]")); // whitespace is allowed after indexers
|
||||
|
||||
CHECK(tbl["b"][2]["c"]);
|
||||
CHECK(tbl["b"][2]["c"] == at_path(tbl, "b[2].c"));
|
||||
CHECK(tbl["b"][2]["c"] == at_path(tbl, "b[2] \t.c")); // whitespace is allowed after indexers
|
||||
|
||||
// permissivity checks for missing trailing ']'
|
||||
// (this permissivity is undocumented but serves to reduce error paths in user code)
|
||||
CHECK(tbl["b"][1][0] == at_path(tbl, "b[1[0]"));
|
||||
CHECK(tbl["b"][1][0] == at_path(tbl, "b[1[0"));
|
||||
CHECK(tbl["b"][2]["c"] == at_path(tbl, "b[2.c"));
|
||||
|
||||
CHECK(tbl["d"]);
|
||||
CHECK(tbl["d"] == at_path(tbl, "d"));
|
||||
|
||||
CHECK(tbl["d"]["e"]);
|
||||
CHECK(tbl["d"]["e"] == at_path(tbl, "d.e"));
|
||||
CHECK(tbl["d"]["e"] != at_path(tbl, "d. e")); // equivalent to "d"." e"
|
||||
CHECK(!at_path(tbl, "d. e"));
|
||||
|
||||
CHECK(tbl["d"][""]);
|
||||
CHECK(tbl["d"][""] == at_path(tbl, "d."));
|
||||
}
|
||||
|
||||
SECTION("array")
|
||||
{
|
||||
// this section uses the node_view member function version of at_path
|
||||
|
||||
auto arr = tbl["b"];
|
||||
|
||||
CHECK(tbl["b"][0]);
|
||||
CHECK(tbl["b"][0] == arr.at_path("[0]"));
|
||||
CHECK(tbl["b"][0] == arr.at_path("[0] "));
|
||||
CHECK(tbl["b"][0] == arr.at_path("[ 0\t]")); // whitespace is allowed inside indexer
|
||||
|
||||
CHECK(tbl["b"][1]);
|
||||
CHECK(tbl["b"][1].node() != arr[0].node());
|
||||
CHECK(tbl["b"][1] == arr.at_path("[1]"));
|
||||
|
||||
CHECK(tbl["b"][1][0]);
|
||||
CHECK(tbl["b"][1][0] == arr.at_path("[1][0]"));
|
||||
CHECK(tbl["b"][1][0] == arr.at_path("[1] \t [0]")); // whitespace is allowed after indexers
|
||||
|
||||
CHECK(tbl["b"][2]["c"]);
|
||||
CHECK(tbl["b"][2]["c"] == arr.at_path("[2].c"));
|
||||
CHECK(tbl["b"][2]["c"] == arr.at_path("[2] \t.c")); // whitespace is allowed after indexers
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,451 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
//-----
|
||||
// this file was generated by generate_conformance_tests.py - do not modify it directly
|
||||
|
||||
#include "tests.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
static constexpr auto array_of_tables_1 = "# INVALID TOML DOC\r\n"
|
||||
"fruit = []\r\n"
|
||||
"\r\n"
|
||||
"[[fruit]] # Not allowed"sv;
|
||||
static constexpr auto array_of_tables_2 = "# INVALID TOML DOC\r\n"
|
||||
"[[fruit]]\r\n"
|
||||
" name = \"apple\"\r\n"
|
||||
"\r\n"
|
||||
" [[fruit.variety]]\r\n"
|
||||
" name = \"red delicious\"\r\n"
|
||||
"\r\n"
|
||||
" # This table conflicts with the previous table\r\n"
|
||||
" [fruit.variety]\r\n"
|
||||
" name = \"granny smith\""sv;
|
||||
|
||||
static constexpr auto bare_key_1 = "bare!key = 123"sv;
|
||||
static constexpr auto bare_key_2 = "barekey\r\n"
|
||||
" = 123"sv;
|
||||
static constexpr auto bare_key_3 = R"(barekey =)"sv;
|
||||
|
||||
static constexpr auto comment_control_1 = "a = \"null\" # \x00"sv;
|
||||
static constexpr auto comment_control_2 = "a = \"ctrl-P\" # \x10"sv;
|
||||
static constexpr auto comment_control_3 = "a = \"ctrl-_\" # \x1F"sv;
|
||||
static constexpr auto comment_control_4 = "a = \"0x7f\" # \x7F"sv;
|
||||
|
||||
static constexpr auto inline_table_imutable_1 = "[product]\r\n"
|
||||
"type = { name = \"Nail\" }\r\n"
|
||||
"type.edible = false # INVALID"sv;
|
||||
static constexpr auto inline_table_imutable_2 = "[product]\r\n"
|
||||
"type.name = \"Nail\"\r\n"
|
||||
"type = { edible = false } # INVALID"sv;
|
||||
|
||||
#if !TOML_LANG_UNRELEASED
|
||||
|
||||
static constexpr auto inline_table_trailing_comma = "abc = { abc = 123, }"sv;
|
||||
|
||||
#endif // !TOML_LANG_UNRELEASED
|
||||
|
||||
static constexpr auto int_0_padded = "int = 0123"sv;
|
||||
static constexpr auto int_signed_bin = "bin = +0b10"sv;
|
||||
static constexpr auto int_signed_hex = "hex = +0xab"sv;
|
||||
static constexpr auto int_signed_oct = "oct = +0o23"sv;
|
||||
|
||||
static constexpr auto key_value_pair_1 = "key = # INVALID"sv;
|
||||
static constexpr auto key_value_pair_2 = "first = \"Tom\" last = \"Preston-Werner\" # INVALID"sv;
|
||||
|
||||
static constexpr auto multiple_dot_key = "# THE FOLLOWING IS INVALID\r\n"
|
||||
"\r\n"
|
||||
"# This defines the value of fruit.apple to be an integer.\r\n"
|
||||
"fruit.apple = 1\r\n"
|
||||
"\r\n"
|
||||
"# But then this treats fruit.apple like it's a table.\r\n"
|
||||
"# You can't turn an integer into a table.\r\n"
|
||||
"fruit.apple.smooth = true"sv;
|
||||
static constexpr auto multiple_key = "# DO NOT DO THIS\r\n"
|
||||
"name = \"Tom\"\r\n"
|
||||
"name = \"Pradyun\""sv;
|
||||
|
||||
static constexpr auto no_key_name = "= \"no key name\" # INVALID"sv;
|
||||
|
||||
static constexpr auto string_basic_control_1 = "a = \"null\x00\""sv;
|
||||
static constexpr auto string_basic_control_2 = "a = \"ctrl-P\x10\""sv;
|
||||
static constexpr auto string_basic_control_3 = "a = \"ctrl-_\x1F\""sv;
|
||||
static constexpr auto string_basic_control_4 = "a = \"0x7f\x7F\""sv;
|
||||
static constexpr auto string_basic_multiline_control_1 = "a = \"\"\"null\x00\"\"\""sv;
|
||||
static constexpr auto string_basic_multiline_control_2 = "a = \"\"\"null\x10\"\"\""sv;
|
||||
static constexpr auto string_basic_multiline_control_3 = "a = \"\"\"null\x1F\"\"\""sv;
|
||||
static constexpr auto string_basic_multiline_control_4 = "a = \"\"\"null\x7F\"\"\""sv;
|
||||
static constexpr auto string_basic_multiline_invalid_backslash = "a = \"\"\"\r\n"
|
||||
" foo \\ \\n\r\n"
|
||||
" bar\"\"\""sv;
|
||||
static constexpr auto string_basic_multiline_out_of_range_unicode_escape_1 = "a = \"\"\"\\UFFFFFFFF\"\"\""sv;
|
||||
static constexpr auto string_basic_multiline_out_of_range_unicode_escape_2 = "a = \"\"\"\\U00D80000\"\"\""sv;
|
||||
static constexpr auto string_basic_multiline_quotes =
|
||||
"str5 = \"\"\"Here are three quotation marks: \"\"\".\"\"\""sv;
|
||||
static constexpr auto string_basic_multiline_unknown_escape = "a = \"\"\"\\@\"\"\""sv;
|
||||
static constexpr auto string_basic_out_of_range_unicode_escape_1 = "a = \"\\UFFFFFFFF\""sv;
|
||||
static constexpr auto string_basic_out_of_range_unicode_escape_2 = "a = \"\\U00D80000\""sv;
|
||||
static constexpr auto string_basic_unknown_escape = "a = \"\\@\""sv;
|
||||
static constexpr auto string_literal_control_1 = "a = 'null\x00'"sv;
|
||||
static constexpr auto string_literal_control_2 = "a = 'null\x10'"sv;
|
||||
static constexpr auto string_literal_control_3 = "a = 'null\x1F'"sv;
|
||||
static constexpr auto string_literal_control_4 = "a = 'null\x7F'"sv;
|
||||
static constexpr auto string_literal_multiline_control_1 = "a = '''null\x00'''"sv;
|
||||
static constexpr auto string_literal_multiline_control_2 = "a = '''null\x10'''"sv;
|
||||
static constexpr auto string_literal_multiline_control_3 = "a = '''null\x1F'''"sv;
|
||||
static constexpr auto string_literal_multiline_control_4 = "a = '''null\x7F'''"sv;
|
||||
static constexpr auto string_literal_multiline_quotes =
|
||||
"apos15 = '''Here are fifteen apostrophes: '''''''''''''''''' # INVALID"sv;
|
||||
|
||||
static constexpr auto table_1 = "# DO NOT DO THIS\r\n"
|
||||
"\r\n"
|
||||
"[fruit]\r\n"
|
||||
"apple = \"red\"\r\n"
|
||||
"\r\n"
|
||||
"[fruit]\r\n"
|
||||
"orange = \"orange\""sv;
|
||||
static constexpr auto table_2 = "# DO NOT DO THIS EITHER\r\n"
|
||||
"\r\n"
|
||||
"[fruit]\r\n"
|
||||
"apple = \"red\"\r\n"
|
||||
"\r\n"
|
||||
"[fruit.apple]\r\n"
|
||||
"texture = \"smooth\""sv;
|
||||
static constexpr auto table_3 = "[fruit]\r\n"
|
||||
"apple.color = \"red\"\r\n"
|
||||
"apple.taste.sweet = true\r\n"
|
||||
"\r\n"
|
||||
"[fruit.apple] # INVALID"sv;
|
||||
static constexpr auto table_4 = "[fruit]\r\n"
|
||||
"apple.color = \"red\"\r\n"
|
||||
"apple.taste.sweet = true\r\n"
|
||||
"\r\n"
|
||||
"[fruit.apple.taste] # INVALID"sv;
|
||||
static constexpr auto table_invalid_1 =
|
||||
"[fruit.physical] # subtable, but to which parent element should it belong?\r\n"
|
||||
" color = \"red\"\r\n"
|
||||
" shape = \"round\"\r\n"
|
||||
"\r\n"
|
||||
"[[fruit]] # parser must throw an error upon discovering that \"fruit\" is\r\n"
|
||||
" # an array rather than a table\r\n"
|
||||
" name = \"apple\""sv;
|
||||
static constexpr auto table_invalid_2 = "# INVALID TOML DOC\r\n"
|
||||
"fruit = []\r\n"
|
||||
"\r\n"
|
||||
"[[fruit]] # Not allowed"sv;
|
||||
static constexpr auto table_invalid_3 = "# INVALID TOML DOC\r\n"
|
||||
"[[fruit]]\r\n"
|
||||
" name = \"apple\"\r\n"
|
||||
"\r\n"
|
||||
" [[fruit.variety]]\r\n"
|
||||
" name = \"red delicious\"\r\n"
|
||||
"\r\n"
|
||||
" # INVALID: This table conflicts with the previous array of tables\r\n"
|
||||
" [fruit.variety]\r\n"
|
||||
" name = \"granny smith\"\r\n"
|
||||
"\r\n"
|
||||
" [fruit.physical]\r\n"
|
||||
" color = \"red\"\r\n"
|
||||
" shape = \"round\""sv;
|
||||
static constexpr auto table_invalid_4 = "# INVALID TOML DOC\r\n"
|
||||
"[[fruit]]\r\n"
|
||||
" name = \"apple\"\r\n"
|
||||
"\r\n"
|
||||
" [[fruit.variety]]\r\n"
|
||||
" name = \"red delicious\"\r\n"
|
||||
"\r\n"
|
||||
" [fruit.physical]\r\n"
|
||||
" color = \"red\"\r\n"
|
||||
" shape = \"round\"\r\n"
|
||||
"\r\n"
|
||||
" # INVALID: This array of tables conflicts with the previous table\r\n"
|
||||
" [[fruit.physical]]\r\n"
|
||||
" color = \"green\""sv;
|
||||
}
|
||||
|
||||
TEST_CASE("conformance - iarna/invalid")
|
||||
{
|
||||
SECTION("array-of-tables-1")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, array_of_tables_1); // array-of-tables-1
|
||||
}
|
||||
|
||||
SECTION("array-of-tables-2")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, array_of_tables_2); // array-of-tables-2
|
||||
}
|
||||
|
||||
SECTION("bare-key-1")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, bare_key_1); // bare-key-1
|
||||
}
|
||||
|
||||
SECTION("bare-key-2")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, bare_key_2); // bare-key-2
|
||||
}
|
||||
|
||||
SECTION("bare-key-3")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, bare_key_3); // bare-key-3
|
||||
}
|
||||
|
||||
SECTION("comment-control-1")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, comment_control_1); // comment-control-1
|
||||
}
|
||||
|
||||
SECTION("comment-control-2")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, comment_control_2); // comment-control-2
|
||||
}
|
||||
|
||||
SECTION("comment-control-3")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, comment_control_3); // comment-control-3
|
||||
}
|
||||
|
||||
SECTION("comment-control-4")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, comment_control_4); // comment-control-4
|
||||
}
|
||||
|
||||
SECTION("inline-table-imutable-1")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, inline_table_imutable_1); // inline-table-imutable-1
|
||||
}
|
||||
|
||||
SECTION("inline-table-imutable-2")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, inline_table_imutable_2); // inline-table-imutable-2
|
||||
}
|
||||
|
||||
#if !TOML_LANG_UNRELEASED
|
||||
|
||||
SECTION("inline-table-trailing-comma")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, inline_table_trailing_comma); // inline-table-trailing-comma
|
||||
}
|
||||
|
||||
#endif // !TOML_LANG_UNRELEASED
|
||||
|
||||
SECTION("int-0-padded")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, int_0_padded); // int-0-padded
|
||||
}
|
||||
|
||||
SECTION("int-signed-bin")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, int_signed_bin); // int-signed-bin
|
||||
}
|
||||
|
||||
SECTION("int-signed-hex")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, int_signed_hex); // int-signed-hex
|
||||
}
|
||||
|
||||
SECTION("int-signed-oct")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, int_signed_oct); // int-signed-oct
|
||||
}
|
||||
|
||||
SECTION("key-value-pair-1")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, key_value_pair_1); // key-value-pair-1
|
||||
}
|
||||
|
||||
SECTION("key-value-pair-2")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, key_value_pair_2); // key-value-pair-2
|
||||
}
|
||||
|
||||
SECTION("multiple-dot-key")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, multiple_dot_key); // multiple-dot-key
|
||||
}
|
||||
|
||||
SECTION("multiple-key")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, multiple_key); // multiple-key
|
||||
}
|
||||
|
||||
SECTION("no-key-name")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, no_key_name); // no-key-name
|
||||
}
|
||||
|
||||
SECTION("string-basic-control-1")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_control_1); // string-basic-control-1
|
||||
}
|
||||
|
||||
SECTION("string-basic-control-2")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_control_2); // string-basic-control-2
|
||||
}
|
||||
|
||||
SECTION("string-basic-control-3")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_control_3); // string-basic-control-3
|
||||
}
|
||||
|
||||
SECTION("string-basic-control-4")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_control_4); // string-basic-control-4
|
||||
}
|
||||
|
||||
SECTION("string-basic-multiline-control-1")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_control_1); // string-basic-multiline-control-1
|
||||
}
|
||||
|
||||
SECTION("string-basic-multiline-control-2")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_control_2); // string-basic-multiline-control-2
|
||||
}
|
||||
|
||||
SECTION("string-basic-multiline-control-3")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_control_3); // string-basic-multiline-control-3
|
||||
}
|
||||
|
||||
SECTION("string-basic-multiline-control-4")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_control_4); // string-basic-multiline-control-4
|
||||
}
|
||||
|
||||
SECTION("string-basic-multiline-invalid-backslash")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS,
|
||||
string_basic_multiline_invalid_backslash); // string-basic-multiline-invalid-backslash
|
||||
}
|
||||
|
||||
SECTION("string-basic-multiline-out-of-range-unicode-escape-1")
|
||||
{
|
||||
parsing_should_fail(
|
||||
FILE_LINE_ARGS,
|
||||
string_basic_multiline_out_of_range_unicode_escape_1); // string-basic-multiline-out-of-range-unicode-escape-1
|
||||
}
|
||||
|
||||
SECTION("string-basic-multiline-out-of-range-unicode-escape-2")
|
||||
{
|
||||
parsing_should_fail(
|
||||
FILE_LINE_ARGS,
|
||||
string_basic_multiline_out_of_range_unicode_escape_2); // string-basic-multiline-out-of-range-unicode-escape-2
|
||||
}
|
||||
|
||||
SECTION("string-basic-multiline-quotes")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_quotes); // string-basic-multiline-quotes
|
||||
}
|
||||
|
||||
SECTION("string-basic-multiline-unknown-escape")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS,
|
||||
string_basic_multiline_unknown_escape); // string-basic-multiline-unknown-escape
|
||||
}
|
||||
|
||||
SECTION("string-basic-out-of-range-unicode-escape-1")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS,
|
||||
string_basic_out_of_range_unicode_escape_1); // string-basic-out-of-range-unicode-escape-1
|
||||
}
|
||||
|
||||
SECTION("string-basic-out-of-range-unicode-escape-2")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS,
|
||||
string_basic_out_of_range_unicode_escape_2); // string-basic-out-of-range-unicode-escape-2
|
||||
}
|
||||
|
||||
SECTION("string-basic-unknown-escape")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_unknown_escape); // string-basic-unknown-escape
|
||||
}
|
||||
|
||||
SECTION("string-literal-control-1")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_literal_control_1); // string-literal-control-1
|
||||
}
|
||||
|
||||
SECTION("string-literal-control-2")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_literal_control_2); // string-literal-control-2
|
||||
}
|
||||
|
||||
SECTION("string-literal-control-3")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_literal_control_3); // string-literal-control-3
|
||||
}
|
||||
|
||||
SECTION("string-literal-control-4")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_literal_control_4); // string-literal-control-4
|
||||
}
|
||||
|
||||
SECTION("string-literal-multiline-control-1")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_literal_multiline_control_1); // string-literal-multiline-control-1
|
||||
}
|
||||
|
||||
SECTION("string-literal-multiline-control-2")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_literal_multiline_control_2); // string-literal-multiline-control-2
|
||||
}
|
||||
|
||||
SECTION("string-literal-multiline-control-3")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_literal_multiline_control_3); // string-literal-multiline-control-3
|
||||
}
|
||||
|
||||
SECTION("string-literal-multiline-control-4")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_literal_multiline_control_4); // string-literal-multiline-control-4
|
||||
}
|
||||
|
||||
SECTION("string-literal-multiline-quotes")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, string_literal_multiline_quotes); // string-literal-multiline-quotes
|
||||
}
|
||||
|
||||
SECTION("table-1")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, table_1); // table-1
|
||||
}
|
||||
|
||||
SECTION("table-2")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, table_2); // table-2
|
||||
}
|
||||
|
||||
SECTION("table-3")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, table_3); // table-3
|
||||
}
|
||||
|
||||
SECTION("table-4")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, table_4); // table-4
|
||||
}
|
||||
|
||||
SECTION("table-invalid-1")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, table_invalid_1); // table-invalid-1
|
||||
}
|
||||
|
||||
SECTION("table-invalid-2")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, table_invalid_2); // table-invalid-2
|
||||
}
|
||||
|
||||
SECTION("table-invalid-3")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, table_invalid_3); // table-invalid-3
|
||||
}
|
||||
|
||||
SECTION("table-invalid-4")
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, table_invalid_4); // table-invalid-4
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
#define TEST_CASE(...) void func()
|
@ -1,380 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
|
||||
TEST_CASE("array::for_each")
|
||||
{
|
||||
toml::array arr{ 0, 1, 2, 3.0, "four", "five", 6 };
|
||||
|
||||
// check lvalue propagates correctly
|
||||
static_cast<array&>(arr).for_each(
|
||||
[](auto&& elem, size_t) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_lvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(!std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
static_cast<array&>(arr).for_each(
|
||||
[](size_t, auto&& elem) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_lvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(!std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
static_cast<array&>(arr).for_each(
|
||||
[](auto&& elem) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_lvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(!std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
|
||||
// check rvalue propagates correctly
|
||||
static_cast<array&&>(arr).for_each(
|
||||
[](auto&& elem, size_t) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_rvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(!std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
static_cast<array&&>(arr).for_each(
|
||||
[](size_t, auto&& elem) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_rvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(!std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
static_cast<array&&>(arr).for_each(
|
||||
[](auto&& elem) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_rvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(!std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
|
||||
// check const lvalue propagates correctly
|
||||
static_cast<const array&>(arr).for_each(
|
||||
[](auto&& elem, size_t) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_lvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
static_cast<const array&>(arr).for_each(
|
||||
[](size_t, auto&& elem) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_lvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
static_cast<const array&>(arr).for_each(
|
||||
[](auto&& elem) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_lvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
|
||||
// check const rvalue propagates correctly
|
||||
static_cast<const array&&>(arr).for_each(
|
||||
[](auto&& elem, size_t) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_rvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
static_cast<const array&&>(arr).for_each(
|
||||
[](size_t, auto&& elem) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_rvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
static_cast<const array&&>(arr).for_each(
|
||||
[](auto&& elem) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_rvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
|
||||
// check noexcept - func(elem, i)
|
||||
{
|
||||
static constexpr auto throwing_visitor = [](auto&&, size_t) noexcept(false) {};
|
||||
static constexpr auto non_throwing_visitor = [](auto&&, size_t) noexcept(true) {};
|
||||
static_assert(!noexcept(static_cast<array&>(arr).for_each(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<array&&>(arr).for_each(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<const array&>(arr).for_each(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<const array&&>(arr).for_each(throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<array&>(arr).for_each(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<array&&>(arr).for_each(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<const array&>(arr).for_each(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<const array&&>(arr).for_each(non_throwing_visitor)));
|
||||
}
|
||||
|
||||
// check noexcept - func(i, elem)
|
||||
{
|
||||
static constexpr auto throwing_visitor = [](size_t, auto&&) noexcept(false) {};
|
||||
static constexpr auto non_throwing_visitor = [](size_t, auto&&) noexcept(true) {};
|
||||
static_assert(!noexcept(static_cast<array&>(arr).for_each(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<array&&>(arr).for_each(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<const array&>(arr).for_each(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<const array&&>(arr).for_each(throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<array&>(arr).for_each(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<array&&>(arr).for_each(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<const array&>(arr).for_each(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<const array&&>(arr).for_each(non_throwing_visitor)));
|
||||
}
|
||||
|
||||
// check noexcept - func(elem)
|
||||
{
|
||||
static constexpr auto throwing_visitor = [](auto&&) noexcept(false) {};
|
||||
static constexpr auto non_throwing_visitor = [](auto&&) noexcept(true) {};
|
||||
static_assert(!noexcept(static_cast<array&>(arr).for_each(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<array&&>(arr).for_each(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<const array&>(arr).for_each(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<const array&&>(arr).for_each(throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<array&>(arr).for_each(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<array&&>(arr).for_each(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<const array&>(arr).for_each(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<const array&&>(arr).for_each(non_throwing_visitor)));
|
||||
}
|
||||
|
||||
// check that the iteration actually does what it says on the box
|
||||
{
|
||||
toml::array arr2;
|
||||
arr.for_each([&](const auto& val) { arr2.push_back(val); });
|
||||
CHECK(arr == arr2);
|
||||
}
|
||||
|
||||
// check that visitation works for a specific type
|
||||
{
|
||||
toml::array arr2;
|
||||
arr.for_each([&](const toml::value<int64_t>& val) { arr2.push_back(val); });
|
||||
CHECK(arr2 == toml::array{ 0, 1, 2, 6 });
|
||||
}
|
||||
|
||||
#if !TOML_RETURN_BOOL_FROM_FOR_EACH_BROKEN
|
||||
|
||||
// check that early-stopping works
|
||||
{
|
||||
toml::array arr2;
|
||||
arr.for_each(
|
||||
[&](const auto& val)
|
||||
{
|
||||
if constexpr (!toml::is_number<decltype(val)>)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
arr2.push_back(val);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
CHECK(arr2 == toml::array{ 0, 1, 2, 3.0 });
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST_CASE("table::for_each")
|
||||
{
|
||||
table tbl{ { "zero", 0 }, //
|
||||
{ "one", 1 }, //
|
||||
{ "two", 2 }, //
|
||||
{ "three", 3.0 }, //
|
||||
{ "four", "four" }, //
|
||||
{ "five", "five" }, //
|
||||
{ "six", 6 } };
|
||||
|
||||
// check lvalue propagates correctly
|
||||
static_cast<table&>(tbl).for_each(
|
||||
[](const toml::key&, auto&& elem) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_lvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(!std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
static_cast<table&>(tbl).for_each(
|
||||
[](auto&& elem) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_lvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(!std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
|
||||
// check rvalue propagates correctly
|
||||
static_cast<table&&>(tbl).for_each(
|
||||
[](const toml::key&, auto&& elem) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_rvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(!std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
static_cast<table&&>(tbl).for_each(
|
||||
[](auto&& elem) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_rvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(!std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
|
||||
// check const lvalue propagates correctly
|
||||
static_cast<const table&>(tbl).for_each(
|
||||
[](const toml::key&, auto&& elem) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_lvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
static_cast<const table&>(tbl).for_each(
|
||||
[](auto&& elem) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_lvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
|
||||
// check const rvalue propagates correctly
|
||||
static_cast<const table&&>(tbl).for_each(
|
||||
[](const toml::key&, auto&& elem) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_rvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
static_cast<const table&&>(tbl).for_each(
|
||||
[](auto&& elem) noexcept
|
||||
{
|
||||
using elem_ref_type = decltype(elem);
|
||||
static_assert(std::is_rvalue_reference_v<elem_ref_type>);
|
||||
|
||||
using elem_type = std::remove_reference_t<elem_ref_type>;
|
||||
static_assert(std::is_const_v<elem_type>);
|
||||
static_assert(!std::is_volatile_v<elem_type>);
|
||||
});
|
||||
|
||||
// check noexcept - func(key, value)
|
||||
{
|
||||
static constexpr auto throwing_visitor = [](const toml::key&, auto&&) noexcept(false) {};
|
||||
static constexpr auto non_throwing_visitor = [](const toml::key&, auto&&) noexcept(true) {};
|
||||
static_assert(!noexcept(static_cast<table&>(tbl).for_each(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<table&&>(tbl).for_each(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<const table&>(tbl).for_each(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<const table&&>(tbl).for_each(throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<table&>(tbl).for_each(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<table&&>(tbl).for_each(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<const table&>(tbl).for_each(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<const table&&>(tbl).for_each(non_throwing_visitor)));
|
||||
}
|
||||
|
||||
// check noexcept - func(value)
|
||||
{
|
||||
static constexpr auto throwing_visitor = [](auto&&) noexcept(false) {};
|
||||
static constexpr auto non_throwing_visitor = [](auto&&) noexcept(true) {};
|
||||
static_assert(!noexcept(static_cast<table&>(tbl).for_each(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<table&&>(tbl).for_each(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<const table&>(tbl).for_each(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<const table&&>(tbl).for_each(throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<table&>(tbl).for_each(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<table&&>(tbl).for_each(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<const table&>(tbl).for_each(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<const table&&>(tbl).for_each(non_throwing_visitor)));
|
||||
}
|
||||
|
||||
// check that the iteration actually does what it says on the box
|
||||
{
|
||||
toml::table tbl2;
|
||||
tbl.for_each([&](auto&& key, auto&& val) { tbl2.insert_or_assign(key, val); });
|
||||
CHECK(tbl == tbl2);
|
||||
}
|
||||
|
||||
// check that visitation works for a specific type
|
||||
{
|
||||
toml::table tbl2;
|
||||
tbl.for_each([&](auto&& key, const toml::value<int64_t>& val) { tbl2.insert_or_assign(key, val); });
|
||||
CHECK(tbl2
|
||||
== table{ { "zero", 0 }, //
|
||||
{ "one", 1 }, //
|
||||
{ "two", 2 }, //
|
||||
{ "six", 6 } });
|
||||
}
|
||||
|
||||
#if !TOML_RETURN_BOOL_FROM_FOR_EACH_BROKEN
|
||||
|
||||
// check that early-stopping works
|
||||
{
|
||||
toml::table tbl2;
|
||||
size_t added{};
|
||||
tbl.for_each(
|
||||
[&](auto&& key, const auto& val)
|
||||
{
|
||||
tbl2.insert_or_assign(key, val);
|
||||
added++;
|
||||
return added < 3u;
|
||||
});
|
||||
CHECK(tbl2.size() == 3u);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
@ -1,332 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
template <typename Formatter, typename T>
|
||||
static auto format_to_string(const T& obj,
|
||||
format_flags flags = Formatter::default_flags,
|
||||
format_flags exclude_flags = format_flags::none)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "*****\n" << Formatter{ obj, flags & ~(exclude_flags) } << "\n*****";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
struct char32_printer
|
||||
{
|
||||
char32_t value;
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& os, const char32_printer& p)
|
||||
{
|
||||
if (p.value <= U'\x1F')
|
||||
return os << '\'' << impl::control_char_escapes[static_cast<size_t>(p.value)] << '\'';
|
||||
else if (p.value == U'\x7F')
|
||||
return os << "'\\u007F'"sv;
|
||||
else if (p.value < 127u)
|
||||
return os << '\'' << static_cast<char>(static_cast<uint8_t>(p.value)) << '\'';
|
||||
else
|
||||
return os << static_cast<uint_least32_t>(p.value);
|
||||
}
|
||||
};
|
||||
|
||||
struct string_difference
|
||||
{
|
||||
source_position position;
|
||||
size_t index;
|
||||
char32_t a, b;
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& os, const string_difference& diff)
|
||||
{
|
||||
if (diff.a && diff.b && diff.a != diff.b)
|
||||
os << char32_printer{ diff.a } << " vs "sv << char32_printer{ diff.b } << " at "sv;
|
||||
return os << diff.position << ", index "sv << diff.index;
|
||||
}
|
||||
};
|
||||
|
||||
static optional<string_difference> find_first_difference(std::string_view str_a, std::string_view str_b) noexcept
|
||||
{
|
||||
string_difference diff{ { 1u, 1u } };
|
||||
impl::utf8_decoder a, b;
|
||||
|
||||
for (size_t i = 0, e = std::min(str_a.length(), str_b.length()); i < e; i++, diff.index++)
|
||||
{
|
||||
a(static_cast<uint8_t>(str_a[i]));
|
||||
b(static_cast<uint8_t>(str_b[i]));
|
||||
if (a.has_code_point() != b.has_code_point() || a.error() != b.error())
|
||||
return diff;
|
||||
|
||||
if (a.error())
|
||||
{
|
||||
a.reset();
|
||||
b.reset();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!a.has_code_point())
|
||||
continue;
|
||||
|
||||
if (a.codepoint != b.codepoint)
|
||||
{
|
||||
diff.a = a.codepoint;
|
||||
diff.b = b.codepoint;
|
||||
return diff;
|
||||
}
|
||||
|
||||
if (a.codepoint == U'\n')
|
||||
{
|
||||
diff.position.line++;
|
||||
diff.position.column = 1u;
|
||||
}
|
||||
else
|
||||
diff.position.column++;
|
||||
}
|
||||
if (str_a.length() != str_b.length())
|
||||
return diff;
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
#define CHECK_FORMATTER(formatter, data, expected) \
|
||||
do \
|
||||
{ \
|
||||
const auto str = format_to_string<formatter>(data); \
|
||||
const auto diff = find_first_difference(str, expected); \
|
||||
if (diff) \
|
||||
FORCE_FAIL("string mismatch: "sv << *diff); \
|
||||
} \
|
||||
while (false)
|
||||
|
||||
TEST_CASE("formatters")
|
||||
{
|
||||
const auto data_date = toml::date{ 2021, 11, 2 };
|
||||
const auto data_time = toml::time{ 20, 33, 0 };
|
||||
const auto data = toml::table{
|
||||
{ "integers"sv,
|
||||
toml::table{ { "zero"sv, 0 },
|
||||
{ "one"sv, 1 },
|
||||
{ "dec"sv, 10 },
|
||||
{ "bin"sv, 10, toml::value_flags::format_as_binary },
|
||||
{ "oct"sv, 10, toml::value_flags::format_as_octal },
|
||||
{ "hex"sv, 10, toml::value_flags::format_as_hexadecimal } } },
|
||||
{ "floats"sv,
|
||||
toml::table{ { "pos_zero"sv, +0.0 },
|
||||
{ "neg_zero"sv, -0.0 },
|
||||
{ "one"sv, 1.0 },
|
||||
{ "pos_inf"sv, +std::numeric_limits<double>::infinity() },
|
||||
{ "neg_inf"sv, -std::numeric_limits<double>::infinity() },
|
||||
{ "pos_nan"sv, +std::numeric_limits<double>::quiet_NaN() },
|
||||
{ "neg_nan"sv, -std::numeric_limits<double>::quiet_NaN() }
|
||||
|
||||
} },
|
||||
|
||||
{ "dates and times"sv,
|
||||
toml::table{
|
||||
|
||||
{ "dates"sv, toml::table{ { "val"sv, data_date } } },
|
||||
|
||||
{ "times"sv, toml::table{ { "val"sv, data_time } } },
|
||||
|
||||
{ "date-times"sv,
|
||||
toml::table{
|
||||
|
||||
{ "local"sv, toml::table{ { "val"sv, toml::date_time{ data_date, data_time } } } },
|
||||
{ "offset"sv,
|
||||
toml::table{
|
||||
{ "val"sv, toml::date_time{ data_date, data_time, toml::time_offset{} } } } } } } } },
|
||||
|
||||
{ "bools"sv,
|
||||
toml::table{ { "true"sv, true }, //
|
||||
{ "false"sv, false } } },
|
||||
|
||||
{
|
||||
"strings"sv,
|
||||
toml::array{ R"()"sv,
|
||||
R"(string)"sv,
|
||||
R"(string with a single quote in it: ')"sv,
|
||||
R"(string with a double quote in it: ")"sv,
|
||||
"string with a tab: \t"sv,
|
||||
R"(a long string to force the array over multiple lines)"sv },
|
||||
},
|
||||
|
||||
{ "a"sv,
|
||||
toml::table{ { "val", true },
|
||||
{ "b"sv, toml::table{ { "val", true }, { "c"sv, toml::table{ { "val", true } } } } } } }
|
||||
|
||||
};
|
||||
|
||||
SECTION("toml_formatter")
|
||||
{
|
||||
static constexpr auto expected = R"(*****
|
||||
strings = [
|
||||
'',
|
||||
'string',
|
||||
"string with a single quote in it: '",
|
||||
'string with a double quote in it: "',
|
||||
'string with a tab: ',
|
||||
'a long string to force the array over multiple lines'
|
||||
]
|
||||
|
||||
[a]
|
||||
val = true
|
||||
|
||||
[a.b]
|
||||
val = true
|
||||
|
||||
[a.b.c]
|
||||
val = true
|
||||
|
||||
[bools]
|
||||
false = false
|
||||
true = true
|
||||
|
||||
['dates and times'.date-times.local]
|
||||
val = 2021-11-02T20:33:00
|
||||
|
||||
['dates and times'.date-times.offset]
|
||||
val = 2021-11-02T20:33:00Z
|
||||
|
||||
['dates and times'.dates]
|
||||
val = 2021-11-02
|
||||
|
||||
['dates and times'.times]
|
||||
val = 20:33:00
|
||||
|
||||
[floats]
|
||||
neg_inf = -inf
|
||||
neg_nan = nan
|
||||
neg_zero = -0.0
|
||||
one = 1.0
|
||||
pos_inf = inf
|
||||
pos_nan = nan
|
||||
pos_zero = 0.0
|
||||
|
||||
[integers]
|
||||
bin = 0b1010
|
||||
dec = 10
|
||||
hex = 0xA
|
||||
oct = 0o12
|
||||
one = 1
|
||||
zero = 0
|
||||
*****)"sv;
|
||||
|
||||
CHECK_FORMATTER(toml_formatter, data, expected);
|
||||
}
|
||||
|
||||
SECTION("json_formatter")
|
||||
{
|
||||
static constexpr auto expected = R"(*****
|
||||
{
|
||||
"a" : {
|
||||
"b" : {
|
||||
"c" : {
|
||||
"val" : true
|
||||
},
|
||||
"val" : true
|
||||
},
|
||||
"val" : true
|
||||
},
|
||||
"bools" : {
|
||||
"false" : false,
|
||||
"true" : true
|
||||
},
|
||||
"dates and times" : {
|
||||
"date-times" : {
|
||||
"local" : {
|
||||
"val" : "2021-11-02T20:33:00"
|
||||
},
|
||||
"offset" : {
|
||||
"val" : "2021-11-02T20:33:00Z"
|
||||
}
|
||||
},
|
||||
"dates" : {
|
||||
"val" : "2021-11-02"
|
||||
},
|
||||
"times" : {
|
||||
"val" : "20:33:00"
|
||||
}
|
||||
},
|
||||
"floats" : {
|
||||
"neg_inf" : "-Infinity",
|
||||
"neg_nan" : "NaN",
|
||||
"neg_zero" : -0.0,
|
||||
"one" : 1.0,
|
||||
"pos_inf" : "Infinity",
|
||||
"pos_nan" : "NaN",
|
||||
"pos_zero" : 0.0
|
||||
},
|
||||
"integers" : {
|
||||
"bin" : 10,
|
||||
"dec" : 10,
|
||||
"hex" : 10,
|
||||
"oct" : 10,
|
||||
"one" : 1,
|
||||
"zero" : 0
|
||||
},
|
||||
"strings" : [
|
||||
"",
|
||||
"string",
|
||||
"string with a single quote in it: '",
|
||||
"string with a double quote in it: \"",
|
||||
"string with a tab: \t",
|
||||
"a long string to force the array over multiple lines"
|
||||
]
|
||||
}
|
||||
*****)"sv;
|
||||
|
||||
CHECK_FORMATTER(json_formatter, data, expected);
|
||||
}
|
||||
|
||||
SECTION("yaml_formatter")
|
||||
{
|
||||
static constexpr auto expected = R"(*****
|
||||
a:
|
||||
b:
|
||||
c:
|
||||
val: true
|
||||
val: true
|
||||
val: true
|
||||
bools:
|
||||
false: false
|
||||
true: true
|
||||
'dates and times':
|
||||
date-times:
|
||||
local:
|
||||
val: '2021-11-02T20:33:00'
|
||||
offset:
|
||||
val: '2021-11-02T20:33:00Z'
|
||||
dates:
|
||||
val: '2021-11-02'
|
||||
times:
|
||||
val: '20:33:00'
|
||||
floats:
|
||||
neg_inf: -.inf
|
||||
neg_nan: .NAN
|
||||
neg_zero: -0.0
|
||||
one: 1.0
|
||||
pos_inf: .inf
|
||||
pos_nan: .NAN
|
||||
pos_zero: 0.0
|
||||
integers:
|
||||
bin: 10
|
||||
dec: 10
|
||||
hex: 0xA
|
||||
oct: 0o12
|
||||
one: 1
|
||||
zero: 0
|
||||
strings:
|
||||
- ''
|
||||
- string
|
||||
- "string with a single quote in it: '"
|
||||
- 'string with a double quote in it: "'
|
||||
- "string with a tab: \t"
|
||||
- 'a long string to force the array over multiple lines'
|
||||
*****)"sv;
|
||||
|
||||
CHECK_FORMATTER(yaml_formatter, data, expected);
|
||||
}
|
||||
}
|
@ -1,407 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "settings.hpp"
|
||||
#if !TOML_HEADER_ONLY && !TOML_SHARED_LIB
|
||||
#define TOML_IMPLEMENTATION
|
||||
#endif
|
||||
|
||||
#if USE_SINGLE_HEADER
|
||||
#include "../toml.hpp"
|
||||
#else
|
||||
#include "../include/toml++/toml.hpp"
|
||||
#endif
|
||||
|
||||
namespace toml
|
||||
{
|
||||
using std::declval;
|
||||
using std::is_same_v;
|
||||
|
||||
#define CHECK_NODE_TYPE_MAPPING(T, expected) \
|
||||
static_assert(impl::node_type_of<T> == expected); \
|
||||
static_assert(impl::node_type_of<T&> == expected); \
|
||||
static_assert(impl::node_type_of<T&&> == expected); \
|
||||
static_assert(impl::node_type_of<const T> == expected); \
|
||||
static_assert(impl::node_type_of<const T&> == expected); \
|
||||
static_assert(impl::node_type_of<const T&&> == expected); \
|
||||
static_assert(impl::node_type_of<volatile T> == expected); \
|
||||
static_assert(impl::node_type_of<volatile T&> == expected); \
|
||||
static_assert(impl::node_type_of<volatile T&&> == expected); \
|
||||
static_assert(impl::node_type_of<const volatile T> == expected); \
|
||||
static_assert(impl::node_type_of<const volatile T&> == expected); \
|
||||
static_assert(impl::node_type_of<const volatile T&&> == expected)
|
||||
|
||||
CHECK_NODE_TYPE_MAPPING(int64_t, node_type::integer);
|
||||
CHECK_NODE_TYPE_MAPPING(double, node_type::floating_point);
|
||||
CHECK_NODE_TYPE_MAPPING(std::string, node_type::string);
|
||||
CHECK_NODE_TYPE_MAPPING(bool, node_type::boolean);
|
||||
CHECK_NODE_TYPE_MAPPING(toml::date, node_type::date);
|
||||
CHECK_NODE_TYPE_MAPPING(toml::time, node_type::time);
|
||||
CHECK_NODE_TYPE_MAPPING(toml::date_time, node_type::date_time);
|
||||
CHECK_NODE_TYPE_MAPPING(toml::array, node_type::array);
|
||||
CHECK_NODE_TYPE_MAPPING(toml::table, node_type::table);
|
||||
|
||||
#define CHECK_CAN_REPRESENT_NATIVE(T, expected) \
|
||||
static_assert((impl::value_traits<T>::is_native || impl::value_traits<T>::can_represent_native) == expected)
|
||||
|
||||
CHECK_CAN_REPRESENT_NATIVE(time, true);
|
||||
CHECK_CAN_REPRESENT_NATIVE(date, true);
|
||||
CHECK_CAN_REPRESENT_NATIVE(date_time, true);
|
||||
CHECK_CAN_REPRESENT_NATIVE(bool, true);
|
||||
CHECK_CAN_REPRESENT_NATIVE(int8_t, false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(int16_t, false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(int32_t, false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(int64_t, true);
|
||||
CHECK_CAN_REPRESENT_NATIVE(uint8_t, false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(uint16_t, false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(uint32_t, false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(uint64_t, false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(float, false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(double, true);
|
||||
#ifdef TOML_INT128
|
||||
CHECK_CAN_REPRESENT_NATIVE(TOML_INT128, true);
|
||||
CHECK_CAN_REPRESENT_NATIVE(TOML_UINT128, false);
|
||||
#endif
|
||||
#if TOML_ENABLE_FLOAT16
|
||||
CHECK_CAN_REPRESENT_NATIVE(_Float16, false);
|
||||
#endif
|
||||
#ifdef TOML_FLOAT128
|
||||
CHECK_CAN_REPRESENT_NATIVE(TOML_FLOAT128, true);
|
||||
#endif
|
||||
|
||||
CHECK_CAN_REPRESENT_NATIVE(char*, false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(char* const, false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(char[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(const char[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(char (&)[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(const char (&)[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(char (&&)[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(const char (&&)[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(const char*, true);
|
||||
CHECK_CAN_REPRESENT_NATIVE(const char* const, true);
|
||||
CHECK_CAN_REPRESENT_NATIVE(std::string, true);
|
||||
CHECK_CAN_REPRESENT_NATIVE(std::string_view, true);
|
||||
#if TOML_HAS_CHAR8
|
||||
CHECK_CAN_REPRESENT_NATIVE(char8_t*, false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(char8_t* const, false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(char8_t[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(const char8_t[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(char8_t (&)[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(const char8_t (&)[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(char (&&)[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(const char8_t (&&)[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(const char8_t*, true);
|
||||
CHECK_CAN_REPRESENT_NATIVE(const char8_t* const, true);
|
||||
CHECK_CAN_REPRESENT_NATIVE(std::u8string, true);
|
||||
CHECK_CAN_REPRESENT_NATIVE(std::u8string_view, true);
|
||||
#endif
|
||||
CHECK_CAN_REPRESENT_NATIVE(wchar_t*, false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(wchar_t* const, false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(wchar_t[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(const wchar_t[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(wchar_t (&)[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(const wchar_t (&)[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(wchar_t (&&)[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(const wchar_t (&&)[2], false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(const wchar_t*, false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(const wchar_t* const, false);
|
||||
CHECK_CAN_REPRESENT_NATIVE(std::wstring, !!TOML_ENABLE_WINDOWS_COMPAT);
|
||||
CHECK_CAN_REPRESENT_NATIVE(std::wstring_view, false);
|
||||
|
||||
#define CHECK_VALUE_EXACT(T, expected) \
|
||||
static_assert(is_same_v<decltype(declval<node>().value_exact<T>()), optional<expected>>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<node>>().value_exact<T>()), optional<expected>>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<const node>>().value_exact<T>()), optional<expected>>)
|
||||
|
||||
#define CHECK_VALUE_OR(T, expected) \
|
||||
static_assert(is_same_v<decltype(declval<node>().value_or(declval<T>())), expected>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<node>>().value_or(declval<T>())), expected>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<const node>>().value_or(declval<T>())), expected>)
|
||||
|
||||
CHECK_VALUE_EXACT(time, time);
|
||||
CHECK_VALUE_EXACT(date, date);
|
||||
CHECK_VALUE_EXACT(date_time, date_time);
|
||||
CHECK_VALUE_EXACT(bool, bool);
|
||||
CHECK_VALUE_EXACT(double, double);
|
||||
CHECK_VALUE_EXACT(int64_t, int64_t);
|
||||
CHECK_VALUE_EXACT(const char*, const char*);
|
||||
CHECK_VALUE_EXACT(std::string_view, std::string_view);
|
||||
CHECK_VALUE_EXACT(std::string, std::string);
|
||||
#if TOML_HAS_CHAR8
|
||||
CHECK_VALUE_EXACT(const char8_t*, const char8_t*);
|
||||
CHECK_VALUE_EXACT(std::u8string_view, std::u8string_view);
|
||||
CHECK_VALUE_EXACT(std::u8string, std::u8string);
|
||||
#endif
|
||||
|
||||
CHECK_VALUE_OR(time, time);
|
||||
CHECK_VALUE_OR(time&, time);
|
||||
CHECK_VALUE_OR(time&&, time);
|
||||
CHECK_VALUE_OR(time const, time);
|
||||
CHECK_VALUE_OR(date, date);
|
||||
CHECK_VALUE_OR(date&, date);
|
||||
CHECK_VALUE_OR(date&&, date);
|
||||
CHECK_VALUE_OR(date const, date);
|
||||
CHECK_VALUE_OR(date_time, date_time);
|
||||
CHECK_VALUE_OR(date_time&, date_time);
|
||||
CHECK_VALUE_OR(date_time&&, date_time);
|
||||
CHECK_VALUE_OR(date_time const, date_time);
|
||||
CHECK_VALUE_OR(bool, bool);
|
||||
CHECK_VALUE_OR(bool&, bool);
|
||||
CHECK_VALUE_OR(bool&&, bool);
|
||||
CHECK_VALUE_OR(bool const, bool);
|
||||
CHECK_VALUE_OR(int32_t, int32_t);
|
||||
CHECK_VALUE_OR(int32_t&, int32_t);
|
||||
CHECK_VALUE_OR(int32_t&&, int32_t);
|
||||
CHECK_VALUE_OR(int32_t const, int32_t);
|
||||
CHECK_VALUE_OR(int64_t, int64_t);
|
||||
CHECK_VALUE_OR(int64_t&, int64_t);
|
||||
CHECK_VALUE_OR(int64_t&&, int64_t);
|
||||
CHECK_VALUE_OR(int64_t const, int64_t);
|
||||
#ifdef TOML_INT128
|
||||
CHECK_VALUE_OR(TOML_INT128, TOML_INT128);
|
||||
CHECK_VALUE_OR(TOML_INT128&, TOML_INT128);
|
||||
CHECK_VALUE_OR(TOML_INT128&&, TOML_INT128);
|
||||
CHECK_VALUE_OR(TOML_INT128 const, TOML_INT128);
|
||||
CHECK_VALUE_OR(TOML_UINT128, TOML_UINT128);
|
||||
CHECK_VALUE_OR(TOML_UINT128&, TOML_UINT128);
|
||||
CHECK_VALUE_OR(TOML_UINT128&&, TOML_UINT128);
|
||||
CHECK_VALUE_OR(TOML_UINT128 const, TOML_UINT128);
|
||||
#endif
|
||||
CHECK_VALUE_OR(float, float);
|
||||
CHECK_VALUE_OR(float&, float);
|
||||
CHECK_VALUE_OR(float&&, float);
|
||||
CHECK_VALUE_OR(float const, float);
|
||||
CHECK_VALUE_OR(double, double);
|
||||
CHECK_VALUE_OR(double&, double);
|
||||
CHECK_VALUE_OR(double&&, double);
|
||||
CHECK_VALUE_OR(double const, double);
|
||||
#ifdef TOML_FLOAT128
|
||||
CHECK_VALUE_OR(TOML_FLOAT128, TOML_FLOAT128);
|
||||
CHECK_VALUE_OR(TOML_FLOAT128&, TOML_FLOAT128);
|
||||
CHECK_VALUE_OR(TOML_FLOAT128&&, TOML_FLOAT128);
|
||||
CHECK_VALUE_OR(TOML_FLOAT128 const, TOML_FLOAT128);
|
||||
#endif
|
||||
CHECK_VALUE_OR(char*, const char*);
|
||||
CHECK_VALUE_OR(char*&, const char*);
|
||||
CHECK_VALUE_OR(char*&&, const char*);
|
||||
CHECK_VALUE_OR(char* const, const char*);
|
||||
CHECK_VALUE_OR(char[2], const char*);
|
||||
CHECK_VALUE_OR(char (&)[2], const char*);
|
||||
CHECK_VALUE_OR(char (&&)[2], const char*);
|
||||
CHECK_VALUE_OR(const char*, const char*);
|
||||
CHECK_VALUE_OR(const char*&, const char*);
|
||||
CHECK_VALUE_OR(const char*&&, const char*);
|
||||
CHECK_VALUE_OR(const char* const, const char*);
|
||||
CHECK_VALUE_OR(const char[2], const char*);
|
||||
CHECK_VALUE_OR(const char (&)[2], const char*);
|
||||
CHECK_VALUE_OR(const char (&&)[2], const char*);
|
||||
CHECK_VALUE_OR(std::string_view, std::string_view);
|
||||
CHECK_VALUE_OR(std::string_view&, std::string_view);
|
||||
CHECK_VALUE_OR(std::string_view&&, std::string_view);
|
||||
CHECK_VALUE_OR(const std::string_view, std::string_view);
|
||||
CHECK_VALUE_OR(const std::string_view&, std::string_view);
|
||||
CHECK_VALUE_OR(const std::string_view&&, std::string_view);
|
||||
CHECK_VALUE_OR(std::string, std::string);
|
||||
CHECK_VALUE_OR(std::string&, std::string);
|
||||
CHECK_VALUE_OR(std::string&&, std::string);
|
||||
CHECK_VALUE_OR(const std::string, std::string);
|
||||
CHECK_VALUE_OR(const std::string&, std::string);
|
||||
CHECK_VALUE_OR(const std::string&&, std::string);
|
||||
#if TOML_HAS_CHAR8
|
||||
CHECK_VALUE_OR(char8_t*, const char8_t*);
|
||||
CHECK_VALUE_OR(char8_t*&, const char8_t*);
|
||||
CHECK_VALUE_OR(char8_t*&&, const char8_t*);
|
||||
CHECK_VALUE_OR(char8_t* const, const char8_t*);
|
||||
CHECK_VALUE_OR(char8_t[2], const char8_t*);
|
||||
CHECK_VALUE_OR(char8_t (&)[2], const char8_t*);
|
||||
CHECK_VALUE_OR(char8_t (&&)[2], const char8_t*);
|
||||
CHECK_VALUE_OR(const char8_t*, const char8_t*);
|
||||
CHECK_VALUE_OR(const char8_t*&, const char8_t*);
|
||||
CHECK_VALUE_OR(const char8_t*&&, const char8_t*);
|
||||
CHECK_VALUE_OR(const char8_t* const, const char8_t*);
|
||||
CHECK_VALUE_OR(const char8_t[2], const char8_t*);
|
||||
CHECK_VALUE_OR(const char8_t (&)[2], const char8_t*);
|
||||
CHECK_VALUE_OR(const char8_t (&&)[2], const char8_t*);
|
||||
CHECK_VALUE_OR(std::u8string_view, std::u8string_view);
|
||||
CHECK_VALUE_OR(std::u8string_view&, std::u8string_view);
|
||||
CHECK_VALUE_OR(std::u8string_view&&, std::u8string_view);
|
||||
CHECK_VALUE_OR(const std::u8string_view, std::u8string_view);
|
||||
CHECK_VALUE_OR(const std::u8string_view&, std::u8string_view);
|
||||
CHECK_VALUE_OR(const std::u8string_view&&, std::u8string_view);
|
||||
CHECK_VALUE_OR(std::u8string, std::u8string);
|
||||
CHECK_VALUE_OR(std::u8string&, std::u8string);
|
||||
CHECK_VALUE_OR(std::u8string&&, std::u8string);
|
||||
CHECK_VALUE_OR(const std::u8string, std::u8string);
|
||||
CHECK_VALUE_OR(const std::u8string&, std::u8string);
|
||||
CHECK_VALUE_OR(const std::u8string&&, std::u8string);
|
||||
#endif
|
||||
#if TOML_ENABLE_WINDOWS_COMPAT
|
||||
CHECK_VALUE_OR(wchar_t*, std::wstring);
|
||||
CHECK_VALUE_OR(wchar_t*&, std::wstring);
|
||||
CHECK_VALUE_OR(wchar_t*&&, std::wstring);
|
||||
CHECK_VALUE_OR(wchar_t* const, std::wstring);
|
||||
CHECK_VALUE_OR(wchar_t[2], std::wstring);
|
||||
CHECK_VALUE_OR(wchar_t (&)[2], std::wstring);
|
||||
CHECK_VALUE_OR(wchar_t (&&)[2], std::wstring);
|
||||
CHECK_VALUE_OR(const wchar_t*, std::wstring);
|
||||
CHECK_VALUE_OR(const wchar_t*&, std::wstring);
|
||||
CHECK_VALUE_OR(const wchar_t*&&, std::wstring);
|
||||
CHECK_VALUE_OR(const wchar_t* const, std::wstring);
|
||||
CHECK_VALUE_OR(const wchar_t[2], std::wstring);
|
||||
CHECK_VALUE_OR(const wchar_t (&)[2], std::wstring);
|
||||
CHECK_VALUE_OR(const wchar_t (&&)[2], std::wstring);
|
||||
CHECK_VALUE_OR(std::wstring_view, std::wstring);
|
||||
CHECK_VALUE_OR(std::wstring_view&, std::wstring);
|
||||
CHECK_VALUE_OR(std::wstring_view&&, std::wstring);
|
||||
CHECK_VALUE_OR(const std::wstring_view, std::wstring);
|
||||
CHECK_VALUE_OR(const std::wstring_view&, std::wstring);
|
||||
CHECK_VALUE_OR(const std::wstring_view&&, std::wstring);
|
||||
CHECK_VALUE_OR(std::wstring, std::wstring);
|
||||
CHECK_VALUE_OR(std::wstring&, std::wstring);
|
||||
CHECK_VALUE_OR(std::wstring&&, std::wstring);
|
||||
CHECK_VALUE_OR(const std::wstring, std::wstring);
|
||||
CHECK_VALUE_OR(const std::wstring&, std::wstring);
|
||||
CHECK_VALUE_OR(const std::wstring&&, std::wstring);
|
||||
#endif
|
||||
|
||||
#define CHECK_INSERTED_AS(T, expected) \
|
||||
static_assert(std::is_same_v<toml::inserted_type_of<T>, expected>); \
|
||||
static_assert(std::is_same_v<toml::inserted_type_of<const T>, expected>); \
|
||||
static_assert(std::is_same_v<toml::inserted_type_of<T&>, expected>); \
|
||||
static_assert(std::is_same_v<toml::inserted_type_of<const T&>, expected>); \
|
||||
static_assert(std::is_same_v<toml::inserted_type_of<T&&>, expected>)
|
||||
|
||||
CHECK_INSERTED_AS(table, table);
|
||||
CHECK_INSERTED_AS(array, array);
|
||||
CHECK_INSERTED_AS(node, node);
|
||||
CHECK_INSERTED_AS(time, value<time>);
|
||||
CHECK_INSERTED_AS(date, value<date>);
|
||||
CHECK_INSERTED_AS(date_time, value<date_time>);
|
||||
CHECK_INSERTED_AS(bool, value<bool>);
|
||||
CHECK_INSERTED_AS(int8_t, value<int64_t>);
|
||||
CHECK_INSERTED_AS(int16_t, value<int64_t>);
|
||||
CHECK_INSERTED_AS(int32_t, value<int64_t>);
|
||||
CHECK_INSERTED_AS(int64_t, value<int64_t>);
|
||||
CHECK_INSERTED_AS(uint8_t, value<int64_t>);
|
||||
CHECK_INSERTED_AS(uint16_t, value<int64_t>);
|
||||
CHECK_INSERTED_AS(uint32_t, value<int64_t>);
|
||||
CHECK_INSERTED_AS(float, value<double>);
|
||||
CHECK_INSERTED_AS(double, value<double>);
|
||||
#if TOML_ENABLE_FLOAT16
|
||||
CHECK_INSERTED_AS(_Float16, value<double>);
|
||||
#endif
|
||||
|
||||
#define CHECK_NODE_REF_TYPE(T) \
|
||||
static_assert(is_same_v<decltype(declval<node&>().ref<T>()), T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&>().ref<const T>()), const T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&>().ref<volatile T>()), volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&>().ref<const volatile T>()), const volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&>().ref<T&>()), T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&>().ref<const T&>()), const T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&>().ref<volatile T&>()), volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&>().ref<const volatile T&>()), const volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&>().ref<T&&>()), T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&>().ref<const T&&>()), const T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&>().ref<volatile T&&>()), volatile T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&>().ref<const volatile T&&>()), const volatile T&&>); \
|
||||
\
|
||||
static_assert(is_same_v<decltype(declval<node&&>().ref<T>()), T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&&>().ref<const T>()), const T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&&>().ref<volatile T>()), volatile T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&&>().ref<const volatile T>()), const volatile T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&&>().ref<T&>()), T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&&>().ref<const T&>()), const T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&&>().ref<volatile T&>()), volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&&>().ref<const volatile T&>()), const volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&&>().ref<T&&>()), T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&&>().ref<const T&&>()), const T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&&>().ref<volatile T&&>()), volatile T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<node&&>().ref<const volatile T&&>()), const volatile T&&>); \
|
||||
\
|
||||
static_assert(is_same_v<decltype(declval<const node&>().ref<T>()), const T&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&>().ref<const T>()), const T&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&>().ref<volatile T>()), const volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&>().ref<const volatile T>()), const volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&>().ref<T&>()), const T&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&>().ref<const T&>()), const T&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&>().ref<volatile T&>()), const volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&>().ref<const volatile T&>()), const volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&>().ref<T&&>()), const T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&>().ref<const T&&>()), const T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&>().ref<volatile T&&>()), const volatile T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&>().ref<const volatile T&&>()), const volatile T&&>); \
|
||||
\
|
||||
static_assert(is_same_v<decltype(declval<const node&&>().ref<T>()), const T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&&>().ref<const T>()), const T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&&>().ref<volatile T>()), const volatile T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&&>().ref<const volatile T>()), const volatile T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&&>().ref<T&>()), const T&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&&>().ref<const T&>()), const T&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&&>().ref<volatile T&>()), const volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&&>().ref<const volatile T&>()), const volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&&>().ref<T&&>()), const T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&&>().ref<const T&&>()), const T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&&>().ref<volatile T&&>()), const volatile T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<const node&&>().ref<const volatile T&&>()), const volatile T&&>)
|
||||
|
||||
CHECK_NODE_REF_TYPE(table);
|
||||
CHECK_NODE_REF_TYPE(array);
|
||||
CHECK_NODE_REF_TYPE(std::string);
|
||||
CHECK_NODE_REF_TYPE(int64_t);
|
||||
CHECK_NODE_REF_TYPE(double);
|
||||
CHECK_NODE_REF_TYPE(bool);
|
||||
CHECK_NODE_REF_TYPE(date);
|
||||
CHECK_NODE_REF_TYPE(time);
|
||||
CHECK_NODE_REF_TYPE(date_time);
|
||||
|
||||
#define CHECK_NODE_VIEW_REF_TYPE(T) \
|
||||
static_assert(is_same_v<decltype(declval<node_view<node>>().ref<T>()), T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<node>>().ref<const T>()), const T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<node>>().ref<volatile T>()), volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<node>>().ref<const volatile T>()), const volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<node>>().ref<T&>()), T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<node>>().ref<const T&>()), const T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<node>>().ref<volatile T&>()), volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<node>>().ref<const volatile T&>()), const volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<node>>().ref<T&&>()), T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<node>>().ref<const T&&>()), const T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<node>>().ref<volatile T&&>()), volatile T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<node>>().ref<const volatile T&&>()), const volatile T&&>)
|
||||
|
||||
CHECK_NODE_VIEW_REF_TYPE(table);
|
||||
CHECK_NODE_VIEW_REF_TYPE(array);
|
||||
CHECK_NODE_VIEW_REF_TYPE(std::string);
|
||||
CHECK_NODE_VIEW_REF_TYPE(int64_t);
|
||||
CHECK_NODE_VIEW_REF_TYPE(double);
|
||||
CHECK_NODE_VIEW_REF_TYPE(bool);
|
||||
CHECK_NODE_VIEW_REF_TYPE(date);
|
||||
CHECK_NODE_VIEW_REF_TYPE(time);
|
||||
CHECK_NODE_VIEW_REF_TYPE(date_time);
|
||||
|
||||
#define CHECK_CONST_NODE_VIEW_REF_TYPE(T) \
|
||||
static_assert(is_same_v<decltype(declval<node_view<const node>>().ref<T>()), const T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<const node>>().ref<const T>()), const T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<const node>>().ref<volatile T>()), const volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<const node>>().ref<const volatile T>()), const volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<const node>>().ref<T&>()), const T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<const node>>().ref<const T&>()), const T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<const node>>().ref<volatile T&>()), const volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<const node>>().ref<const volatile T&>()), const volatile T&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<const node>>().ref<T&&>()), const T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<const node>>().ref<const T&&>()), const T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<const node>>().ref<volatile T&&>()), const volatile T&&>); \
|
||||
static_assert(is_same_v<decltype(declval<node_view<const node>>().ref<const volatile T&&>()), const volatile T&&>)
|
||||
|
||||
CHECK_CONST_NODE_VIEW_REF_TYPE(table);
|
||||
CHECK_CONST_NODE_VIEW_REF_TYPE(array);
|
||||
CHECK_CONST_NODE_VIEW_REF_TYPE(std::string);
|
||||
CHECK_CONST_NODE_VIEW_REF_TYPE(int64_t);
|
||||
CHECK_CONST_NODE_VIEW_REF_TYPE(double);
|
||||
CHECK_CONST_NODE_VIEW_REF_TYPE(bool);
|
||||
CHECK_CONST_NODE_VIEW_REF_TYPE(date);
|
||||
CHECK_CONST_NODE_VIEW_REF_TYPE(time);
|
||||
CHECK_CONST_NODE_VIEW_REF_TYPE(date_time);
|
||||
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace leakproof
|
||||
{
|
||||
void table_created() noexcept;
|
||||
void array_created() noexcept;
|
||||
void value_created() noexcept;
|
||||
void table_destroyed() noexcept;
|
||||
void array_destroyed() noexcept;
|
||||
void value_destroyed() noexcept;
|
||||
}
|
||||
|
||||
#define TOML_LIFETIME_HOOKS 1
|
||||
#define TOML_TABLE_CREATED ::leakproof::table_created()
|
||||
#define TOML_TABLE_DESTROYED ::leakproof::table_destroyed()
|
||||
#define TOML_ARRAY_CREATED ::leakproof::array_created()
|
||||
#define TOML_ARRAY_DESTROYED ::leakproof::array_destroyed()
|
||||
#define TOML_VALUE_CREATED ::leakproof::value_created()
|
||||
#define TOML_VALUE_DESTROYED ::leakproof::value_destroyed()
|
@ -1,44 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
#pragma once
|
||||
|
||||
#include "settings.hpp"
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Weverything"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wall"
|
||||
#pragma GCC diagnostic ignored "-Wextra"
|
||||
#pragma GCC diagnostic ignored "-Wpadded"
|
||||
#pragma GCC diagnostic ignored "-Wfloat-equal"
|
||||
#elif defined(_MSC_VER)
|
||||
#pragma warning(push, 0)
|
||||
#pragma warning(disable : 4619)
|
||||
#pragma warning(disable : 4365)
|
||||
#pragma warning(disable : 4868)
|
||||
#pragma warning(disable : 5105)
|
||||
#pragma warning(disable : 5262)
|
||||
#pragma warning(disable : 5264)
|
||||
#endif
|
||||
|
||||
#if !defined(USE_VENDORED_LIBS) || USE_VENDORED_LIBS
|
||||
#include "../vendor/catch.hpp"
|
||||
#elif __has_include(<Catch2/single_include/catch2/catch.hpp>)
|
||||
#include <Catch2/single_include/catch2/catch.hpp>
|
||||
#elif __has_include(<catch2/catch.hpp>)
|
||||
#include <catch2/catch.hpp>
|
||||
#else
|
||||
#error Catch2 is missing!
|
||||
#endif
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#elif defined(_MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#endif
|
@ -1,98 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4619)
|
||||
#pragma warning(disable : 5262)
|
||||
#pragma warning(disable : 5264)
|
||||
#endif
|
||||
|
||||
#define CATCH_CONFIG_RUNNER
|
||||
#include "lib_catch2.hpp"
|
||||
#include <clocale>
|
||||
|
||||
#if LEAK_TESTS
|
||||
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <atomic>
|
||||
#include "leakproof.hpp"
|
||||
using namespace std::string_view_literals;
|
||||
|
||||
namespace leakproof
|
||||
{
|
||||
static std::atomic_llong total_created_ = 0LL;
|
||||
static std::atomic_llong tables_ = 0LL;
|
||||
static std::atomic_llong arrays_ = 0LL;
|
||||
static std::atomic_llong values_ = 0LL;
|
||||
|
||||
void table_created() noexcept
|
||||
{
|
||||
tables_++;
|
||||
total_created_++;
|
||||
}
|
||||
|
||||
void table_destroyed() noexcept
|
||||
{
|
||||
tables_--;
|
||||
}
|
||||
|
||||
void array_created() noexcept
|
||||
{
|
||||
arrays_++;
|
||||
total_created_++;
|
||||
}
|
||||
|
||||
void array_destroyed() noexcept
|
||||
{
|
||||
arrays_--;
|
||||
}
|
||||
|
||||
void value_created() noexcept
|
||||
{
|
||||
values_++;
|
||||
total_created_++;
|
||||
}
|
||||
|
||||
void value_destroyed() noexcept
|
||||
{
|
||||
values_--;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // LEAK_TESTS
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
#ifdef _WIN32
|
||||
SetConsoleOutputCP(65001);
|
||||
#endif
|
||||
std::setlocale(LC_ALL, "");
|
||||
std::locale::global(std::locale(""));
|
||||
if (auto result = Catch::Session().run(argc, argv))
|
||||
return result;
|
||||
|
||||
#if LEAK_TESTS
|
||||
constexpr auto handle_leak_result = [](std::string_view name, long long count) noexcept
|
||||
{
|
||||
std::cout << "\n"sv << name << ": "sv << std::right << std::setw(6) << count;
|
||||
if (count > 0LL)
|
||||
std::cout << " *** LEAK DETECTED ***"sv;
|
||||
if (count < 0LL)
|
||||
std::cout << " *** UNBALANCED LIFETIME CALLS ***"sv;
|
||||
return count == 0LL;
|
||||
};
|
||||
std::cout << "\n---------- leak test results ----------"sv;
|
||||
bool ok = true;
|
||||
ok = handle_leak_result("tables"sv, leakproof::tables_.load()) && ok;
|
||||
ok = handle_leak_result("arrays"sv, leakproof::arrays_.load()) && ok;
|
||||
ok = handle_leak_result("values"sv, leakproof::values_.load()) && ok;
|
||||
std::cout << "\n(total objects created: "sv << leakproof::total_created_.load() << ")"sv;
|
||||
std::cout << "\n---------------------------------------"sv;
|
||||
return ok ? 0 : -1;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
@ -1,629 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
|
||||
TEST_CASE("arrays - moving")
|
||||
{
|
||||
static constexpr auto filename = "foo.toml"sv;
|
||||
|
||||
parsing_should_succeed(
|
||||
FILE_LINE_ARGS,
|
||||
R"(test = [ "foo" ])"sv,
|
||||
[&](table&& tbl)
|
||||
{
|
||||
// sanity-check initial state of a freshly-parsed array
|
||||
auto arr1 = tbl["test"].as<array>();
|
||||
REQUIRE(arr1);
|
||||
CHECK(arr1->size() == 1u);
|
||||
CHECK(arr1->source().begin == source_position{ 1, 8 });
|
||||
CHECK(arr1->source().end == source_position{ 1, 17 });
|
||||
CHECK(arr1->source().path);
|
||||
CHECK(*arr1->source().path == filename);
|
||||
REQUIRE(arr1->get_as<std::string>(0u));
|
||||
CHECK(*arr1->get_as<std::string>(0u) == "foo"sv);
|
||||
|
||||
// sanity check the virtual type checks
|
||||
CHECK(arr1->type() == node_type::array);
|
||||
CHECK(!arr1->is_table());
|
||||
CHECK(arr1->is_array());
|
||||
CHECK(!arr1->is_array_of_tables());
|
||||
CHECK(!arr1->is_value());
|
||||
CHECK(!arr1->is_string());
|
||||
CHECK(!arr1->is_integer());
|
||||
CHECK(!arr1->is_floating_point());
|
||||
CHECK(!arr1->is_number());
|
||||
CHECK(!arr1->is_boolean());
|
||||
CHECK(!arr1->is_date());
|
||||
CHECK(!arr1->is_time());
|
||||
CHECK(!arr1->is_date_time());
|
||||
|
||||
// sanity check the virtual type casts (non-const)
|
||||
CHECK(!arr1->as_table());
|
||||
CHECK(arr1->as_array() == arr1);
|
||||
CHECK(!arr1->as_string());
|
||||
CHECK(!arr1->as_integer());
|
||||
CHECK(!arr1->as_floating_point());
|
||||
CHECK(!arr1->as_boolean());
|
||||
CHECK(!arr1->as_date());
|
||||
CHECK(!arr1->as_time());
|
||||
CHECK(!arr1->as_date_time());
|
||||
|
||||
// sanity check the virtual type casts (const)
|
||||
const auto carr1 = &std::as_const(*arr1);
|
||||
CHECK(!carr1->as_table());
|
||||
CHECK(carr1->as_array() == carr1);
|
||||
CHECK(!carr1->as_string());
|
||||
CHECK(!carr1->as_integer());
|
||||
CHECK(!carr1->as_floating_point());
|
||||
CHECK(!carr1->as_boolean());
|
||||
CHECK(!carr1->as_date());
|
||||
CHECK(!carr1->as_time());
|
||||
CHECK(!carr1->as_date_time());
|
||||
|
||||
// sanity-check initial state of default-constructed array
|
||||
array arr2;
|
||||
CHECK(arr2.source().begin == source_position{});
|
||||
CHECK(arr2.source().end == source_position{});
|
||||
CHECK(!arr2.source().path);
|
||||
CHECK(arr2.size() == 0u);
|
||||
|
||||
// check the results of move-assignment
|
||||
arr2 = std::move(*arr1);
|
||||
CHECK(arr2.source().begin == source_position{ 1, 8 });
|
||||
CHECK(arr2.source().end == source_position{ 1, 17 });
|
||||
CHECK(arr2.source().path);
|
||||
CHECK(*arr2.source().path == filename);
|
||||
CHECK(arr2.size() == 1u);
|
||||
REQUIRE(arr2.get_as<std::string>(0u));
|
||||
CHECK(*arr2.get_as<std::string>(0u) == "foo"sv);
|
||||
|
||||
// check that moved-from array is now the same as default-constructed
|
||||
CHECK(arr1->source().begin == source_position{});
|
||||
CHECK(arr1->source().end == source_position{});
|
||||
CHECK(!arr1->source().path);
|
||||
CHECK(arr1->size() == 0u);
|
||||
|
||||
// check the results of move-construction
|
||||
array arr3{ std::move(arr2) };
|
||||
CHECK(arr3.source().begin == source_position{ 1, 8 });
|
||||
CHECK(arr3.source().end == source_position{ 1, 17 });
|
||||
CHECK(arr3.source().path);
|
||||
CHECK(*arr3.source().path == filename);
|
||||
CHECK(arr3.size() == 1u);
|
||||
REQUIRE(arr3.get_as<std::string>(0u));
|
||||
CHECK(*arr3.get_as<std::string>(0u) == "foo"sv);
|
||||
|
||||
// check that moved-from array is now the same as default-constructed
|
||||
CHECK(arr2.source().begin == source_position{});
|
||||
CHECK(arr2.source().end == source_position{});
|
||||
CHECK(!arr2.source().path);
|
||||
CHECK(arr2.size() == 0u);
|
||||
},
|
||||
filename);
|
||||
}
|
||||
|
||||
TEST_CASE("arrays - copying")
|
||||
{
|
||||
static constexpr auto filename = "foo.toml"sv;
|
||||
|
||||
parsing_should_succeed(
|
||||
FILE_LINE_ARGS,
|
||||
R"(test = [ "foo" ])"sv,
|
||||
[&](table&& tbl)
|
||||
{
|
||||
// sanity-check initial state of a freshly-parsed array
|
||||
auto arr1 = tbl["test"].as<array>();
|
||||
REQUIRE(arr1);
|
||||
CHECK(arr1->size() == 1u);
|
||||
CHECK(arr1->source().begin == source_position{ 1, 8 });
|
||||
CHECK(arr1->source().end == source_position{ 1, 17 });
|
||||
CHECK(arr1->source().path);
|
||||
CHECK(*arr1->source().path == filename);
|
||||
REQUIRE(arr1->get_as<std::string>(0u));
|
||||
CHECK(*arr1->get_as<std::string>(0u) == "foo"sv);
|
||||
|
||||
// sanity-check initial state of default-constructed array
|
||||
array arr2;
|
||||
CHECK(arr2.source().begin == source_position{});
|
||||
CHECK(arr2.source().end == source_position{});
|
||||
CHECK(!arr2.source().path);
|
||||
CHECK(arr2.size() == 0u);
|
||||
|
||||
// check the results of copy-assignment
|
||||
arr2 = *arr1;
|
||||
CHECK(arr2.source().begin == source_position{});
|
||||
CHECK(arr2.source().end == source_position{});
|
||||
CHECK(!arr2.source().path);
|
||||
CHECK(arr2.size() == 1u);
|
||||
REQUIRE(arr2.get_as<std::string>(0u));
|
||||
CHECK(*arr2.get_as<std::string>(0u) == "foo"sv);
|
||||
CHECK(arr2 == *arr1);
|
||||
|
||||
// check the results of copy-construction
|
||||
array arr3{ arr2 };
|
||||
CHECK(arr3.source().begin == source_position{});
|
||||
CHECK(arr3.source().end == source_position{});
|
||||
CHECK(!arr3.source().path);
|
||||
CHECK(arr3.size() == 1u);
|
||||
REQUIRE(arr3.get_as<std::string>(0u));
|
||||
CHECK(*arr3.get_as<std::string>(0u) == "foo"sv);
|
||||
CHECK(arr3 == *arr1);
|
||||
CHECK(arr3 == arr2);
|
||||
},
|
||||
filename);
|
||||
}
|
||||
|
||||
TEST_CASE("arrays - construction")
|
||||
{
|
||||
{
|
||||
array arr;
|
||||
CHECK(arr.size() == 0u);
|
||||
CHECK(arr.empty());
|
||||
CHECK(arr.begin() == arr.end());
|
||||
CHECK(arr.cbegin() == arr.cend());
|
||||
CHECK(arr.source().begin == source_position{});
|
||||
CHECK(arr.source().end == source_position{});
|
||||
CHECK(!arr.source().path);
|
||||
CHECK(!arr.is_homogeneous());
|
||||
}
|
||||
|
||||
{
|
||||
array arr{ 42 };
|
||||
CHECK(arr.size() == 1u);
|
||||
CHECK(!arr.empty());
|
||||
CHECK(arr.begin() != arr.end());
|
||||
CHECK(arr.cbegin() != arr.cend());
|
||||
REQUIRE(arr.get_as<int64_t>(0u));
|
||||
CHECK(*arr.get_as<int64_t>(0u) == 42);
|
||||
CHECK(arr.get(0u) == &arr[0u]);
|
||||
CHECK(arr.is_homogeneous());
|
||||
CHECK(arr.is_homogeneous<int64_t>());
|
||||
CHECK(!arr.is_homogeneous<double>());
|
||||
CHECK(arr.get(0u) == &arr.at(0u));
|
||||
|
||||
const array& carr = arr;
|
||||
CHECK(carr.size() == 1u);
|
||||
CHECK(!carr.empty());
|
||||
CHECK(carr.begin() != carr.end());
|
||||
CHECK(carr.cbegin() != carr.cend());
|
||||
REQUIRE(carr.get_as<int64_t>(0u));
|
||||
CHECK(*carr.get_as<int64_t>(0u) == 42);
|
||||
CHECK(carr.get(0u) == &carr[0u]);
|
||||
CHECK(carr.is_homogeneous());
|
||||
CHECK(carr.is_homogeneous<int64_t>());
|
||||
CHECK(!carr.is_homogeneous<double>());
|
||||
CHECK(carr.get(0u) == &carr.at(0u));
|
||||
}
|
||||
|
||||
{
|
||||
array arr{ 42, "test"sv, 10.0f, array{}, value{ 3 } };
|
||||
CHECK(arr.size() == 5u);
|
||||
CHECK(!arr.empty());
|
||||
REQUIRE(arr.get_as<int64_t>(0u));
|
||||
CHECK(*arr.get_as<int64_t>(0u) == 42);
|
||||
CHECK(arr.get(0u) == &arr[0u]);
|
||||
REQUIRE(arr.get_as<std::string>(1u));
|
||||
CHECK(*arr.get_as<std::string>(1u) == "test"sv);
|
||||
CHECK(arr.get(1u) == &arr[1u]);
|
||||
REQUIRE(arr.get_as<double>(2u));
|
||||
CHECK(*arr.get_as<double>(2u) == 10.0);
|
||||
REQUIRE(arr.get_as<array>(3u));
|
||||
REQUIRE(arr.get_as<int64_t>(4u));
|
||||
CHECK(*arr.get_as<int64_t>(4u) == 3);
|
||||
CHECK(!arr.is_homogeneous());
|
||||
CHECK(arr.get(0u) == &arr.at(0u));
|
||||
CHECK(arr.get(1u) == &arr.at(1u));
|
||||
}
|
||||
|
||||
#if TOML_ENABLE_WINDOWS_COMPAT
|
||||
{
|
||||
array arr{ "mixed", "string"sv, L"test", L"kek"sv };
|
||||
CHECK(arr.size() == 4u);
|
||||
CHECK(arr.is_homogeneous());
|
||||
CHECK(arr.is_homogeneous<std::string>());
|
||||
CHECK(*arr.get_as<std::string>(0) == "mixed"sv);
|
||||
CHECK(*arr.get_as<std::string>(1) == "string"sv);
|
||||
CHECK(*arr.get_as<std::string>(2) == "test"sv);
|
||||
CHECK(*arr.get_as<std::string>(3) == "kek"sv);
|
||||
}
|
||||
#endif // TOML_ENABLE_WINDOWS_COMPAT
|
||||
}
|
||||
|
||||
TEST_CASE("arrays - equality")
|
||||
{
|
||||
array arr1{ 1, 2, 3 };
|
||||
CHECK(arr1 == arr1);
|
||||
{
|
||||
auto ilist = { 1, 2, 3 };
|
||||
CHECK(arr1 == ilist);
|
||||
CHECK(ilist == arr1);
|
||||
|
||||
ilist = { 2, 3, 4 };
|
||||
CHECK(arr1 != ilist);
|
||||
CHECK(ilist != arr1);
|
||||
|
||||
auto ivec = std::vector{ 1, 2, 3 };
|
||||
CHECK(arr1 == ivec);
|
||||
CHECK(ivec == arr1);
|
||||
|
||||
ivec = std::vector{ 2, 3, 4 };
|
||||
CHECK(arr1 != ivec);
|
||||
CHECK(ivec != arr1);
|
||||
}
|
||||
|
||||
array arr2{ 1, 2, 3 };
|
||||
CHECK(arr1 == arr2);
|
||||
|
||||
array arr3{ 1, 2 };
|
||||
CHECK(arr1 != arr3);
|
||||
|
||||
array arr4{ 1, 2, 3, 4 };
|
||||
CHECK(arr1 != arr4);
|
||||
|
||||
array arr5{ 1, 2, 3.0 };
|
||||
CHECK(arr1 != arr5);
|
||||
|
||||
array arr6{};
|
||||
CHECK(arr1 != arr6);
|
||||
CHECK(arr6 == arr6);
|
||||
|
||||
array arr7{};
|
||||
CHECK(arr6 == arr7);
|
||||
}
|
||||
|
||||
TEST_CASE("arrays - insertion and erasure")
|
||||
{
|
||||
array arr;
|
||||
|
||||
// insert(const_iterator pos, ElemType&& val)
|
||||
auto it = arr.insert(arr.cbegin(), 42);
|
||||
CHECK(it == arr.begin());
|
||||
CHECK(arr.size() == 1u);
|
||||
CHECK(!arr.empty());
|
||||
REQUIRE(arr.get_as<int64_t>(0u));
|
||||
CHECK(*arr.get_as<int64_t>(0u) == 42);
|
||||
REQUIRE(arr == array{ 42 });
|
||||
|
||||
// insert(const_iterator pos, size_t count, ElemType&& val)
|
||||
it = arr.insert(arr.cend(), 3, 10.0f);
|
||||
CHECK(it == arr.begin() + 1);
|
||||
CHECK(arr.size() == 4u);
|
||||
REQUIRE(arr.get_as<double>(1u));
|
||||
CHECK(*arr.get_as<double>(1u) == 10.0);
|
||||
REQUIRE(arr.get_as<double>(2u));
|
||||
CHECK(*arr.get_as<double>(2u) == 10.0);
|
||||
REQUIRE(arr.get_as<double>(3u));
|
||||
CHECK(*arr.get_as<double>(3u) == 10.0);
|
||||
REQUIRE(arr == array{ 42, 10.0, 10.0, 10.0 });
|
||||
|
||||
// emplace(const_iterator pos, Args &&... args) noexcept
|
||||
it = arr.emplace<array>(arr.cbegin(), 1, 2, 3);
|
||||
CHECK(it == arr.begin());
|
||||
CHECK(arr.size() == 5u);
|
||||
REQUIRE(arr.get_as<array>(0u));
|
||||
CHECK(arr.get_as<array>(0u)->size() == 3u);
|
||||
REQUIRE(arr == array{ array{ 1, 2, 3 }, 42, 10.0, 10.0, 10.0 });
|
||||
|
||||
// push_back(ElemType&& val) noexcept
|
||||
{
|
||||
arr.push_back("test"sv);
|
||||
auto& val = *arr.back().as_string();
|
||||
CHECK(arr.size() == 6u);
|
||||
REQUIRE(arr.get_as<std::string>(5u));
|
||||
CHECK(*arr.get_as<std::string>(5u) == "test"sv);
|
||||
CHECK(val == "test"sv);
|
||||
CHECK(&val == &arr.back());
|
||||
REQUIRE(arr == array{ array{ 1, 2, 3 }, 42, 10.0, 10.0, 10.0, "test"sv });
|
||||
}
|
||||
|
||||
// decltype(auto) emplace_back(Args&&... args) noexcept
|
||||
{
|
||||
decltype(auto) val = arr.emplace_back<std::string>("test2"sv);
|
||||
CHECK(arr.size() == 7u);
|
||||
REQUIRE(arr.get_as<std::string>(6u));
|
||||
CHECK(*arr.get_as<std::string>(6u) == "test2"sv);
|
||||
CHECK(val == "test2"sv);
|
||||
CHECK(&val == &arr.back());
|
||||
REQUIRE(arr == array{ array{ 1, 2, 3 }, 42, 10.0, 10.0, 10.0, "test"sv, "test2"sv });
|
||||
}
|
||||
|
||||
// erase(const_iterator pos) noexcept;
|
||||
it = arr.erase(arr.cbegin());
|
||||
REQUIRE(arr == array{ 42, 10.0, 10.0, 10.0, "test"sv, "test2"sv });
|
||||
CHECK(it == arr.begin());
|
||||
CHECK(arr.size() == 6u);
|
||||
|
||||
// erase(const_iterator first, const_iterator last) noexcept;
|
||||
it = arr.erase(arr.cbegin() + 2, arr.cbegin() + 4);
|
||||
REQUIRE(arr == array{ 42, 10.0, "test"sv, "test2"sv });
|
||||
CHECK(it == arr.begin() + 2);
|
||||
CHECK(arr.size() == 4u);
|
||||
|
||||
arr.pop_back();
|
||||
REQUIRE(arr == array{ 42, 10.0, "test"sv });
|
||||
CHECK(arr.size() == 3u);
|
||||
|
||||
arr.clear();
|
||||
REQUIRE(arr == array{});
|
||||
CHECK(arr.size() == 0u);
|
||||
CHECK(arr.empty());
|
||||
|
||||
// insert(const_iterator pos, Iter first, Iter last)
|
||||
{
|
||||
auto vals = std::vector{ 1.0, 2.0, 3.0 };
|
||||
arr.insert(arr.cbegin(), vals.begin(), vals.end());
|
||||
CHECK(arr.size() == 3u);
|
||||
REQUIRE(arr.get_as<double>(0u));
|
||||
CHECK(*arr.get_as<double>(0u) == 1.0);
|
||||
REQUIRE(arr.get_as<double>(1u));
|
||||
CHECK(*arr.get_as<double>(1u) == 2.0);
|
||||
REQUIRE(arr.get_as<double>(2u));
|
||||
CHECK(*arr.get_as<double>(2u) == 3.0);
|
||||
|
||||
arr.insert(arr.cbegin() + 1, vals.begin(), vals.end());
|
||||
CHECK(arr.size() == 6u);
|
||||
REQUIRE(arr.get_as<double>(0u));
|
||||
CHECK(*arr.get_as<double>(0u) == 1.0);
|
||||
REQUIRE(arr.get_as<double>(1u));
|
||||
CHECK(*arr.get_as<double>(1u) == 1.0);
|
||||
REQUIRE(arr.get_as<double>(2u));
|
||||
CHECK(*arr.get_as<double>(2u) == 2.0);
|
||||
REQUIRE(arr.get_as<double>(3u));
|
||||
CHECK(*arr.get_as<double>(3u) == 3.0);
|
||||
REQUIRE(arr.get_as<double>(4u));
|
||||
CHECK(*arr.get_as<double>(4u) == 2.0);
|
||||
REQUIRE(arr.get_as<double>(5u));
|
||||
CHECK(*arr.get_as<double>(5u) == 3.0);
|
||||
}
|
||||
|
||||
// insert(const_iterator pos, Iter first, Iter last) (with move iterators)
|
||||
{
|
||||
arr.clear();
|
||||
|
||||
std::vector<std::string> vals{ "foo", "bar", "kek" };
|
||||
arr.insert(arr.cbegin(), std::make_move_iterator(vals.begin()), std::make_move_iterator(vals.end()));
|
||||
CHECK(arr.size() == 3u);
|
||||
REQUIRE(arr.get_as<std::string>(0));
|
||||
CHECK(*arr.get_as<std::string>(0) == "foo");
|
||||
REQUIRE(arr.get_as<std::string>(1));
|
||||
CHECK(*arr.get_as<std::string>(1) == "bar");
|
||||
REQUIRE(arr.get_as<std::string>(2));
|
||||
CHECK(*arr.get_as<std::string>(2) == "kek");
|
||||
|
||||
REQUIRE(vals.size() == 3u);
|
||||
CHECK(vals[0] == "");
|
||||
CHECK(vals[1] == "");
|
||||
CHECK(vals[2] == "");
|
||||
}
|
||||
|
||||
// iterator insert(const_iterator pos, std::initializer_list<ElemType> ilist) noexcept
|
||||
{
|
||||
arr.clear();
|
||||
|
||||
arr.insert(arr.cbegin(), { 1.0, 2.0, 3.0 });
|
||||
CHECK(arr.size() == 3u);
|
||||
REQUIRE(arr.get_as<double>(0u));
|
||||
CHECK(*arr.get_as<double>(0u) == 1.0);
|
||||
REQUIRE(arr.get_as<double>(1u));
|
||||
CHECK(*arr.get_as<double>(1u) == 2.0);
|
||||
REQUIRE(arr.get_as<double>(2u));
|
||||
CHECK(*arr.get_as<double>(2u) == 3.0);
|
||||
|
||||
arr.insert(arr.cbegin() + 1, { 1.0, 2.0, 3.0 });
|
||||
CHECK(arr.size() == 6u);
|
||||
REQUIRE(arr.get_as<double>(0u));
|
||||
CHECK(*arr.get_as<double>(0u) == 1.0);
|
||||
REQUIRE(arr.get_as<double>(1u));
|
||||
CHECK(*arr.get_as<double>(1u) == 1.0);
|
||||
REQUIRE(arr.get_as<double>(2u));
|
||||
CHECK(*arr.get_as<double>(2u) == 2.0);
|
||||
REQUIRE(arr.get_as<double>(3u));
|
||||
CHECK(*arr.get_as<double>(3u) == 3.0);
|
||||
REQUIRE(arr.get_as<double>(4u));
|
||||
CHECK(*arr.get_as<double>(4u) == 2.0);
|
||||
REQUIRE(arr.get_as<double>(5u));
|
||||
CHECK(*arr.get_as<double>(5u) == 3.0);
|
||||
}
|
||||
|
||||
// iterator replace(const_iterator pos, ElemType&& elem) noexcept
|
||||
{
|
||||
arr.clear();
|
||||
arr.insert(arr.begin(), { 1, 2, 3 });
|
||||
CHECK(arr == array{ 1, 2, 3 });
|
||||
arr.replace(arr.begin() + 1u, "two"sv);
|
||||
CHECK(arr == array{ 1, "two"sv, 3 });
|
||||
}
|
||||
|
||||
#if TOML_ENABLE_WINDOWS_COMPAT
|
||||
|
||||
arr.clear();
|
||||
it = arr.insert(arr.cbegin(), L"test");
|
||||
CHECK(*arr.get_as<std::string>(0u) == "test"sv);
|
||||
|
||||
it = arr.emplace<std::string>(arr.cbegin(), L"test2"sv);
|
||||
CHECK(*arr.get_as<std::string>(0u) == "test2"sv);
|
||||
|
||||
arr.push_back(L"test3"s);
|
||||
CHECK(*arr.back().as_string() == "test3"sv);
|
||||
|
||||
arr.emplace_back<std::string>(L"test4");
|
||||
CHECK(*arr.back().as_string() == "test4"sv);
|
||||
|
||||
#endif // TOML_ENABLE_WINDOWS_COMPAT
|
||||
|
||||
// push_back with value_flags
|
||||
{
|
||||
arr.clear();
|
||||
|
||||
auto hex = toml::value{ 1 };
|
||||
hex.flags(value_flags::format_as_hexadecimal);
|
||||
CHECK(hex.flags() == value_flags::format_as_hexadecimal);
|
||||
|
||||
arr.push_back(hex);
|
||||
CHECK(hex.flags() == value_flags::format_as_hexadecimal);
|
||||
CHECK(arr.back().as_integer()->flags() == value_flags::format_as_hexadecimal);
|
||||
|
||||
arr.push_back(std::move(hex));
|
||||
CHECK(hex.flags() == value_flags{});
|
||||
CHECK(arr.back().as_integer()->flags() == value_flags::format_as_hexadecimal);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("arrays - flattening")
|
||||
{
|
||||
{
|
||||
array arr{
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
array{ 4, 5 },
|
||||
6,
|
||||
array{},
|
||||
array{ 7,
|
||||
array{
|
||||
8,
|
||||
array{ 9 },
|
||||
10,
|
||||
array{},
|
||||
},
|
||||
11 },
|
||||
};
|
||||
arr.flatten();
|
||||
CHECK(arr == array{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 });
|
||||
}
|
||||
|
||||
{
|
||||
array arr{ array{},
|
||||
array{ inserter{ array{} } },
|
||||
array{ array{}, array{ array{}, array{} }, array{} },
|
||||
array{ array{ array{ array{ array{ array{ 1 } } } } } } };
|
||||
arr.flatten();
|
||||
CHECK(arr == array{ 1 });
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("arrays - pruning")
|
||||
{
|
||||
// [ 1, [ 2, [], 3 ], { 4 = 5, 6 = 7 }, [], 8, [{}], 9, 10 ]
|
||||
const auto arr =
|
||||
array{ 1, array{ 2, array{}, 3 }, table{ { "4", 5 }, { "6", array{} } }, array{}, 8, array{ table{} }, 9, 10 };
|
||||
|
||||
// [ 1, [ 2, 3 ], { 4 = 5, 6 = 7 }, 8, 9, 10 ]
|
||||
const auto pruned_recursive = array{ 1, array{ 2, 3 }, table{ { "4", 5 } }, 8, 9, 10 };
|
||||
CHECK(array{ arr }.prune(true) == pruned_recursive);
|
||||
|
||||
// [ 1, [ 2, [], 3 ], { 4 = 5, 6 = 7 }, [], 8, [{}], 9, 10 ]
|
||||
const auto pruned_flat =
|
||||
array{ 1, array{ 2, array{}, 3 }, table{ { "4", 5 }, { "6", array{} } }, 8, array{ table{} }, 9, 10 };
|
||||
CHECK(array{ arr }.prune(false) == pruned_flat);
|
||||
}
|
||||
|
||||
TEST_CASE("arrays - resizing and truncation")
|
||||
{
|
||||
array arr{ 1, 2, 3, 4, 5 };
|
||||
CHECK(arr.size() == 5u);
|
||||
|
||||
// truncate with no change
|
||||
arr.truncate(5u);
|
||||
CHECK(arr.size() == 5u);
|
||||
CHECK(arr == array{ 1, 2, 3, 4, 5 });
|
||||
|
||||
// truncate down to three elements
|
||||
arr.truncate(3u);
|
||||
CHECK(arr.size() == 3u);
|
||||
CHECK(arr == array{ 1, 2, 3 });
|
||||
|
||||
// resize down to two elements
|
||||
arr.resize(2u, 42);
|
||||
CHECK(arr.size() == 2u);
|
||||
CHECK(arr == array{ 1, 2 });
|
||||
|
||||
// resize with no change
|
||||
arr.resize(2u, 42);
|
||||
CHECK(arr.size() == 2u);
|
||||
CHECK(arr == array{ 1, 2 });
|
||||
|
||||
// resize up to six elements
|
||||
arr.resize(6u, 42);
|
||||
CHECK(arr.size() == 6u);
|
||||
CHECK(arr == array{ 1, 2, 42, 42, 42, 42 });
|
||||
}
|
||||
|
||||
TEST_CASE("arrays - for_each")
|
||||
{
|
||||
const auto arr = array{ 1, 2.0, 3, "four", false };
|
||||
|
||||
SECTION("type checking")
|
||||
{
|
||||
int count = 0;
|
||||
int ints = 0;
|
||||
int floats = 0;
|
||||
int numbers = 0;
|
||||
int strings = 0;
|
||||
int bools = 0;
|
||||
arr.for_each(
|
||||
[&](const auto& v) noexcept
|
||||
{
|
||||
count++;
|
||||
if constexpr (toml::is_integer<decltype(v)>)
|
||||
ints++;
|
||||
if constexpr (toml::is_floating_point<decltype(v)>)
|
||||
floats++;
|
||||
if constexpr (toml::is_number<decltype(v)>)
|
||||
numbers++;
|
||||
if constexpr (toml::is_string<decltype(v)>)
|
||||
strings++;
|
||||
if constexpr (toml::is_boolean<decltype(v)>)
|
||||
bools++;
|
||||
});
|
||||
CHECK(count == 5);
|
||||
CHECK(ints == 2);
|
||||
CHECK(floats == 1);
|
||||
CHECK(numbers == (ints + floats));
|
||||
CHECK(strings == 1);
|
||||
CHECK(bools == 1);
|
||||
}
|
||||
|
||||
#if !TOML_RETURN_BOOL_FROM_FOR_EACH_BROKEN
|
||||
|
||||
SECTION("early-exit (elem, index)")
|
||||
{
|
||||
int count = 0;
|
||||
arr.for_each(
|
||||
[&](const auto& elem, size_t /*idx*/) noexcept -> bool
|
||||
{
|
||||
count++;
|
||||
return !toml::is_string<decltype(elem)>;
|
||||
});
|
||||
CHECK(count == 4);
|
||||
}
|
||||
|
||||
SECTION("early-exit (elem)")
|
||||
{
|
||||
int count = 0;
|
||||
arr.for_each(
|
||||
[&](const auto& elem) noexcept -> bool
|
||||
{
|
||||
count++;
|
||||
return !toml::is_string<decltype(elem)>;
|
||||
});
|
||||
CHECK(count == 4);
|
||||
}
|
||||
|
||||
SECTION("early-exit (index, elem)")
|
||||
{
|
||||
int count = 0;
|
||||
arr.for_each(
|
||||
[&](size_t /*idx*/, const auto& elem) noexcept -> bool
|
||||
{
|
||||
count++;
|
||||
return !toml::is_string<decltype(elem)>;
|
||||
});
|
||||
CHECK(count == 4);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
@ -1,115 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
|
||||
#if !TOML_EXCEPTIONS
|
||||
|
||||
TEST_CASE("parse_result - good parse")
|
||||
{
|
||||
auto result = "key = true"_toml;
|
||||
static_assert(std::is_same_v<decltype(result), parse_result>);
|
||||
static_assert(!std::is_same_v<decltype(result), table>);
|
||||
|
||||
REQUIRE(result.succeeded());
|
||||
REQUIRE(!result.failed());
|
||||
REQUIRE(result);
|
||||
|
||||
REQUIRE(!result.table().empty());
|
||||
REQUIRE(result.table().size() == 1);
|
||||
REQUIRE(!std::move(result).table().empty());
|
||||
REQUIRE(!static_cast<const parse_result&>(result).table().empty());
|
||||
|
||||
REQUIRE(!static_cast<table&>(result).empty());
|
||||
REQUIRE(!static_cast<table&&>(result).empty());
|
||||
REQUIRE(!static_cast<const table&>(result).empty());
|
||||
|
||||
auto& tbl = static_cast<table&>(result);
|
||||
CHECK(tbl["key"sv]);
|
||||
CHECK(result["key"sv]);
|
||||
CHECK(&result["key"sv].ref<bool>() == &tbl["key"sv].ref<bool>());
|
||||
CHECK(result.begin() == tbl.begin());
|
||||
CHECK(result.end() == tbl.end());
|
||||
CHECK(result.begin() != tbl.end());
|
||||
CHECK(result.cbegin() == tbl.cbegin());
|
||||
CHECK(result.cend() == tbl.cend());
|
||||
CHECK(result.cbegin() != tbl.cend());
|
||||
|
||||
auto& cresult = static_cast<const parse_result&>(result);
|
||||
auto& ctbl = static_cast<const table&>(cresult);
|
||||
CHECK(cresult.begin() == ctbl.begin());
|
||||
CHECK(cresult.end() == ctbl.end());
|
||||
CHECK(cresult.begin() != ctbl.end());
|
||||
CHECK(cresult.cbegin() == ctbl.cbegin());
|
||||
CHECK(cresult.cend() == ctbl.cend());
|
||||
CHECK(cresult.cbegin() != ctbl.cend());
|
||||
CHECK(ctbl["key"sv]);
|
||||
CHECK(cresult["key"sv]);
|
||||
CHECK(&cresult["key"sv].ref<bool>() == &ctbl["key"sv].ref<bool>());
|
||||
|
||||
size_t tbl_iterations{};
|
||||
for (auto&& [k, v] : tbl)
|
||||
{
|
||||
(void)k;
|
||||
(void)v;
|
||||
tbl_iterations++;
|
||||
}
|
||||
size_t result_iterations{};
|
||||
for (auto& [k, v] : result)
|
||||
{
|
||||
(void)k;
|
||||
(void)v;
|
||||
result_iterations++;
|
||||
}
|
||||
size_t cresult_iterations{};
|
||||
for (auto [k, v] : cresult)
|
||||
{
|
||||
(void)k;
|
||||
(void)v;
|
||||
cresult_iterations++;
|
||||
}
|
||||
CHECK(tbl_iterations == tbl.size());
|
||||
CHECK(tbl_iterations == result_iterations);
|
||||
CHECK(tbl_iterations == cresult_iterations);
|
||||
}
|
||||
|
||||
TEST_CASE("parse_result - bad parse")
|
||||
{
|
||||
auto result = "key = trUe"_toml;
|
||||
static_assert(std::is_same_v<decltype(result), parse_result>);
|
||||
static_assert(!std::is_same_v<decltype(result), table>);
|
||||
|
||||
REQUIRE(!result.succeeded());
|
||||
REQUIRE(result.failed());
|
||||
REQUIRE(!result);
|
||||
|
||||
CHECK(!result["key"sv]);
|
||||
CHECK(result.begin() == decltype(result.begin()){});
|
||||
CHECK(result.end() == decltype(result.end()){});
|
||||
CHECK(result.cbegin() == decltype(result.cbegin()){});
|
||||
CHECK(result.cend() == decltype(result.cend()){});
|
||||
|
||||
auto& cresult = static_cast<const parse_result&>(result);
|
||||
CHECK(!result["key"sv]);
|
||||
CHECK(cresult.begin() == decltype(cresult.begin()){});
|
||||
CHECK(cresult.end() == decltype(cresult.end()){});
|
||||
CHECK(cresult.cbegin() == decltype(cresult.cbegin()){});
|
||||
CHECK(cresult.cend() == decltype(cresult.cend()){});
|
||||
|
||||
for (auto [k, v] : result)
|
||||
{
|
||||
(void)k;
|
||||
(void)v;
|
||||
FAIL("This code should not run");
|
||||
}
|
||||
for (auto [k, v] : cresult)
|
||||
{
|
||||
(void)k;
|
||||
(void)v;
|
||||
FAIL("This code should not run");
|
||||
}
|
||||
}
|
||||
|
||||
#endif //!TOML_EXCEPTIONS
|
@ -1,672 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
|
||||
TEST_CASE("tables - moving")
|
||||
{
|
||||
static constexpr auto filename = "foo.toml"sv;
|
||||
|
||||
parsing_should_succeed(
|
||||
FILE_LINE_ARGS,
|
||||
R"(test = { val1 = "foo" })"sv,
|
||||
[&](table&& tbl)
|
||||
{
|
||||
// sanity-check initial state of a freshly-parsed table
|
||||
REQUIRE(tbl["test"].as<table>());
|
||||
CHECK(tbl["test"].as<table>()->size() == 1u);
|
||||
CHECK(tbl["test"].as<table>()->source().begin == source_position{ 1, 8 });
|
||||
CHECK(tbl["test"].as<table>()->source().end == source_position{ 1, 24 });
|
||||
CHECK(tbl["test"].node() == tbl.get("test"sv));
|
||||
CHECK(tbl["test"].node() == &tbl.at("test"sv));
|
||||
|
||||
// sanity-check initial state of a freshly-parsed table (const)
|
||||
const table& ctbl = tbl;
|
||||
REQUIRE(ctbl["test"].as<table>());
|
||||
CHECK(ctbl["test"].as<table>()->size() == 1u);
|
||||
CHECK(ctbl["test"].as<table>()->source().begin == source_position{ 1, 8 });
|
||||
CHECK(ctbl["test"].as<table>()->source().end == source_position{ 1, 24 });
|
||||
CHECK(ctbl["test"].node() == ctbl.get("test"sv));
|
||||
CHECK(ctbl["test"].node() == &ctbl.at("test"sv));
|
||||
|
||||
// sanity check the virtual type checks
|
||||
CHECK(tbl.type() == node_type::table);
|
||||
CHECK(tbl.is_table());
|
||||
CHECK(!tbl.is_array());
|
||||
CHECK(!tbl.is_array_of_tables());
|
||||
CHECK(!tbl.is_value());
|
||||
CHECK(!tbl.is_string());
|
||||
CHECK(!tbl.is_integer());
|
||||
CHECK(!tbl.is_floating_point());
|
||||
CHECK(!tbl.is_number());
|
||||
CHECK(!tbl.is_boolean());
|
||||
CHECK(!tbl.is_date());
|
||||
CHECK(!tbl.is_time());
|
||||
CHECK(!tbl.is_date_time());
|
||||
|
||||
// sanity check the virtual type casts (non-const)
|
||||
CHECK(tbl.as_table() == &tbl);
|
||||
CHECK(!tbl.as_array());
|
||||
CHECK(!tbl.as_string());
|
||||
CHECK(!tbl.as_integer());
|
||||
CHECK(!tbl.as_floating_point());
|
||||
CHECK(!tbl.as_boolean());
|
||||
CHECK(!tbl.as_date());
|
||||
CHECK(!tbl.as_time());
|
||||
CHECK(!tbl.as_date_time());
|
||||
|
||||
// sanity check the virtual type casts (const)
|
||||
CHECK(ctbl.as_table() == &ctbl);
|
||||
CHECK(!ctbl.as_array());
|
||||
CHECK(!ctbl.as_string());
|
||||
CHECK(!ctbl.as_integer());
|
||||
CHECK(!ctbl.as_floating_point());
|
||||
CHECK(!ctbl.as_boolean());
|
||||
CHECK(!ctbl.as_date());
|
||||
CHECK(!ctbl.as_time());
|
||||
CHECK(!ctbl.as_date_time());
|
||||
|
||||
// sanity-check initial state of default-constructed table
|
||||
table tbl2;
|
||||
CHECK(tbl2.source().begin == source_position{});
|
||||
CHECK(tbl2.source().end == source_position{});
|
||||
CHECK(!tbl2.source().path);
|
||||
CHECK(tbl2.size() == 0u);
|
||||
|
||||
// check the results of move-assignment
|
||||
tbl2 = std::move(tbl);
|
||||
CHECK(tbl2.source().begin == source_position{ 1, 1 });
|
||||
CHECK(tbl2.source().end == source_position{ 1, 24 });
|
||||
CHECK(tbl2.source().path);
|
||||
CHECK(*tbl2.source().path == filename);
|
||||
CHECK(tbl2.size() == 1u);
|
||||
REQUIRE(tbl2["test"].as<table>());
|
||||
CHECK(tbl2["test"].as<table>()->size() == 1u);
|
||||
CHECK(tbl2["test"]["val1"] == "foo"sv);
|
||||
|
||||
// check that moved-from table is now the same as default-constructed
|
||||
CHECK(tbl.source().begin == source_position{});
|
||||
CHECK(tbl.source().end == source_position{});
|
||||
CHECK(!tbl.source().path);
|
||||
CHECK(tbl.size() == 0u);
|
||||
CHECK(!tbl["test"].as<table>());
|
||||
|
||||
// check the results of move-construction
|
||||
table tbl3{ std::move(tbl2) };
|
||||
CHECK(tbl3.source().begin == source_position{ 1, 1 });
|
||||
CHECK(tbl3.source().end == source_position{ 1, 24 });
|
||||
CHECK(tbl3.source().path);
|
||||
CHECK(*tbl3.source().path == filename);
|
||||
CHECK(tbl3.size() == 1u);
|
||||
REQUIRE(tbl3["test"].as<table>());
|
||||
CHECK(tbl3["test"].as<table>()->size() == 1u);
|
||||
CHECK(tbl3["test"]["val1"] == "foo"sv);
|
||||
|
||||
// check that moved-from table is now the same as default-constructed
|
||||
CHECK(tbl2.source().begin == source_position{});
|
||||
CHECK(tbl2.source().end == source_position{});
|
||||
CHECK(!tbl2.source().path);
|
||||
CHECK(tbl2.size() == 0u);
|
||||
CHECK(!tbl2["test"].as<table>());
|
||||
},
|
||||
filename);
|
||||
}
|
||||
|
||||
TEST_CASE("tables - copying")
|
||||
{
|
||||
static constexpr auto filename = "foo.toml"sv;
|
||||
|
||||
parsing_should_succeed(
|
||||
FILE_LINE_ARGS,
|
||||
R"(test = { val1 = "foo" })"sv,
|
||||
[&](table&& tbl)
|
||||
{
|
||||
// sanity-check initial state of a freshly-parsed table
|
||||
REQUIRE(tbl["test"].as<table>());
|
||||
CHECK(tbl["test"].as<table>()->size() == 1u);
|
||||
CHECK(tbl["test"].as<table>()->source().begin == source_position{ 1, 8 });
|
||||
CHECK(tbl["test"].as<table>()->source().end == source_position{ 1, 24 });
|
||||
CHECK(tbl["test"]["val1"] == "foo");
|
||||
|
||||
// sanity-check initial state of default-constructed table
|
||||
table tbl2;
|
||||
CHECK(tbl2.source().begin == source_position{});
|
||||
CHECK(tbl2.source().end == source_position{});
|
||||
CHECK(!tbl2.source().path);
|
||||
CHECK(tbl2.size() == 0u);
|
||||
|
||||
// check the results of copy-assignment
|
||||
tbl2 = tbl;
|
||||
CHECK(tbl2.source().begin == source_position{});
|
||||
CHECK(tbl2.source().end == source_position{});
|
||||
CHECK(!tbl2.source().path);
|
||||
CHECK(tbl2.size() == 1u);
|
||||
REQUIRE(tbl2["test"].as<table>());
|
||||
CHECK(tbl2["test"].as<table>()->size() == 1u);
|
||||
CHECK(tbl2["test"]["val1"] == "foo"sv);
|
||||
CHECK(tbl2 == tbl);
|
||||
|
||||
// check the results of copy-construction
|
||||
table tbl3{ tbl2 };
|
||||
CHECK(tbl3.source().begin == source_position{});
|
||||
CHECK(tbl3.source().end == source_position{});
|
||||
CHECK(!tbl3.source().path);
|
||||
CHECK(tbl3.size() == 1u);
|
||||
REQUIRE(tbl3["test"].as<table>());
|
||||
CHECK(tbl3["test"].as<table>()->size() == 1u);
|
||||
CHECK(tbl3["test"]["val1"] == "foo"sv);
|
||||
CHECK(tbl3 == tbl2);
|
||||
CHECK(tbl3 == tbl);
|
||||
},
|
||||
filename);
|
||||
}
|
||||
|
||||
TEST_CASE("tables - construction")
|
||||
{
|
||||
{
|
||||
table tbl;
|
||||
CHECK(tbl.size() == 0u);
|
||||
CHECK(tbl.empty());
|
||||
CHECK(tbl.begin() == tbl.end());
|
||||
CHECK(tbl.cbegin() == tbl.cend());
|
||||
CHECK(tbl.source().begin == source_position{});
|
||||
CHECK(tbl.source().end == source_position{});
|
||||
CHECK(!tbl.source().path);
|
||||
}
|
||||
|
||||
{
|
||||
table tbl{ { "foo"sv, 42 } };
|
||||
CHECK(tbl.size() == 1u);
|
||||
CHECK(!tbl.empty());
|
||||
CHECK(tbl.begin() != tbl.end());
|
||||
CHECK(tbl.cbegin() != tbl.cend());
|
||||
REQUIRE(tbl.get_as<int64_t>("foo"sv));
|
||||
CHECK(*tbl.get_as<int64_t>("foo"sv) == 42);
|
||||
}
|
||||
|
||||
{
|
||||
table tbl{ { "foo"sv, 42 }, { "bar"sv, 10.0 }, { "kek"sv, false }, { "qux"sv, array{ 1 } } };
|
||||
CHECK(tbl.size() == 4u);
|
||||
CHECK(!tbl.empty());
|
||||
REQUIRE(tbl.get_as<int64_t>("foo"sv));
|
||||
CHECK(*tbl.get_as<int64_t>("foo"sv) == 42);
|
||||
REQUIRE(tbl.get_as<double>("bar"sv));
|
||||
CHECK(*tbl.get_as<double>("bar"sv) == 10.0);
|
||||
REQUIRE(tbl.get_as<bool>("kek"sv));
|
||||
CHECK(*tbl.get_as<bool>("kek"sv) == false);
|
||||
REQUIRE(tbl.get_as<array>("qux"sv));
|
||||
CHECK(*tbl.get_as<array>("qux"sv) == array{ 1 });
|
||||
}
|
||||
|
||||
#if TOML_ENABLE_WINDOWS_COMPAT
|
||||
{
|
||||
table tbl{ { L"foo", L"test1" },
|
||||
{ L"bar"sv, L"test2"sv },
|
||||
{ L"kek"s, L"test3"sv },
|
||||
{ L"qux"sv.data(), L"test4"sv.data() } };
|
||||
CHECK(tbl.size() == 4u);
|
||||
CHECK(!tbl.empty());
|
||||
REQUIRE(tbl.get_as<std::string>("foo"sv));
|
||||
CHECK(*tbl.get_as<std::string>("foo"sv) == "test1"sv);
|
||||
REQUIRE(tbl.get_as<std::string>("bar"sv));
|
||||
CHECK(*tbl.get_as<std::string>("bar"sv) == "test2"sv);
|
||||
REQUIRE(tbl.get_as<std::string>("kek"sv));
|
||||
CHECK(*tbl.get_as<std::string>("kek"sv) == "test3"sv);
|
||||
REQUIRE(tbl.get_as<std::string>("qux"sv));
|
||||
CHECK(*tbl.get_as<std::string>("qux"sv) == "test4"sv);
|
||||
}
|
||||
#endif // TOML_ENABLE_WINDOWS_COMPAT
|
||||
}
|
||||
|
||||
TEST_CASE("tables - equality")
|
||||
{
|
||||
static constexpr const char* one = "one";
|
||||
|
||||
table tbl1{ { one, 1 }, { "two", 2 }, { "three", 3 } };
|
||||
CHECK(tbl1 == tbl1);
|
||||
|
||||
table tbl2{ { "one"sv, 1 }, { "two"sv, 2 }, { "three"sv, 3 } };
|
||||
CHECK(tbl1 == tbl2);
|
||||
|
||||
table tbl3{ { "one"sv, 1 }, { "two"sv, 2 } };
|
||||
CHECK(tbl1 != tbl3);
|
||||
|
||||
table tbl4{ { "one"sv, 1 }, { "two"sv, 2 }, { "three"sv, 3 }, { "four"sv, 4 } };
|
||||
CHECK(tbl1 != tbl4);
|
||||
|
||||
table tbl5{ { "one"sv, 1 }, { "two"sv, 2 }, { "three"sv, 3.0 } };
|
||||
CHECK(tbl1 != tbl5);
|
||||
|
||||
table tbl6;
|
||||
CHECK(tbl1 != tbl6);
|
||||
CHECK(tbl6 == tbl6);
|
||||
|
||||
table tbl7;
|
||||
CHECK(tbl6 == tbl7);
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
template <typename T>
|
||||
static auto advance(T iter, ptrdiff_t offset)
|
||||
{
|
||||
while (offset > 0)
|
||||
{
|
||||
iter++;
|
||||
offset--;
|
||||
}
|
||||
while (offset < 0)
|
||||
{
|
||||
iter--;
|
||||
offset++;
|
||||
}
|
||||
return iter;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("tables - insertion and erasure")
|
||||
{
|
||||
table tbl;
|
||||
auto res = tbl.insert("a", 42);
|
||||
CHECK(res.first == tbl.begin());
|
||||
CHECK(res.second == true);
|
||||
CHECK(tbl.size() == 1u);
|
||||
CHECK(!tbl.empty());
|
||||
REQUIRE(tbl.get_as<int64_t>("a"sv));
|
||||
CHECK(*tbl.get_as<int64_t>("a"sv) == 42);
|
||||
REQUIRE(tbl == table{ { "a"sv, 42 } });
|
||||
|
||||
res = tbl.insert("a", 69);
|
||||
CHECK(res.first == tbl.begin());
|
||||
CHECK(res.second == false);
|
||||
CHECK(tbl.size() == 1u);
|
||||
REQUIRE(tbl.get_as<int64_t>("a"));
|
||||
CHECK(*tbl.get_as<int64_t>("a") == 42);
|
||||
REQUIRE(tbl == table{ { "a"sv, 42 } });
|
||||
|
||||
static constexpr const char* a = "a";
|
||||
res = tbl.insert_or_assign(a, 69);
|
||||
CHECK(res.first == tbl.begin());
|
||||
CHECK(res.second == false); // should assign
|
||||
CHECK(tbl.size() == 1u);
|
||||
REQUIRE(tbl.get_as<int64_t>("a"));
|
||||
CHECK(*tbl.get_as<int64_t>("a") == 69);
|
||||
REQUIRE(tbl == table{ { "a"sv, 69 } });
|
||||
|
||||
res = tbl.insert_or_assign("b", "kek");
|
||||
CHECK(res.first == advance(tbl.begin(), 1));
|
||||
CHECK(res.second == true); // should insert
|
||||
CHECK(tbl.size() == 2u);
|
||||
REQUIRE(tbl.get_as<std::string>("b"));
|
||||
CHECK(*tbl.get_as<std::string>("b") == "kek"sv);
|
||||
REQUIRE(tbl == table{ { "a"sv, 69 }, { "b"sv, "kek" } });
|
||||
|
||||
res = tbl.emplace<array>("c", 1, 2, 3);
|
||||
CHECK(res.first == advance(tbl.begin(), 2));
|
||||
CHECK(res.second == true);
|
||||
CHECK(tbl.size() == 3u);
|
||||
REQUIRE(tbl.get_as<array>("c"));
|
||||
CHECK(*tbl.get_as<array>("c") == array{ 1, 2, 3 });
|
||||
REQUIRE(tbl == table{ { "a"sv, 69 }, { "b"sv, "kek"sv }, { "c"sv, array{ 1, 2, 3 } } });
|
||||
|
||||
res = tbl.emplace<int64_t>("c", 1);
|
||||
CHECK(res.first == advance(tbl.begin(), 2));
|
||||
CHECK(res.second == false);
|
||||
CHECK(tbl.size() == 3u);
|
||||
REQUIRE(!tbl.get_as<int64_t>("c"));
|
||||
REQUIRE(tbl.get_as<array>("c"));
|
||||
REQUIRE(tbl == table{ { "a"sv, 69 }, { "b"sv, "kek"s }, { "c"sv, array{ 1, 2, 3 } } });
|
||||
|
||||
auto it = tbl.erase(tbl.cbegin());
|
||||
REQUIRE(tbl == table{ { { "b"sv, "kek" }, { "c"sv, array{ 1, 2, 3 } } } });
|
||||
CHECK(it == tbl.begin());
|
||||
CHECK(tbl.size() == 2u);
|
||||
|
||||
res = tbl.insert_or_assign("a"sv, 69);
|
||||
CHECK(res.first == tbl.begin());
|
||||
CHECK(res.second == true); // should insert
|
||||
CHECK(tbl.size() == 3u);
|
||||
REQUIRE(tbl.get_as<int64_t>("a"));
|
||||
CHECK(*tbl.get_as<int64_t>("a") == 69);
|
||||
REQUIRE(tbl == table{ { "a"sv, 69 }, { "b"sv, "kek" }, { "c"sv, array{ 1, 2, 3 } } });
|
||||
|
||||
it = tbl.erase(advance(tbl.cbegin(), 1), advance(tbl.cbegin(), 3));
|
||||
REQUIRE(tbl == table{ { "a"sv, 69 } });
|
||||
CHECK(it == tbl.end());
|
||||
CHECK(tbl.size() == 1u);
|
||||
|
||||
tbl.clear();
|
||||
REQUIRE(tbl == table{});
|
||||
CHECK(tbl.size() == 0u);
|
||||
CHECK(tbl.empty());
|
||||
|
||||
// void insert(Iter first, Iter last)
|
||||
{
|
||||
std::vector<std::pair<std::string, std::string>> vals{ { "foo", "foo" }, { "bar", "bar" }, { "kek", "kek" } };
|
||||
tbl.insert(vals.begin(), vals.end());
|
||||
CHECK(tbl.size() == 3u);
|
||||
REQUIRE(tbl.get_as<std::string>("foo"));
|
||||
CHECK(*tbl.get_as<std::string>("foo") == "foo");
|
||||
REQUIRE(tbl.get_as<std::string>("bar"));
|
||||
CHECK(*tbl.get_as<std::string>("bar") == "bar");
|
||||
REQUIRE(tbl.get_as<std::string>("kek"));
|
||||
CHECK(*tbl.get_as<std::string>("kek") == "kek");
|
||||
|
||||
REQUIRE(vals.size() == 3u);
|
||||
CHECK(vals[0].first == "foo");
|
||||
CHECK(vals[0].second == "foo");
|
||||
CHECK(vals[1].first == "bar");
|
||||
CHECK(vals[1].second == "bar");
|
||||
CHECK(vals[2].first == "kek");
|
||||
CHECK(vals[2].second == "kek");
|
||||
|
||||
tbl.clear();
|
||||
}
|
||||
|
||||
// void insert(Iter first, Iter last) (with move iterators)
|
||||
{
|
||||
std::vector<std::pair<std::string, std::string>> vals{ { "foo", "foo" }, { "bar", "bar" }, { "kek", "kek" } };
|
||||
tbl.insert(std::make_move_iterator(vals.begin()), std::make_move_iterator(vals.end()));
|
||||
CHECK(tbl.size() == 3u);
|
||||
REQUIRE(tbl.get_as<std::string>("foo"));
|
||||
CHECK(*tbl.get_as<std::string>("foo") == "foo");
|
||||
REQUIRE(tbl.get_as<std::string>("bar"));
|
||||
CHECK(*tbl.get_as<std::string>("bar") == "bar");
|
||||
REQUIRE(tbl.get_as<std::string>("kek"));
|
||||
CHECK(*tbl.get_as<std::string>("kek") == "kek");
|
||||
|
||||
REQUIRE(vals.size() == 3u);
|
||||
CHECK(vals[0].first == "");
|
||||
CHECK(vals[0].second == "");
|
||||
CHECK(vals[1].first == "");
|
||||
CHECK(vals[1].second == "");
|
||||
CHECK(vals[2].first == "");
|
||||
CHECK(vals[2].second == "");
|
||||
|
||||
tbl.clear();
|
||||
}
|
||||
|
||||
#if TOML_ENABLE_WINDOWS_COMPAT
|
||||
|
||||
tbl.insert(L"a", L"test1");
|
||||
REQUIRE(*tbl.get_as<std::string>(L"a"sv) == "test1"sv);
|
||||
tbl.insert_or_assign(L"a"sv, L"test2");
|
||||
REQUIRE(*tbl.get_as<std::string>(L"a"sv) == "test2"sv);
|
||||
tbl.emplace<std::string>(L"b", L"test3");
|
||||
REQUIRE(*tbl.get_as<std::string>(L"b"sv) == "test3"sv);
|
||||
CHECK(tbl.size() == 2u);
|
||||
tbl.erase(L"b");
|
||||
CHECK(tbl.size() == 1u);
|
||||
tbl.erase(L"a"s);
|
||||
CHECK(tbl.size() == 0u);
|
||||
|
||||
#endif // TOML_ENABLE_WINDOWS_COMPAT
|
||||
|
||||
// insert with value_flags
|
||||
{
|
||||
tbl.clear();
|
||||
|
||||
auto hex = toml::value{ 1 };
|
||||
hex.flags(value_flags::format_as_hexadecimal);
|
||||
CHECK(hex.flags() == value_flags::format_as_hexadecimal);
|
||||
|
||||
tbl.insert("hex", hex);
|
||||
CHECK(hex.flags() == value_flags::format_as_hexadecimal);
|
||||
CHECK(tbl["hex"].as_integer()->flags() == value_flags::format_as_hexadecimal);
|
||||
|
||||
tbl.insert("hex2", std::move(hex));
|
||||
CHECK(hex.flags() == value_flags{});
|
||||
CHECK(tbl["hex2"].as_integer()->flags() == value_flags::format_as_hexadecimal);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("tables - toml_formatter")
|
||||
{
|
||||
static constexpr auto to_string = [](std::string_view some_toml,
|
||||
format_flags flags = toml_formatter::default_flags,
|
||||
format_flags exclude_flags = format_flags::none)
|
||||
{
|
||||
auto val = toml::parse(some_toml);
|
||||
std::stringstream ss;
|
||||
ss << toml_formatter{ val, flags & ~(exclude_flags) };
|
||||
return ss.str();
|
||||
};
|
||||
|
||||
{
|
||||
static constexpr auto some_toml = R"(val1 = 1
|
||||
val2 = 2
|
||||
val3 = 3)"sv;
|
||||
|
||||
CHECK(to_string(some_toml) == some_toml);
|
||||
}
|
||||
|
||||
{
|
||||
static constexpr auto some_toml = R"([a_table]
|
||||
a = 1
|
||||
b = 2
|
||||
c = 3)"sv;
|
||||
|
||||
CHECK(to_string(some_toml) == some_toml);
|
||||
}
|
||||
|
||||
{
|
||||
static constexpr auto some_toml = R"(val1 = 1
|
||||
val2 = 2
|
||||
val3 = 3
|
||||
|
||||
[a_table]
|
||||
a = 1
|
||||
b = 2
|
||||
c = 3)"sv;
|
||||
|
||||
CHECK(to_string(some_toml) == some_toml);
|
||||
}
|
||||
|
||||
{
|
||||
static constexpr auto some_toml = "[a]\n\n[b]\n\n[c]"sv;
|
||||
CHECK(to_string(some_toml) == some_toml);
|
||||
}
|
||||
|
||||
{
|
||||
static constexpr auto some_toml = "[a]\nkey = 1\n\n[b]\n\n[c]"sv;
|
||||
CHECK(to_string(some_toml) == some_toml);
|
||||
}
|
||||
|
||||
{
|
||||
static constexpr auto some_toml = "key = 1\n\n[a]\nkey = 1\n\n[b]\n\n[c]"sv;
|
||||
CHECK(to_string(some_toml) == some_toml);
|
||||
}
|
||||
|
||||
{
|
||||
static constexpr auto some_toml = "key = 1\n\n[a]\nkey = 1\n\n[b]\n\n[[c]]\n\n[[c]]"sv;
|
||||
CHECK(to_string(some_toml) == some_toml);
|
||||
}
|
||||
|
||||
{
|
||||
constexpr auto input = R"(key1 = 'val1'
|
||||
key2 = [ 1, 2, 3, 4, '5' ]
|
||||
key3 = [ 'this is a really long array', 'and should be split over multiple lines', 'by the formatter', 'unless i dun goofed', 'i guess thats what tests are for' ]
|
||||
|
||||
[sub1]
|
||||
key4 = 'val'
|
||||
|
||||
[sub2]
|
||||
key5 = 'val'
|
||||
|
||||
[sub2.sub3]
|
||||
key6 = 'val'
|
||||
key7 = [ 1, 2, 3, 4, '5' ]
|
||||
key8 = [ 'this is a really long array', 'and should be split over multiple lines', 'by the formatter', 'unless i dun goofed', 'i guess thats what tests are for' ])"sv;
|
||||
|
||||
constexpr auto expected_default = R"(key1 = 'val1'
|
||||
key2 = [ 1, 2, 3, 4, '5' ]
|
||||
key3 = [
|
||||
'this is a really long array',
|
||||
'and should be split over multiple lines',
|
||||
'by the formatter',
|
||||
'unless i dun goofed',
|
||||
'i guess thats what tests are for'
|
||||
]
|
||||
|
||||
[sub1]
|
||||
key4 = 'val'
|
||||
|
||||
[sub2]
|
||||
key5 = 'val'
|
||||
|
||||
[sub2.sub3]
|
||||
key6 = 'val'
|
||||
key7 = [ 1, 2, 3, 4, '5' ]
|
||||
key8 = [
|
||||
'this is a really long array',
|
||||
'and should be split over multiple lines',
|
||||
'by the formatter',
|
||||
'unless i dun goofed',
|
||||
'i guess thats what tests are for'
|
||||
])"sv;
|
||||
CHECK(to_string(input) == expected_default);
|
||||
|
||||
constexpr auto expected_without_indented_subtables = R"(key1 = 'val1'
|
||||
key2 = [ 1, 2, 3, 4, '5' ]
|
||||
key3 = [
|
||||
'this is a really long array',
|
||||
'and should be split over multiple lines',
|
||||
'by the formatter',
|
||||
'unless i dun goofed',
|
||||
'i guess thats what tests are for'
|
||||
]
|
||||
|
||||
[sub1]
|
||||
key4 = 'val'
|
||||
|
||||
[sub2]
|
||||
key5 = 'val'
|
||||
|
||||
[sub2.sub3]
|
||||
key6 = 'val'
|
||||
key7 = [ 1, 2, 3, 4, '5' ]
|
||||
key8 = [
|
||||
'this is a really long array',
|
||||
'and should be split over multiple lines',
|
||||
'by the formatter',
|
||||
'unless i dun goofed',
|
||||
'i guess thats what tests are for'
|
||||
])"sv;
|
||||
CHECK(to_string(input, toml_formatter::default_flags, format_flags::indent_sub_tables)
|
||||
== expected_without_indented_subtables);
|
||||
|
||||
constexpr auto expected_without_indented_arrays = R"(key1 = 'val1'
|
||||
key2 = [ 1, 2, 3, 4, '5' ]
|
||||
key3 = [
|
||||
'this is a really long array',
|
||||
'and should be split over multiple lines',
|
||||
'by the formatter',
|
||||
'unless i dun goofed',
|
||||
'i guess thats what tests are for'
|
||||
]
|
||||
|
||||
[sub1]
|
||||
key4 = 'val'
|
||||
|
||||
[sub2]
|
||||
key5 = 'val'
|
||||
|
||||
[sub2.sub3]
|
||||
key6 = 'val'
|
||||
key7 = [ 1, 2, 3, 4, '5' ]
|
||||
key8 = [
|
||||
'this is a really long array',
|
||||
'and should be split over multiple lines',
|
||||
'by the formatter',
|
||||
'unless i dun goofed',
|
||||
'i guess thats what tests are for'
|
||||
])"sv;
|
||||
CHECK(to_string(input, toml_formatter::default_flags, format_flags::indent_array_elements)
|
||||
== expected_without_indented_arrays);
|
||||
|
||||
constexpr auto expected_without_indentation = R"(key1 = 'val1'
|
||||
key2 = [ 1, 2, 3, 4, '5' ]
|
||||
key3 = [
|
||||
'this is a really long array',
|
||||
'and should be split over multiple lines',
|
||||
'by the formatter',
|
||||
'unless i dun goofed',
|
||||
'i guess thats what tests are for'
|
||||
]
|
||||
|
||||
[sub1]
|
||||
key4 = 'val'
|
||||
|
||||
[sub2]
|
||||
key5 = 'val'
|
||||
|
||||
[sub2.sub3]
|
||||
key6 = 'val'
|
||||
key7 = [ 1, 2, 3, 4, '5' ]
|
||||
key8 = [
|
||||
'this is a really long array',
|
||||
'and should be split over multiple lines',
|
||||
'by the formatter',
|
||||
'unless i dun goofed',
|
||||
'i guess thats what tests are for'
|
||||
])"sv;
|
||||
CHECK(to_string(input, toml_formatter::default_flags, format_flags::indentation)
|
||||
== expected_without_indentation);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("tables - for_each")
|
||||
{
|
||||
const auto tbl = table{ { "a", 1 }, { "b", 2.0 }, { "c", 3 }, { "d", "four" }, { "e", false } };
|
||||
|
||||
SECTION("type checking")
|
||||
{
|
||||
int count = 0;
|
||||
int ints = 0;
|
||||
int floats = 0;
|
||||
int numbers = 0;
|
||||
int strings = 0;
|
||||
int bools = 0;
|
||||
tbl.for_each(
|
||||
[&](const auto& v) noexcept
|
||||
{
|
||||
count++;
|
||||
if constexpr (toml::is_integer<decltype(v)>)
|
||||
ints++;
|
||||
if constexpr (toml::is_floating_point<decltype(v)>)
|
||||
floats++;
|
||||
if constexpr (toml::is_number<decltype(v)>)
|
||||
numbers++;
|
||||
if constexpr (toml::is_string<decltype(v)>)
|
||||
strings++;
|
||||
if constexpr (toml::is_boolean<decltype(v)>)
|
||||
bools++;
|
||||
});
|
||||
CHECK(count == 5);
|
||||
CHECK(ints == 2);
|
||||
CHECK(floats == 1);
|
||||
CHECK(numbers == (ints + floats));
|
||||
CHECK(strings == 1);
|
||||
CHECK(bools == 1);
|
||||
}
|
||||
|
||||
#if !TOML_RETURN_BOOL_FROM_FOR_EACH_BROKEN
|
||||
|
||||
SECTION("early-exit (key, val)")
|
||||
{
|
||||
int count = 0;
|
||||
tbl.for_each([&](const key& /*k*/, const auto& /*v*/) noexcept -> bool { return ++count < 3; });
|
||||
CHECK(count == 3);
|
||||
}
|
||||
|
||||
SECTION("early-exit (val)")
|
||||
{
|
||||
int count = 0;
|
||||
tbl.for_each([&](const auto& /*v*/) noexcept -> bool { return ++count < 3; });
|
||||
CHECK(count == 3);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
@ -1,590 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
|
||||
#ifdef _WIN32
|
||||
TOML_DISABLE_WARNINGS;
|
||||
#include <Windows.h>
|
||||
TOML_ENABLE_WARNINGS;
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
static constexpr T one = static_cast<T>(1);
|
||||
|
||||
TEST_CASE("values - construction")
|
||||
{
|
||||
static constexpr auto check_value = [](const auto& init_value, auto expected_native_type_tag)
|
||||
{
|
||||
using init_type = impl::remove_cvref<decltype(init_value)>;
|
||||
using native_type = impl::native_type_of<init_type>;
|
||||
using expected_native_type = typename decltype(expected_native_type_tag)::type;
|
||||
static_assert(std::is_same_v<native_type, expected_native_type>);
|
||||
|
||||
auto v = value{ init_value };
|
||||
using value_type = decltype(v);
|
||||
static_assert(std::is_same_v<value_type, value<native_type>>);
|
||||
|
||||
if constexpr (std::is_same_v<std::string, native_type>)
|
||||
{
|
||||
#if TOML_HAS_CHAR8
|
||||
using char8_type = char8_t;
|
||||
#else
|
||||
using char8_type = char;
|
||||
#endif
|
||||
|
||||
using init_char_type = impl::remove_cvref<decltype(init_value[0])>;
|
||||
using init_view_type = std::basic_string_view<init_char_type>;
|
||||
static_assert(impl::is_one_of<init_char_type, char, wchar_t, char8_type>);
|
||||
|
||||
const auto init_view = init_view_type{ init_value };
|
||||
if constexpr (impl::is_one_of<init_char_type, char, char8_type>)
|
||||
{
|
||||
const auto coerced_view =
|
||||
std::string_view{ reinterpret_cast<const char*>(init_view.data()), init_view.length() };
|
||||
|
||||
CHECK(v == coerced_view);
|
||||
CHECK(coerced_view == v);
|
||||
}
|
||||
#if TOML_ENABLE_WINDOWS_COMPAT
|
||||
else if constexpr (impl::is_one_of<init_char_type, wchar_t>)
|
||||
{
|
||||
const auto narrowed_string = impl::narrow(init_view);
|
||||
|
||||
CHECK(v == narrowed_string);
|
||||
CHECK(narrowed_string == v);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
static_assert(impl::always_false<init_char_type>, "evaluated unreachable branch");
|
||||
}
|
||||
}
|
||||
else if constexpr (impl::is_one_of<native_type, int64_t, double, bool>)
|
||||
{
|
||||
CHECK(v == static_cast<native_type>(init_value));
|
||||
CHECK(static_cast<native_type>(init_value) == v);
|
||||
}
|
||||
else // dates + times
|
||||
{
|
||||
CHECK(v == init_value);
|
||||
CHECK(init_value == v);
|
||||
}
|
||||
|
||||
static constexpr auto expected_node_type = impl::node_type_of<native_type>;
|
||||
|
||||
CHECK(v.is_homogeneous());
|
||||
CHECK(v.template is_homogeneous<native_type>());
|
||||
CHECK(v.is_homogeneous(expected_node_type));
|
||||
|
||||
// sanity check the virtual type checks
|
||||
CHECK(v.type() == expected_node_type);
|
||||
CHECK(!v.is_table());
|
||||
CHECK(!v.is_array());
|
||||
CHECK(!v.is_array_of_tables());
|
||||
CHECK(v.is_value());
|
||||
CHECK(v.is_string() == (expected_node_type == node_type::string));
|
||||
CHECK(v.is_integer() == (expected_node_type == node_type::integer));
|
||||
CHECK(v.is_floating_point() == (expected_node_type == node_type::floating_point));
|
||||
CHECK(v.is_number()
|
||||
== (expected_node_type == node_type::integer || expected_node_type == node_type::floating_point));
|
||||
CHECK(v.is_boolean() == (expected_node_type == node_type::boolean));
|
||||
CHECK(v.is_date() == (expected_node_type == node_type::date));
|
||||
CHECK(v.is_time() == (expected_node_type == node_type::time));
|
||||
CHECK(v.is_date_time() == (expected_node_type == node_type::date_time));
|
||||
|
||||
// sanity check the virtual type casts (non-const)
|
||||
CHECK(!v.as_table());
|
||||
CHECK(!v.as_array());
|
||||
if constexpr (expected_node_type == node_type::string)
|
||||
CHECK(v.as_string() == &v);
|
||||
else
|
||||
CHECK(!v.as_string());
|
||||
if constexpr (expected_node_type == node_type::integer)
|
||||
CHECK(v.as_integer() == &v);
|
||||
else
|
||||
CHECK(!v.as_integer());
|
||||
if constexpr (expected_node_type == node_type::floating_point)
|
||||
CHECK(v.as_floating_point() == &v);
|
||||
else
|
||||
CHECK(!v.as_floating_point());
|
||||
if constexpr (expected_node_type == node_type::boolean)
|
||||
CHECK(v.as_boolean() == &v);
|
||||
else
|
||||
CHECK(!v.as_boolean());
|
||||
if constexpr (expected_node_type == node_type::date)
|
||||
CHECK(v.as_date() == &v);
|
||||
else
|
||||
CHECK(!v.as_date());
|
||||
if constexpr (expected_node_type == node_type::time)
|
||||
CHECK(v.as_time() == &v);
|
||||
else
|
||||
CHECK(!v.as_time());
|
||||
if constexpr (expected_node_type == node_type::date_time)
|
||||
CHECK(v.as_date_time() == &v);
|
||||
else
|
||||
CHECK(!v.as_date_time());
|
||||
|
||||
// sanity check the virtual type casts (const)
|
||||
const auto& cv = std::as_const(v);
|
||||
CHECK(!cv.as_table());
|
||||
CHECK(!cv.as_array());
|
||||
if constexpr (expected_node_type == node_type::string)
|
||||
CHECK(cv.as_string() == &v);
|
||||
else
|
||||
CHECK(!cv.as_string());
|
||||
if constexpr (expected_node_type == node_type::integer)
|
||||
CHECK(cv.as_integer() == &v);
|
||||
else
|
||||
CHECK(!cv.as_integer());
|
||||
if constexpr (expected_node_type == node_type::floating_point)
|
||||
CHECK(cv.as_floating_point() == &v);
|
||||
else
|
||||
CHECK(!cv.as_floating_point());
|
||||
if constexpr (expected_node_type == node_type::boolean)
|
||||
CHECK(cv.as_boolean() == &v);
|
||||
else
|
||||
CHECK(!cv.as_boolean());
|
||||
if constexpr (expected_node_type == node_type::date)
|
||||
CHECK(cv.as_date() == &v);
|
||||
else
|
||||
CHECK(!cv.as_date());
|
||||
if constexpr (expected_node_type == node_type::time)
|
||||
CHECK(cv.as_time() == &v);
|
||||
else
|
||||
CHECK(!cv.as_time());
|
||||
if constexpr (expected_node_type == node_type::date_time)
|
||||
CHECK(cv.as_date_time() == &v);
|
||||
else
|
||||
CHECK(!cv.as_date_time());
|
||||
};
|
||||
|
||||
check_value(one<signed char>, type_tag<int64_t>{});
|
||||
check_value(one<signed short>, type_tag<int64_t>{});
|
||||
check_value(one<signed int>, type_tag<int64_t>{});
|
||||
check_value(one<signed long>, type_tag<int64_t>{});
|
||||
check_value(one<signed long long>, type_tag<int64_t>{});
|
||||
check_value(one<unsigned char>, type_tag<int64_t>{});
|
||||
check_value(one<unsigned short>, type_tag<int64_t>{});
|
||||
check_value(one<unsigned int>, type_tag<int64_t>{});
|
||||
check_value(one<unsigned long>, type_tag<int64_t>{});
|
||||
check_value(one<unsigned long long>, type_tag<int64_t>{});
|
||||
check_value(true, type_tag<bool>{});
|
||||
check_value(false, type_tag<bool>{});
|
||||
check_value("kek", type_tag<std::string>{});
|
||||
check_value("kek"s, type_tag<std::string>{});
|
||||
check_value("kek"sv, type_tag<std::string>{});
|
||||
check_value("kek"sv.data(), type_tag<std::string>{});
|
||||
#if TOML_HAS_CHAR8
|
||||
check_value(u8"kek", type_tag<std::string>{});
|
||||
check_value(u8"kek"s, type_tag<std::string>{});
|
||||
check_value(u8"kek"sv, type_tag<std::string>{});
|
||||
check_value(u8"kek"sv.data(), type_tag<std::string>{});
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
check_value(one<BOOL>, type_tag<int64_t>{});
|
||||
check_value(one<SHORT>, type_tag<int64_t>{});
|
||||
check_value(one<INT>, type_tag<int64_t>{});
|
||||
check_value(one<LONG>, type_tag<int64_t>{});
|
||||
check_value(one<INT_PTR>, type_tag<int64_t>{});
|
||||
check_value(one<LONG_PTR>, type_tag<int64_t>{});
|
||||
check_value(one<USHORT>, type_tag<int64_t>{});
|
||||
check_value(one<UINT>, type_tag<int64_t>{});
|
||||
check_value(one<ULONG>, type_tag<int64_t>{});
|
||||
check_value(one<UINT_PTR>, type_tag<int64_t>{});
|
||||
check_value(one<ULONG_PTR>, type_tag<int64_t>{});
|
||||
check_value(one<WORD>, type_tag<int64_t>{});
|
||||
check_value(one<DWORD>, type_tag<int64_t>{});
|
||||
check_value(one<DWORD32>, type_tag<int64_t>{});
|
||||
check_value(one<DWORD64>, type_tag<int64_t>{});
|
||||
check_value(one<DWORDLONG>, type_tag<int64_t>{});
|
||||
|
||||
#if TOML_ENABLE_WINDOWS_COMPAT
|
||||
|
||||
check_value(L"kek", type_tag<std::string>{});
|
||||
check_value(L"kek"s, type_tag<std::string>{});
|
||||
check_value(L"kek"sv, type_tag<std::string>{});
|
||||
check_value(L"kek"sv.data(), type_tag<std::string>{});
|
||||
|
||||
#endif // TOML_ENABLE_WINDOWS_COMPAT
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST_CASE("values - toml_formatter")
|
||||
{
|
||||
static constexpr auto print_value = [](auto&& raw)
|
||||
{
|
||||
auto val = toml::value{ std::forward<decltype(raw)>(raw) };
|
||||
std::stringstream ss;
|
||||
ss << val;
|
||||
return ss.str();
|
||||
};
|
||||
|
||||
CHECK(print_value(1) == "1");
|
||||
CHECK(print_value(1.0f) == "1.0");
|
||||
CHECK(print_value(1.0) == "1.0");
|
||||
|
||||
CHECK(print_value(1.5f) == "1.5");
|
||||
CHECK(print_value(1.5) == "1.5");
|
||||
|
||||
CHECK(print_value(10) == "10");
|
||||
CHECK(print_value(10.0f) == "10.0");
|
||||
CHECK(print_value(10.0) == "10.0");
|
||||
|
||||
CHECK(print_value(100) == "100");
|
||||
CHECK(print_value(100.0f) == "100.0");
|
||||
CHECK(print_value(100.0) == "100.0");
|
||||
|
||||
CHECK(print_value(1000) == "1000");
|
||||
CHECK(print_value(1000.0f) == "1000.0");
|
||||
CHECK(print_value(1000.0) == "1000.0");
|
||||
|
||||
CHECK(print_value(10000) == "10000");
|
||||
CHECK(print_value(10000.0f) == "10000.0");
|
||||
CHECK(print_value(10000.0) == "10000.0");
|
||||
|
||||
CHECK(print_value(std::numeric_limits<double>::infinity()) == "inf");
|
||||
CHECK(print_value(-std::numeric_limits<double>::infinity()) == "-inf");
|
||||
CHECK(print_value(std::numeric_limits<double>::quiet_NaN()) == "nan");
|
||||
|
||||
// only integers for large values;
|
||||
// large floats might get output as scientific notation and that's fine
|
||||
CHECK(print_value(10000000000) == "10000000000");
|
||||
CHECK(print_value(100000000000000) == "100000000000000");
|
||||
}
|
||||
|
||||
TEST_CASE("nodes - value() int/float/bool conversions")
|
||||
{
|
||||
#define CHECK_VALUE_PASS(type, v) CHECK(n.value<type>() == static_cast<type>(v))
|
||||
#define CHECK_VALUE_FAIL(type) CHECK(!n.value<type>())
|
||||
|
||||
// bools
|
||||
{
|
||||
value val{ false };
|
||||
const node& n = val;
|
||||
CHECK_VALUE_PASS(bool, false);
|
||||
CHECK_VALUE_PASS(int8_t, 0);
|
||||
CHECK_VALUE_PASS(uint8_t, 0);
|
||||
CHECK_VALUE_PASS(int16_t, 0);
|
||||
CHECK_VALUE_PASS(uint16_t, 0);
|
||||
CHECK_VALUE_PASS(int32_t, 0);
|
||||
CHECK_VALUE_PASS(uint32_t, 0);
|
||||
CHECK_VALUE_PASS(int64_t, 0);
|
||||
CHECK_VALUE_PASS(uint64_t, 0);
|
||||
CHECK_VALUE_FAIL(float);
|
||||
CHECK_VALUE_FAIL(double);
|
||||
CHECK_VALUE_FAIL(std::string);
|
||||
CHECK_VALUE_FAIL(std::string_view);
|
||||
CHECK_VALUE_FAIL(toml::date);
|
||||
CHECK_VALUE_FAIL(toml::time);
|
||||
CHECK_VALUE_FAIL(toml::date_time);
|
||||
|
||||
*val = true;
|
||||
CHECK_VALUE_PASS(bool, true);
|
||||
CHECK_VALUE_PASS(int8_t, 1);
|
||||
CHECK_VALUE_PASS(uint8_t, 1);
|
||||
CHECK_VALUE_PASS(int16_t, 1);
|
||||
CHECK_VALUE_PASS(uint16_t, 1);
|
||||
CHECK_VALUE_PASS(int32_t, 1);
|
||||
CHECK_VALUE_PASS(uint32_t, 1);
|
||||
CHECK_VALUE_PASS(int64_t, 1);
|
||||
CHECK_VALUE_PASS(uint64_t, 1);
|
||||
CHECK_VALUE_FAIL(float);
|
||||
CHECK_VALUE_FAIL(double);
|
||||
CHECK_VALUE_FAIL(std::string);
|
||||
CHECK_VALUE_FAIL(std::string_view);
|
||||
CHECK_VALUE_FAIL(toml::date);
|
||||
CHECK_VALUE_FAIL(toml::time);
|
||||
CHECK_VALUE_FAIL(toml::date_time);
|
||||
}
|
||||
|
||||
// ints
|
||||
{
|
||||
value val{ 0 };
|
||||
const node& n = val;
|
||||
CHECK_VALUE_PASS(bool, false); // int -> bool coercion
|
||||
CHECK_VALUE_PASS(int8_t, 0);
|
||||
CHECK_VALUE_PASS(uint8_t, 0);
|
||||
CHECK_VALUE_PASS(int16_t, 0);
|
||||
CHECK_VALUE_PASS(uint16_t, 0);
|
||||
CHECK_VALUE_PASS(int32_t, 0);
|
||||
CHECK_VALUE_PASS(uint32_t, 0);
|
||||
CHECK_VALUE_PASS(int64_t, 0);
|
||||
CHECK_VALUE_PASS(uint64_t, 0);
|
||||
CHECK_VALUE_PASS(float, 0);
|
||||
CHECK_VALUE_PASS(double, 0);
|
||||
CHECK_VALUE_FAIL(std::string);
|
||||
CHECK_VALUE_FAIL(std::string_view);
|
||||
CHECK_VALUE_FAIL(toml::date);
|
||||
CHECK_VALUE_FAIL(toml::time);
|
||||
CHECK_VALUE_FAIL(toml::date_time);
|
||||
|
||||
*val = 100;
|
||||
CHECK_VALUE_PASS(bool, true); // int -> bool coercion
|
||||
CHECK_VALUE_PASS(int8_t, 100);
|
||||
CHECK_VALUE_PASS(uint8_t, 100);
|
||||
CHECK_VALUE_PASS(int16_t, 100);
|
||||
CHECK_VALUE_PASS(uint16_t, 100);
|
||||
CHECK_VALUE_PASS(int32_t, 100);
|
||||
CHECK_VALUE_PASS(uint32_t, 100);
|
||||
CHECK_VALUE_PASS(int64_t, 100);
|
||||
CHECK_VALUE_PASS(uint64_t, 100);
|
||||
CHECK_VALUE_PASS(float, 100);
|
||||
CHECK_VALUE_PASS(double, 100);
|
||||
CHECK_VALUE_FAIL(std::string);
|
||||
CHECK_VALUE_FAIL(std::string_view);
|
||||
CHECK_VALUE_FAIL(toml::date);
|
||||
CHECK_VALUE_FAIL(toml::time);
|
||||
CHECK_VALUE_FAIL(toml::date_time);
|
||||
|
||||
*val = -100;
|
||||
CHECK_VALUE_PASS(bool, true); // int -> bool coercion
|
||||
CHECK_VALUE_PASS(int8_t, -100);
|
||||
CHECK_VALUE_FAIL(uint8_t);
|
||||
CHECK_VALUE_PASS(int16_t, -100);
|
||||
CHECK_VALUE_FAIL(uint16_t);
|
||||
CHECK_VALUE_PASS(int32_t, -100);
|
||||
CHECK_VALUE_FAIL(uint32_t);
|
||||
CHECK_VALUE_PASS(int64_t, -100);
|
||||
CHECK_VALUE_FAIL(uint64_t);
|
||||
CHECK_VALUE_PASS(float, -100);
|
||||
CHECK_VALUE_PASS(double, -100);
|
||||
CHECK_VALUE_FAIL(std::string);
|
||||
CHECK_VALUE_FAIL(std::string_view);
|
||||
CHECK_VALUE_FAIL(toml::date);
|
||||
CHECK_VALUE_FAIL(toml::time);
|
||||
CHECK_VALUE_FAIL(toml::date_time);
|
||||
|
||||
*val = 1000;
|
||||
CHECK_VALUE_PASS(bool, true); // int -> bool coercion
|
||||
CHECK_VALUE_FAIL(int8_t);
|
||||
CHECK_VALUE_FAIL(uint8_t);
|
||||
CHECK_VALUE_PASS(int16_t, 1000);
|
||||
CHECK_VALUE_PASS(uint16_t, 1000);
|
||||
CHECK_VALUE_PASS(int32_t, 1000);
|
||||
CHECK_VALUE_PASS(uint32_t, 1000);
|
||||
CHECK_VALUE_PASS(int64_t, 1000);
|
||||
CHECK_VALUE_PASS(uint64_t, 1000);
|
||||
CHECK_VALUE_PASS(float, 1000);
|
||||
CHECK_VALUE_PASS(double, 1000);
|
||||
CHECK_VALUE_FAIL(std::string);
|
||||
CHECK_VALUE_FAIL(std::string_view);
|
||||
CHECK_VALUE_FAIL(toml::date);
|
||||
CHECK_VALUE_FAIL(toml::time);
|
||||
CHECK_VALUE_FAIL(toml::date_time);
|
||||
|
||||
*val = -1000;
|
||||
CHECK_VALUE_PASS(bool, true); // int -> bool coercion
|
||||
CHECK_VALUE_FAIL(int8_t);
|
||||
CHECK_VALUE_FAIL(uint8_t);
|
||||
CHECK_VALUE_PASS(int16_t, -1000);
|
||||
CHECK_VALUE_FAIL(uint16_t);
|
||||
CHECK_VALUE_PASS(int32_t, -1000);
|
||||
CHECK_VALUE_FAIL(uint32_t);
|
||||
CHECK_VALUE_PASS(int64_t, -1000);
|
||||
CHECK_VALUE_FAIL(uint64_t);
|
||||
CHECK_VALUE_PASS(float, -1000);
|
||||
CHECK_VALUE_PASS(double, -1000);
|
||||
CHECK_VALUE_FAIL(std::string);
|
||||
CHECK_VALUE_FAIL(std::string_view);
|
||||
CHECK_VALUE_FAIL(toml::date);
|
||||
CHECK_VALUE_FAIL(toml::time);
|
||||
CHECK_VALUE_FAIL(toml::date_time);
|
||||
|
||||
*val = (std::numeric_limits<int64_t>::max)();
|
||||
CHECK_VALUE_PASS(bool, true); // int -> bool coercion
|
||||
CHECK_VALUE_FAIL(int8_t);
|
||||
CHECK_VALUE_FAIL(uint8_t);
|
||||
CHECK_VALUE_FAIL(int16_t);
|
||||
CHECK_VALUE_FAIL(uint16_t);
|
||||
CHECK_VALUE_FAIL(int32_t);
|
||||
CHECK_VALUE_FAIL(uint32_t);
|
||||
CHECK_VALUE_PASS(int64_t, (std::numeric_limits<int64_t>::max)());
|
||||
CHECK_VALUE_PASS(uint64_t, (std::numeric_limits<int64_t>::max)());
|
||||
CHECK_VALUE_FAIL(float);
|
||||
CHECK_VALUE_FAIL(double);
|
||||
CHECK_VALUE_FAIL(std::string);
|
||||
CHECK_VALUE_FAIL(std::string_view);
|
||||
CHECK_VALUE_FAIL(toml::date);
|
||||
CHECK_VALUE_FAIL(toml::time);
|
||||
CHECK_VALUE_FAIL(toml::date_time);
|
||||
|
||||
*val = (std::numeric_limits<int64_t>::min)();
|
||||
CHECK_VALUE_PASS(bool, true); // int -> bool coercion
|
||||
CHECK_VALUE_FAIL(int8_t);
|
||||
CHECK_VALUE_FAIL(uint8_t);
|
||||
CHECK_VALUE_FAIL(int16_t);
|
||||
CHECK_VALUE_FAIL(uint16_t);
|
||||
CHECK_VALUE_FAIL(int32_t);
|
||||
CHECK_VALUE_FAIL(uint32_t);
|
||||
CHECK_VALUE_PASS(int64_t, (std::numeric_limits<int64_t>::min)());
|
||||
CHECK_VALUE_FAIL(uint64_t);
|
||||
CHECK_VALUE_FAIL(float);
|
||||
CHECK_VALUE_FAIL(double);
|
||||
CHECK_VALUE_FAIL(std::string);
|
||||
CHECK_VALUE_FAIL(std::string_view);
|
||||
CHECK_VALUE_FAIL(toml::date);
|
||||
CHECK_VALUE_FAIL(toml::time);
|
||||
CHECK_VALUE_FAIL(toml::date_time);
|
||||
}
|
||||
|
||||
// floats
|
||||
{
|
||||
value val{ 0.0 };
|
||||
const node& n = val;
|
||||
CHECK_VALUE_FAIL(bool);
|
||||
CHECK_VALUE_PASS(int8_t, 0);
|
||||
CHECK_VALUE_PASS(uint8_t, 0);
|
||||
CHECK_VALUE_PASS(int16_t, 0);
|
||||
CHECK_VALUE_PASS(uint16_t, 0);
|
||||
CHECK_VALUE_PASS(int32_t, 0);
|
||||
CHECK_VALUE_PASS(uint32_t, 0);
|
||||
CHECK_VALUE_PASS(int64_t, 0);
|
||||
CHECK_VALUE_PASS(uint64_t, 0);
|
||||
CHECK_VALUE_PASS(float, 0);
|
||||
CHECK_VALUE_PASS(double, 0);
|
||||
CHECK_VALUE_FAIL(std::string);
|
||||
CHECK_VALUE_FAIL(std::string_view);
|
||||
CHECK_VALUE_FAIL(toml::date);
|
||||
CHECK_VALUE_FAIL(toml::time);
|
||||
CHECK_VALUE_FAIL(toml::date_time);
|
||||
|
||||
*val = 1.0;
|
||||
CHECK_VALUE_FAIL(bool);
|
||||
CHECK_VALUE_PASS(int8_t, 1);
|
||||
CHECK_VALUE_PASS(uint8_t, 1);
|
||||
CHECK_VALUE_PASS(int16_t, 1);
|
||||
CHECK_VALUE_PASS(uint16_t, 1);
|
||||
CHECK_VALUE_PASS(int32_t, 1);
|
||||
CHECK_VALUE_PASS(uint32_t, 1);
|
||||
CHECK_VALUE_PASS(int64_t, 1);
|
||||
CHECK_VALUE_PASS(uint64_t, 1);
|
||||
CHECK_VALUE_PASS(float, 1);
|
||||
CHECK_VALUE_PASS(double, 1);
|
||||
CHECK_VALUE_FAIL(std::string);
|
||||
CHECK_VALUE_FAIL(std::string_view);
|
||||
CHECK_VALUE_FAIL(toml::date);
|
||||
CHECK_VALUE_FAIL(toml::time);
|
||||
CHECK_VALUE_FAIL(toml::date_time);
|
||||
|
||||
*val = -1.0;
|
||||
CHECK_VALUE_FAIL(bool);
|
||||
CHECK_VALUE_PASS(int8_t, -1);
|
||||
CHECK_VALUE_FAIL(uint8_t);
|
||||
CHECK_VALUE_PASS(int16_t, -1);
|
||||
CHECK_VALUE_FAIL(uint16_t);
|
||||
CHECK_VALUE_PASS(int32_t, -1);
|
||||
CHECK_VALUE_FAIL(uint32_t);
|
||||
CHECK_VALUE_PASS(int64_t, -1);
|
||||
CHECK_VALUE_FAIL(uint64_t);
|
||||
CHECK_VALUE_PASS(float, -1);
|
||||
CHECK_VALUE_PASS(double, -1);
|
||||
CHECK_VALUE_FAIL(std::string);
|
||||
CHECK_VALUE_FAIL(std::string_view);
|
||||
CHECK_VALUE_FAIL(toml::date);
|
||||
CHECK_VALUE_FAIL(toml::time);
|
||||
CHECK_VALUE_FAIL(toml::date_time);
|
||||
|
||||
*val = 1.5;
|
||||
CHECK_VALUE_FAIL(bool);
|
||||
CHECK_VALUE_FAIL(int8_t);
|
||||
CHECK_VALUE_FAIL(uint8_t);
|
||||
CHECK_VALUE_FAIL(int16_t);
|
||||
CHECK_VALUE_FAIL(uint16_t);
|
||||
CHECK_VALUE_FAIL(int32_t);
|
||||
CHECK_VALUE_FAIL(uint32_t);
|
||||
CHECK_VALUE_FAIL(int64_t);
|
||||
CHECK_VALUE_FAIL(uint64_t);
|
||||
CHECK_VALUE_PASS(float, 1.5);
|
||||
CHECK_VALUE_PASS(double, 1.5);
|
||||
CHECK_VALUE_FAIL(std::string);
|
||||
CHECK_VALUE_FAIL(std::string_view);
|
||||
CHECK_VALUE_FAIL(toml::date);
|
||||
CHECK_VALUE_FAIL(toml::time);
|
||||
CHECK_VALUE_FAIL(toml::date_time);
|
||||
|
||||
*val = -1.5;
|
||||
CHECK_VALUE_FAIL(bool);
|
||||
CHECK_VALUE_FAIL(int8_t);
|
||||
CHECK_VALUE_FAIL(uint8_t);
|
||||
CHECK_VALUE_FAIL(int16_t);
|
||||
CHECK_VALUE_FAIL(uint16_t);
|
||||
CHECK_VALUE_FAIL(int32_t);
|
||||
CHECK_VALUE_FAIL(uint32_t);
|
||||
CHECK_VALUE_FAIL(int64_t);
|
||||
CHECK_VALUE_FAIL(uint64_t);
|
||||
CHECK_VALUE_PASS(float, -1.5);
|
||||
CHECK_VALUE_PASS(double, -1.5);
|
||||
CHECK_VALUE_FAIL(std::string);
|
||||
CHECK_VALUE_FAIL(std::string_view);
|
||||
CHECK_VALUE_FAIL(toml::date);
|
||||
CHECK_VALUE_FAIL(toml::time);
|
||||
CHECK_VALUE_FAIL(toml::date_time);
|
||||
|
||||
*val = std::numeric_limits<double>::infinity();
|
||||
CHECK_VALUE_FAIL(bool);
|
||||
CHECK_VALUE_FAIL(int8_t);
|
||||
CHECK_VALUE_FAIL(uint8_t);
|
||||
CHECK_VALUE_FAIL(int16_t);
|
||||
CHECK_VALUE_FAIL(uint16_t);
|
||||
CHECK_VALUE_FAIL(int32_t);
|
||||
CHECK_VALUE_FAIL(uint32_t);
|
||||
CHECK_VALUE_FAIL(int64_t);
|
||||
CHECK_VALUE_FAIL(uint64_t);
|
||||
CHECK_VALUE_PASS(float, std::numeric_limits<float>::infinity());
|
||||
CHECK_VALUE_PASS(double, std::numeric_limits<double>::infinity());
|
||||
CHECK_VALUE_FAIL(std::string);
|
||||
CHECK_VALUE_FAIL(std::string_view);
|
||||
CHECK_VALUE_FAIL(toml::date);
|
||||
CHECK_VALUE_FAIL(toml::time);
|
||||
CHECK_VALUE_FAIL(toml::date_time);
|
||||
|
||||
*val = -std::numeric_limits<double>::infinity();
|
||||
CHECK_VALUE_FAIL(bool);
|
||||
CHECK_VALUE_FAIL(int8_t);
|
||||
CHECK_VALUE_FAIL(uint8_t);
|
||||
CHECK_VALUE_FAIL(int16_t);
|
||||
CHECK_VALUE_FAIL(uint16_t);
|
||||
CHECK_VALUE_FAIL(int32_t);
|
||||
CHECK_VALUE_FAIL(uint32_t);
|
||||
CHECK_VALUE_FAIL(int64_t);
|
||||
CHECK_VALUE_FAIL(uint64_t);
|
||||
CHECK_VALUE_PASS(float, -std::numeric_limits<float>::infinity());
|
||||
CHECK_VALUE_PASS(double, -std::numeric_limits<double>::infinity());
|
||||
CHECK_VALUE_FAIL(std::string);
|
||||
CHECK_VALUE_FAIL(std::string_view);
|
||||
CHECK_VALUE_FAIL(toml::date);
|
||||
CHECK_VALUE_FAIL(toml::time);
|
||||
CHECK_VALUE_FAIL(toml::date_time);
|
||||
|
||||
*val = std::numeric_limits<double>::quiet_NaN();
|
||||
CHECK_VALUE_FAIL(bool);
|
||||
CHECK_VALUE_FAIL(int8_t);
|
||||
CHECK_VALUE_FAIL(uint8_t);
|
||||
CHECK_VALUE_FAIL(int16_t);
|
||||
CHECK_VALUE_FAIL(uint16_t);
|
||||
CHECK_VALUE_FAIL(int32_t);
|
||||
CHECK_VALUE_FAIL(uint32_t);
|
||||
CHECK_VALUE_FAIL(int64_t);
|
||||
CHECK_VALUE_FAIL(uint64_t);
|
||||
{
|
||||
auto fval = n.value<float>();
|
||||
REQUIRE(fval.has_value());
|
||||
CHECK(impl::fpclassify(*fval) == impl::fp_class::nan);
|
||||
}
|
||||
{
|
||||
auto fval = n.value<double>();
|
||||
REQUIRE(fval.has_value());
|
||||
CHECK(impl::fpclassify(*fval) == impl::fp_class::nan);
|
||||
}
|
||||
CHECK_VALUE_FAIL(std::string);
|
||||
CHECK_VALUE_FAIL(std::string_view);
|
||||
CHECK_VALUE_FAIL(toml::date);
|
||||
CHECK_VALUE_FAIL(toml::time);
|
||||
CHECK_VALUE_FAIL(toml::date_time);
|
||||
}
|
||||
}
|
@ -1,106 +0,0 @@
|
||||
# This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
# Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
assert(build_tests)
|
||||
|
||||
test_sources = files(
|
||||
'at_path.cpp',
|
||||
'conformance_burntsushi_invalid.cpp',
|
||||
'conformance_burntsushi_valid.cpp',
|
||||
'conformance_iarna_invalid.cpp',
|
||||
'conformance_iarna_valid.cpp',
|
||||
'formatters.cpp',
|
||||
'for_each.cpp',
|
||||
'impl_toml.cpp',
|
||||
'main.cpp',
|
||||
'manipulating_arrays.cpp',
|
||||
'manipulating_parse_result.cpp',
|
||||
'manipulating_tables.cpp',
|
||||
'manipulating_values.cpp',
|
||||
'parsing_arrays.cpp',
|
||||
'parsing_booleans.cpp',
|
||||
'parsing_comments.cpp',
|
||||
'parsing_dates_and_times.cpp',
|
||||
'parsing_floats.cpp',
|
||||
'parsing_integers.cpp',
|
||||
'parsing_key_value_pairs.cpp',
|
||||
'parsing_spec_example.cpp',
|
||||
'parsing_strings.cpp',
|
||||
'parsing_tables.cpp',
|
||||
'path.cpp',
|
||||
'tests.cpp',
|
||||
'user_feedback.cpp',
|
||||
'using_iterators.cpp',
|
||||
'visit.cpp',
|
||||
'windows_compat.cpp'
|
||||
)
|
||||
|
||||
test_deps = [ tomlplusplus_dep ]
|
||||
if not get_option('use_vendored_libs')
|
||||
test_deps += dependency('catch2')
|
||||
endif
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
# tests.exe
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
test_args = []
|
||||
test_args += global_args
|
||||
if has_exceptions
|
||||
test_args += cpp.get_supported_arguments('-DSHOULD_HAVE_EXCEPTIONS=1')
|
||||
else
|
||||
test_args += cpp.get_supported_arguments('-DSHOULD_HAVE_EXCEPTIONS=0')
|
||||
endif
|
||||
if get_option('use_vendored_libs')
|
||||
test_args += cpp.get_supported_arguments('-DUSE_VENDORED_LIBS=1')
|
||||
else
|
||||
test_args += cpp.get_supported_arguments('-DUSE_VENDORED_LIBS=0')
|
||||
endif
|
||||
|
||||
|
||||
test_exe = executable(
|
||||
'tomlplusplus_tests',
|
||||
test_sources,
|
||||
cpp_args: test_args,
|
||||
dependencies: test_deps,
|
||||
override_options: global_overrides
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
# per-locale invocations
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
test_locales = [
|
||||
'C',
|
||||
'en_US.utf8',
|
||||
'ja_JP.utf8',
|
||||
'it_IT.utf8',
|
||||
'tr_TR.utf8',
|
||||
'fi_FI.utf8',
|
||||
'fr_FR.utf8',
|
||||
'zh_CN.utf8',
|
||||
'de_DE.utf8'
|
||||
]
|
||||
|
||||
foreach locale : test_locales
|
||||
test(
|
||||
'tests - ' + locale,
|
||||
test_exe,
|
||||
env: ['LC_ALL=' + locale],
|
||||
workdir: meson.project_source_root()/'tests'
|
||||
)
|
||||
endforeach
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
# ODR build test
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# add the ODR-test build project
|
||||
executable(
|
||||
'tomlplusplus_odr_test',
|
||||
files( 'odr_test_1.cpp', 'odr_test_2.cpp' ),
|
||||
cpp_args: test_args,
|
||||
dependencies: test_deps
|
||||
)
|
@ -1,9 +0,0 @@
|
||||
#define TOML_UNDEF_MACROS 0
|
||||
#include "../toml.hpp"
|
||||
|
||||
TOML_DISABLE_WARNINGS;
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
#include "../toml.hpp"
|
||||
#include "../toml.hpp" // make sure it behaves if included more than once
|
@ -1,181 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
|
||||
TEST_CASE("parsing - arrays")
|
||||
{
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
integers = [ 1, 2, 3 ]
|
||||
integers2 = [
|
||||
1, 2, 3
|
||||
]
|
||||
integers3 = [
|
||||
1,
|
||||
2, # this is ok
|
||||
]
|
||||
colors = [ "red", "yellow", "green" ]
|
||||
nested_array_of_int = [ [ 1, 2 ], [3, 4, 5] ]
|
||||
nested_mixed_array = [ [ 1, 2 ], ["a", "b", "c"] ]
|
||||
string_array = [ "all", 'strings', """are the same""", '''type''' ]
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
REQUIRE(tbl["integers"].as<array>());
|
||||
CHECK(tbl["integers"].is_homogeneous());
|
||||
CHECK(tbl["integers"].is_homogeneous(node_type::integer));
|
||||
CHECK(!tbl["integers"].is_homogeneous(node_type::floating_point));
|
||||
CHECK(tbl["integers"].is_homogeneous<int64_t>());
|
||||
CHECK(!tbl["integers"].is_homogeneous<double>());
|
||||
CHECK(tbl["integers"].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["integers"].as<array>()->is_homogeneous(node_type::integer));
|
||||
CHECK(!tbl["integers"].as<array>()->is_homogeneous(node_type::floating_point));
|
||||
CHECK(tbl["integers"].as<array>()->is_homogeneous<int64_t>());
|
||||
CHECK(!tbl["integers"].as<array>()->is_homogeneous<double>());
|
||||
CHECK(tbl["integers"].as<array>()->size() == 3);
|
||||
CHECK(tbl["integers"][0] == 1);
|
||||
CHECK(tbl["integers"][1] == 2);
|
||||
CHECK(tbl["integers"][2] == 3);
|
||||
|
||||
REQUIRE(tbl["integers2"].as<array>());
|
||||
CHECK(tbl["integers2"].is_homogeneous());
|
||||
CHECK(tbl["integers2"].is_homogeneous(node_type::integer));
|
||||
CHECK(!tbl["integers2"].is_homogeneous(node_type::floating_point));
|
||||
CHECK(tbl["integers2"].is_homogeneous<int64_t>());
|
||||
CHECK(!tbl["integers2"].is_homogeneous<double>());
|
||||
CHECK(tbl["integers2"].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["integers2"].as<array>()->is_homogeneous(node_type::integer));
|
||||
CHECK(!tbl["integers2"].as<array>()->is_homogeneous(node_type::floating_point));
|
||||
CHECK(tbl["integers2"].as<array>()->is_homogeneous<int64_t>());
|
||||
CHECK(!tbl["integers2"].as<array>()->is_homogeneous<double>());
|
||||
CHECK(tbl["integers2"].as<array>()->size() == 3);
|
||||
CHECK(tbl["integers2"][0] == 1);
|
||||
CHECK(tbl["integers2"][1] == 2);
|
||||
CHECK(tbl["integers2"][2] == 3);
|
||||
|
||||
REQUIRE(tbl["integers3"].as<array>());
|
||||
CHECK(tbl["integers3"].is_homogeneous());
|
||||
CHECK(tbl["integers3"].is_homogeneous(node_type::integer));
|
||||
CHECK(!tbl["integers3"].is_homogeneous(node_type::floating_point));
|
||||
CHECK(tbl["integers3"].is_homogeneous<int64_t>());
|
||||
CHECK(!tbl["integers3"].is_homogeneous<double>());
|
||||
CHECK(tbl["integers3"].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["integers3"].as<array>()->is_homogeneous(node_type::integer));
|
||||
CHECK(!tbl["integers3"].as<array>()->is_homogeneous(node_type::floating_point));
|
||||
CHECK(tbl["integers3"].as<array>()->is_homogeneous<int64_t>());
|
||||
CHECK(!tbl["integers3"].as<array>()->is_homogeneous<double>());
|
||||
CHECK(tbl["integers3"].as<array>()->size() == 2);
|
||||
CHECK(tbl["integers3"][0] == 1);
|
||||
CHECK(tbl["integers3"][1] == 2);
|
||||
|
||||
REQUIRE(tbl["colors"].as<array>());
|
||||
CHECK(tbl["colors"].is_homogeneous());
|
||||
CHECK(tbl["colors"].is_homogeneous(node_type::string));
|
||||
CHECK(!tbl["colors"].is_homogeneous(node_type::floating_point));
|
||||
CHECK(tbl["colors"].is_homogeneous<std::string>());
|
||||
CHECK(!tbl["colors"].is_homogeneous<double>());
|
||||
CHECK(tbl["colors"].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["colors"].as<array>()->is_homogeneous(node_type::string));
|
||||
CHECK(!tbl["colors"].as<array>()->is_homogeneous(node_type::floating_point));
|
||||
CHECK(tbl["colors"].as<array>()->is_homogeneous<std::string>());
|
||||
CHECK(!tbl["colors"].as<array>()->is_homogeneous<double>());
|
||||
CHECK(tbl["colors"].as<array>()->size() == 3);
|
||||
CHECK(tbl["colors"][0] == "red"sv);
|
||||
CHECK(tbl["colors"][1] == "yellow"sv);
|
||||
CHECK(tbl["colors"][2] == "green"sv);
|
||||
|
||||
REQUIRE(tbl["nested_array_of_int"].as<array>());
|
||||
CHECK(tbl["nested_array_of_int"].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["nested_array_of_int"].as<array>()->size() == 2);
|
||||
REQUIRE(tbl["nested_array_of_int"][0].as<array>());
|
||||
CHECK(tbl["nested_array_of_int"][0].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["nested_array_of_int"][0].as<array>()->size() == 2);
|
||||
CHECK(tbl["nested_array_of_int"][0][0] == 1);
|
||||
CHECK(tbl["nested_array_of_int"][0][1] == 2);
|
||||
REQUIRE(tbl["nested_array_of_int"][1].as<array>());
|
||||
CHECK(tbl["nested_array_of_int"][1].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["nested_array_of_int"][1].as<array>()->size() == 3);
|
||||
CHECK(tbl["nested_array_of_int"][1][0] == 3);
|
||||
CHECK(tbl["nested_array_of_int"][1][1] == 4);
|
||||
CHECK(tbl["nested_array_of_int"][1][2] == 5);
|
||||
|
||||
REQUIRE(tbl["nested_mixed_array"].as<array>());
|
||||
CHECK(tbl["nested_mixed_array"].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["nested_mixed_array"].as<array>()->size() == 2);
|
||||
REQUIRE(tbl["nested_mixed_array"][0].as<array>());
|
||||
CHECK(tbl["nested_mixed_array"][0].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["nested_mixed_array"][0].as<array>()->size() == 2);
|
||||
CHECK(tbl["nested_mixed_array"][0][0] == 1);
|
||||
CHECK(tbl["nested_mixed_array"][0][1] == 2);
|
||||
REQUIRE(tbl["nested_mixed_array"][1].as<array>());
|
||||
CHECK(tbl["nested_mixed_array"][1].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["nested_mixed_array"][1].as<array>()->size() == 3);
|
||||
CHECK(tbl["nested_mixed_array"][1][0] == "a"sv);
|
||||
CHECK(tbl["nested_mixed_array"][1][1] == "b"sv);
|
||||
CHECK(tbl["nested_mixed_array"][1][2] == "c"sv);
|
||||
|
||||
REQUIRE(tbl["string_array"].as<array>());
|
||||
CHECK(tbl["string_array"].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["string_array"].as<array>()->size() == 4);
|
||||
CHECK(tbl["string_array"][0] == "all"sv);
|
||||
CHECK(tbl["string_array"][1] == "strings"sv);
|
||||
CHECK(tbl["string_array"][2] == "are the same"sv);
|
||||
CHECK(tbl["string_array"][3] == "type"sv);
|
||||
REQUIRE(tbl["integers"].as<array>());
|
||||
CHECK(tbl["integers"].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["integers"].as<array>()->size() == 3);
|
||||
CHECK(tbl["integers"][0] == 1);
|
||||
CHECK(tbl["integers"][1] == 2);
|
||||
CHECK(tbl["integers"][2] == 3);
|
||||
});
|
||||
|
||||
// toml/issues/665 (heterogeneous arrays)
|
||||
#if TOML_LANG_AT_LEAST(1, 0, 0)
|
||||
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
# Mixed-type arrays are allowed
|
||||
numbers = [ 0.1, 0.2, 0.5, 1, 2, 5 ]
|
||||
contributors = [
|
||||
"Foo Bar <foo@example.com>",
|
||||
{ name = "Baz Qux", email = "bazqux@example.com", url = "https://example.com/bazqux" }
|
||||
]
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
REQUIRE(tbl["numbers"].as<array>());
|
||||
CHECK(!tbl["numbers"].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["numbers"].as<array>()->size() == 6);
|
||||
CHECK(tbl["numbers"][0].as<double>());
|
||||
CHECK(tbl["numbers"][1].as<double>());
|
||||
CHECK(tbl["numbers"][2].as<double>());
|
||||
CHECK(tbl["numbers"][3].as<int64_t>());
|
||||
CHECK(tbl["numbers"][4].as<int64_t>());
|
||||
CHECK(tbl["numbers"][5].as<int64_t>());
|
||||
CHECK(tbl["numbers"][0] == 0.1);
|
||||
CHECK(tbl["numbers"][1] == 0.2);
|
||||
CHECK(tbl["numbers"][2] == 0.5);
|
||||
CHECK(tbl["numbers"][3] == 1);
|
||||
CHECK(tbl["numbers"][4] == 2);
|
||||
CHECK(tbl["numbers"][5] == 5);
|
||||
|
||||
REQUIRE(tbl["contributors"].as<array>());
|
||||
CHECK(!tbl["contributors"].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["contributors"].as<array>()->size() == 2);
|
||||
CHECK(tbl["contributors"][0].as<std::string>());
|
||||
CHECK(tbl["contributors"][1].as<table>());
|
||||
CHECK(tbl["contributors"][0] == "Foo Bar <foo@example.com>"sv);
|
||||
CHECK(tbl["contributors"][1]["name"] == "Baz Qux"sv);
|
||||
CHECK(tbl["contributors"][1]["email"] == "bazqux@example.com"sv);
|
||||
CHECK(tbl["contributors"][1]["url"] == "https://example.com/bazqux"sv);
|
||||
});
|
||||
|
||||
#else
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS, "numbers = [ 0.1, 0.2, 0.5, 1, 2, 5 ]"sv);
|
||||
|
||||
#endif
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
|
||||
TEST_CASE("parsing - booleans")
|
||||
{
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
bool1 = true
|
||||
bool2 = false
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["bool1"] == true);
|
||||
CHECK(tbl["bool2"] == false);
|
||||
});
|
||||
|
||||
// "Always lowercase."
|
||||
parsing_should_fail(FILE_LINE_ARGS, "bool = True"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "bool = TRUE"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "bool = tRUE"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "bool = False"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "bool = FALSE"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "bool = fALSE"sv);
|
||||
|
||||
// value tests
|
||||
parse_expected_value(FILE_LINE_ARGS, " true", true);
|
||||
parse_expected_value(FILE_LINE_ARGS, "false", false);
|
||||
}
|
@ -1,110 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
|
||||
TEST_CASE("parsing - comments")
|
||||
{
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
# This is a full-line comment
|
||||
key = "value" # This is a comment at the end of a line
|
||||
another = "# This is not a comment"
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl.size() == 2);
|
||||
CHECK(tbl["key"] == "value"sv);
|
||||
CHECK(tbl["another"] == "# This is not a comment"sv);
|
||||
});
|
||||
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(# this = "looks like a KVP but is commented out)"sv,
|
||||
[](table&& tbl) { CHECK(tbl.size() == 0); });
|
||||
|
||||
#if TOML_LANG_AT_LEAST(1, 0, 0)
|
||||
{
|
||||
// toml/issues/567 (disallow non-TAB control characters in comments)
|
||||
// 00 - 08
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0000 some trailing garbage"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0001"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0002"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0003"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0004"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0005"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0006"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0007"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0008"sv);
|
||||
|
||||
// skip tab and line breaks (real and otherwise)
|
||||
// \u0009 is \t
|
||||
// \u000A is \n
|
||||
// \u000B is \v (vertical tab)
|
||||
// \u000C is \f (form feed)
|
||||
// \u000D is \r
|
||||
|
||||
// 0E - 1F
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u000E"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u000F"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0010"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0011"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0012"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0013"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0014"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0015"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0016"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0017"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0018"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u0019"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u001A"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u001B"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u001C"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u001D"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u001E"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u001F"sv);
|
||||
// 7F
|
||||
parsing_should_fail(FILE_LINE_ARGS, "# \u007F"sv);
|
||||
}
|
||||
#else
|
||||
{
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
S("## 00 - 08"
|
||||
"# \u0000 "
|
||||
"# \u0001 "
|
||||
"# \u0002 "
|
||||
"# \u0003 "
|
||||
"# \u0004 "
|
||||
"# \u0005 "
|
||||
"# \u0006 "
|
||||
"# \u0007 "
|
||||
"# \u0008 "
|
||||
"## 0A - 1F"
|
||||
"# \u000A "
|
||||
"# \u000B "
|
||||
"# \u000C "
|
||||
"# \u000D "
|
||||
"# \u000E "
|
||||
"# \u000F "
|
||||
"# \u0010 "
|
||||
"# \u0011 "
|
||||
"# \u0012 "
|
||||
"# \u0013 "
|
||||
"# \u0014 "
|
||||
"# \u0015 "
|
||||
"# \u0016 "
|
||||
"# \u0017 "
|
||||
"# \u0018 "
|
||||
"# \u0019 "
|
||||
"# \u001A "
|
||||
"# \u001B "
|
||||
"# \u001C "
|
||||
"# \u001D "
|
||||
"# \u001E "
|
||||
"# \u001F "
|
||||
"## 7F "
|
||||
"# \u007F "sv));
|
||||
}
|
||||
#endif
|
||||
}
|
@ -1,174 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
|
||||
TEST_CASE("parsing - dates and times")
|
||||
{
|
||||
parsing_should_succeed(
|
||||
FILE_LINE_ARGS,
|
||||
R"(
|
||||
odt1 = 1979-05-27T07:32:00Z
|
||||
odt2 = 1979-05-27T00:32:00-07:00
|
||||
odt3 = 1979-05-27T00:32:00.999999-07:00
|
||||
odt4 = 1979-05-27 07:32:00Z
|
||||
ldt1 = 1979-05-27T07:32:00
|
||||
ldt2 = 1979-05-27T00:32:00.999999
|
||||
ld1 = 1979-05-27
|
||||
lt1 = 07:32:00
|
||||
lt2 = 00:32:00.999999
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
static constexpr auto odt1 = date_time{ { 1979, 5, 27 }, { 7, 32 }, {} };
|
||||
CHECK(tbl["odt1"] == odt1);
|
||||
static constexpr auto odt2 = date_time{ { 1979, 5, 27 }, { 0, 32 }, { -7, 0 } };
|
||||
CHECK(tbl["odt2"] == odt2);
|
||||
static constexpr auto odt3 = date_time{ { 1979, 5, 27 }, { 0, 32, 0, 999999000u }, { -7, 0 } };
|
||||
CHECK(tbl["odt3"] == odt3);
|
||||
static constexpr auto odt4 = date_time{ { 1979, 5, 27 }, { 7, 32 }, {} };
|
||||
CHECK(tbl["odt4"] == odt4);
|
||||
static constexpr auto ldt1 = date_time{ { 1979, 5, 27 }, { 7, 32 } };
|
||||
CHECK(tbl["ldt1"] == ldt1);
|
||||
static constexpr auto ldt2 = date_time{ { 1979, 5, 27 }, { 0, 32, 0, 999999000u } };
|
||||
CHECK(tbl["ldt2"] == ldt2);
|
||||
static constexpr auto ld1 = date{ 1979, 5, 27 };
|
||||
CHECK(tbl["ld1"] == ld1);
|
||||
static constexpr auto lt1 = toml::time{ 7, 32 };
|
||||
CHECK(tbl["lt1"] == lt1);
|
||||
static constexpr auto lt2 = toml::time{ 0, 32, 0, 999999000u };
|
||||
CHECK(tbl["lt2"] == lt2);
|
||||
});
|
||||
|
||||
// value tests
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16"sv, date{ 1987, 3, 16 });
|
||||
parse_expected_value(FILE_LINE_ARGS, "10:20:30"sv, toml::time{ 10, 20, 30 });
|
||||
parse_expected_value(FILE_LINE_ARGS, "10:20:30.04"sv, toml::time{ 10, 20, 30, 40000000 });
|
||||
{
|
||||
const auto val = date_time{ { 1987, 3, 16 }, { 10, 20, 30 } };
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16T10:20:30"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16t10:20:30"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16 10:20:30"sv, val);
|
||||
}
|
||||
{
|
||||
const auto val = date_time{ { 1987, 3, 16 }, { 10, 20, 30 }, { -9, -30 } };
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16T10:20:30-09:30"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16t10:20:30-09:30"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16 10:20:30-09:30"sv, val);
|
||||
}
|
||||
{
|
||||
const auto val = date_time{ { 1987, 3, 16 }, { 10, 20, 30 }, { 9, 30 } };
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16T10:20:30+09:30"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16t10:20:30+09:30"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16 10:20:30+09:30"sv, val);
|
||||
}
|
||||
{
|
||||
const auto val = date_time{ { 1987, 3, 16 }, { 10, 20, 30, 40000000 } };
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16T10:20:30.04"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16t10:20:30.04"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16 10:20:30.04"sv, val);
|
||||
}
|
||||
{
|
||||
const auto val = date_time{ { 1987, 3, 16 }, { 10, 20, 30, 40000000 }, { -9, -30 } };
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16T10:20:30.04-09:30"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16t10:20:30.04-09:30"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16 10:20:30.04-09:30"sv, val);
|
||||
}
|
||||
{
|
||||
const auto val = date_time{ { 1987, 3, 16 }, { 10, 20, 30, 40000000 }, { 9, 30 } };
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16T10:20:30.04+09:30"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16t10:20:30.04+09:30"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16 10:20:30.04+09:30"sv, val);
|
||||
}
|
||||
{
|
||||
const auto val = date_time{ { 1987, 3, 16 }, { 10, 20, 30 }, {} };
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16T10:20:30Z"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16t10:20:30Z"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16 10:20:30Z"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16T10:20:30z"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16t10:20:30z"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16 10:20:30z"sv, val);
|
||||
}
|
||||
{
|
||||
const auto val = date_time{ { 1987, 3, 16 }, { 10, 20, 30, 40000000 }, {} };
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16T10:20:30.04Z"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16t10:20:30.04Z"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16 10:20:30.04Z"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16T10:20:30.04z"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16t10:20:30.04z"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16 10:20:30.04z"sv, val);
|
||||
}
|
||||
|
||||
// toml/issues/671 (allow omission of seconds)
|
||||
#if TOML_LANG_UNRELEASED
|
||||
|
||||
parse_expected_value(FILE_LINE_ARGS, "10:20"sv, toml::time{ 10, 20 });
|
||||
{
|
||||
const auto val = date_time{ { 1987, 3, 16 }, { 10, 20 } };
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16T10:20"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16 10:20"sv, val);
|
||||
}
|
||||
{
|
||||
const auto val = date_time{ { 1987, 3, 16 }, { 10, 20 }, { -9, -30 } };
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16T10:20-09:30"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16 10:20-09:30"sv, val);
|
||||
}
|
||||
{
|
||||
const auto val = date_time{ { 1987, 3, 16 }, { 10, 20 }, { 9, 30 } };
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16T10:20+09:30"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16 10:20+09:30"sv, val);
|
||||
}
|
||||
{
|
||||
const auto val = date_time{ { 1987, 3, 16 }, { 10, 20 }, {} };
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16T10:20Z"sv, val);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16 10:20Z"sv, val);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS, "10:20"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "1987-03-16T10:20"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "1987-03-16 10:20"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "1987-03-16T10:20-09:30"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "1987-03-16 10:20-09:30"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "1987-03-16T10:20+09:30"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "1987-03-16 10:20+09:30"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "1987-03-16T10:20Z"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "1987-03-16 10:20Z"sv);
|
||||
|
||||
#endif
|
||||
|
||||
// eof tests
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-03-1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-03-"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-03"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-0"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 10:20:30."sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 10:20:3"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 10:20:"sv);
|
||||
#if !TOML_LANG_UNRELEASED // toml/issues/671 (allow omission of seconds)
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 10:20"sv);
|
||||
#endif
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 10:2"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 10:"sv);
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-03-16 10:20:30.04-09:3"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-03-16 10:20:30.04-09:"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-03-16 10:20:30.04-09"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-03-16 10:20:30.04-0"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-03-16 10:20:30.04-"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-03-16 10:20:30."sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-03-16 10:20:3"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-03-16 10:20:"sv);
|
||||
#if !TOML_LANG_UNRELEASED // toml/issues/671 (allow omission of seconds)
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-03-16 10:20"sv);
|
||||
#endif
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-03-16 10:2"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-03-16 10:"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-03-16 10"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1987-03-16 1"sv);
|
||||
}
|
@ -1,242 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
|
||||
TEST_CASE("parsing - floats")
|
||||
{
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
# fractional
|
||||
flt1 = +1.0
|
||||
flt2 = 3.1415
|
||||
flt3 = -0.01
|
||||
|
||||
# exponent
|
||||
flt4 = 5e+22
|
||||
flt5 = 1e06
|
||||
flt6 = -2E-2
|
||||
|
||||
# both
|
||||
flt7 = 6.626e-34
|
||||
|
||||
flt8 = 224_617.445_991_228
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["flt1"] == 1.0);
|
||||
CHECK(tbl["flt2"] == 3.1415);
|
||||
CHECK(tbl["flt3"] == -0.01);
|
||||
CHECK(tbl["flt4"].as<double>()->get() == 5e+22_a);
|
||||
CHECK(tbl["flt5"].as<double>()->get() == 1e6_a);
|
||||
CHECK(tbl["flt6"] == -2E-2);
|
||||
CHECK(tbl["flt7"].as<double>()->get() == 6.626e-34_a);
|
||||
CHECK(tbl["flt8"].as<double>()->get() == 224617.445991228_a);
|
||||
});
|
||||
|
||||
// "Each underscore must be surrounded by at least one digit on each side."
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt8 = 224_617.445_991_228_"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt8 = _224_617.445_991_228"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt8 = 224__617.445_991_228"sv);
|
||||
|
||||
// "Float values -0.0 and +0.0 are valid and should map according to IEEE 754."
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(zeroes = [-0.0, +0.0])"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["zeroes"][0] == -0.0);
|
||||
CHECK(tbl["zeroes"][1] == +0.0);
|
||||
});
|
||||
|
||||
// "A float consists of an integer part followed by a fractional part and/or an exponent part"
|
||||
// (i.e. omitting the leading digits before the '.' is not legal in TOML)
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = .1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = +.1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = -.1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = .1e1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = .1e+1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = .1e-1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = +.1e1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = +.1e+1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = +.1e-1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = -.1e1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = -.1e+1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = -.1e-1"sv);
|
||||
|
||||
// likewise, so is omitting digits _after_ the '.'
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = 1."sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = +1."sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = -1."sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = 1.e1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = 1.e+1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = 1.e-1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = +1.e1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = +1.e+1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = +1.e-1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = -1.e1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = -1.e+1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "flt = -1.e-1"sv);
|
||||
|
||||
// value tests
|
||||
parse_expected_value(FILE_LINE_ARGS, "1e1"sv, 1e1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1e+1"sv, 1e+1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1e-1"sv, 1e-1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1.0"sv, 1.0);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1.0e1"sv, 1.0e1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1.0e+1"sv, 1.0e+1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1.0e-1"sv, 1.0e-1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "+1e1"sv, +1e1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "+1.0"sv, +1.0);
|
||||
parse_expected_value(FILE_LINE_ARGS, "+1.0e1"sv, +1.0e1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "+1.0e+1"sv, +1.0e+1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "+1.0e-1"sv, +1.0e-1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-1.0e+1"sv, -1.0e+1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-1e1"sv, -1e1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-1.0"sv, -1.0);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-1.0e1"sv, -1.0e1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-1.0e-1"sv, -1.0e-1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0.1"sv, 0.1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0.001"sv, 0.001);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0.100"sv, 0.100);
|
||||
parse_expected_value(FILE_LINE_ARGS, "+3.14"sv, +3.14);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-3.14"sv, -3.14);
|
||||
parse_expected_value(FILE_LINE_ARGS, "3.1415_9265_3589"sv, 3.141592653589);
|
||||
parse_expected_value(FILE_LINE_ARGS, "+3.1415_9265_3589"sv, +3.141592653589);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-3.1415_9265_3589"sv, -3.141592653589);
|
||||
parse_expected_value(FILE_LINE_ARGS, "123_456.789"sv, 123456.789);
|
||||
parse_expected_value(FILE_LINE_ARGS, "+123_456.789"sv, +123456.789);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-123_456.789"sv, -123456.789);
|
||||
parse_expected_value(FILE_LINE_ARGS, "+0.0"sv, +0.0);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-0.0"sv, -0.0);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1e10"sv, 1e10);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1e+10"sv, 1e+10);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1e-10"sv, 1e-10);
|
||||
parse_expected_value(FILE_LINE_ARGS, "+1e10"sv, +1e10);
|
||||
parse_expected_value(FILE_LINE_ARGS, "+1e+10"sv, +1e+10);
|
||||
parse_expected_value(FILE_LINE_ARGS, "+1e-10"sv, +1e-10);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-1e10"sv, -1e10);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-1e+10"sv, -1e+10);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-1e-10"sv, -1e-10);
|
||||
parse_expected_value(FILE_LINE_ARGS, "123e-10"sv, 123e-10);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1E10"sv, 1E10);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1E+10"sv, 1E+10);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1E-10"sv, 1E-10);
|
||||
parse_expected_value(FILE_LINE_ARGS, "123E-10"sv, 123E-10);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1_2_3E-10"sv, 123E-10);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1_2_3E-1_0"sv, 123E-10);
|
||||
parse_expected_value(FILE_LINE_ARGS, "+0e0"sv, +0e0);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-0e0"sv, -0e0);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1_2_3E-01"sv, 123E-01);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1_2_3E-0_1"sv, 123E-01);
|
||||
parse_expected_value(FILE_LINE_ARGS, "6.02e23"sv, 6.02e23);
|
||||
parse_expected_value(FILE_LINE_ARGS, "6.02e+23"sv, 6.02e+23);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1.112_650_06e-17"sv, 1.11265006e-17);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0.010284358729827818"sv, 0.010284358729827818);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0.010284358729827818"sv, 0.010284358729827818);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0.0102"sv, 0.0102);
|
||||
parse_expected_value(FILE_LINE_ARGS, "10.0102"sv, 10.0102);
|
||||
parse_expected_value(FILE_LINE_ARGS, "10.010284358729828"sv, 10.010284358729828);
|
||||
parse_expected_value(FILE_LINE_ARGS, "10.0"sv, 10.0);
|
||||
|
||||
// toml/issues/562 (hexfloats)
|
||||
#if TOML_LANG_UNRELEASED
|
||||
parse_expected_value(FILE_LINE_ARGS, " 0x1.2p3"sv, 0x1.2p3);
|
||||
parse_expected_value(FILE_LINE_ARGS, " 0x10p1"sv, 0x10p1);
|
||||
parse_expected_value(FILE_LINE_ARGS, " 0x10p-1"sv, 0x10p-1);
|
||||
parse_expected_value(FILE_LINE_ARGS, " 0x10p+1"sv, 0x10p+1);
|
||||
parse_expected_value(FILE_LINE_ARGS, " -0x10p1"sv, -0x10p1);
|
||||
parse_expected_value(FILE_LINE_ARGS, " -0x10p-1"sv, -0x10p-1);
|
||||
parse_expected_value(FILE_LINE_ARGS, " +0x10p1"sv, +0x10p1);
|
||||
parse_expected_value(FILE_LINE_ARGS, " +0x10p+1"sv, +0x10p+1);
|
||||
parse_expected_value(FILE_LINE_ARGS, " -0x10p+1"sv, -0x10p+1);
|
||||
parse_expected_value(FILE_LINE_ARGS, " +0x10p-1"sv, +0x10p-1);
|
||||
parse_expected_value(FILE_LINE_ARGS, " 0x10.1p1"sv, 0x10.1p1);
|
||||
parse_expected_value(FILE_LINE_ARGS, " 0x10.1p-1"sv, 0x10.1p-1);
|
||||
parse_expected_value(FILE_LINE_ARGS, " 0x10.1p+1"sv, 0x10.1p+1);
|
||||
parse_expected_value(FILE_LINE_ARGS, " -0x10.1p1"sv, -0x10.1p1);
|
||||
parse_expected_value(FILE_LINE_ARGS, " -0x10.1p-1"sv, -0x10.1p-1);
|
||||
parse_expected_value(FILE_LINE_ARGS, " +0x10.1p1"sv, +0x10.1p1);
|
||||
parse_expected_value(FILE_LINE_ARGS, " +0x10.1p+1"sv, +0x10.1p+1);
|
||||
parse_expected_value(FILE_LINE_ARGS, " -0x10.1p+1"sv, -0x10.1p+1);
|
||||
parse_expected_value(FILE_LINE_ARGS, " +0x10.1p-1"sv, +0x10.1p-1);
|
||||
#else
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 0x10p1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 0x10p-1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 0x10p+1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = -0x10p1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = -0x10p-1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = +0x10p1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = +0x10p+1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = -0x10p+1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = +0x10p-1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 0x10.1p1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 0x10.1p-1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 0x10.1p+1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = -0x10.1p1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = -0x10.1p-1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = +0x10.1p1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = +0x10.1p+1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = -0x10.1p+1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = +0x10.1p-1"sv);
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST_CASE("parsing - inf and nan")
|
||||
{
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
# infinity
|
||||
sf1 = inf # positive infinity
|
||||
sf2 = +inf # positive infinity
|
||||
sf3 = -inf # negative infinity
|
||||
|
||||
# not a number
|
||||
sf4 = nan # actual sNaN/qNaN encoding is implementation specific
|
||||
sf5 = +nan # same as `nan`
|
||||
sf6 = -nan # valid, actual encoding is implementation specific
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(impl::fpclassify(**tbl["sf1"].as<double>()) == impl::fp_class::pos_inf);
|
||||
CHECK(impl::fpclassify(**tbl["sf2"].as<double>()) == impl::fp_class::pos_inf);
|
||||
CHECK(impl::fpclassify(**tbl["sf3"].as<double>()) == impl::fp_class::neg_inf);
|
||||
CHECK(impl::fpclassify(**tbl["sf4"].as<double>()) == impl::fp_class::nan);
|
||||
CHECK(impl::fpclassify(**tbl["sf5"].as<double>()) == impl::fp_class::nan);
|
||||
CHECK(impl::fpclassify(**tbl["sf6"].as<double>()) == impl::fp_class::nan);
|
||||
});
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = NaN "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = Nan "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = NAN "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = +NaN "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = +Nan "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = +NAN "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = -NaN "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = -Nan "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = -NAN "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 1.nan "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 1,nan "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = .nan "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = ,nan "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = nan.1 "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = nan,1 "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = nan. "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = nan, "sv);
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = Inf "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = INF "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = +Inf "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = +INF "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = -Inf "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = -INF "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 1.inf "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 1,inf "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = .inf "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = ,inf "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = inf.1 "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = inf,1 "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = inf. "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = inf, "sv);
|
||||
}
|
@ -1,177 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
|
||||
TEST_CASE("parsing - integers (decimal)")
|
||||
{
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
BOM_PREFIX R"(
|
||||
int1 = +99
|
||||
int2 = 42
|
||||
int3 = 0
|
||||
int4 = -17
|
||||
int5 = 1_000
|
||||
int6 = 5_349_221
|
||||
int7 = 1_2_3_4_5 # VALID but discouraged
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["int1"] == 99);
|
||||
CHECK(tbl["int2"] == 42);
|
||||
CHECK(tbl["int3"] == 0);
|
||||
CHECK(tbl["int4"] == -17);
|
||||
CHECK(tbl["int5"] == 1000);
|
||||
CHECK(tbl["int6"] == 5349221);
|
||||
CHECK(tbl["int7"] == 12345);
|
||||
});
|
||||
|
||||
// "Each underscore must be surrounded by at least one digit on each side."
|
||||
parsing_should_fail(FILE_LINE_ARGS, "int5 = 1__000"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "int5 = _1_000"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "int5 = 1_000_"sv);
|
||||
|
||||
// "Leading zeroes are not allowed."
|
||||
parsing_should_fail(FILE_LINE_ARGS, "int1 = +099"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "int2 = 042"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "int3 = 00"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "int4 = -017"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "int5 = 01_000"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "int6 = 05_349_221"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "int7 = 01_2_3_4_5"sv);
|
||||
|
||||
// "Integer values -0 and +0 are valid and identical to an unprefixed zero."
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
"zeroes = [-0, +0]"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["zeroes"][0] == 0);
|
||||
CHECK(tbl["zeroes"][1] == 0);
|
||||
});
|
||||
|
||||
// "64 bit (signed long) range expected (−9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)."
|
||||
parse_expected_value(FILE_LINE_ARGS, "9223372036854775807"sv, INT64_MAX);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-9223372036854775808"sv, INT64_MIN);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 9223372036854775808"sv); // INT64_MAX + 1
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = -9223372036854775809"sv); // INT64_MIN - 1
|
||||
|
||||
// signs in weird places
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = +-1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = -+1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = ++1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = --1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1-"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 1+"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = -1+"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = +1-"sv);
|
||||
|
||||
// value tests
|
||||
parse_expected_value(FILE_LINE_ARGS, "0"sv, 0);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1"sv, 1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "+1"sv, 1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-1"sv, -1);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1234"sv, 1234);
|
||||
parse_expected_value(FILE_LINE_ARGS, "+1234"sv, 1234);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-1234"sv, -1234);
|
||||
parse_expected_value(FILE_LINE_ARGS, "1_2_3_4"sv, 1234);
|
||||
parse_expected_value(FILE_LINE_ARGS, "+1_2_3_4"sv, 1234);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-1_2_3_4"sv, -1234);
|
||||
parse_expected_value(FILE_LINE_ARGS, "123_456_789"sv, 123456789);
|
||||
}
|
||||
|
||||
TEST_CASE("parsing - integers (hex, bin, oct)")
|
||||
{
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
# hexadecimal with prefix `0x`
|
||||
hex1 = 0xDEADBEEF
|
||||
hex2 = 0xdeadbeef
|
||||
hex3 = 0xdead_beef
|
||||
|
||||
# octal with prefix `0o`
|
||||
oct1 = 0o01234567
|
||||
oct2 = 0o755 # useful for Unix file permissions
|
||||
|
||||
# binary with prefix `0b`
|
||||
bin1 = 0b11010110
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["hex1"] == 0xDEADBEEF);
|
||||
CHECK(tbl["hex2"] == 0xDEADBEEF);
|
||||
CHECK(tbl["hex3"] == 0xDEADBEEF);
|
||||
CHECK(tbl["oct1"] == 01234567);
|
||||
CHECK(tbl["oct2"] == 0755);
|
||||
CHECK(tbl["bin1"] == 0b11010110);
|
||||
});
|
||||
|
||||
// "leading + is not allowed"
|
||||
parsing_should_fail(FILE_LINE_ARGS, "hex1 = +0xDEADBEEF"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "hex2 = +0xdeadbeef"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "hex3 = +0xdead_beef"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "oct1 = +0o01234567"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "oct2 = +0o7550"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "int6 = +05_349_221"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "bin1 = +0b11010110"sv);
|
||||
|
||||
// "leading zeros are allowed (after the prefix)"
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
hex1 = 0x000DEADBEEF
|
||||
hex2 = 0x00000deadbeef
|
||||
hex3 = 0x0dead_beef
|
||||
oct1 = 0o0001234567
|
||||
oct2 = 0o000755
|
||||
bin1 = 0b0000011010110
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["hex1"] == 0xDEADBEEF);
|
||||
CHECK(tbl["hex2"] == 0xDEADBEEF);
|
||||
CHECK(tbl["hex3"] == 0xDEADBEEF);
|
||||
CHECK(tbl["oct1"] == 01234567);
|
||||
CHECK(tbl["oct2"] == 0755);
|
||||
CHECK(tbl["bin1"] == 0b11010110);
|
||||
});
|
||||
|
||||
// "***Non-negative*** integer values may also be expressed in hexadecimal, octal, or binary"
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = -0x1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = -0o1"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = -0b1"sv);
|
||||
|
||||
// "64 bit (signed long) range expected (−9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)."
|
||||
// (ignoring INT64_MIN because toml doesn't allow these forms to represent negative values)
|
||||
parse_expected_value(FILE_LINE_ARGS, "0x7FFFFFFFFFFFFFFF"sv, INT64_MAX);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0o777777777777777777777"sv, INT64_MAX);
|
||||
parse_expected_value(FILE_LINE_ARGS,
|
||||
"0b111111111111111111111111111111111111111111111111111111111111111"sv,
|
||||
INT64_MAX);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 0x8000000000000000"sv); // INT64_MAX + 1
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 0o1000000000000000000000"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 0b1000000000000000000000000000000000000000000000000000000000000000"sv);
|
||||
|
||||
// missing values after base prefix
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 0x "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 0o "sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "val = 0b "sv);
|
||||
|
||||
// value tests
|
||||
parse_expected_value(FILE_LINE_ARGS, "0xDEADBEEF"sv, 0xDEADBEEF);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0xdeadbeef"sv, 0xDEADBEEF);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0xDEADbeef"sv, 0xDEADBEEF);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0xDEAD_BEEF"sv, 0xDEADBEEF);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0xdead_beef"sv, 0xDEADBEEF);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0xdead_BEEF"sv, 0xDEADBEEF);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0xFF"sv, 0xFF);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0x00FF"sv, 0xFF);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0x0000FF"sv, 0xFF);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0o777"sv, 0777);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0o7_7_7"sv, 0777);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0o007"sv, 0007);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0b10000"sv, 0b10000);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0b010000"sv, 0b10000);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0b01_00_00"sv, 0b10000);
|
||||
parse_expected_value(FILE_LINE_ARGS, "0b111111"sv, 0b111111);
|
||||
}
|
@ -1,399 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
|
||||
TEST_CASE("parsing - key-value pairs")
|
||||
{
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
key = "value"
|
||||
bare_key = "value"
|
||||
bare-key = "value"
|
||||
1234 = "value"
|
||||
"" = "blank"
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl.size() == 5);
|
||||
CHECK(tbl["key"] == "value"sv);
|
||||
CHECK(tbl["bare_key"] == "value"sv);
|
||||
CHECK(tbl["bare-key"] == "value"sv);
|
||||
CHECK(tbl["1234"] == "value"sv);
|
||||
CHECK(tbl[""] == "blank"sv);
|
||||
});
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(key = # INVALID)"sv);
|
||||
|
||||
#if UNICODE_LITERALS_OK
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
"127.0.0.1" = "value"
|
||||
"character encoding" = "value"
|
||||
"ʎǝʞ" = "value"
|
||||
'key2' = "value"
|
||||
'quoted "value"' = "value"
|
||||
'' = 'blank'
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["127.0.0.1"] == "value"sv);
|
||||
CHECK(tbl["character encoding"] == "value"sv);
|
||||
CHECK(tbl["ʎǝʞ"] == "value"sv);
|
||||
CHECK(tbl["key2"] == "value"sv);
|
||||
CHECK(tbl["quoted \"value\""] == "value"sv);
|
||||
CHECK(tbl[""] == "blank"sv);
|
||||
});
|
||||
#endif // UNICODE_LITERALS_OK
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(= "no key name")"sv);
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
# DO NOT DO THIS
|
||||
name = "Tom"
|
||||
name = "Pradyun"
|
||||
)"sv);
|
||||
}
|
||||
|
||||
TEST_CASE("parsing - key-value pairs (dotted)")
|
||||
{
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
name = "Orange"
|
||||
physical.color = "orange"
|
||||
physical.shape = "round"
|
||||
site."google.com" = true
|
||||
3.14159 = "pi"
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl.size() == 4);
|
||||
CHECK(tbl["name"] == "Orange"sv);
|
||||
CHECK(tbl["physical"]["color"] == "orange"sv);
|
||||
CHECK(tbl["physical"]["shape"] == "round"sv);
|
||||
CHECK(tbl["site"]["google.com"] == true);
|
||||
CHECK(tbl["3"]["14159"] == "pi"sv);
|
||||
});
|
||||
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
fruit.apple.smooth = true
|
||||
fruit.orange = 2
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["fruit"]["apple"]["smooth"] == true);
|
||||
CHECK(tbl["fruit"]["orange"] == 2);
|
||||
});
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
# THIS IS INVALID
|
||||
fruit.apple = 1
|
||||
fruit.apple.smooth = true
|
||||
)"sv);
|
||||
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
# VALID BUT DISCOURAGED
|
||||
|
||||
apple.type = "fruit"
|
||||
orange.type = "fruit"
|
||||
|
||||
apple.skin = "thin"
|
||||
orange.skin = "thick"
|
||||
|
||||
apple.color = "red"
|
||||
orange.color = "orange"
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["apple"]["type"] == "fruit"sv);
|
||||
CHECK(tbl["apple"]["skin"] == "thin"sv);
|
||||
CHECK(tbl["apple"]["color"] == "red"sv);
|
||||
CHECK(tbl["orange"]["type"] == "fruit"sv);
|
||||
CHECK(tbl["orange"]["skin"] == "thick"sv);
|
||||
CHECK(tbl["orange"]["color"] == "orange"sv);
|
||||
});
|
||||
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
# RECOMMENDED
|
||||
|
||||
apple.type = "fruit"
|
||||
apple.skin = "thin"
|
||||
apple.color = "red"
|
||||
|
||||
orange.type = "fruit"
|
||||
orange.skin = "thick"
|
||||
orange.color = "orange"
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["apple"]["type"] == "fruit"sv);
|
||||
CHECK(tbl["apple"]["skin"] == "thin"sv);
|
||||
CHECK(tbl["apple"]["color"] == "red"sv);
|
||||
CHECK(tbl["orange"]["type"] == "fruit"sv);
|
||||
CHECK(tbl["orange"]["skin"] == "thick"sv);
|
||||
CHECK(tbl["orange"]["color"] == "orange"sv);
|
||||
});
|
||||
|
||||
// toml/issues/644 ('+' in bare keys)
|
||||
#if TOML_LANG_UNRELEASED
|
||||
parsing_should_succeed(FILE_LINE_ARGS, "key+1 = 0"sv, [](table&& tbl) { CHECK(tbl["key+1"] == 0); });
|
||||
#else
|
||||
parsing_should_fail(FILE_LINE_ARGS, "key+1 = 0"sv);
|
||||
#endif
|
||||
|
||||
// toml/pull/891 (unicode bare keys)
|
||||
// clang-format off
|
||||
#if UNICODE_LITERALS_OK
|
||||
#if TOML_LANG_UNRELEASED
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(ʎǝʞ = 1)"sv, [](table&& tbl) { CHECK(tbl[R"(ʎǝʞ)"] == 1); });
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(Fuß = 2)"sv, [](table&& tbl) { CHECK(tbl[R"(Fuß)"] == 2); });
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(😂 = 3)"sv, [](table&& tbl) { CHECK(tbl[R"(😂)"] == 3); });
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(汉语大字典 = 4)"sv, [](table&& tbl) { CHECK(tbl[R"(汉语大字典)"] == 4); });
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(辭源 = 5)"sv, [](table&& tbl) { CHECK(tbl[R"(辭源)"] == 5); });
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(பெண்டிரேம் = 6)"sv, [](table&& tbl) { CHECK(tbl[R"(பெண்டிரேம்)"] == 6); });
|
||||
#else
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(ʎǝʞ = 1)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(Fuß = 2)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(😂 = 3)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(汉语大字典 = 4)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(辭源 = 5)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(பெண்டிரேம் = 6)"sv);
|
||||
#endif
|
||||
#endif // UNICODE_LITERALS_OK
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
TEST_CASE("parsing - key-value pairs (string keys)")
|
||||
{
|
||||
// these are all derived from the discussion at
|
||||
// https://github.com/toml-lang/toml/issues/733.
|
||||
|
||||
// whitespace stripped, fail duplicate keys
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
a = 2
|
||||
a = 3
|
||||
)"sv);
|
||||
|
||||
// only surrounding whitespace is stripped, fail: illegal key name or syntax error
|
||||
parsing_should_fail(FILE_LINE_ARGS, "a b = 3"sv);
|
||||
|
||||
// whitespace is allowed when quoted, fail duplicate key
|
||||
parsing_should_succeed(FILE_LINE_ARGS, "\"a b\" = 3"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, "'a b' = 3"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
"a b" = 3
|
||||
'a b' = 3
|
||||
)"sv);
|
||||
|
||||
// whitespace is allowed when quoted, but not collapsed, success
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(
|
||||
"a b" = 3
|
||||
'a b' = 3
|
||||
)"sv);
|
||||
|
||||
// whitespace relevant, but fail: duplicate key
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
"a " = 2
|
||||
'a ' = 3
|
||||
)"sv);
|
||||
|
||||
// whitespace relevant, and not collapsed, success
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(
|
||||
"a " = 2
|
||||
"a " = 3
|
||||
)"sv);
|
||||
|
||||
// whitespace can be escaped, success, different keys (whitespace escapes are not normalized)
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(
|
||||
"a\n" = 2
|
||||
"a\r" = 3
|
||||
"a\t" = 3
|
||||
"a\f" = 3
|
||||
)"sv);
|
||||
|
||||
// valid keys composed of various string/non-string mixes types
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(a = 3)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"('a' = 3)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"("a" = 3)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(a.b = 3)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"('a'.b = 3)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"("a".b = 3)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(a.'b' = 3)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"('a'.'b' = 3)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"("a".'b' = 3)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(a."b" = 3)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"('a'."b" = 3)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"("a"."b" = 3)"sv);
|
||||
|
||||
// multi-line strings can't be used in keys
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"('''a''' = 3)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"("""a""" = 3)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(a.'''b''' = 3)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(a."""b""" = 3)"sv);
|
||||
|
||||
// whitespace relevant (success test, values are NOTE equal)
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
a = " to do "
|
||||
b = "to do"
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["a"] == " to do "sv);
|
||||
CHECK(tbl["b"] == "to do"sv);
|
||||
});
|
||||
|
||||
// values must be quoted, syntax error
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
a = to do
|
||||
b = todo
|
||||
)"sv);
|
||||
|
||||
// different quotes, fail duplicate keys
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
a = 2
|
||||
'a' = 2
|
||||
)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
'a' = 2
|
||||
"a" = 2
|
||||
)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
'a' = 2
|
||||
"""a""" = 2
|
||||
)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
'''a''' = 2
|
||||
"""a""" = 2
|
||||
)"sv);
|
||||
|
||||
// success test, capital not equal to small
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(
|
||||
a = 2
|
||||
A = 3
|
||||
)"sv);
|
||||
|
||||
// inner quotes are not stripped from value, a & b are equal, value surrounded by quotes
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
a = "\"quoted\""
|
||||
b = """"quoted""""
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["a"] == "\"quoted\""sv);
|
||||
CHECK(tbl["b"] == "\"quoted\""sv);
|
||||
});
|
||||
|
||||
// quote correction is not applied, fail syntax error
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"("a = "test")"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"('a = 'test')"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"("a = 'test")"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"('a = "test')"sv);
|
||||
|
||||
// quotes cannot appear in keys this way, fail syntax error
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"("a'b = 3)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"("a"b = 3)"sv);
|
||||
|
||||
// escaped quotes and single quotes can appear this way, fail duplicate keys
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"("a'b" = 2)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"("a\u0027b" = 4)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
"a'b" = 2
|
||||
"a\u0027b" = 4
|
||||
)"sv);
|
||||
|
||||
// literal strings, escapes are not escaped, success, since keys are valid and not equal
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(
|
||||
'a"b' = 2
|
||||
'a\"b' = 4
|
||||
)"sv);
|
||||
|
||||
// escapes must be compared after unescaping, fail duplicate key
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(a = 1)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"("\u0061" = 2)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
a = 1
|
||||
"\u0061" = 2
|
||||
)"sv);
|
||||
|
||||
// escaping requires quotes, syntax error
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(\u0061 = 2)"sv);
|
||||
|
||||
// empty keys are allowed, but can only appear once, fail duplicate key
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"("" = 2)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"('' = 3)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
"" = 2
|
||||
'' = 3
|
||||
)"sv);
|
||||
|
||||
// bare keys can be numerals, but are interpreted as strings, fail duplicate key
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(1234 = 5)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"("1234" = 5)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
1234 = 5
|
||||
"1234" = 5
|
||||
)"sv);
|
||||
|
||||
// bare keys can be numerals, but are interpreted as strings, fail duplicate key
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(1234 = 5)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"('1234' = 5)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
1234 = 5
|
||||
'1234' = 5
|
||||
)"sv);
|
||||
|
||||
// bare keys can be numerals, but are interpreted as strings, valid, different keys
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(
|
||||
1234 = 5
|
||||
01234 = 5
|
||||
)"sv);
|
||||
|
||||
// bare keys can be numerals, but are interpreted as strings, valid, different keys
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(
|
||||
12e3 = 4
|
||||
12000 = 5
|
||||
)"sv);
|
||||
|
||||
// bare keys can be numerals, but are interpreted as strings, valid, different keys, one dotted
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(
|
||||
1.2e3 = 4
|
||||
1200 = 5
|
||||
)"sv);
|
||||
|
||||
// bare keys can be numerals, but are interpreted as strings, success, cause one is dotted
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(
|
||||
1.2e3 = 4
|
||||
"1.2e3" = 5
|
||||
)"sv);
|
||||
|
||||
// bare keys can be numerals, but are interpreted as strings, fail duplicate keys
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(12e3 = 4)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"("12e3" = 5)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
12e3 = 4
|
||||
"12e3" = 5
|
||||
)"sv);
|
||||
|
||||
// bare keys can be numerals, but are interpreted as strings, fail duplicate dotted keys
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(1.2e3 = 4)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(1."2e3" = 5)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
1.2e3 = 4
|
||||
1."2e3" = 5
|
||||
)"sv);
|
||||
|
||||
// bare keys can be numerals, but are interpreted as strings, fail duplicate dotted keys
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(1.2e3 = 4)"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"("1".2e3 = 5)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
1.2e3 = 4
|
||||
"1".2e3 = 5
|
||||
)"sv);
|
||||
}
|
@ -1,92 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
|
||||
TEST_CASE("parsing - TOML spec example")
|
||||
{
|
||||
static constexpr auto toml_text = R"(
|
||||
# This is a TOML document.
|
||||
|
||||
title = "TOML Example"
|
||||
|
||||
[owner]
|
||||
name = "Tom Preston-Werner"
|
||||
dob = 1979-05-27T07:32:00-08:00 # First class dates
|
||||
|
||||
[database]
|
||||
server = "192.168.1.1"
|
||||
ports = [ 8001, 8001, 8002 ]
|
||||
connection_max = 5000
|
||||
enabled = true
|
||||
|
||||
[servers]
|
||||
|
||||
# Indentation (tabs and/or spaces) is allowed but not required
|
||||
[servers.alpha]
|
||||
ip = "10.0.0.1"
|
||||
dc = "eqdc10"
|
||||
|
||||
[servers.beta]
|
||||
ip = "10.0.0.2"
|
||||
dc = "eqdc10"
|
||||
|
||||
[clients]
|
||||
data = [ ["gamma", "delta"], [1, 2] ]
|
||||
|
||||
# Line breaks are OK when inside arrays
|
||||
hosts = [
|
||||
"alpha",
|
||||
"omega"
|
||||
]
|
||||
)"sv;
|
||||
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
toml_text,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl.size() == 5);
|
||||
|
||||
CHECK(tbl["title"] == "TOML Example"sv);
|
||||
|
||||
CHECK(tbl["owner"]);
|
||||
CHECK(tbl["owner"].as<table>());
|
||||
CHECK(tbl["owner"]["name"] == "Tom Preston-Werner"sv);
|
||||
const auto dob = date_time{ { 1979, 5, 27 }, { 7, 32 }, { -8, 0 } };
|
||||
CHECK(tbl["owner"]["dob"] == dob);
|
||||
|
||||
CHECK(tbl["database"].as<table>());
|
||||
CHECK(tbl["database"]["server"] == "192.168.1.1"sv);
|
||||
const auto ports = { 8001, 8001, 8002 };
|
||||
CHECK(tbl["database"]["ports"] == ports);
|
||||
CHECK(tbl["database"]["connection_max"] == 5000);
|
||||
CHECK(tbl["database"]["enabled"] == true);
|
||||
|
||||
CHECK(tbl["servers"].as<table>());
|
||||
CHECK(tbl["servers"]["alpha"].as<table>());
|
||||
CHECK(tbl["servers"]["alpha"]["ip"] == "10.0.0.1"sv);
|
||||
CHECK(tbl["servers"]["alpha"]["dc"] == "eqdc10"sv);
|
||||
CHECK(tbl["servers"]["beta"].as<table>());
|
||||
CHECK(tbl["servers"]["beta"]["ip"] == "10.0.0.2"sv);
|
||||
CHECK(tbl["servers"]["beta"]["dc"] == "eqdc10"sv);
|
||||
|
||||
CHECK(tbl["clients"].as<table>());
|
||||
REQUIRE(tbl["clients"]["data"].as<array>());
|
||||
CHECK(tbl["clients"]["data"].as<array>()->size() == 2);
|
||||
REQUIRE(tbl["clients"]["data"][0].as<array>());
|
||||
CHECK(tbl["clients"]["data"][0].as<array>()->size() == 2);
|
||||
CHECK(tbl["clients"]["data"][0][0] == "gamma"sv);
|
||||
CHECK(tbl["clients"]["data"][0][1] == "delta"sv);
|
||||
REQUIRE(tbl["clients"]["data"][1].as<array>());
|
||||
CHECK(tbl["clients"]["data"][1].as<array>()->size() == 2);
|
||||
CHECK(tbl["clients"]["data"][1][0] == 1);
|
||||
CHECK(tbl["clients"]["data"][1][1] == 2);
|
||||
REQUIRE(tbl["clients"]["hosts"].as<array>());
|
||||
CHECK(tbl["clients"]["hosts"].as<array>()->size() == 2);
|
||||
CHECK(tbl["clients"]["hosts"][0] == "alpha"sv);
|
||||
CHECK(tbl["clients"]["hosts"][1] == "omega"sv);
|
||||
});
|
||||
}
|
@ -1,211 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
|
||||
TEST_CASE("parsing - strings")
|
||||
{
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
str = "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF."
|
||||
|
||||
str1 = """
|
||||
Roses are red
|
||||
Violets are blue"""
|
||||
|
||||
str2 = """
|
||||
|
||||
Roses are red
|
||||
Violets are blue"""
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["str"]
|
||||
== "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF."sv);
|
||||
CHECK(tbl["str1"] == "Roses are red\nViolets are blue"sv);
|
||||
CHECK(tbl["str2"] == "\nRoses are red\nViolets are blue"sv);
|
||||
});
|
||||
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
# The following strings are byte-for-byte equivalent:
|
||||
str1 = "The quick brown fox jumps over the lazy dog."
|
||||
|
||||
str2 = """
|
||||
The quick brown \
|
||||
|
||||
|
||||
fox jumps over \
|
||||
the lazy dog."""
|
||||
|
||||
str3 = """\
|
||||
The quick brown \
|
||||
fox jumps over \
|
||||
the lazy dog.\
|
||||
"""
|
||||
|
||||
str4 = """Here are two quotation marks: "". Simple enough."""
|
||||
# str5 = """Here are three quotation marks: """.""" # INVALID
|
||||
str5 = """Here are three quotation marks: ""\"."""
|
||||
str6 = """Here are fifteen quotation marks: ""\"""\"""\"""\"""\"."""
|
||||
|
||||
# "This," she said, "is just a pointless statement."
|
||||
str7 = """"This," she said, "is just a pointless statement.""""
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
static constexpr auto quick_brown_fox = "The quick brown fox jumps over the lazy dog."sv;
|
||||
CHECK(tbl["str1"] == quick_brown_fox);
|
||||
CHECK(tbl["str2"] == quick_brown_fox);
|
||||
CHECK(tbl["str3"] == quick_brown_fox);
|
||||
CHECK(tbl["str4"] == R"(Here are two quotation marks: "". Simple enough.)"sv);
|
||||
CHECK(tbl["str5"] == R"(Here are three quotation marks: """.)"sv);
|
||||
CHECK(tbl["str6"] == R"(Here are fifteen quotation marks: """"""""""""""".)"sv);
|
||||
CHECK(tbl["str7"] == R"("This," she said, "is just a pointless statement.")"sv);
|
||||
});
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(str5 = """Here are three quotation marks: """.""")"sv);
|
||||
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
# What you see is what you get.
|
||||
winpath = 'C:\Users\nodejs\templates'
|
||||
winpath2 = '\\ServerX\admin$\system32\'
|
||||
quoted = 'Tom "Dubs" Preston-Werner'
|
||||
regex = '<\i\c*\s*>'
|
||||
regex2 = '''I [dw]on't need \d{2} apples'''
|
||||
lines = '''
|
||||
The first newline is
|
||||
trimmed in raw strings.
|
||||
All other whitespace
|
||||
is preserved.
|
||||
'''
|
||||
lines2 = '''
|
||||
|
||||
The first newline is
|
||||
trimmed in raw strings.
|
||||
All other whitespace
|
||||
is preserved.
|
||||
'''
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["winpath"] == R"(C:\Users\nodejs\templates)"sv);
|
||||
CHECK(tbl["winpath2"] == R"(\\ServerX\admin$\system32\)"sv);
|
||||
CHECK(tbl["quoted"] == R"(Tom "Dubs" Preston-Werner)"sv);
|
||||
CHECK(tbl["regex"] == R"(<\i\c*\s*>)"sv);
|
||||
CHECK(tbl["regex2"] == R"(I [dw]on't need \d{2} apples)"sv);
|
||||
CHECK(tbl["lines"] == R"(The first newline is
|
||||
trimmed in raw strings.
|
||||
All other whitespace
|
||||
is preserved.
|
||||
)"sv);
|
||||
CHECK(tbl["lines2"] == R"(
|
||||
The first newline is
|
||||
trimmed in raw strings.
|
||||
All other whitespace
|
||||
is preserved.
|
||||
)"sv);
|
||||
});
|
||||
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
quot15 = '''Here are fifteen quotation marks: """""""""""""""'''
|
||||
|
||||
# apos15 = '''Here are fifteen apostrophes: '''''''''''''''''' # INVALID
|
||||
apos15 = "Here are fifteen apostrophes: '''''''''''''''"
|
||||
|
||||
# 'That's still pointless', she said.
|
||||
str = ''''That's still pointless', she said.'''
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["quot15"] == R"(Here are fifteen quotation marks: """"""""""""""")"sv);
|
||||
CHECK(tbl["apos15"] == R"(Here are fifteen apostrophes: ''''''''''''''')"sv);
|
||||
CHECK(tbl["str"] == R"('That's still pointless', she said.)"sv);
|
||||
});
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(apos15 = '''Here are fifteen apostrophes: '''''''''''''''''' # INVALID)"sv);
|
||||
|
||||
// value tests
|
||||
parse_expected_value(FILE_LINE_ARGS,
|
||||
R"("The quick brown fox jumps over the lazy dog")"sv,
|
||||
"The quick brown fox jumps over the lazy dog"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS,
|
||||
R"('The quick brown fox jumps over the lazy dog')"sv,
|
||||
"The quick brown fox jumps over the lazy dog"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS,
|
||||
R"("""The quick brown fox jumps over the lazy dog""")"sv,
|
||||
"The quick brown fox jumps over the lazy dog"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS,
|
||||
R"('''The quick brown fox jumps over the lazy dog''')"sv,
|
||||
"The quick brown fox jumps over the lazy dog"sv);
|
||||
|
||||
#if UNICODE_LITERALS_OK
|
||||
parse_expected_value(FILE_LINE_ARGS, R"("Ýôú'ℓℓ λáƭè ₥è áƒƭèř ƭλïƨ - #")"sv, R"(Ýôú'ℓℓ λáƭè ₥è áƒƭèř ƭλïƨ - #)"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS,
|
||||
R"(" Âñδ ωλèñ \"'ƨ ářè ïñ ƭλè ƨƭřïñϱ, áℓôñϱ ωïƭλ # \"")"sv,
|
||||
R"( Âñδ ωλèñ "'ƨ ářè ïñ ƭλè ƨƭřïñϱ, áℓôñϱ ωïƭλ # ")"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS,
|
||||
R"("Ýôú δôñ'ƭ ƭλïñƙ ƨô₥è úƨèř ωôñ'ƭ δô ƭλáƭ?")"sv,
|
||||
R"(Ýôú δôñ'ƭ ƭλïñƙ ƨô₥è úƨèř ωôñ'ƭ δô ƭλáƭ?)"sv);
|
||||
#endif // UNICODE_LITERALS_OK
|
||||
|
||||
parse_expected_value(FILE_LINE_ARGS, R"("\"\u03B1\u03B2\u03B3\"")"sv, "\"\u03B1\u03B2\u03B3\""sv);
|
||||
|
||||
// toml/pull/796 (\xHH unicode scalars)
|
||||
#if TOML_LANG_UNRELEASED
|
||||
parse_expected_value(FILE_LINE_ARGS,
|
||||
R"("\x00\x10\x20\x30\x40\x50\x60\x70\x80\x90\x11\xFF\xEE")"sv,
|
||||
"\u0000\u0010\u0020\u0030\u0040\u0050\u0060\u0070\u0080\u0090\u0011\u00FF\u00EE"sv);
|
||||
#else
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(str = "\x00\x10\x20\x30\x40\x50\x60\x70\x80\x90\x11\xFF\xEE")"sv);
|
||||
#endif
|
||||
|
||||
// toml/pull/790
|
||||
#if TOML_LANG_UNRELEASED
|
||||
parse_expected_value(FILE_LINE_ARGS, R"("\e[31mfoo\e[0m")"sv, "\x1B[31mfoo\x1B[0m"sv);
|
||||
|
||||
#else
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"("\e[31mfoo\e[0m")"sv);
|
||||
#endif
|
||||
|
||||
// check 8-digit \U scalars with insufficient digits
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(str = "\U1234567")"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(str = "\U123456")"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(str = "\U12345")"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(str = "\U1234")"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(str = "\U123")"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(str = "\U12")"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(str = "\U1")"sv);
|
||||
|
||||
// check 4-digit \u scalars with insufficient digits
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(str = "\u123")"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(str = "\u12")"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(str = "\u1")"sv);
|
||||
|
||||
// check 2-digit \x scalars with insufficient digits
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(str = "\x1")"sv);
|
||||
|
||||
// ML string examples from https://github.com/toml-lang/toml/issues/725
|
||||
parse_expected_value(FILE_LINE_ARGS, R"( """ """ )"sv, R"( )"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"( """ """" )"sv, R"( ")"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"( """ """"" )"sv, R"( "")"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(v= """ """""" )"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"( ''' ''' )"sv, R"( )"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"( ''' '''' )"sv, R"( ')"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"( ''' ''''' )"sv, R"( '')"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(v= ''' '''''' )"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"( """""" )"sv, R"()"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"( """" """ )"sv, R"(" )"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"( """"" """ )"sv, R"("" )"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(v= """""" """ )"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"( '''''' )"sv, R"()"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"( '''' ''' )"sv, R"(' )"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"( ''''' ''' )"sv, R"('' )"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(v= '''''' ''' )"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"( """""\"""""" )"sv, R"(""""")"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"( """""\"""\"""""" )"sv, R"("""""""")"sv);
|
||||
}
|
@ -1,595 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
|
||||
TEST_CASE("parsing - tables")
|
||||
{
|
||||
// these are the examples from https://toml.io/en/v1.0.0#table
|
||||
|
||||
// "Tables are defined by headers, with square brackets on a line by themselves."
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
"[table]"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
REQUIRE(tbl["table"].as_table());
|
||||
CHECK(tbl["table"].as_table()->empty());
|
||||
CHECK(tbl["table"].as_table()->size() == 0u);
|
||||
});
|
||||
parsing_should_fail(FILE_LINE_ARGS, "[]"sv);
|
||||
|
||||
// "Under that, and until the next header or EOF, are the key/values of that table.
|
||||
// Key/value pairs within tables are not guaranteed to be in any specific order."
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
[table-1]
|
||||
key1 = "some string"
|
||||
key2 = 123
|
||||
|
||||
[table-2]
|
||||
key1 = "another string"
|
||||
key2 = 456
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
REQUIRE(tbl["table-1"].as_table());
|
||||
CHECK(tbl["table-1"].as_table()->size() == 2u);
|
||||
CHECK(tbl["table-1"]["key1"] == "some string"sv);
|
||||
CHECK(tbl["table-1"]["key2"] == 123);
|
||||
|
||||
REQUIRE(tbl["table-2"].as_table());
|
||||
CHECK(tbl["table-2"].as_table()->size() == 2u);
|
||||
CHECK(tbl["table-2"]["key1"] == "another string"sv);
|
||||
CHECK(tbl["table-2"]["key2"] == 456);
|
||||
});
|
||||
|
||||
// "Naming rules for tables are the same as for keys." (i.e. can be quoted)
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
[dog."tater.man"]
|
||||
type.name = "pug"
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
REQUIRE(tbl["dog"].as_table());
|
||||
CHECK(tbl["dog"].as_table()->size() == 1u);
|
||||
|
||||
REQUIRE(tbl["dog"]["tater.man"].as_table());
|
||||
CHECK(tbl["dog"]["tater.man"].as_table()->size() == 1u);
|
||||
CHECK(tbl["dog"]["tater.man"]["type"]["name"] == "pug"sv);
|
||||
});
|
||||
|
||||
// "Whitespace around the key is ignored. However, best practice is to not use any extraneous whitespace."
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
[a.b.c] # this is best practice
|
||||
[ d.e.f ] # same as [d.e.f]
|
||||
[ g . h . i ] # same as [g.h.i]
|
||||
[ j . "k" . 'l' ] # same as [j."k".'l']
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["a"].as_table());
|
||||
CHECK(tbl["a"]["b"].as_table());
|
||||
CHECK(tbl["a"]["b"]["c"].as_table());
|
||||
|
||||
CHECK(tbl["d"].as_table());
|
||||
CHECK(tbl["d"]["e"].as_table());
|
||||
CHECK(tbl["d"]["e"]["f"].as_table());
|
||||
|
||||
CHECK(tbl["g"].as_table());
|
||||
CHECK(tbl["g"]["h"].as_table());
|
||||
CHECK(tbl["g"]["h"]["i"].as_table());
|
||||
|
||||
CHECK(tbl["j"].as_table());
|
||||
CHECK(tbl["j"]["k"].as_table());
|
||||
CHECK(tbl["j"]["k"]["l"].as_table());
|
||||
});
|
||||
|
||||
// "You don't need to specify all the super-tables if you don't want to. TOML knows how to do it for you."
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
# [x] you
|
||||
# [x.y] don't
|
||||
# [x.y.z] need these
|
||||
[x.y.z.w] # for this to work
|
||||
|
||||
[x] # defining a super-table afterwards is ok
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["x"].as_table());
|
||||
CHECK(tbl["x"]["y"].as_table());
|
||||
CHECK(tbl["x"]["y"]["z"].as_table());
|
||||
CHECK(tbl["x"]["y"]["z"]["w"].as_table());
|
||||
});
|
||||
|
||||
// "Like keys, you cannot define a table more than once. Doing so is invalid."
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
# DO NOT DO THIS
|
||||
|
||||
[fruit]
|
||||
apple = "red"
|
||||
|
||||
[fruit]
|
||||
orange = "orange"
|
||||
)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
# DO NOT DO THIS EITHER
|
||||
|
||||
[fruit]
|
||||
apple = "red"
|
||||
|
||||
[fruit.apple]
|
||||
texture = "smooth"
|
||||
)"sv);
|
||||
|
||||
// "Defining tables out-of-order is discouraged."
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
# VALID BUT DISCOURAGED
|
||||
[fruit.apple]
|
||||
[animal]
|
||||
[fruit.orange]
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["fruit"].as_table());
|
||||
CHECK(tbl["fruit"]["apple"].as_table());
|
||||
CHECK(tbl["animal"].as_table());
|
||||
CHECK(tbl["fruit"]["orange"].as_table());
|
||||
});
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
# RECOMMENDED
|
||||
[fruit.apple]
|
||||
[fruit.orange]
|
||||
[animal]
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["fruit"].as_table());
|
||||
CHECK(tbl["fruit"]["apple"].as_table());
|
||||
CHECK(tbl["fruit"]["orange"].as_table());
|
||||
CHECK(tbl["animal"].as_table());
|
||||
});
|
||||
|
||||
// "The top-level table, also called the root table, starts at the beginning of the document
|
||||
// and ends just before the first table header (or EOF)."
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
# Top-level table begins.
|
||||
name = "Fido"
|
||||
breed = "pug"
|
||||
|
||||
# Top-level table ends.
|
||||
[owner]
|
||||
name = "Regina Dogman"
|
||||
member_since = 1999-08-04
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["name"].as_string());
|
||||
CHECK(*tbl["name"].as_string() == "Fido"sv);
|
||||
CHECK(tbl["breed"].as_string());
|
||||
CHECK(*tbl["breed"].as_string() == "pug"sv);
|
||||
|
||||
CHECK(tbl["owner"].as_table());
|
||||
CHECK(*tbl["owner"]["name"].as_string() == "Regina Dogman"sv);
|
||||
|
||||
static constexpr auto member_since = toml::date{ 1999, 8, 4 };
|
||||
CHECK(*tbl["owner"]["member_since"].as_date() == member_since);
|
||||
});
|
||||
|
||||
// "Dotted keys create and define a table for each key part before the last one,
|
||||
// provided that such tables were not previously created."
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
fruit.apple.color = "red"
|
||||
# Defines a table named fruit
|
||||
# Defines a table named fruit.apple
|
||||
|
||||
fruit.apple.taste.sweet = true
|
||||
# Defines a table named fruit.apple.taste
|
||||
# fruit and fruit.apple were already created
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["fruit"].as_table());
|
||||
CHECK(tbl["fruit"]["apple"].as_table());
|
||||
CHECK(tbl["fruit"]["apple"]["color"].as_string());
|
||||
CHECK(*tbl["fruit"]["apple"]["color"].as_string() == "red"sv);
|
||||
|
||||
CHECK(tbl["fruit"]["apple"]["taste"].as_table());
|
||||
CHECK(tbl["fruit"]["apple"]["taste"]["sweet"].as_boolean());
|
||||
CHECK(*tbl["fruit"]["apple"]["taste"]["sweet"].as_boolean() == true);
|
||||
});
|
||||
|
||||
// "Since tables cannot be defined more than once, redefining such tables using a [table] header is not allowed."
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
[fruit]
|
||||
apple.color = "red"
|
||||
apple.taste.sweet = true
|
||||
|
||||
[fruit.apple] # INVALID
|
||||
)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
[fruit]
|
||||
apple.color = "red"
|
||||
apple.taste.sweet = true
|
||||
|
||||
[fruit.apple.taste] # INVALID
|
||||
)"sv);
|
||||
|
||||
// "Likewise, using dotted keys to redefine tables already defined in [table] form is not allowed."
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
[fruit.apple.taste]
|
||||
sweet = true
|
||||
|
||||
[fruit]
|
||||
apple.taste = { sweet = false } # INVALID
|
||||
)"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
[fruit.apple.taste]
|
||||
sweet = true
|
||||
|
||||
[fruit]
|
||||
apple.taste.foo = "bar" # INVALID
|
||||
)"sv);
|
||||
|
||||
// "The [table] form can, however, be used to define sub-tables within tables defined via dotted keys."
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
[fruit]
|
||||
apple.color = "red"
|
||||
apple.taste.sweet = true
|
||||
|
||||
[fruit.apple.texture] # you can add sub-tables
|
||||
smooth = true
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["fruit"].as_table());
|
||||
CHECK(tbl["fruit"]["apple"].as_table());
|
||||
CHECK(tbl["fruit"]["apple"]["color"].as_string());
|
||||
CHECK(*tbl["fruit"]["apple"]["color"].as_string() == "red"sv);
|
||||
|
||||
CHECK(tbl["fruit"]["apple"]["texture"].as_table());
|
||||
CHECK(tbl["fruit"]["apple"]["texture"]["smooth"].as_boolean());
|
||||
CHECK(*tbl["fruit"]["apple"]["texture"]["smooth"].as_boolean() == true);
|
||||
});
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
[fruit]
|
||||
apple.color = "red"
|
||||
apple.taste.sweet = true
|
||||
|
||||
[fruit.apple]
|
||||
shape = "round"
|
||||
|
||||
[fruit.apple.texture]
|
||||
smooth = true
|
||||
)"sv);
|
||||
|
||||
// same as above but the table order is reversed.
|
||||
// see: https://github.com/toml-lang/toml/issues/769
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
[fruit.apple.texture]
|
||||
smooth = true
|
||||
|
||||
[fruit]
|
||||
apple.color = "red"
|
||||
apple.taste.sweet = true
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
CHECK(tbl["fruit"].as_table());
|
||||
CHECK(tbl["fruit"]["apple"].as_table());
|
||||
CHECK(tbl["fruit"]["apple"]["color"].as_string());
|
||||
CHECK(*tbl["fruit"]["apple"]["color"].as_string() == "red"sv);
|
||||
|
||||
CHECK(tbl["fruit"]["apple"]["texture"].as_table());
|
||||
CHECK(tbl["fruit"]["apple"]["texture"]["smooth"].as_boolean());
|
||||
CHECK(*tbl["fruit"]["apple"]["texture"]["smooth"].as_boolean() == true);
|
||||
});
|
||||
}
|
||||
|
||||
TEST_CASE("parsing - inline tables")
|
||||
{
|
||||
// these are the examples from https://toml.io/en/v1.0.0#inline-table
|
||||
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
name = { first = "Tom", last = "Preston-Werner" }
|
||||
point = { x = 1, y = 2 }
|
||||
animal = { type.name = "pug" }
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
REQUIRE(tbl["name"].as_table());
|
||||
CHECK(tbl["name"].as_table()->size() == 2u);
|
||||
CHECK(tbl["name"].as_table()->is_inline());
|
||||
CHECK(tbl["name"]["first"] == "Tom"sv);
|
||||
CHECK(tbl["name"]["last"] == "Preston-Werner"sv);
|
||||
|
||||
REQUIRE(tbl["point"].as_table());
|
||||
CHECK(tbl["point"].as_table()->size() == 2u);
|
||||
CHECK(tbl["point"].as_table()->is_inline());
|
||||
CHECK(tbl["point"]["x"] == 1);
|
||||
CHECK(tbl["point"]["y"] == 2);
|
||||
|
||||
REQUIRE(tbl["animal"].as_table());
|
||||
CHECK(tbl["animal"].as_table()->size() == 1u);
|
||||
CHECK(tbl["animal"].as_table()->is_inline());
|
||||
REQUIRE(tbl["animal"]["type"].as_table());
|
||||
CHECK(tbl["animal"]["type"].as_table()->size() == 1u);
|
||||
CHECK(tbl["animal"]["type"]["name"] == "pug"sv);
|
||||
});
|
||||
|
||||
// "Inline tables are fully self-contained and define all keys and sub-tables within them.
|
||||
// Keys and sub-tables cannot be added outside the braces."
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
[product]
|
||||
type = { name = "Nail" }
|
||||
type.edible = false # INVALID
|
||||
)"sv);
|
||||
|
||||
// "Similarly, inline tables cannot be used to add keys or sub-tables to an already-defined table."
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
[product]
|
||||
type.name = "Nail"
|
||||
type = { edible = false } # INVALID
|
||||
)"sv);
|
||||
|
||||
// "newlines are allowed between the curly braces [if] they are valid within a value."
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
test = { val1 = "foo", val2 = [
|
||||
1, 2,
|
||||
3
|
||||
], val3 = "bar" }
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
REQUIRE(tbl["test"].as_table());
|
||||
CHECK(tbl["test"].as_table()->size() == 3u);
|
||||
CHECK(tbl["test"]["val1"] == "foo"sv);
|
||||
REQUIRE(tbl["test"]["val2"].as<array>());
|
||||
CHECK(tbl["test"]["val2"].as<array>()->size() == 3u);
|
||||
CHECK(tbl["test"]["val2"][0] == 1);
|
||||
CHECK(tbl["test"]["val2"][1] == 2);
|
||||
CHECK(tbl["test"]["val2"][2] == 3);
|
||||
CHECK(tbl["test"]["val3"] == "bar"sv);
|
||||
});
|
||||
|
||||
// toml/issues/516 (newlines/trailing commas in inline tables)
|
||||
#if TOML_LANG_UNRELEASED
|
||||
{
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
name = {
|
||||
first = "Tom",
|
||||
last = "Preston-Werner",
|
||||
}
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
REQUIRE(tbl["name"].as_table());
|
||||
CHECK(tbl["name"].as_table()->size() == 2u);
|
||||
CHECK(tbl["name"]["first"] == "Tom"sv);
|
||||
CHECK(tbl["name"]["last"] == "Preston-Werner"sv);
|
||||
});
|
||||
}
|
||||
#else
|
||||
{
|
||||
// "A terminating comma (also called trailing comma) is not permitted after the last key/value pair in an inline
|
||||
// table."
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(name = { first = "Tom", last = "Preston-Werner", })"sv);
|
||||
|
||||
// "No newlines are allowed between the curly braces unless they are valid within a value."
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
name = {
|
||||
first = "Tom",
|
||||
last = "Preston-Werner"
|
||||
}
|
||||
)"sv);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST_CASE("parsing - arrays-of-tables")
|
||||
{
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
points = [ { x = 1, y = 2, z = 3 },
|
||||
{ x = 7, y = 8, z = 9 },
|
||||
{ x = 2, y = 4, z = 8 } ]
|
||||
|
||||
[[products]]
|
||||
name = "Hammer"
|
||||
sku = 738594937
|
||||
|
||||
[[products]]
|
||||
|
||||
[[products]]
|
||||
name = "Nail"
|
||||
sku = 284758393
|
||||
|
||||
color = "gray"
|
||||
|
||||
[[fruit]]
|
||||
name = "apple"
|
||||
|
||||
[fruit.physical] # subtable
|
||||
color = "red"
|
||||
shape = "round"
|
||||
|
||||
[[fruit.variety]] # nested array of tables
|
||||
name = "red delicious"
|
||||
|
||||
[[fruit.variety]]
|
||||
name = "granny smith"
|
||||
|
||||
[[fruit]]
|
||||
name = "banana"
|
||||
|
||||
[[fruit.variety]]
|
||||
name = "plantain"
|
||||
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
REQUIRE(tbl["points"].as<array>());
|
||||
CHECK(tbl["points"].as<array>()->size() == 3u);
|
||||
CHECK(tbl["points"].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["points"].as<array>()->is_array_of_tables());
|
||||
CHECK(tbl["points"][0]["x"] == 1);
|
||||
CHECK(tbl["points"][0]["y"] == 2);
|
||||
CHECK(tbl["points"][0]["z"] == 3);
|
||||
CHECK(tbl["points"][1]["x"] == 7);
|
||||
CHECK(tbl["points"][1]["y"] == 8);
|
||||
CHECK(tbl["points"][1]["z"] == 9);
|
||||
CHECK(tbl["points"][2]["x"] == 2);
|
||||
CHECK(tbl["points"][2]["y"] == 4);
|
||||
CHECK(tbl["points"][2]["z"] == 8);
|
||||
|
||||
REQUIRE(tbl["products"].as<array>());
|
||||
CHECK(tbl["products"].as<array>()->size() == 3u);
|
||||
CHECK(tbl["products"].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["products"].as<array>()->is_array_of_tables());
|
||||
|
||||
REQUIRE(tbl["products"][0].as_table());
|
||||
CHECK(tbl["products"][0].as_table()->size() == 2u);
|
||||
CHECK(tbl["products"][0]["name"] == "Hammer"sv);
|
||||
CHECK(tbl["products"][0]["sku"] == 738594937);
|
||||
|
||||
REQUIRE(tbl["products"][1].as_table());
|
||||
CHECK(tbl["products"][1].as_table()->size() == 0u);
|
||||
|
||||
REQUIRE(tbl["products"][2].as_table());
|
||||
CHECK(tbl["products"][2].as_table()->size() == 3u);
|
||||
CHECK(tbl["products"][2]["name"] == "Nail"sv);
|
||||
CHECK(tbl["products"][2]["sku"] == 284758393);
|
||||
CHECK(tbl["products"][2]["color"] == "gray"sv);
|
||||
|
||||
REQUIRE(tbl["fruit"].as<array>());
|
||||
CHECK(tbl["fruit"].as<array>()->size() == 2u);
|
||||
CHECK(tbl["fruit"].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["fruit"].as<array>()->is_array_of_tables());
|
||||
|
||||
REQUIRE(tbl["fruit"][0].as_table());
|
||||
CHECK(tbl["fruit"][0].as_table()->size() == 3u);
|
||||
CHECK(tbl["fruit"][0]["name"] == "apple"sv);
|
||||
|
||||
REQUIRE(tbl["fruit"][0]["physical"].as_table());
|
||||
CHECK(tbl["fruit"][0]["physical"].as_table()->size() == 2u);
|
||||
CHECK(tbl["fruit"][0]["physical"]["color"] == "red"sv);
|
||||
CHECK(tbl["fruit"][0]["physical"]["shape"] == "round"sv);
|
||||
|
||||
REQUIRE(tbl["fruit"][0]["variety"].as<array>());
|
||||
CHECK(tbl["fruit"][0]["variety"].as<array>()->size() == 2u);
|
||||
CHECK(tbl["fruit"][0]["variety"].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["fruit"][0]["variety"].as<array>()->is_array_of_tables());
|
||||
CHECK(tbl["fruit"][0]["variety"][0]["name"] == "red delicious"sv);
|
||||
CHECK(tbl["fruit"][0]["variety"][1]["name"] == "granny smith"sv);
|
||||
|
||||
REQUIRE(tbl["fruit"][1].as_table());
|
||||
CHECK(tbl["fruit"][1].as_table()->size() == 2u);
|
||||
CHECK(tbl["fruit"][1]["name"] == "banana"sv);
|
||||
|
||||
REQUIRE(tbl["fruit"][1]["variety"].as<array>());
|
||||
CHECK(tbl["fruit"][1]["variety"].as<array>()->size() == 1u);
|
||||
CHECK(tbl["fruit"][1]["variety"].as<array>()->is_homogeneous());
|
||||
CHECK(tbl["fruit"][1]["variety"].as<array>()->is_array_of_tables());
|
||||
CHECK(tbl["fruit"][1]["variety"][0]["name"] == "plantain"sv);
|
||||
});
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
# INVALID TOML DOC
|
||||
[fruit.physical] # subtable, but to which parent element should it belong?
|
||||
color = "red"
|
||||
shape = "round"
|
||||
|
||||
[[fruit]] # parser must throw an error upon discovering that "fruit" is
|
||||
# an array rather than a table
|
||||
name = "apple"
|
||||
)"sv);
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
# INVALID TOML DOC
|
||||
fruit = []
|
||||
|
||||
[[fruit]] # Not allowed
|
||||
)"sv);
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
# INVALID TOML DOC
|
||||
[[fruit]]
|
||||
name = "apple"
|
||||
|
||||
[[fruit.variety]]
|
||||
name = "red delicious"
|
||||
|
||||
# INVALID: This table conflicts with the previous array of tables
|
||||
[fruit.variety]
|
||||
name = "granny smith"
|
||||
)"sv);
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
# INVALID TOML DOC
|
||||
[[fruit]]
|
||||
name = "apple"
|
||||
|
||||
[fruit.physical]
|
||||
color = "red"
|
||||
shape = "round"
|
||||
|
||||
# INVALID: This array of tables conflicts with the previous table
|
||||
[[fruit.physical]]
|
||||
color = "green"
|
||||
)"sv);
|
||||
}
|
||||
|
||||
TEST_CASE("parsing - keys")
|
||||
{
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
R"(
|
||||
[a.b]
|
||||
c = "10.0.0.1"
|
||||
d = "frontend"
|
||||
e = { f.g = 79.5, h = 72.0 }
|
||||
)"sv,
|
||||
[](table&& tbl)
|
||||
{
|
||||
// ensure types are sane first
|
||||
REQUIRE(tbl["a"].is_table());
|
||||
REQUIRE(tbl["a"]["b"].is_table());
|
||||
REQUIRE(tbl["a"]["b"]["c"]);
|
||||
REQUIRE(tbl["a"]["b"]["d"]);
|
||||
REQUIRE(tbl["a"]["b"]["e"].is_table());
|
||||
REQUIRE(tbl["a"]["b"]["e"]["f"].is_table());
|
||||
REQUIRE(tbl["a"]["b"]["e"]["f"]["g"]);
|
||||
REQUIRE(tbl["a"]["b"]["e"]["h"]);
|
||||
|
||||
const auto check_key =
|
||||
[&](const auto& t, std::string_view k, source_position b, source_position e)
|
||||
{
|
||||
const toml::key& found_key = t.as_table()->find(k)->first;
|
||||
CHECK(found_key.str() == k);
|
||||
CHECK(found_key.source().begin == b);
|
||||
CHECK(found_key.source().end == e);
|
||||
CHECK(found_key.source().path == tbl.source().path);
|
||||
};
|
||||
|
||||
check_key(tbl, "a", { 2, 2 }, { 2, 3 });
|
||||
check_key(tbl["a"], "b", { 2, 4 }, { 2, 5 });
|
||||
check_key(tbl["a"]["b"], "c", { 3, 1 }, { 3, 2 });
|
||||
check_key(tbl["a"]["b"], "d", { 4, 1 }, { 4, 2 });
|
||||
check_key(tbl["a"]["b"], "e", { 5, 1 }, { 5, 2 });
|
||||
check_key(tbl["a"]["b"]["e"], "f", { 5, 7 }, { 5, 8 });
|
||||
check_key(tbl["a"]["b"]["e"]["f"], "g", { 5, 9 }, { 5, 10 });
|
||||
check_key(tbl["a"]["b"]["e"], "h", { 5, 19 }, { 5, 20 });
|
||||
});
|
||||
}
|
592
tests/path.cpp
592
tests/path.cpp
@ -1,592 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
|
||||
TEST_CASE("path - parsing")
|
||||
{
|
||||
SECTION("parsing")
|
||||
{
|
||||
CHECK(toml::path("").str() == "");
|
||||
CHECK(toml::path("[1]").str() == "[1]");
|
||||
CHECK(toml::path("[1][2]").str() == "[1][2]");
|
||||
CHECK(toml::path(" [1][2]").str() == " [1][2]");
|
||||
CHECK(toml::path("a. .b").str() == "a. .b");
|
||||
CHECK(toml::path("test[23]").str() == "test[23]");
|
||||
CHECK(toml::path("[ 120 ]").str() == "[120]");
|
||||
CHECK(toml::path("[ 120\t\t]").str() == "[120]");
|
||||
CHECK(toml::path("test.value").str() == "test.value");
|
||||
CHECK(toml::path("test[0].value").str() == "test[0].value");
|
||||
CHECK(toml::path("test[1][2]\t .value").str() == "test[1][2].value");
|
||||
CHECK(toml::path("test[1]\t[2].value").str() == "test[1][2].value");
|
||||
CHECK(toml::path(".test[1][2]\t ..value").str() == ".test[1][2]..value");
|
||||
|
||||
#if TOML_ENABLE_WINDOWS_COMPAT
|
||||
|
||||
CHECK(toml::path(L"").str() == "");
|
||||
CHECK(toml::path(L"[1]").str() == "[1]");
|
||||
CHECK(toml::path(L"[1][2]").str() == "[1][2]");
|
||||
CHECK(toml::path(L" [1][2]").str() == " [1][2]");
|
||||
CHECK(toml::path(L"a. .b").str() == "a. .b");
|
||||
CHECK(toml::path(L"test[23]").str() == "test[23]");
|
||||
CHECK(toml::path(L"[ 120 ]").str() == "[120]");
|
||||
CHECK(toml::path(L"[ 120\t\t]").str() == "[120]");
|
||||
CHECK(toml::path(L"test.value").str() == "test.value");
|
||||
CHECK(toml::path(L"test[0].value").str() == "test[0].value");
|
||||
CHECK(toml::path(L"test[1][2]\t .value").str() == "test[1][2].value");
|
||||
CHECK(toml::path(L"test[1]\t[2].value").str() == "test[1][2].value");
|
||||
CHECK(toml::path(L".test[1][2]\t ..value").str() == ".test[1][2]..value");
|
||||
|
||||
#endif // TOML_ENABLE_WINDOWS_COMPAT
|
||||
}
|
||||
|
||||
SECTION("parsing - errors")
|
||||
{
|
||||
CHECK(!toml::path("test[][2].value"));
|
||||
CHECK(!toml::path("test[ "));
|
||||
CHECK(!toml::path("test[1]a.b"));
|
||||
CHECK(!toml::path("test[1] a.b"));
|
||||
CHECK(!toml::path("test[1a]"));
|
||||
CHECK(!toml::path("test[a1]"));
|
||||
CHECK(!toml::path("test[1!]"));
|
||||
CHECK(!toml::path("test[!1]"));
|
||||
CHECK(!toml::path("test[1 2]"));
|
||||
CHECK(!toml::path("test[1.2]"));
|
||||
CHECK(!toml::path("test[0.2]"));
|
||||
|
||||
#if TOML_ENABLE_WINDOWS_COMPAT
|
||||
|
||||
CHECK(!toml::path(L"test[][2].value"));
|
||||
CHECK(!toml::path(L"test[ "));
|
||||
CHECK(!toml::path(L"test[1]a.b"));
|
||||
CHECK(!toml::path(L"test[1] a.b"));
|
||||
CHECK(!toml::path(L"test[1a]"));
|
||||
CHECK(!toml::path(L"test[a1]"));
|
||||
CHECK(!toml::path(L"test[1!]"));
|
||||
CHECK(!toml::path(L"test[!1]"));
|
||||
CHECK(!toml::path(L"test[1 2]"));
|
||||
CHECK(!toml::path(L"test[1.2]"));
|
||||
CHECK(!toml::path(L"test[0.2]"));
|
||||
|
||||
#endif // TOML_ENABLE_WINDOWS_COMPAT
|
||||
}
|
||||
|
||||
SECTION("parsing from literal")
|
||||
{
|
||||
auto p0 = "a.b.c[1][12]"_tpath;
|
||||
CHECK(p0);
|
||||
CHECK(p0.str() == "a.b.c[1][12]");
|
||||
|
||||
CHECK("ab.cd[1]"_tpath == toml::path("ab.cd[1]"));
|
||||
|
||||
CHECK(("an.invalid.path[a1]"_tpath).str() == "");
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("path - manipulating")
|
||||
{
|
||||
SECTION("parent_node and truncation")
|
||||
{
|
||||
toml::path p0("");
|
||||
CHECK(p0.parent().str() == "");
|
||||
|
||||
toml::path p1("start.middle.end");
|
||||
CHECK(p1.parent().str() == "start.middle");
|
||||
CHECK(p1.parent().parent().str() == "start");
|
||||
CHECK(p1.parent().parent().parent().str() == "");
|
||||
CHECK(p1.parent().parent().parent().parent().str() == "");
|
||||
|
||||
toml::path p2("[1][2][3]");
|
||||
CHECK(p2.parent().str() == "[1][2]");
|
||||
CHECK(p2.parent().parent().str() == "[1]");
|
||||
CHECK(p2.parent().parent().parent().str() == "");
|
||||
|
||||
toml::path p3(".test");
|
||||
CHECK(p3.parent().str() == "");
|
||||
|
||||
toml::path p4("test..");
|
||||
CHECK(p4.parent().str() == "test.");
|
||||
CHECK(p4.parent().parent().str() == "test");
|
||||
CHECK(p4.parent().parent().parent().str() == "");
|
||||
|
||||
toml::path p5("test.key[12].subkey");
|
||||
CHECK(p5.parent().str() == "test.key[12]");
|
||||
CHECK(p5.parent().parent().str() == "test.key");
|
||||
CHECK(p5.parent().parent().parent().str() == "test");
|
||||
CHECK(p5.parent().parent().parent().parent().str() == "");
|
||||
|
||||
toml::path p6("test.key1.key2.key3.key4");
|
||||
CHECK(p6.truncated(0).str() == "test.key1.key2.key3.key4");
|
||||
CHECK(p6.truncated(1).str() == "test.key1.key2.key3");
|
||||
CHECK(p6.truncated(4).str() == "test");
|
||||
CHECK(p6.truncated(5).str() == "");
|
||||
CHECK(p6.truncated(20).str() == "");
|
||||
CHECK(p6.str() == "test.key1.key2.key3.key4");
|
||||
|
||||
p6.truncate(0);
|
||||
CHECK(p6.str() == "test.key1.key2.key3.key4");
|
||||
p6.truncate(2);
|
||||
CHECK(p6.str() == "test.key1.key2");
|
||||
p6.truncate(3);
|
||||
CHECK(p6.str() == "");
|
||||
}
|
||||
|
||||
SECTION("subpath")
|
||||
{
|
||||
toml::path p0("a.simple[1].path[2].object");
|
||||
|
||||
CHECK(p0.subpath(p0.begin() + 1, p0.begin() + 4).str() == "simple[1].path");
|
||||
CHECK(p0.subpath(p0.begin() + 1, p0.end() - 1).str() == "simple[1].path[2]");
|
||||
CHECK(p0.subpath(p0.begin(), p0.begin()).str() == "");
|
||||
CHECK(p0.subpath(p0.begin(), p0.end() - 5).str() == "a");
|
||||
CHECK(p0.subpath(p0.begin() + 2, p0.end() - 1).str() == "[1].path[2]");
|
||||
|
||||
CHECK(p0.subpath(p0.begin() + 5, p0.end() - 5).str() == "");
|
||||
CHECK(!p0.subpath(p0.end(), p0.begin()));
|
||||
|
||||
CHECK(p0.subpath(1, 4).str() == "simple[1].path[2]");
|
||||
CHECK(p0.subpath(0, 0).str() == "");
|
||||
CHECK(p0.subpath(2, 0).str() == "");
|
||||
CHECK(p0.subpath(2, 1).str() == "[1]");
|
||||
}
|
||||
|
||||
SECTION("leaf")
|
||||
{
|
||||
toml::path p0("one.two.three.four.five");
|
||||
CHECK(p0.leaf(0).str() == "");
|
||||
CHECK(p0.leaf().str() == "five");
|
||||
CHECK(p0.leaf(3).str() == "three.four.five");
|
||||
CHECK(p0.leaf(5).str() == "one.two.three.four.five");
|
||||
CHECK(p0.leaf(10).str() == "one.two.three.four.five");
|
||||
|
||||
toml::path p1("[10][2][30][4][50]");
|
||||
CHECK(p1.leaf(0).str() == "");
|
||||
CHECK(p1.leaf().str() == "[50]");
|
||||
CHECK(p1.leaf(3).str() == "[30][4][50]");
|
||||
CHECK(p1.leaf(5).str() == "[10][2][30][4][50]");
|
||||
CHECK(p1.leaf(10).str() == "[10][2][30][4][50]");
|
||||
|
||||
toml::path p2("one[1].two.three[3]");
|
||||
CHECK(p2.leaf(0).str() == "");
|
||||
CHECK(p2.leaf().str() == "[3]");
|
||||
CHECK(p2.leaf(3).str() == "two.three[3]");
|
||||
CHECK(p2.leaf(4).str() == "[1].two.three[3]");
|
||||
CHECK(p2.leaf(10).str() == "one[1].two.three[3]");
|
||||
}
|
||||
|
||||
SECTION("append - string")
|
||||
{
|
||||
toml::path p0("start");
|
||||
CHECK(p0.size() == 1u);
|
||||
CHECK(p0.append("middle.end").str() == "start.middle.end");
|
||||
CHECK(p0.append("[12]").str() == "start.middle.end[12]");
|
||||
|
||||
toml::path p1("");
|
||||
CHECK(p1.size() == 1u);
|
||||
p1.append("[1].key"sv);
|
||||
CHECK(p1.size() == 3u);
|
||||
CHECK(p1.str() == "[1].key"sv);
|
||||
|
||||
#if TOML_ENABLE_WINDOWS_COMPAT
|
||||
|
||||
toml::path p2("start");
|
||||
CHECK(p2.size() == 1u);
|
||||
CHECK(p2.append(L"middle.end").str() == "start.middle.end");
|
||||
CHECK(p2.append(L"[12]").str() == "start.middle.end[12]");
|
||||
|
||||
toml::path p3("");
|
||||
CHECK(p3.append(L"[1].key").str() == "[1].key");
|
||||
|
||||
#endif // TOML_ENABLE_WINDOWS_COMPAT
|
||||
|
||||
toml::path p4;
|
||||
CHECK(p4.size() == 0u);
|
||||
CHECK(p4.append("[1].key").str() == "[1].key");
|
||||
}
|
||||
|
||||
SECTION("append - toml::path copy")
|
||||
{
|
||||
toml::path p0("start");
|
||||
toml::path appendee1("middle.end");
|
||||
toml::path appendee2("[12]");
|
||||
CHECK(p0.append(appendee1).str() == "start.middle.end");
|
||||
CHECK(p0.append(appendee2).str() == "start.middle.end[12]");
|
||||
|
||||
// Ensure copies and not moves
|
||||
CHECK(appendee1.str() == "middle.end");
|
||||
CHECK(appendee2.str() == "[12]");
|
||||
|
||||
toml::path p1("");
|
||||
toml::path appendee3("[1].key");
|
||||
CHECK(p1.append(appendee3).str() == "[1].key");
|
||||
|
||||
// Ensure copies and not moves
|
||||
CHECK(appendee3.str() == "[1].key");
|
||||
}
|
||||
|
||||
SECTION("append - toml::path move")
|
||||
{
|
||||
toml::path p0("start");
|
||||
CHECK(p0.append(toml::path{ "middle.end" }).str() == "start.middle.end");
|
||||
CHECK(p0.append(toml::path{ "[12]" }).str() == "start.middle.end[12]");
|
||||
|
||||
toml::path p1("");
|
||||
CHECK(p1.size() == 1u);
|
||||
CHECK(p1.append(toml::path{ "[1].key" }).str() == "[1].key");
|
||||
|
||||
toml::path p2;
|
||||
CHECK(p2.size() == 0u);
|
||||
CHECK(p2.append(toml::path{ "[1].key" }).str() == "[1].key");
|
||||
}
|
||||
|
||||
SECTION("prepend - string")
|
||||
{
|
||||
toml::path p0("start");
|
||||
CHECK(p0.prepend("middle.end").str() == "middle.end.start");
|
||||
CHECK(p0.prepend("[12]").str() == "[12].middle.end.start");
|
||||
|
||||
toml::path p1;
|
||||
CHECK(p1.prepend("[1].key").str() == "[1].key");
|
||||
|
||||
toml::path p2("");
|
||||
CHECK(p2.prepend("[1].key").str() == "[1].key.");
|
||||
|
||||
#if TOML_ENABLE_WINDOWS_COMPAT
|
||||
|
||||
toml::path p3("start");
|
||||
CHECK(p3.prepend(L"middle.end").str() == "middle.end.start");
|
||||
CHECK(p3.prepend(L"[12]").str() == "[12].middle.end.start");
|
||||
|
||||
#endif // TOML_ENABLE_WINDOWS_COMPAT
|
||||
}
|
||||
|
||||
SECTION("prepend - toml::path copy")
|
||||
{
|
||||
toml::path p0("start");
|
||||
toml::path prependee1("middle.end");
|
||||
toml::path prependee2("[12]");
|
||||
CHECK(p0.prepend(prependee1).str() == "middle.end.start");
|
||||
CHECK(p0.prepend(prependee2).str() == "[12].middle.end.start");
|
||||
|
||||
// Ensure copies and not moves
|
||||
CHECK(prependee1.str() == "middle.end");
|
||||
CHECK(prependee2.str() == "[12]");
|
||||
|
||||
toml::path p1;
|
||||
toml::path prependee3("[1].key");
|
||||
CHECK(p1.prepend(prependee3).str() == "[1].key");
|
||||
|
||||
// Ensure copies and not moves
|
||||
CHECK(prependee3.str() == "[1].key");
|
||||
}
|
||||
|
||||
SECTION("prepend - toml::path move")
|
||||
{
|
||||
toml::path p0("start");
|
||||
CHECK(p0.prepend(toml::path("middle.end")).str() == "middle.end.start");
|
||||
CHECK(p0.prepend(toml::path("[12]")).str() == "[12].middle.end.start");
|
||||
|
||||
toml::path p1;
|
||||
CHECK(p1.prepend(toml::path("[1].key")).str() == "[1].key");
|
||||
}
|
||||
|
||||
SECTION("alter components")
|
||||
{
|
||||
toml::path p0("start.mid[1][2].end");
|
||||
|
||||
p0[3] = std::size_t{ 13 };
|
||||
CHECK(p0.str() == "start.mid[1][13].end");
|
||||
|
||||
p0[0] = 2u;
|
||||
CHECK(p0.str() == "[2].mid[1][13].end");
|
||||
|
||||
p0[0] = 10;
|
||||
CHECK(p0.str() == "[10].mid[1][13].end");
|
||||
|
||||
p0[3] = "newkey";
|
||||
CHECK(p0.str() == "[10].mid[1].newkey.end");
|
||||
}
|
||||
|
||||
SECTION("assign")
|
||||
{
|
||||
toml::path p0("start.mid[1][2].end");
|
||||
p0.assign("test.key[1]");
|
||||
CHECK(p0.str() == "test.key[1]");
|
||||
p0.assign("");
|
||||
CHECK(p0.str() == "");
|
||||
|
||||
toml::path p1("a.test.path[1]");
|
||||
p1.assign("invalid[abc]");
|
||||
CHECK(!p1);
|
||||
CHECK(p1.str() == "");
|
||||
|
||||
toml::path p2("another[1].test.path");
|
||||
p2.assign(toml::path("test"));
|
||||
CHECK(p2.str() == "test");
|
||||
p2.assign(toml::path(""));
|
||||
CHECK(p2.str() == "");
|
||||
|
||||
toml::path p3("final.test[1]");
|
||||
p3.assign(toml::path("invalid[abc"));
|
||||
CHECK(!p3);
|
||||
CHECK(p3.str() == "");
|
||||
|
||||
#if TOML_ENABLE_WINDOWS_COMPAT
|
||||
|
||||
toml::path p4("start.mid[1][2].end");
|
||||
p4.assign(L"test.key[1]");
|
||||
CHECK(p4.str() == "test.key[1]");
|
||||
p4.assign("");
|
||||
CHECK(p4.str() == "");
|
||||
|
||||
toml::path p5("a.test.path[1]");
|
||||
p5.assign("invalid[abc]");
|
||||
CHECK(!p5);
|
||||
CHECK(p5.str() == "");
|
||||
|
||||
#endif // TOML_ENABLE_WINDOWS_COMPAT
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("path - operators")
|
||||
{
|
||||
SECTION("object equality")
|
||||
{
|
||||
CHECK(toml::path("a.b.c") == toml::path("a.b.c"));
|
||||
CHECK(toml::path("[1].a") == toml::path("[1].a"));
|
||||
|
||||
CHECK(toml::path("a.b.c") != toml::path("a.b"));
|
||||
CHECK(toml::path("[1].b") != toml::path("[1].b.c"));
|
||||
}
|
||||
|
||||
SECTION("string equality")
|
||||
{
|
||||
CHECK(toml::path("a.b.c") == "a.b.c");
|
||||
CHECK(toml::path("[1].a") == "[1].a");
|
||||
|
||||
CHECK(toml::path("a.b.c") != "a.b");
|
||||
CHECK(toml::path("[1].b") != "[1].b.c");
|
||||
|
||||
#if TOML_ENABLE_WINDOWS_COMPAT
|
||||
|
||||
CHECK(toml::path("a.b.c") == L"a.b.c");
|
||||
CHECK(toml::path("[1].a") == L"[1].a");
|
||||
|
||||
CHECK(toml::path("a.b.c") != L"a.b");
|
||||
CHECK(toml::path("[1].b") != L"[1].b.c");
|
||||
|
||||
#endif // TOML_ENABLE_WINDOWS_COMPAT
|
||||
}
|
||||
|
||||
SECTION("arithmetic")
|
||||
{
|
||||
CHECK(toml::path("a.b.c") + "a[1]" == "a.b.c.a[1]");
|
||||
CHECK((toml::path("a.b.c") + "a[1]") == "a.b.c.a[1]");
|
||||
|
||||
CHECK(toml::path("a.b.c") + toml::path("a[1]") == "a.b.c.a[1]");
|
||||
|
||||
toml::path p1("a.b");
|
||||
toml::path p2("c[1]");
|
||||
CHECK(p1 + p2 == "a.b.c[1]");
|
||||
|
||||
CHECK(p1 + "c[1]" == "a.b.c[1]");
|
||||
|
||||
CHECK("a.b" + p2 == "a.b.c[1]");
|
||||
|
||||
#if TOML_ENABLE_WINDOWS_COMPAT
|
||||
|
||||
CHECK(toml::path("a.b.c") + L"a[1]" == "a.b.c.a[1]");
|
||||
|
||||
CHECK(p1 + L"c[1]" == "a.b.c[1]");
|
||||
|
||||
CHECK(L"a.b" + p2 == "a.b.c[1]");
|
||||
|
||||
#endif // TOML_ENABLE_WINDOWS_COMPAT
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("path - misc")
|
||||
{
|
||||
CHECK(toml::path{ "" }.str() == "");
|
||||
CHECK(toml::path{ "a" }.str() == "a");
|
||||
CHECK(toml::path{ "a.b" }.str() == "a.b");
|
||||
CHECK(toml::path{ "a.b.c" }.str() == "a.b.c");
|
||||
CHECK(toml::path{ ".a.b.c" }.str() == ".a.b.c");
|
||||
|
||||
CHECK(toml::path{}.empty());
|
||||
CHECK(!toml::path{ "" }.empty());
|
||||
CHECK(!toml::path{ "a" }.empty());
|
||||
|
||||
CHECK(static_cast<std::string>(toml::path("a.b[1]")) == "a.b[1]");
|
||||
CHECK(static_cast<bool>(toml::path("a.b[1]")));
|
||||
CHECK(!static_cast<bool>(toml::path("a.b[a b]")));
|
||||
|
||||
#if TOML_ENABLE_WINDOWS_COMPAT
|
||||
|
||||
CHECK(static_cast<std::wstring>(toml::path("a.b[1]")) == L"a.b[1]");
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST_CASE("path - accessing")
|
||||
{
|
||||
// clang-format off
|
||||
|
||||
const auto tbl = table
|
||||
{
|
||||
{ ""sv, 0 }, // blank key
|
||||
{ "a"sv, 1 },
|
||||
{
|
||||
"b"sv,
|
||||
array
|
||||
{
|
||||
2,
|
||||
array{ 3 },
|
||||
table { { "c", 4 } }
|
||||
},
|
||||
},
|
||||
{ "d", table{ {"e", 5, }, {""sv, -1 } } }
|
||||
};
|
||||
|
||||
// clang-format on
|
||||
|
||||
/*
|
||||
|
||||
# equivalent to the following TOML:
|
||||
|
||||
"" = 0
|
||||
a = 1
|
||||
b = [
|
||||
2,
|
||||
[ 3 ],
|
||||
{ "c" = 4 }
|
||||
]
|
||||
d = { "e" = 5, "" = -1 }
|
||||
|
||||
*/
|
||||
|
||||
SECTION("table")
|
||||
{
|
||||
// this section uses the free function version of at_path
|
||||
|
||||
CHECK(tbl[""]);
|
||||
CHECK(tbl[""] == at_path(tbl, toml::path("")));
|
||||
|
||||
CHECK(tbl["a"]);
|
||||
CHECK(tbl["a"] == at_path(tbl, toml::path("a")));
|
||||
CHECK(tbl["a"] != at_path(tbl, toml::path(".a"))); // equivalent to ""."a"
|
||||
CHECK(!at_path(tbl, toml::path(".a")));
|
||||
|
||||
CHECK(tbl["b"]);
|
||||
CHECK(tbl["b"] == at_path(tbl, toml::path("b")));
|
||||
|
||||
CHECK(tbl["b"][0]);
|
||||
CHECK(tbl["b"][0] == at_path(tbl, toml::path("b[0]")));
|
||||
CHECK(tbl["b"][0] == at_path(tbl, toml::path("b[0] ")));
|
||||
CHECK(tbl["b"][0] == at_path(tbl, toml::path("b[ 0\t]"))); // whitespace is allowed inside array indexer
|
||||
|
||||
CHECK(tbl["b"][1]);
|
||||
CHECK(tbl["b"][1] != tbl["b"][0]);
|
||||
CHECK(tbl["b"][1] == at_path(tbl, toml::path("b[1]")));
|
||||
|
||||
CHECK(tbl["b"][1][0]);
|
||||
CHECK(tbl["b"][1][0] == at_path(tbl, toml::path("b[1][0]")));
|
||||
CHECK(tbl["b"][1][0] == at_path(tbl, toml::path("b[1] \t [0]"))); // whitespace is allowed after array
|
||||
// indexers
|
||||
|
||||
CHECK(tbl["b"][2]["c"]);
|
||||
CHECK(tbl["b"][2]["c"] == at_path(tbl, toml::path("b[2].c")));
|
||||
CHECK(tbl["b"][2]["c"] == at_path(tbl, toml::path("b[2] \t.c"))); // whitespace is allowed after array
|
||||
// indexers
|
||||
|
||||
CHECK(tbl["d"]);
|
||||
CHECK(tbl["d"] == at_path(tbl, toml::path("d")));
|
||||
|
||||
CHECK(tbl["d"]["e"]);
|
||||
CHECK(tbl["d"]["e"] == at_path(tbl, toml::path("d.e")));
|
||||
CHECK(tbl["d"]["e"] != at_path(tbl, toml::path("d. e"))); // equivalent to "d"." e"
|
||||
CHECK(!at_path(tbl, toml::path("d. e")));
|
||||
|
||||
CHECK(tbl["d"][""]);
|
||||
CHECK(tbl["d"][""] == at_path(tbl, toml::path("d.")));
|
||||
|
||||
CHECK(!at_path(tbl, toml::path("has.missing.component")));
|
||||
}
|
||||
|
||||
SECTION("array")
|
||||
{
|
||||
// this section uses the node_view member function version of at_path
|
||||
|
||||
auto arr = tbl["b"];
|
||||
|
||||
CHECK(tbl["b"][0]);
|
||||
CHECK(tbl["b"][0] == arr.at_path(toml::path("[0]")));
|
||||
CHECK(tbl["b"][0] == arr.at_path(toml::path("[0] ")));
|
||||
CHECK(tbl["b"][0] == arr.at_path(toml::path("[ 0\t]"))); // whitespace is allowed inside array indexer
|
||||
|
||||
CHECK(tbl["b"][1]);
|
||||
CHECK(tbl["b"][1].node() != arr[0].node());
|
||||
CHECK(tbl["b"][1] == arr.at_path(toml::path("[1]")));
|
||||
|
||||
CHECK(tbl["b"][1][0]);
|
||||
CHECK(tbl["b"][1][0] == arr.at_path(toml::path("[1][0]")));
|
||||
CHECK(tbl["b"][1][0] == arr.at_path(toml::path("[1] \t [0]"))); // whitespace is allowed after array
|
||||
// indexers
|
||||
|
||||
CHECK(tbl["b"][2]["c"]);
|
||||
CHECK(tbl["b"][2]["c"] == arr.at_path(toml::path("[2].c")));
|
||||
CHECK(tbl["b"][2]["c"] == arr.at_path(toml::path("[2] \t.c"))); // whitespace is allowed after array indexers
|
||||
|
||||
CHECK(!arr.at_path(toml::path("[3].missing.component")));
|
||||
}
|
||||
|
||||
SECTION("indexing operator")
|
||||
{
|
||||
// this section uses the operator[] of table and node_view
|
||||
CHECK(tbl[""]);
|
||||
CHECK(tbl[""] == tbl[toml::path("")]);
|
||||
|
||||
CHECK(tbl["a"]);
|
||||
CHECK(tbl["a"] == tbl[toml::path("a")]);
|
||||
CHECK(tbl["a"] != tbl[toml::path(".a")]); // equivalent to ""."a"
|
||||
CHECK(!tbl[toml::path(".a")]);
|
||||
|
||||
CHECK(tbl["b"]);
|
||||
CHECK(tbl["b"] == tbl[toml::path("b")]);
|
||||
|
||||
CHECK(tbl["b"][0]);
|
||||
CHECK(tbl["b"][0] == tbl[toml::path("b[0]")]);
|
||||
CHECK(tbl["b"][0] == tbl[toml::path("b[0] ")]);
|
||||
CHECK(tbl["b"][0] == tbl[toml::path("b[ 0\t]")]); // whitespace is allowed inside array indexer
|
||||
|
||||
CHECK(tbl["b"][1]);
|
||||
CHECK(tbl["b"][1] != tbl[toml::path("b")][0]);
|
||||
CHECK(tbl["b"][1] == tbl[toml::path("b[1]")]);
|
||||
|
||||
CHECK(tbl["b"][1][0]);
|
||||
CHECK(tbl["b"][1][0] == tbl[toml::path("b[1]")][0]);
|
||||
CHECK(tbl["b"][1][0] == tbl[toml::path("b[1] \t [0]")]); // whitespace is allowed after array
|
||||
// indexers
|
||||
|
||||
CHECK(tbl["b"][2]["c"]);
|
||||
CHECK(tbl["b"][2]["c"] == tbl[toml::path("b")][toml::path("[2].c")]);
|
||||
CHECK(tbl["b"][2]["c"] == tbl[toml::path("b[2] \t.c")]); // whitespace is allowed after array
|
||||
// indexers
|
||||
|
||||
CHECK(tbl["d"]);
|
||||
CHECK(tbl["d"] == tbl[toml::path("d")]);
|
||||
|
||||
CHECK(tbl["d"]["e"]);
|
||||
CHECK(tbl["d"]["e"] == tbl[toml::path("d.e")]);
|
||||
CHECK(tbl["d"]["e"] != tbl[toml::path("d. e")]); // equivalent to "d"." e"
|
||||
CHECK(!tbl[toml::path("d. e")]);
|
||||
|
||||
CHECK(tbl["d"][""]);
|
||||
CHECK(tbl["d"][""] == tbl[toml::path("d.")]);
|
||||
|
||||
CHECK(!tbl[toml::path("has.missing.component")]);
|
||||
}
|
||||
}
|
@ -1,98 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
#pragma once
|
||||
|
||||
// toml++ config
|
||||
#define TOML_UNDEF_MACROS 0
|
||||
#ifndef TOML_HEADER_ONLY
|
||||
#define TOML_HEADER_ONLY 0
|
||||
#endif
|
||||
#ifndef TOML_SHARED_LIB
|
||||
#define TOML_SHARED_LIB 0
|
||||
#endif
|
||||
#ifndef USE_SINGLE_HEADER
|
||||
#define USE_SINGLE_HEADER 0
|
||||
#endif
|
||||
#if defined(LEAK_TESTS) && LEAK_TESTS
|
||||
#define TOML_CONFIG_HEADER "leakproof.hpp"
|
||||
#else
|
||||
#undef LEAK_TESTS
|
||||
#define LEAK_TESTS 0
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#define TOML_CALLCONV __stdcall // just to test that TOML_CALLCONV doesn't cause linker failures
|
||||
#endif
|
||||
|
||||
// catch2 config
|
||||
#define CATCH_CONFIG_CPP11_TO_STRING
|
||||
#define CATCH_CONFIG_CPP17_OPTIONAL
|
||||
#define CATCH_CONFIG_CPP17_STRING_VIEW
|
||||
#define CATCH_CONFIG_FAST_COMPILE
|
||||
#define CATCH_CONFIG_CONSOLE_WIDTH 120
|
||||
#define CATCH_CONFIG_CPP11_TO_STRING
|
||||
#define CATCH_CONFIG_DISABLE_MATCHERS
|
||||
#define CATCH_CONFIG_NO_NOMINMAX
|
||||
|
||||
// windows.h config (included transitively by catch2 on windows)
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define VC_EXTRALEAN
|
||||
#define NOATOM // Atom Manager routines
|
||||
#define NOBITMAP //
|
||||
#define NOCLIPBOARD // Clipboard routines
|
||||
#define NOCOLOR // Screen colors
|
||||
#define NOCOMM // COMM driver routines
|
||||
#define NOCTLMGR // Control and Dialog routines
|
||||
#define NODEFERWINDOWPOS // DeferWindowPos routines
|
||||
#define NODRAWTEXT // DrawText() and DT_*
|
||||
#define NOGDI // All GDI defines and routines
|
||||
#define NOGDICAPMASKS // CC_*, LC_*, PC_*, CP_*, TC_*, RC_
|
||||
#define NOHELP // Help engine interface.
|
||||
#define NOICONS // IDI_*
|
||||
#define NOKANJI // Kanji support stuff.
|
||||
#define NOKEYSTATES // MK_*
|
||||
#define NOKERNEL // All KERNEL defines and routines
|
||||
#define NOMB // MB_* and MessageBox()
|
||||
#define NOMCX // Modem Configuration Extensions
|
||||
#define NOMENUS // MF_*
|
||||
#define NOMEMMGR // GMEM_*, LMEM_*, GHND, LHND, associated routines
|
||||
#define NOMETAFILE // typedef METAFILEPICT
|
||||
#define NOMSG // typedef MSG and associated routines
|
||||
#define NOOPENFILE // OpenFile(), OemToAnsi, AnsiToOem, and OF_*
|
||||
#define NOPROFILER // Profiler interface.
|
||||
#define NORASTEROPS // Binary and Tertiary raster ops
|
||||
#define NOSCROLL // SB_* and scrolling routines
|
||||
#define NOSERVICE // All Service Controller routines, SERVICE_ equates, etc.
|
||||
#define NOSHOWWINDOW // SW_*
|
||||
#define NOSOUND // Sound driver routines
|
||||
#define NOSYSCOMMANDS // SC_*
|
||||
#define NOSYSMETRICS // SM_*
|
||||
#define NOTEXTMETRIC // typedef TEXTMETRIC and associated routines
|
||||
#define NOUSER // All USER defines and routines
|
||||
#define NOVIRTUALKEYCODES // VK_*
|
||||
#define NOWH // SetWindowsHook and WH_*
|
||||
#define NOWINOFFSETS // GWL_*, GCL_*, associated routines
|
||||
#define NOWINMESSAGES // WM_*, EM_*, LB_*, CB_*
|
||||
#define NOWINSTYLES // WS_*, CS_*, ES_*, LBS_*, SBS_*, CBS_*
|
||||
//#define NOMINMAX // Macros min(a,b) and max(a,b)
|
||||
//#define NONLS // All NLS defines and routines
|
||||
#endif
|
||||
|
||||
// test harness stuff
|
||||
#ifndef SHOULD_HAVE_FP16
|
||||
#define SHOULD_HAVE_FP16 0
|
||||
#endif
|
||||
#ifndef SHOULD_HAVE_FLOAT16
|
||||
#define SHOULD_HAVE_FLOAT16 0
|
||||
#endif
|
||||
#ifndef SHOULD_HAVE_FLOAT128
|
||||
#define SHOULD_HAVE_FLOAT128 0
|
||||
#endif
|
||||
#ifndef SHOULD_HAVE_INT128
|
||||
#define SHOULD_HAVE_INT128 0
|
||||
#endif
|
||||
#ifndef SHOULD_HAVE_EXCEPTIONS
|
||||
#define SHOULD_HAVE_EXCEPTIONS 1
|
||||
#endif
|
230
tests/tests.cpp
230
tests/tests.cpp
@ -1,230 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
|
||||
bool parsing_should_succeed(std::string_view test_file,
|
||||
uint32_t test_line,
|
||||
std::string_view toml_str,
|
||||
pss_func&& func,
|
||||
std::string_view source_path)
|
||||
{
|
||||
INFO("["sv << test_file << ", line "sv << test_line << "] "sv
|
||||
<< "parsing_should_succeed(\""sv << toml_str << "\")"sv)
|
||||
|
||||
constexpr auto validate_table = [](table&& tabl, std::string_view path) -> table&&
|
||||
{
|
||||
INFO("Validating table source information"sv)
|
||||
CHECK(tabl.source().begin != source_position{});
|
||||
CHECK(tabl.source().end != source_position{});
|
||||
if (path.empty())
|
||||
CHECK(tabl.source().path == nullptr);
|
||||
else
|
||||
{
|
||||
REQUIRE(tabl.source().path != nullptr);
|
||||
CHECK(*tabl.source().path == path);
|
||||
}
|
||||
return std::move(tabl);
|
||||
};
|
||||
|
||||
#if TOML_EXCEPTIONS
|
||||
|
||||
try
|
||||
{
|
||||
{
|
||||
INFO("Parsing string directly"sv)
|
||||
if (func)
|
||||
func(validate_table(toml::parse(toml_str, source_path), source_path));
|
||||
else
|
||||
validate_table(toml::parse(toml_str, source_path), source_path);
|
||||
}
|
||||
{
|
||||
INFO("Parsing from a string stream"sv)
|
||||
std::stringstream ss;
|
||||
ss.write(toml_str.data(), static_cast<std::streamsize>(toml_str.length()));
|
||||
if (func)
|
||||
func(validate_table(toml::parse(ss, source_path), source_path));
|
||||
else
|
||||
validate_table(toml::parse(ss, source_path), source_path);
|
||||
}
|
||||
}
|
||||
catch (const parse_error& err)
|
||||
{
|
||||
FORCE_FAIL("Parse error on line "sv << err.source().begin.line << ", column "sv << err.source().begin.column
|
||||
<< ":\n"sv << err.description());
|
||||
return false;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
{
|
||||
INFO("Parsing string directly"sv)
|
||||
parse_result result = toml::parse(toml_str, source_path);
|
||||
if (result)
|
||||
{
|
||||
if (func)
|
||||
func(validate_table(std::move(result), source_path));
|
||||
else
|
||||
validate_table(std::move(result), source_path);
|
||||
}
|
||||
else
|
||||
{
|
||||
FORCE_FAIL("Parse error on line "sv << result.error().source().begin.line << ", column "sv
|
||||
<< result.error().source().begin.column << ":\n"sv
|
||||
<< result.error().description());
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
INFO("Parsing from a string stream"sv)
|
||||
std::stringstream ss;
|
||||
ss.write(toml_str.data(), static_cast<std::streamsize>(toml_str.length()));
|
||||
parse_result result = toml::parse(ss, source_path);
|
||||
if (result)
|
||||
{
|
||||
if (func)
|
||||
func(validate_table(std::move(result), source_path));
|
||||
else
|
||||
validate_table(std::move(result), source_path);
|
||||
}
|
||||
else
|
||||
{
|
||||
FORCE_FAIL("Parse error on line "sv << result.error().source().begin.line << ", column "sv
|
||||
<< result.error().source().begin.column << ":\n"sv
|
||||
<< result.error().description());
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool parsing_should_fail(std::string_view test_file,
|
||||
uint32_t test_line,
|
||||
std::string_view toml_str,
|
||||
source_index expected_failure_line,
|
||||
source_index expected_failure_column)
|
||||
{
|
||||
INFO("["sv << test_file << ", line "sv << test_line << "] "sv
|
||||
<< "parsing_should_fail(\""sv << toml_str << "\")"sv)
|
||||
|
||||
#if TOML_EXCEPTIONS
|
||||
|
||||
static constexpr auto run_tests = [](source_index ex_line, source_index ex_col, auto&& fn)
|
||||
{
|
||||
try
|
||||
{
|
||||
fn();
|
||||
}
|
||||
catch (const parse_error& err)
|
||||
{
|
||||
if (ex_line != static_cast<source_index>(-1) && err.source().begin.line != ex_line)
|
||||
{
|
||||
FORCE_FAIL("Expected parse_error at line "sv << ex_line << ", actually occured at line "sv
|
||||
<< err.source().begin.line);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ex_col != static_cast<source_index>(-1) && err.source().begin.column != ex_col)
|
||||
{
|
||||
FORCE_FAIL("Expected parse_error at column "sv << ex_col << ", actually occured at column "sv
|
||||
<< err.source().begin.column);
|
||||
return false;
|
||||
}
|
||||
|
||||
SUCCEED("parse_error thrown OK"sv);
|
||||
return true;
|
||||
}
|
||||
catch (const std::exception& exc)
|
||||
{
|
||||
FORCE_FAIL("Expected parsing failure, saw exception: "sv << exc.what());
|
||||
return false;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
FORCE_FAIL("Expected parsing failure, saw unspecified exception"sv);
|
||||
return false;
|
||||
}
|
||||
|
||||
FORCE_FAIL("Expected parsing failure"sv);
|
||||
return false;
|
||||
};
|
||||
|
||||
auto result = run_tests(expected_failure_line,
|
||||
expected_failure_column,
|
||||
[=]() { [[maybe_unused]] auto res = toml::parse(toml_str); });
|
||||
result = result
|
||||
&& run_tests(expected_failure_line,
|
||||
expected_failure_column,
|
||||
[=]()
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss.write(toml_str.data(), static_cast<std::streamsize>(toml_str.length()));
|
||||
[[maybe_unused]] auto res = toml::parse(ss);
|
||||
});
|
||||
return result;
|
||||
|
||||
#else
|
||||
|
||||
static constexpr auto run_tests = [](source_index ex_line, source_index ex_col, auto&& fn)
|
||||
{
|
||||
if (parse_result result = fn(); !result)
|
||||
{
|
||||
if (ex_line != static_cast<source_index>(-1) && result.error().source().begin.line != ex_line)
|
||||
{
|
||||
FORCE_FAIL("Expected parse_error at line "sv << ex_line << ", actually occured at line "sv
|
||||
<< result.error().source().begin.line);
|
||||
}
|
||||
|
||||
if (ex_col != static_cast<source_index>(-1) && result.error().source().begin.column != ex_col)
|
||||
{
|
||||
FORCE_FAIL("Expected parse_error at column "sv << ex_col << ", actually occured at column "sv
|
||||
<< result.error().source().begin.column);
|
||||
}
|
||||
|
||||
SUCCEED("parse_error generated OK"sv);
|
||||
return true;
|
||||
}
|
||||
|
||||
FORCE_FAIL("Expected parsing failure"sv);
|
||||
};
|
||||
|
||||
return run_tests(expected_failure_line, expected_failure_column, [=]() { return toml::parse(toml_str); })
|
||||
&& run_tests(expected_failure_line,
|
||||
expected_failure_column,
|
||||
[=]()
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss.write(toml_str.data(), static_cast<std::streamsize>(toml_str.length()));
|
||||
return toml::parse(ss);
|
||||
});
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const int&);
|
||||
template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const unsigned int&);
|
||||
template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const bool&);
|
||||
template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const float&);
|
||||
template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const double&);
|
||||
template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const std::string_view&);
|
||||
|
||||
namespace std
|
||||
{
|
||||
template class unique_ptr<const Catch::IExceptionTranslator>;
|
||||
}
|
||||
namespace Catch
|
||||
{
|
||||
template struct StringMaker<node_view<node>>;
|
||||
template struct StringMaker<node_view<const node>>;
|
||||
template ReusableStringStream& ReusableStringStream::operator<<(node_view<node> const&);
|
||||
template ReusableStringStream& ReusableStringStream::operator<<(node_view<const node> const&);
|
||||
namespace Detail
|
||||
{
|
||||
template std::string stringify(const node_view<node>&);
|
||||
template std::string stringify(const node_view<const node>&);
|
||||
}
|
||||
}
|
410
tests/tests.hpp
410
tests/tests.hpp
@ -1,410 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#pragma once
|
||||
#include "settings.hpp"
|
||||
#include <toml++/toml.hpp>
|
||||
|
||||
#if TOML_COMPILER_HAS_EXCEPTIONS ^ SHOULD_HAVE_EXCEPTIONS
|
||||
#error TOML_COMPILER_HAS_EXCEPTIONS was not deduced correctly
|
||||
#endif
|
||||
#if TOML_COMPILER_HAS_EXCEPTIONS ^ TOML_EXCEPTIONS
|
||||
#error TOML_EXCEPTIONS does not match TOML_COMPILER_HAS_EXCEPTIONS (default behaviour should be to match)
|
||||
#endif
|
||||
#if defined(_WIN32) ^ TOML_ENABLE_WINDOWS_COMPAT
|
||||
#error TOML_ENABLE_WINDOWS_COMPAT does not match _WIN32 (default behaviour should be to match)
|
||||
#endif
|
||||
#if TOML_LIB_SINGLE_HEADER ^ USE_SINGLE_HEADER
|
||||
#error TOML_LIB_SINGLE_HEADER was not set correctly
|
||||
#endif
|
||||
|
||||
#if TOML_ICC
|
||||
#define UNICODE_LITERALS_OK 0
|
||||
#else
|
||||
#define UNICODE_LITERALS_OK 1
|
||||
#endif
|
||||
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
TOML_DISABLE_ARITHMETIC_WARNINGS;
|
||||
#if TOML_CLANG == 13
|
||||
#pragma clang diagnostic ignored "-Wreserved-identifier" // false-positive
|
||||
#endif
|
||||
|
||||
TOML_DISABLE_WARNINGS;
|
||||
#include "lib_catch2.hpp"
|
||||
#include <sstream>
|
||||
namespace toml
|
||||
{
|
||||
}
|
||||
using namespace Catch::literals;
|
||||
using namespace toml;
|
||||
TOML_ENABLE_WARNINGS;
|
||||
|
||||
TOML_NODISCARD
|
||||
TOML_ATTR(const)
|
||||
TOML_ALWAYS_INLINE
|
||||
constexpr size_t operator"" _sz(unsigned long long n) noexcept
|
||||
{
|
||||
return static_cast<size_t>(n);
|
||||
}
|
||||
|
||||
#define FILE_LINE_ARGS trim_file_path(std::string_view{ __FILE__ }), __LINE__
|
||||
#define BOM_PREFIX "\xEF\xBB\xBF"
|
||||
|
||||
#if TOML_EXCEPTIONS
|
||||
#define FORCE_FAIL(...) FAIL(__VA_ARGS__)
|
||||
#else
|
||||
#define FORCE_FAIL(...) \
|
||||
do \
|
||||
{ \
|
||||
FAIL(__VA_ARGS__); \
|
||||
std::exit(-1); \
|
||||
TOML_UNREACHABLE; \
|
||||
} \
|
||||
while (false)
|
||||
#endif
|
||||
|
||||
#define CHECK_SYMMETRIC_RELOP(lhs, op, rhs, result) \
|
||||
CHECK(((lhs)op(rhs)) == (result)); \
|
||||
CHECK(((rhs)op(lhs)) == (result))
|
||||
|
||||
#define CHECK_SYMMETRIC_EQUAL(lhs, rhs) \
|
||||
CHECK_SYMMETRIC_RELOP(lhs, ==, rhs, true); \
|
||||
CHECK_SYMMETRIC_RELOP(lhs, !=, rhs, false)
|
||||
|
||||
#define CHECK_SYMMETRIC_INEQUAL(lhs, rhs) \
|
||||
CHECK_SYMMETRIC_RELOP(lhs, ==, rhs, false); \
|
||||
CHECK_SYMMETRIC_RELOP(lhs, !=, rhs, true)
|
||||
|
||||
template <typename T>
|
||||
struct type_tag
|
||||
{
|
||||
using type = T;
|
||||
};
|
||||
|
||||
// function_view - adapted from here: https://vittorioromeo.info/index/blog/passing_functions_to_functions.html
|
||||
template <typename Func>
|
||||
class function_view;
|
||||
template <typename R, typename... P>
|
||||
class function_view<R(P...)> final
|
||||
{
|
||||
private:
|
||||
using func_type = R(P...);
|
||||
using eraser_func_type = R(void*, P&&...);
|
||||
|
||||
mutable void* ptr_ = {};
|
||||
mutable eraser_func_type* eraser = {};
|
||||
|
||||
public:
|
||||
function_view() noexcept = default;
|
||||
|
||||
template <typename T>
|
||||
function_view(T&& x) noexcept : ptr_{ reinterpret_cast<void*>(std::addressof(x)) }
|
||||
{
|
||||
eraser = [](void* ptr, P&&... xs) -> R
|
||||
{ return (*reinterpret_cast<std::add_pointer_t<std::remove_reference_t<T>>>(ptr))(std::forward<P>(xs)...); };
|
||||
}
|
||||
|
||||
decltype(auto) operator()(P&&... xs) const
|
||||
{
|
||||
return eraser(ptr_, std::forward<P>(xs)...);
|
||||
}
|
||||
|
||||
TOML_NODISCARD
|
||||
operator bool() const noexcept
|
||||
{
|
||||
return !!ptr_;
|
||||
}
|
||||
};
|
||||
|
||||
using pss_func = function_view<void(table&&)>;
|
||||
|
||||
bool parsing_should_succeed(std::string_view test_file,
|
||||
uint32_t test_line,
|
||||
std::string_view toml_str,
|
||||
pss_func&& func = {},
|
||||
std::string_view source_path = {});
|
||||
|
||||
bool parsing_should_fail(std::string_view test_file,
|
||||
uint32_t test_line,
|
||||
std::string_view toml_str,
|
||||
source_index expected_failure_line = static_cast<source_index>(-1),
|
||||
source_index expected_failure_column = static_cast<source_index>(-1));
|
||||
|
||||
TOML_PURE_GETTER
|
||||
constexpr std::string_view trim_file_path(std::string_view sv) noexcept
|
||||
{
|
||||
const auto src = std::min(sv.rfind("\\"sv), sv.rfind("/"sv));
|
||||
if (src != std::string_view::npos)
|
||||
sv = sv.substr(src + 1_sz);
|
||||
return sv;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline bool parse_expected_value(std::string_view test_file,
|
||||
uint32_t test_line,
|
||||
std::string_view value_str,
|
||||
const T& expected)
|
||||
{
|
||||
INFO("["sv << test_file << ", line "sv << test_line << "] "sv
|
||||
<< "parse_expected_value(\""sv << value_str << "\")"sv)
|
||||
|
||||
std::string val;
|
||||
static constexpr auto key = "val = "sv;
|
||||
val.reserve(key.length() + value_str.length());
|
||||
val.append(key);
|
||||
val.append(value_str);
|
||||
|
||||
static constexpr auto is_val = [](char32_t codepoint)
|
||||
{
|
||||
if constexpr (impl::node_type_of<T> == node_type::string)
|
||||
return codepoint == U'"' || codepoint == U'\'';
|
||||
else
|
||||
return !impl::is_whitespace(codepoint);
|
||||
};
|
||||
|
||||
source_position pos{ 1, static_cast<source_index>(key.length()) };
|
||||
source_position begin{}, end{};
|
||||
{
|
||||
impl::utf8_decoder decoder;
|
||||
for (auto c : value_str)
|
||||
{
|
||||
decoder(static_cast<uint8_t>(c));
|
||||
if (!decoder.has_code_point())
|
||||
continue;
|
||||
|
||||
if (impl::is_ascii_vertical_whitespace(decoder.codepoint))
|
||||
{
|
||||
if (decoder.codepoint == U'\n')
|
||||
{
|
||||
pos.line++;
|
||||
pos.column = source_index{ 1 };
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
pos.column++;
|
||||
if (is_val(decoder.codepoint))
|
||||
{
|
||||
if (!begin)
|
||||
begin = pos;
|
||||
else
|
||||
end = pos;
|
||||
}
|
||||
}
|
||||
if (!end)
|
||||
end = begin;
|
||||
end.column++;
|
||||
}
|
||||
|
||||
using value_type = impl::native_type_of<impl::remove_cvref<T>>;
|
||||
value<value_type> val_parsed;
|
||||
{
|
||||
INFO("["sv << test_file << ", line "sv << test_line << "] "sv
|
||||
<< "parse_expected_value: Checking initial parse"sv)
|
||||
|
||||
bool stolen_value = false; // parsing_should_succeed invokes the functor more than once
|
||||
const auto result = parsing_should_succeed(
|
||||
test_file,
|
||||
test_line,
|
||||
std::string_view{ val },
|
||||
[&](table&& tbl)
|
||||
{
|
||||
REQUIRE(tbl.size() == 1);
|
||||
auto nv = tbl["val"sv];
|
||||
REQUIRE(nv);
|
||||
REQUIRE(nv.is<value_type>());
|
||||
REQUIRE(nv.as<value_type>());
|
||||
REQUIRE(nv.type() == impl::node_type_of<T>);
|
||||
REQUIRE(nv.node());
|
||||
REQUIRE(nv.node()->is<value_type>());
|
||||
REQUIRE(nv.node()->as<value_type>());
|
||||
REQUIRE(nv.node()->type() == impl::node_type_of<T>);
|
||||
|
||||
// check homogeneity
|
||||
REQUIRE(nv.is_homogeneous());
|
||||
REQUIRE(nv.is_homogeneous(node_type::none));
|
||||
REQUIRE(nv.is_homogeneous(impl::node_type_of<T>));
|
||||
REQUIRE(nv.is_homogeneous<value_type>());
|
||||
REQUIRE(nv.node()->is_homogeneous());
|
||||
REQUIRE(nv.node()->is_homogeneous(node_type::none));
|
||||
REQUIRE(nv.node()->is_homogeneous(impl::node_type_of<T>));
|
||||
REQUIRE(nv.node()->is_homogeneous<value_type>());
|
||||
for (auto nt = impl::unwrap_enum(node_type::table); nt <= impl::unwrap_enum(node_type::date_time); nt++)
|
||||
{
|
||||
if (node_type{ nt } == impl::node_type_of<T>)
|
||||
continue;
|
||||
node* first_nonmatch{};
|
||||
REQUIRE(!nv.is_homogeneous(node_type{ nt }));
|
||||
REQUIRE(!nv.is_homogeneous(node_type{ nt }, first_nonmatch));
|
||||
REQUIRE(first_nonmatch == nv.node());
|
||||
REQUIRE(!nv.node()->is_homogeneous(node_type{ nt }));
|
||||
REQUIRE(!nv.node()->is_homogeneous(node_type{ nt }, first_nonmatch));
|
||||
REQUIRE(first_nonmatch == nv.node());
|
||||
}
|
||||
|
||||
// check the raw value
|
||||
REQUIRE(nv.node()->value<value_type>() == expected);
|
||||
REQUIRE(nv.node()->value_or(T{}) == expected);
|
||||
REQUIRE(nv.as<value_type>()->get() == expected);
|
||||
REQUIRE(nv.value<value_type>() == expected);
|
||||
REQUIRE(nv.value_or(T{}) == expected);
|
||||
REQUIRE(nv.ref<value_type>() == expected);
|
||||
REQUIRE(nv.node()->ref<value_type>() == expected);
|
||||
|
||||
// check the table relops
|
||||
REQUIRE(tbl == table{ { { "val"sv, expected } } });
|
||||
REQUIRE(!(tbl != table{ { { "val"sv, expected } } }));
|
||||
|
||||
// check value/node relops
|
||||
CHECK_SYMMETRIC_EQUAL(*nv.as<value_type>(), *nv.as<value_type>());
|
||||
CHECK_SYMMETRIC_EQUAL(*nv.as<value_type>(), expected);
|
||||
CHECK_SYMMETRIC_EQUAL(nv, expected);
|
||||
|
||||
// make sure source info is correct
|
||||
CHECK_SYMMETRIC_EQUAL(nv.node()->source().begin, begin);
|
||||
CHECK_SYMMETRIC_EQUAL(nv.node()->source().end, end);
|
||||
|
||||
// check float identities etc
|
||||
if constexpr (std::is_same_v<value_type, double>)
|
||||
{
|
||||
auto& float_node = *nv.as<value_type>();
|
||||
const auto fpcls = impl::fpclassify(*float_node);
|
||||
if (fpcls == impl::fp_class::nan)
|
||||
{
|
||||
CHECK_SYMMETRIC_EQUAL(float_node, std::numeric_limits<double>::quiet_NaN());
|
||||
CHECK_SYMMETRIC_INEQUAL(float_node, std::numeric_limits<double>::infinity());
|
||||
CHECK_SYMMETRIC_INEQUAL(float_node, -std::numeric_limits<double>::infinity());
|
||||
CHECK_SYMMETRIC_INEQUAL(float_node, 1.0);
|
||||
CHECK_SYMMETRIC_INEQUAL(float_node, 0.0);
|
||||
CHECK_SYMMETRIC_INEQUAL(float_node, -1.0);
|
||||
}
|
||||
else if (fpcls == impl::fp_class::neg_inf || fpcls == impl::fp_class::pos_inf)
|
||||
{
|
||||
CHECK_SYMMETRIC_INEQUAL(float_node, std::numeric_limits<double>::quiet_NaN());
|
||||
if (fpcls == impl::fp_class::neg_inf)
|
||||
{
|
||||
CHECK_SYMMETRIC_EQUAL(float_node, -std::numeric_limits<double>::infinity());
|
||||
CHECK_SYMMETRIC_INEQUAL(float_node, std::numeric_limits<double>::infinity());
|
||||
}
|
||||
else
|
||||
{
|
||||
CHECK_SYMMETRIC_EQUAL(float_node, std::numeric_limits<double>::infinity());
|
||||
CHECK_SYMMETRIC_INEQUAL(float_node, -std::numeric_limits<double>::infinity());
|
||||
}
|
||||
CHECK_SYMMETRIC_INEQUAL(float_node, 1.0);
|
||||
CHECK_SYMMETRIC_INEQUAL(float_node, 0.0);
|
||||
CHECK_SYMMETRIC_INEQUAL(float_node, -1.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
CHECK_SYMMETRIC_INEQUAL(float_node, std::numeric_limits<double>::quiet_NaN());
|
||||
CHECK_SYMMETRIC_INEQUAL(float_node, std::numeric_limits<double>::infinity());
|
||||
CHECK_SYMMETRIC_INEQUAL(float_node, -std::numeric_limits<double>::infinity());
|
||||
CHECK_SYMMETRIC_EQUAL(float_node, *float_node);
|
||||
if (std::abs(*float_node) <= 1e10)
|
||||
{
|
||||
CHECK_SYMMETRIC_INEQUAL(float_node, *float_node + 100.0);
|
||||
CHECK_SYMMETRIC_INEQUAL(float_node, *float_node - 100.0);
|
||||
}
|
||||
CHECK(float_node < std::numeric_limits<double>::infinity());
|
||||
CHECK(float_node > -std::numeric_limits<double>::infinity());
|
||||
}
|
||||
}
|
||||
|
||||
// steal the val for round-trip tests
|
||||
if (!stolen_value)
|
||||
{
|
||||
val_parsed = std::move(*nv.as<value_type>());
|
||||
stolen_value = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (!result)
|
||||
return false;
|
||||
}
|
||||
|
||||
// check round-tripping
|
||||
{
|
||||
INFO("["sv << test_file << ", line "sv << test_line << "] "sv
|
||||
<< "parse_expected_value: Checking round-trip"sv)
|
||||
{
|
||||
std::string str;
|
||||
{
|
||||
auto tbl = table{ { { "val"sv, *val_parsed } } };
|
||||
std::ostringstream ss;
|
||||
ss << tbl;
|
||||
str = std::move(ss).str();
|
||||
}
|
||||
|
||||
bool value_ok = true;
|
||||
const auto parse_ok =
|
||||
parsing_should_succeed(test_file,
|
||||
test_line,
|
||||
std::string_view{ str },
|
||||
[&](table&& tbl)
|
||||
{
|
||||
REQUIRE(tbl.size() == 1);
|
||||
auto nv = tbl["val"sv];
|
||||
REQUIRE(nv);
|
||||
REQUIRE(nv.as<value_type>());
|
||||
REQUIRE(nv.node()->type() == impl::node_type_of<T>);
|
||||
|
||||
if (value_ok && nv.ref<value_type>() != expected)
|
||||
{
|
||||
value_ok = false;
|
||||
FORCE_FAIL("Value was not the same after round-tripping"sv);
|
||||
}
|
||||
});
|
||||
|
||||
if (!parse_ok || value_ok)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// manually instantiate some templates to reduce obj bloat and test compilation time
|
||||
|
||||
extern template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const int&);
|
||||
extern template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const unsigned int&);
|
||||
extern template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const bool&);
|
||||
extern template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const float&);
|
||||
extern template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const double&);
|
||||
extern template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const std::string_view&);
|
||||
namespace std
|
||||
{
|
||||
extern template class unique_ptr<const Catch::IExceptionTranslator>;
|
||||
}
|
||||
namespace Catch
|
||||
{
|
||||
extern template struct StringMaker<node_view<node>>;
|
||||
extern template struct StringMaker<node_view<const node>>;
|
||||
extern template ReusableStringStream& ReusableStringStream::operator<<(node_view<node> const&);
|
||||
extern template ReusableStringStream& ReusableStringStream::operator<<(node_view<const node> const&);
|
||||
namespace Detail
|
||||
{
|
||||
extern template std::string stringify(const node_view<node>&);
|
||||
extern template std::string stringify(const node_view<const node>&);
|
||||
}
|
||||
}
|
||||
|
||||
#if TOML_CPP >= 20 && TOML_CLANG && TOML_CLANG <= 14 // https://github.com/llvm/llvm-project/issues/55560
|
||||
|
||||
TOML_PUSH_WARNINGS;
|
||||
TOML_DISABLE_WARNINGS;
|
||||
|
||||
namespace
|
||||
{
|
||||
[[maybe_unused]] static std::u8string clang_string_workaround(const char8_t* a, const char8_t* b)
|
||||
{
|
||||
return { a, b };
|
||||
}
|
||||
}
|
||||
|
||||
TOML_POP_WARNINGS;
|
||||
|
||||
#endif
|
@ -1,447 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
|
||||
// this file is about testing user misc. repros submitted via github issues, et cetera.
|
||||
|
||||
TEST_CASE("user feedback")
|
||||
{
|
||||
SECTION("tomlplusplus/issues/49") // https://github.com/marzer/tomlplusplus/issues/49#issuecomment-664428571
|
||||
{
|
||||
toml::table t1;
|
||||
t1.insert_or_assign("bar1", toml::array{ 1, 2, 3 });
|
||||
CHECK(t1 == toml::table{ { "bar1"sv, toml::array{ 1, 2, 3 } } });
|
||||
|
||||
t1.insert_or_assign("foo1", *t1.get("bar1"));
|
||||
CHECK(t1 == toml::table{ { "bar1"sv, toml::array{ 1, 2, 3 } }, { "foo1"sv, toml::array{ 1, 2, 3 } } });
|
||||
|
||||
// t1["foo1"] = t1["bar1"]; // does nothing, should this fail to compile?
|
||||
// - yes -
|
||||
|
||||
//*t1["foo1"].node() = *t1["bar1"].node(); // compile failure; copying node_view would be a bad thing
|
||||
// - correct; copying toml::node directly like that is impossible b.c. it's an abstract base class-
|
||||
|
||||
toml::array* array1 = t1["foo1"].node()->as_array();
|
||||
array1->push_back(4);
|
||||
CHECK(t1 == toml::table{ { "bar1"sv, toml::array{ 1, 2, 3 } }, { "foo1"sv, toml::array{ 1, 2, 3, 4 } } });
|
||||
|
||||
t1.insert_or_assign("foo3", t1["foo1"]);
|
||||
CHECK(t1
|
||||
== toml::table{ { "bar1"sv, toml::array{ 1, 2, 3 } },
|
||||
{ "foo1"sv, toml::array{ 1, 2, 3, 4 } },
|
||||
{ "foo3"sv, toml::array{ 1, 2, 3, 4 } } });
|
||||
|
||||
t1.insert_or_assign("foo2", *t1["foo1"].node());
|
||||
CHECK(t1
|
||||
== toml::table{ { "bar1"sv, toml::array{ 1, 2, 3 } },
|
||||
{ "foo1"sv, toml::array{ 1, 2, 3, 4 } },
|
||||
{ "foo2"sv, toml::array{ 1, 2, 3, 4 } },
|
||||
{ "foo3"sv, toml::array{ 1, 2, 3, 4 } } });
|
||||
|
||||
toml::array* array2 = t1["foo2"].node()->as_array();
|
||||
array2->push_back("wrench");
|
||||
CHECK(t1
|
||||
== toml::table{ { "bar1"sv, toml::array{ 1, 2, 3 } },
|
||||
{ "foo1"sv, toml::array{ 1, 2, 3, 4 } },
|
||||
{ "foo2"sv, toml::array{ 1, 2, 3, 4, "wrench" } },
|
||||
{ "foo3"sv, toml::array{ 1, 2, 3, 4 } } });
|
||||
|
||||
toml::table t2 = t1;
|
||||
CHECK(t2 == t1);
|
||||
CHECK(&t2 != &t1);
|
||||
|
||||
// t2.emplace("bar", toml::array{6, 7}); // fails to compile? not sure what I did wrong
|
||||
// - it should be this: -
|
||||
t2.emplace<toml::array>("bar", 6, 7);
|
||||
CHECK(t2
|
||||
== toml::table{ { "bar"sv, toml::array{ 6, 7 } },
|
||||
{ "bar1"sv, toml::array{ 1, 2, 3 } },
|
||||
{ "foo1"sv, toml::array{ 1, 2, 3, 4 } },
|
||||
{ "foo2"sv, toml::array{ 1, 2, 3, 4, "wrench" } },
|
||||
{ "foo3"sv, toml::array{ 1, 2, 3, 4 } } });
|
||||
|
||||
t2.insert_or_assign("bar2", toml::array{ 6, 7 });
|
||||
CHECK(t2
|
||||
== toml::table{ { "bar"sv, toml::array{ 6, 7 } },
|
||||
{ "bar1"sv, toml::array{ 1, 2, 3 } },
|
||||
{ "bar2"sv, toml::array{ 6, 7 } },
|
||||
{ "foo1"sv, toml::array{ 1, 2, 3, 4 } },
|
||||
{ "foo2"sv, toml::array{ 1, 2, 3, 4, "wrench" } },
|
||||
{ "foo3"sv, toml::array{ 1, 2, 3, 4 } } });
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/65") // https://github.com/marzer/tomlplusplus/issues/65
|
||||
{
|
||||
// these test a number of things
|
||||
// - a comment at EOF
|
||||
// - a malformed UTF-8 sequence in a comment
|
||||
// - a malformed UTF-8 sequence during a KVP
|
||||
// - overlong numeric literals
|
||||
// all should fail to parse, but correctly issue an error (not crash!)
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS, "#\xf1\x63");
|
||||
parsing_should_fail(FILE_LINE_ARGS, "1= 0x6cA#+\xf1");
|
||||
parsing_should_fail(FILE_LINE_ARGS, "p=06:06:06#\x0b\xff");
|
||||
parsing_should_fail(
|
||||
FILE_LINE_ARGS,
|
||||
"''''d' 't' '+o\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
|
||||
"\x0c\x0c\x0c\x0c\x0c\r\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
|
||||
"\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
|
||||
"\x0c\x0c\x0c\x0c\x0c\x0c\x0cop1\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
|
||||
"\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
|
||||
"\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c' 'ml'\n\n%\x87");
|
||||
parsing_should_fail(
|
||||
FILE_LINE_ARGS,
|
||||
R"(t =[ 9, 2, 1,"r", 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0 ])");
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/67") // https://github.com/marzer/tomlplusplus/issues/67
|
||||
{
|
||||
const auto data = R"(array=["v1", "v2", "v3"])"sv;
|
||||
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
data,
|
||||
[](auto&& table)
|
||||
{
|
||||
auto arr = table["array"].as_array();
|
||||
for (auto it = arr->cbegin(); it != arr->cend();)
|
||||
if (it->value_or(std::string_view{}) == "v2"sv)
|
||||
it = arr->erase(it);
|
||||
else
|
||||
++it;
|
||||
CHECK(arr->size() == 2);
|
||||
});
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/68") // https://github.com/marzer/tomlplusplus/issues/68
|
||||
{
|
||||
const auto data = R"(array=["v1", "v2", "v3"])"sv;
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
data,
|
||||
[](auto&& table)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << table;
|
||||
CHECK(ss.str() == "array = [ 'v1', 'v2', 'v3' ]"sv);
|
||||
});
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/69") // https://github.com/marzer/tomlplusplus/issues/69
|
||||
{
|
||||
using namespace toml::literals; // should compile without namespace ambiguity
|
||||
auto table = "[table]\nkey=\"value\""_toml;
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/pull/80") // https://github.com/marzer/tomlplusplus/pull/80
|
||||
{
|
||||
const auto data = R"(
|
||||
a = { "key" = 1 } # inline table
|
||||
b = [] # array value
|
||||
[[c]] # array-of-tables with a single, empty table element
|
||||
)"sv;
|
||||
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
data,
|
||||
[](auto&& table)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << table;
|
||||
CHECK(ss.str() == R"(a = { key = 1 }
|
||||
b = []
|
||||
|
||||
[[c]])"sv);
|
||||
});
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/100") // https://github.com/marzer/tomlplusplus/issues/100
|
||||
{
|
||||
// this tests for two separate things that should fail gracefully, not crash:
|
||||
// 1. pathologically-nested inputs
|
||||
// 2. a particular sequence of malformed UTF-8
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS, "fl =[ [[[[[[[[[[[[[[[\x36\x80\x86\x00\x00\x00\x2D\x36\x9F\x20\x00"sv);
|
||||
|
||||
std::string s(2048_sz, '[');
|
||||
constexpr auto start = "fl =[ "sv;
|
||||
memcpy(s.data(), start.data(), start.length());
|
||||
parsing_should_fail(FILE_LINE_ARGS, std::string_view{ s });
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/112") // https://github.com/marzer/tomlplusplus/issues/112
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS,
|
||||
R"(
|
||||
[a.b.c.d]
|
||||
u = 6
|
||||
[a]
|
||||
b.t = 8
|
||||
[a.b] # should cause redefinition error here
|
||||
u = 0
|
||||
)",
|
||||
6);
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS,
|
||||
R"(
|
||||
[a]
|
||||
b.t = 8
|
||||
[a.b] # should cause redefinition error here
|
||||
u = 0
|
||||
)",
|
||||
4);
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/125") // https://github.com/marzer/tomlplusplus/issues/125
|
||||
{
|
||||
parse_expected_value(FILE_LINE_ARGS, R"("\u0800")"sv, "\xE0\xA0\x80"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"("\u7840")"sv, "\xE7\xA1\x80"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"("\uAA23")"sv, "\xEA\xA8\xA3"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"("\uA928")"sv, "\xEA\xA4\xA8"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"("\u9CBF")"sv, "\xE9\xB2\xBF"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"("\u2247")"sv, "\xE2\x89\x87"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"("\u13D9")"sv, "\xE1\x8F\x99"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"("\u69FC")"sv, "\xE6\xA7\xBC"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"("\u8DE5")"sv, "\xE8\xB7\xA5"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"("\u699C")"sv, "\xE6\xA6\x9C"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"("\u8CD4")"sv, "\xE8\xB3\x94"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"("\u4ED4")"sv, "\xE4\xBB\x94"sv);
|
||||
parse_expected_value(FILE_LINE_ARGS, R"("\u2597")"sv, "\xE2\x96\x97"sv);
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/127") // https://github.com/marzer/tomlplusplus/issues/127
|
||||
{
|
||||
parse_expected_value(FILE_LINE_ARGS,
|
||||
"12:34:56.11122233345678"sv,
|
||||
toml::time{
|
||||
12,
|
||||
34,
|
||||
56,
|
||||
111222333u // should truncate the .45678 part
|
||||
});
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/128") // https://github.com/marzer/tomlplusplus/issues/128
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, "\f"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "\v"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, " "sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, "\t"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, "\n"sv);
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/129") // https://github.com/marzer/tomlplusplus/issues/129
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
hex = 0x
|
||||
oct = 0o
|
||||
bin = 0b
|
||||
)"sv);
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/130") // https://github.com/marzer/tomlplusplus/issues/130
|
||||
{
|
||||
parse_expected_value(FILE_LINE_ARGS, "0400-01-01 00:00:00"sv, toml::date_time{ { 400, 1, 1 }, { 0, 0, 0 } });
|
||||
parse_expected_value(FILE_LINE_ARGS, "0400-01-01 "sv, toml::date{ 400, 1, 1 });
|
||||
parse_expected_value(FILE_LINE_ARGS, "0400-01-01T00:00:00"sv, toml::date_time{ { 400, 1, 1 }, { 0, 0, 0 } });
|
||||
parse_expected_value(FILE_LINE_ARGS, "1000-01-01 00:00:00"sv, toml::date_time{ { 1000, 1, 1 }, { 0, 0, 0 } });
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/131") // https://github.com/marzer/tomlplusplus/issues/131
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
a={}
|
||||
[a.b]
|
||||
)"sv);
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/132") // https://github.com/marzer/tomlplusplus/issues/132
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, "#\r"sv);
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/134") // https://github.com/marzer/tomlplusplus/issues/134
|
||||
{
|
||||
// binary
|
||||
parsing_should_fail(
|
||||
FILE_LINE_ARGS,
|
||||
"val = 0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111"sv); // uint64_t
|
||||
// max
|
||||
parsing_should_fail(
|
||||
FILE_LINE_ARGS,
|
||||
"val = 0b10000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000"sv); // int64_t
|
||||
// max
|
||||
// + 1
|
||||
parse_expected_value(FILE_LINE_ARGS,
|
||||
"0b01111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111"sv,
|
||||
INT64_MAX); // int64_t max
|
||||
|
||||
// octal
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 0o1777777777777777777777"sv); // uint64_t max
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 0o1000000000000000000000"sv); // int64_t max + 1
|
||||
parse_expected_value(FILE_LINE_ARGS, " 0o0777777777777777777777"sv, INT64_MAX);
|
||||
|
||||
// decimal
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 100000000000000000000"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 18446744073709551615"sv); // uint64_t max
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 10000000000000000000"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 9999999999999999999"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 9223372036854775808"sv); // int64_t max + 1
|
||||
parse_expected_value(FILE_LINE_ARGS, " 9223372036854775807"sv, INT64_MAX);
|
||||
parse_expected_value(FILE_LINE_ARGS, " 1000000000000000000"sv, 1000000000000000000LL);
|
||||
parse_expected_value(FILE_LINE_ARGS, " -1000000000000000000"sv, -1000000000000000000LL);
|
||||
parse_expected_value(FILE_LINE_ARGS, " -9223372036854775808"sv, INT64_MIN);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = -9223372036854775809"sv); // int64_t min - 1
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = -10000000000000000000"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = -18446744073709551615"sv); // -(uint64_t max)
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = -100000000000000000000"sv);
|
||||
|
||||
// hexadecimal
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 0xFFFFFFFFFFFFFFFF"sv); // uint64_t max
|
||||
parsing_should_fail(FILE_LINE_ARGS, " val = 0x8000000000000000"sv); // int64_t max + 1
|
||||
parse_expected_value(FILE_LINE_ARGS, " 0x7FFFFFFFFFFFFFFF"sv, INT64_MAX);
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/135") // https://github.com/marzer/tomlplusplus/issues/135
|
||||
{
|
||||
parsing_should_succeed(FILE_LINE_ARGS, "0=0"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, "1=1"sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, "2=2"sv);
|
||||
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
"0=0\n"
|
||||
"1=1\n"
|
||||
"2=2\n"sv);
|
||||
|
||||
parsing_should_fail(FILE_LINE_ARGS,
|
||||
"0=0\n"
|
||||
"\u2000\u2000\n"
|
||||
"1=1\n"
|
||||
"2=2\n"sv);
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/152") // https://github.com/marzer/tomlplusplus/issues/152
|
||||
{
|
||||
// clang-format off
|
||||
static constexpr auto data = R"([shaders.room_darker])" "\n"
|
||||
R"(file = "room_darker.frag")" "\n"
|
||||
R"(args = { n = "integer", ambientLightLevel = "float" })";
|
||||
// clang-format on
|
||||
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
data,
|
||||
[](auto&& tbl)
|
||||
{
|
||||
const auto check_location = [&](std::string_view path, auto line, auto col)
|
||||
{
|
||||
INFO("Checking source location of \""sv << path << "\""sv)
|
||||
auto v = tbl.at_path(path);
|
||||
REQUIRE(v.node());
|
||||
CHECK(v.node()->source().begin.line == static_cast<toml::source_index>(line));
|
||||
CHECK(v.node()->source().begin.column == static_cast<toml::source_index>(col));
|
||||
};
|
||||
|
||||
check_location("shaders"sv, 1, 1);
|
||||
check_location("shaders.room_darker"sv, 1, 1);
|
||||
check_location("shaders.room_darker.file"sv, 2, 8);
|
||||
check_location("shaders.room_darker.args"sv, 3, 8);
|
||||
check_location("shaders.room_darker.args.n"sv, 3, 14);
|
||||
check_location("shaders.room_darker.args.ambientLightLevel"sv, 3, 45);
|
||||
});
|
||||
}
|
||||
|
||||
SECTION("toml/issues/908") // https://github.com/toml-lang/toml/issues/908
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
a = [{ b = 1 }]
|
||||
[a.c]
|
||||
foo = 1
|
||||
)"sv);
|
||||
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(
|
||||
[[a]]
|
||||
b = 1
|
||||
|
||||
[a.c]
|
||||
foo = 1
|
||||
)"sv);
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/169") // https://github.com/marzer/tomlplusplus/issues/169
|
||||
{
|
||||
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||
[a]
|
||||
b = [c"]
|
||||
)"sv);
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/179") // https://github.com/marzer/tomlplusplus/issues/179
|
||||
{
|
||||
parse_expected_value(FILE_LINE_ARGS, "0.848213"sv, 0.848213);
|
||||
parse_expected_value(FILE_LINE_ARGS, "6.9342"sv, 6.9342);
|
||||
parse_expected_value(FILE_LINE_ARGS, "-995.9214"sv, -995.9214);
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/187") // https://github.com/marzer/tomlplusplus/issues/187
|
||||
{
|
||||
parsing_should_succeed(FILE_LINE_ARGS, R"(
|
||||
[[a.b]]
|
||||
x = 1
|
||||
|
||||
[a]
|
||||
y = 2
|
||||
)"sv);
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/207") // https://github.com/marzer/tomlplusplus/issues/207
|
||||
{
|
||||
enum class an_enum
|
||||
{
|
||||
zero,
|
||||
one,
|
||||
two,
|
||||
three
|
||||
};
|
||||
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
"val = 2\n",
|
||||
[](auto&& tbl)
|
||||
{
|
||||
const auto val = tbl["val"].template value_or<an_enum>(an_enum::zero);
|
||||
CHECK(val == an_enum::two);
|
||||
});
|
||||
}
|
||||
|
||||
SECTION("tomlplusplus/issues/176") // https://github.com/marzer/tomlplusplus/issues/176
|
||||
{
|
||||
parsing_should_succeed(FILE_LINE_ARGS, " a = \"x\\ty\""sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, "\"a\" = \"x\\ty\""sv);
|
||||
parsing_should_succeed(FILE_LINE_ARGS, "\"a\tb\" = \"x\\ty\""sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "\"a\nb\" = \"x\\ty\""sv); // literal newline in single-line key
|
||||
|
||||
static constexpr auto input = R"(
|
||||
"a" = "x\ty"
|
||||
"a\tb" = "x\ty"
|
||||
"a\nb" = "x\ty"
|
||||
)"sv;
|
||||
|
||||
static constexpr auto output = "a = 'x\ty'\n"
|
||||
"\"a\\tb\" = 'x\ty'\n" // tab and newlines in keys should be emitted
|
||||
"\"a\\nb\" = 'x\ty'" // as escapes, not literals
|
||||
""sv;
|
||||
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
input,
|
||||
[&](auto&& tbl)
|
||||
{
|
||||
CHECK(tbl["a"]);
|
||||
CHECK(tbl["a\tb"]);
|
||||
CHECK(tbl["a\nb"]);
|
||||
|
||||
std::stringstream ss;
|
||||
ss << tbl;
|
||||
CHECK(ss.str() == output);
|
||||
});
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
#include "tests.hpp"
|
||||
|
||||
TOML_DISABLE_WARNINGS;
|
||||
#include <algorithm>
|
||||
TOML_ENABLE_WARNINGS;
|
||||
|
||||
TEST_CASE("using iterators")
|
||||
{
|
||||
constexpr auto data = R"(array=[1,"Foo",true]
|
||||
string="Bar"
|
||||
number=5)"sv;
|
||||
parsing_should_succeed(
|
||||
FILE_LINE_ARGS,
|
||||
data,
|
||||
[](auto&& tbl)
|
||||
{
|
||||
const auto tbl_begin = tbl.begin();
|
||||
const auto tbl_end = tbl.end();
|
||||
|
||||
auto count_table_lambda = [tbl_begin, tbl_end](node_type type) noexcept {
|
||||
return std::count_if(tbl_begin,
|
||||
tbl_end,
|
||||
[type](const auto& pair) noexcept { return pair.second.type() == type; });
|
||||
};
|
||||
|
||||
CHECK(std::distance(tbl_begin, tbl_end) == 3);
|
||||
CHECK(count_table_lambda(node_type::table) == 0);
|
||||
CHECK(count_table_lambda(node_type::integer) == 1);
|
||||
CHECK(count_table_lambda(node_type::string) == 1);
|
||||
CHECK(std::next(tbl_begin, 3) == tbl_end);
|
||||
|
||||
const auto arr_iter =
|
||||
std::find_if(tbl_begin, tbl_end, [](const auto& pair) noexcept { return pair.second.is_array(); });
|
||||
|
||||
REQUIRE(arr_iter != tbl_end);
|
||||
const auto& arr = arr_iter->second.as_array();
|
||||
const auto arr_begin = arr->begin();
|
||||
const auto arr_end = arr->end();
|
||||
|
||||
auto count_array_lambda = [arr_begin, arr_end](node_type type) noexcept {
|
||||
return std::count_if(arr_begin,
|
||||
arr_end,
|
||||
[type](const auto& node) noexcept { return node.type() == type; });
|
||||
};
|
||||
|
||||
CHECK(std::distance(arr_begin, arr_end) == 3);
|
||||
CHECK(count_array_lambda(node_type::table) == 0);
|
||||
CHECK(count_array_lambda(node_type::integer) == 1);
|
||||
CHECK(count_array_lambda(node_type::string) == 1);
|
||||
CHECK(std::next(arr_begin, 2) != arr_end);
|
||||
});
|
||||
}
|
139
tests/visit.cpp
139
tests/visit.cpp
@ -1,139 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
|
||||
TEST_CASE("node::visit")
|
||||
{
|
||||
value<int64_t> val{ 3 };
|
||||
|
||||
// check lvalue propagates correctly
|
||||
static_cast<node&>(val).visit(
|
||||
[](auto&& v) noexcept
|
||||
{
|
||||
using val_ref_type = decltype(v);
|
||||
static_assert(std::is_lvalue_reference_v<val_ref_type>);
|
||||
|
||||
using val_type = std::remove_reference_t<val_ref_type>;
|
||||
static_assert(!std::is_const_v<val_type>);
|
||||
static_assert(!std::is_volatile_v<val_type>);
|
||||
});
|
||||
|
||||
// check rvalue propagates correctly
|
||||
static_cast<node&&>(val).visit(
|
||||
[](auto&& v) noexcept
|
||||
{
|
||||
using val_ref_type = decltype(v);
|
||||
static_assert(std::is_rvalue_reference_v<val_ref_type>);
|
||||
|
||||
using val_type = std::remove_reference_t<val_ref_type>;
|
||||
static_assert(!std::is_const_v<val_type>);
|
||||
static_assert(!std::is_volatile_v<val_type>);
|
||||
});
|
||||
|
||||
// check const lvalue propagates correctly
|
||||
static_cast<const node&>(val).visit(
|
||||
[](auto&& v) noexcept
|
||||
{
|
||||
using val_ref_type = decltype(v);
|
||||
static_assert(std::is_lvalue_reference_v<val_ref_type>);
|
||||
|
||||
using val_type = std::remove_reference_t<val_ref_type>;
|
||||
static_assert(std::is_const_v<val_type>);
|
||||
static_assert(!std::is_volatile_v<val_type>);
|
||||
});
|
||||
|
||||
// check const rvalue propagates correctly
|
||||
static_cast<const node&&>(val).visit(
|
||||
[](auto&& v) noexcept
|
||||
{
|
||||
using val_ref_type = decltype(v);
|
||||
static_assert(std::is_rvalue_reference_v<val_ref_type>);
|
||||
|
||||
using val_type = std::remove_reference_t<val_ref_type>;
|
||||
static_assert(std::is_const_v<val_type>);
|
||||
static_assert(!std::is_volatile_v<val_type>);
|
||||
});
|
||||
|
||||
// check noexcept
|
||||
static constexpr auto throwing_visitor = [](auto&&) noexcept(false) {};
|
||||
static constexpr auto non_throwing_visitor = [](auto&&) noexcept(true) {};
|
||||
static_assert(!noexcept(static_cast<node&>(val).visit(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<node&&>(val).visit(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<const node&>(val).visit(throwing_visitor)));
|
||||
static_assert(!noexcept(static_cast<const node&&>(val).visit(throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<node&>(val).visit(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<node&&>(val).visit(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<const node&>(val).visit(non_throwing_visitor)));
|
||||
static_assert(noexcept(static_cast<const node&&>(val).visit(non_throwing_visitor)));
|
||||
|
||||
// check return
|
||||
static constexpr auto returns_boolean = [](auto& v) noexcept { return toml::is_integer<decltype(v)>; };
|
||||
auto return_test = static_cast<node&>(val).visit(returns_boolean);
|
||||
static_assert(std::is_same_v<decltype(return_test), bool>);
|
||||
CHECK(return_test == true);
|
||||
}
|
||||
|
||||
TEST_CASE("node_view::visit")
|
||||
{
|
||||
value<int64_t> val{ 3 };
|
||||
|
||||
auto view = node_view{ val };
|
||||
auto cview = node_view{ std::as_const(val) };
|
||||
static_assert(!std::is_same_v<decltype(view), decltype(cview)>);
|
||||
|
||||
// check mutable views propagate correctly
|
||||
view.visit(
|
||||
[](auto&& v) noexcept
|
||||
{
|
||||
using val_ref_type = decltype(v);
|
||||
static_assert(std::is_lvalue_reference_v<val_ref_type>);
|
||||
|
||||
using val_type = std::remove_reference_t<val_ref_type>;
|
||||
static_assert(!std::is_const_v<val_type>);
|
||||
static_assert(!std::is_volatile_v<val_type>);
|
||||
});
|
||||
|
||||
// check const views propagate correctly
|
||||
cview.visit(
|
||||
[](auto&& v) noexcept
|
||||
{
|
||||
using val_ref_type = decltype(v);
|
||||
static_assert(std::is_lvalue_reference_v<val_ref_type>);
|
||||
|
||||
using val_type = std::remove_reference_t<val_ref_type>;
|
||||
static_assert(std::is_const_v<val_type>);
|
||||
static_assert(!std::is_volatile_v<val_type>);
|
||||
});
|
||||
|
||||
// check noexcept
|
||||
static constexpr auto throwing_visitor = [](auto&&) noexcept(false) {};
|
||||
static constexpr auto non_throwing_visitor = [](auto&&) noexcept(true) {};
|
||||
static_assert(!noexcept(view.visit(throwing_visitor)));
|
||||
static_assert(!noexcept(cview.visit(throwing_visitor)));
|
||||
static_assert(noexcept(view.visit(non_throwing_visitor)));
|
||||
static_assert(noexcept(cview.visit(non_throwing_visitor)));
|
||||
|
||||
// check return
|
||||
static constexpr auto returns_boolean = [](auto&& v) noexcept { return toml::is_integer<decltype(v)>; };
|
||||
auto return_test = view.visit(returns_boolean);
|
||||
static_assert(std::is_same_v<decltype(return_test), bool>);
|
||||
CHECK(return_test == true);
|
||||
|
||||
// check that null views don't invoke the visitor
|
||||
// clang-format off
|
||||
auto null_view = decltype(view){};
|
||||
auto null_cview = decltype(cview){};
|
||||
unsigned count{};
|
||||
unsigned mask{};
|
||||
view.visit([&](auto&&) noexcept { count++; mask |= 0b0001u; });
|
||||
cview.visit([&](auto&&) noexcept { count++; mask |= 0b0010u; });
|
||||
null_view.visit([&](auto&&) noexcept { count++; mask |= 0b0100u; });
|
||||
null_cview.visit([&](auto&&) noexcept { count++; mask |= 0b1000u; });
|
||||
CHECK(count == 2u);
|
||||
CHECK(mask == 0b0011u);
|
||||
// clang-format on
|
||||
}
|
@ -1,82 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{723FC4CA-0E24-4956-8FDC-E537EA3847AA}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\odr_test_1.cpp" />
|
||||
<ClCompile Include="..\odr_test_2.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{202DCF23-B4E4-5FB9-AFA8-CC9A718067FF}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{B0B1EA1E-611A-59B6-939F-0A891C71BBF0}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{2D040A50-F533-5977-AF7F-B25C29112025}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{50988C9F-99C8-59C2-BCAA-AA1F0848472E}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{39175FCA-1342-507B-90F3-E8DCFB4C48D0}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{70F7C29B-3468-5C09-8D47-B649CEBAB09E}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{62191BB3-97A9-552E-93BF-BFDF4D9905DD}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{9A3431E3-4727-5FED-9C18-CCD300C2760E}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{CFBAF3E0-2F81-5178-964C-F419CD2F296D}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{AD9A5FC3-6B12-5B6F-86C0-AB2FBB8C7766}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{DC05B52F-D0ED-5F40-A5EC-92C4C1D77F98}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{41DC0274-FFA8-5D94-AF8D-5677E3141095}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{C8B46DC3-994F-5A7C-98ED-3388BCE5D647}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{F7375F00-0345-5F67-89C0-2B18412B40FB}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{92AAC430-36B0-51E4-8E39-F3C579EDB331}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{B1EAF133-1019-510F-A083-FC04774FF12E}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{F70977E7-E735-5D5C-9043-CA792F1B9392}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{413BDA52-0A9D-56B8-9AF3-A65019F42831}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{6F6D8031-4BA9-5F07-BE1F-190A2FC3CC9C}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{18ADA45A-11DD-5649-8492-F726E6A82803}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{74813AFD-DB22-52FA-9108-0BADD4B0E161}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{B1B28D93-892C-59BF-9C6F-D813EC6438A0}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{6C3EA8CD-33CC-5775-ACC4-631FF5FE1E2C}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{B3779AEA-40D6-5F3C-BC86-98E4E577E09D}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{2D7D2E84-8861-529C-9C05-A1EE1FB84084}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{B98D8D10-4B7B-5AA8-84B5-87FE6AA80C10}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{C9D50E23-65F2-5C1E-BE44-7327A9FFC637}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{082D6FBD-F01E-504B-9905-25937CCE7F9A}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{AD2F4862-1DC2-550B-AFEF-FF3D4D477323}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{0D4D9D25-3F93-5C37-866E-F8B0AC23F851}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{151E9E68-E325-5B08-8722-257F2B083BAD}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,127 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{B3077FF1-FC90-5C14-A69F-3524F62167B1}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
|
||||
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<Import Project="../../toml++.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>tests.hpp</PrecompiledHeaderFile>
|
||||
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>EnableAllWarnings</WarningLevel>
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
|
||||
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\at_path.cpp" />
|
||||
<ClCompile Include="..\path.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\for_each.cpp" />
|
||||
<ClCompile Include="..\formatters.cpp" />
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
<ClCompile Include="..\manipulating_tables.cpp" />
|
||||
<ClCompile Include="..\manipulating_parse_result.cpp" />
|
||||
<ClCompile Include="..\manipulating_values.cpp" />
|
||||
<ClCompile Include="..\parsing_arrays.cpp" />
|
||||
<ClCompile Include="..\parsing_booleans.cpp" />
|
||||
<ClCompile Include="..\parsing_comments.cpp" />
|
||||
<ClCompile Include="..\parsing_dates_and_times.cpp" />
|
||||
<ClCompile Include="..\parsing_floats.cpp" />
|
||||
<ClCompile Include="..\parsing_integers.cpp" />
|
||||
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
|
||||
<ClCompile Include="..\parsing_spec_example.cpp" />
|
||||
<ClCompile Include="..\parsing_strings.cpp" />
|
||||
<ClCompile Include="..\parsing_tables.cpp" />
|
||||
<ClCompile Include="..\tests.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\user_feedback.cpp" />
|
||||
<ClCompile Include="..\using_iterators.cpp" />
|
||||
<ClCompile Include="..\visit.cpp" />
|
||||
<ClCompile Include="..\windows_compat.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Natvis Include="..\..\toml++.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\leakproof.hpp" />
|
||||
<ClInclude Include="..\lib_catch2.hpp" />
|
||||
<ClInclude Include="..\lib_tloptional.hpp" />
|
||||
<ClInclude Include="..\settings.hpp" />
|
||||
<ClInclude Include="..\tests.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\cpp.hint" />
|
||||
<None Include="..\meson.build" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
@ -1,97 +0,0 @@
|
||||
// This file is a part of toml++ and is subject to the the terms of the MIT license.
|
||||
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
|
||||
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.hpp"
|
||||
|
||||
#if TOML_ENABLE_WINDOWS_COMPAT
|
||||
|
||||
TOML_DISABLE_WARNINGS;
|
||||
#include <windows.h>
|
||||
TOML_ENABLE_WARNINGS;
|
||||
|
||||
TEST_CASE("windows compat")
|
||||
{
|
||||
static constexpr auto toml_text = R"(
|
||||
[library]
|
||||
name = "toml++"
|
||||
authors = ["Mark Gillard <mark.gillard@outlook.com.au>"]
|
||||
free = true
|
||||
|
||||
[dependencies]
|
||||
cpp = 17
|
||||
)"sv;
|
||||
|
||||
auto res = toml::parse(toml_text, L"kek.toml");
|
||||
#if !TOML_EXCEPTIONS
|
||||
REQUIRE(res.succeeded());
|
||||
#endif
|
||||
table& tbl = res;
|
||||
|
||||
// source paths
|
||||
REQUIRE(tbl.source().path != nullptr);
|
||||
CHECK(*tbl.source().path == "kek.toml"sv);
|
||||
CHECK(tbl.source().wide_path().has_value());
|
||||
CHECK(tbl.source().wide_path().value() == L"kek.toml"sv);
|
||||
|
||||
// direct lookups from tables
|
||||
REQUIRE(tbl.get("library") != nullptr);
|
||||
CHECK(tbl.get("library") == tbl.get("library"sv));
|
||||
CHECK(tbl.get("library") == tbl.get("library"s));
|
||||
CHECK(tbl.get(L"library") != nullptr);
|
||||
CHECK(tbl.get(L"library") == tbl.get(L"library"sv));
|
||||
CHECK(tbl.get(L"library") == tbl.get(L"library"s));
|
||||
CHECK(tbl.get(L"library") == tbl.get("library"));
|
||||
|
||||
// node-view lookups
|
||||
CHECK(tbl[L"library"].node() != nullptr);
|
||||
CHECK(tbl[L"library"].node() == tbl.get(L"library"));
|
||||
|
||||
// value queries
|
||||
REQUIRE(tbl[L"library"][L"name"].as_string() != nullptr);
|
||||
CHECK(tbl[L"library"][L"name"].value<std::wstring>() == L"toml++"s);
|
||||
CHECK(tbl[L"library"][L"name"].value_or(L""sv) == L"toml++"s);
|
||||
CHECK(tbl[L"library"][L"name"].value_or(L""s) == L"toml++"s);
|
||||
CHECK(tbl[L"library"][L"name"].value_or(L"") == L"toml++"s);
|
||||
|
||||
// node-view comparisons
|
||||
CHECK(tbl[L"library"][L"name"] == "toml++"sv);
|
||||
CHECK(tbl[L"library"][L"name"] == "toml++"s);
|
||||
CHECK(tbl[L"library"][L"name"] == "toml++");
|
||||
CHECK(tbl[L"library"][L"name"] == L"toml++"sv);
|
||||
CHECK(tbl[L"library"][L"name"] == L"toml++"s);
|
||||
CHECK(tbl[L"library"][L"name"] == L"toml++");
|
||||
|
||||
// table manipulation
|
||||
tbl.insert(L"foo", L"bar");
|
||||
REQUIRE(tbl.contains("foo"));
|
||||
REQUIRE(tbl.contains(L"foo"));
|
||||
CHECK(tbl["foo"] == "bar");
|
||||
tbl.insert_or_assign(L"foo", L"kek");
|
||||
CHECK(tbl["foo"] == "kek");
|
||||
tbl.erase(L"foo");
|
||||
REQUIRE(!tbl.contains("foo"));
|
||||
REQUIRE(!tbl.contains(L"foo"));
|
||||
|
||||
// windows types
|
||||
CHECK(tbl[L"library"][L"free"].value<BOOL>() == 1);
|
||||
CHECK(tbl[L"dependencies"][L"cpp"].value<BOOL>() == 17);
|
||||
CHECK(tbl[L"dependencies"][L"cpp"].value<SHORT>() == 17);
|
||||
CHECK(tbl[L"dependencies"][L"cpp"].value<INT>() == 17);
|
||||
CHECK(tbl[L"dependencies"][L"cpp"].value<LONG>() == 17);
|
||||
CHECK(tbl[L"dependencies"][L"cpp"].value<INT_PTR>() == 17);
|
||||
CHECK(tbl[L"dependencies"][L"cpp"].value<LONG_PTR>() == 17);
|
||||
CHECK(tbl[L"dependencies"][L"cpp"].value<USHORT>() == 17u);
|
||||
CHECK(tbl[L"dependencies"][L"cpp"].value<UINT>() == 17u);
|
||||
CHECK(tbl[L"dependencies"][L"cpp"].value<ULONG>() == 17u);
|
||||
CHECK(tbl[L"dependencies"][L"cpp"].value<UINT_PTR>() == 17u);
|
||||
CHECK(tbl[L"dependencies"][L"cpp"].value<ULONG_PTR>() == 17u);
|
||||
CHECK(tbl[L"dependencies"][L"cpp"].value<WORD>() == 17u);
|
||||
CHECK(tbl[L"dependencies"][L"cpp"].value<DWORD>() == 17u);
|
||||
CHECK(tbl[L"dependencies"][L"cpp"].value<DWORD32>() == 17u);
|
||||
CHECK(tbl[L"dependencies"][L"cpp"].value<DWORD64>() == 17u);
|
||||
CHECK(tbl[L"dependencies"][L"cpp"].value<DWORDLONG>() == 17u);
|
||||
}
|
||||
|
||||
#endif // TOML_ENABLE_WINDOWS_COMPAT
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user