├── .clang-format ├── .github ├── dependabot.yml └── workflows │ └── build.yml ├── CMakeLists.txt ├── LICENSE.txt ├── README.md ├── cmake ├── cpd-config.cmake.in └── cpd_test.cmake ├── components └── jsoncpp │ ├── CMakeLists.txt │ ├── include │ └── cpd │ │ └── jsoncpp.hpp │ ├── src │ └── jsoncpp.cpp │ └── tests │ ├── CMakeLists.txt │ └── jsoncpp.cpp ├── docs ├── Doxyfile.in └── namespace.dox ├── examples ├── CMakeLists.txt ├── callback.cpp ├── fgt.cpp ├── random.cpp ├── rigid.cpp ├── transform.cpp └── version.cpp ├── include └── cpd │ ├── affine.hpp │ ├── gauss_transform.hpp │ ├── gauss_transform_fgt.hpp │ ├── matrix.hpp │ ├── nonrigid.hpp │ ├── normalization.hpp │ ├── rigid.hpp │ ├── transform.hpp │ ├── utils.hpp │ └── version.hpp ├── scripts ├── gh-pages.sh ├── travis-install-cmake.sh ├── travis-install-doxygen.sh ├── travis-install-eigen3.sh ├── travis-install-fgt.sh ├── travis-install-jsoncpp.sh └── travis-script.sh ├── src ├── affine.cpp ├── gauss_transform.cpp ├── gauss_transform_fgt.cpp ├── gauss_transform_make_default.cpp ├── matrix.cpp ├── nonrigid.cpp ├── normalization.cpp ├── rigid.cpp ├── transform.cpp ├── utils.cpp └── version.cpp.in ├── tests ├── CMakeLists.txt ├── affine.cpp ├── fixtures │ ├── face.csv │ ├── face.hpp │ ├── face_distorted.csv │ ├── fish.csv │ ├── fish.hpp │ ├── fish_correspondence.csv │ ├── fish_distorted.csv │ ├── helheim.csv │ └── helheim.hpp ├── gauss_transform.cpp ├── gauss_transform_fgt.cpp ├── nonrigid.cpp ├── normalization.cpp ├── rigid.cpp ├── support.hpp.in ├── utils.cpp └── version.cpp └── vendor └── googletest-1.14.0 ├── .clang-format ├── .github ├── ISSUE_TEMPLATE │ ├── 00-bug_report.yml │ ├── 10-feature_request.yml │ └── config.yml └── workflows │ └── gtest-ci.yml ├── .gitignore ├── BUILD.bazel ├── CMakeLists.txt ├── CONTRIBUTING.md ├── CONTRIBUTORS ├── LICENSE ├── README.md ├── WORKSPACE ├── ci ├── linux-presubmit.sh ├── macos-presubmit.sh └── windows-presubmit.bat ├── docs ├── _config.yml ├── _data │ └── navigation.yml ├── _layouts │ └── default.html ├── _sass │ └── main.scss ├── advanced.md ├── assets │ └── css │ │ └── style.scss ├── community_created_documentation.md ├── faq.md ├── gmock_cheat_sheet.md ├── gmock_cook_book.md ├── gmock_faq.md ├── gmock_for_dummies.md ├── index.md ├── pkgconfig.md ├── platforms.md ├── primer.md ├── quickstart-bazel.md ├── quickstart-cmake.md ├── reference │ ├── actions.md │ ├── assertions.md │ ├── matchers.md │ ├── mocking.md │ └── testing.md └── samples.md ├── googlemock ├── CMakeLists.txt ├── README.md ├── cmake │ ├── gmock.pc.in │ └── gmock_main.pc.in ├── docs │ └── README.md ├── include │ └── gmock │ │ ├── gmock-actions.h │ │ ├── gmock-cardinalities.h │ │ ├── gmock-function-mocker.h │ │ ├── gmock-matchers.h │ │ ├── gmock-more-actions.h │ │ ├── gmock-more-matchers.h │ │ ├── gmock-nice-strict.h │ │ ├── gmock-spec-builders.h │ │ ├── gmock.h │ │ └── internal │ │ ├── custom │ │ ├── README.md │ │ ├── gmock-generated-actions.h │ │ ├── gmock-matchers.h │ │ └── gmock-port.h │ │ ├── gmock-internal-utils.h │ │ ├── gmock-port.h │ │ └── gmock-pp.h ├── src │ ├── gmock-all.cc │ ├── gmock-cardinalities.cc │ ├── gmock-internal-utils.cc │ ├── gmock-matchers.cc │ ├── gmock-spec-builders.cc │ ├── gmock.cc │ └── gmock_main.cc └── test │ ├── BUILD.bazel │ ├── gmock-actions_test.cc │ ├── gmock-cardinalities_test.cc │ ├── gmock-function-mocker_test.cc │ ├── gmock-internal-utils_test.cc │ ├── gmock-matchers-arithmetic_test.cc │ ├── gmock-matchers-comparisons_test.cc │ ├── gmock-matchers-containers_test.cc │ ├── gmock-matchers-misc_test.cc │ ├── gmock-matchers_test.h │ ├── gmock-more-actions_test.cc │ ├── gmock-nice-strict_test.cc │ ├── gmock-port_test.cc │ ├── gmock-pp-string_test.cc │ ├── gmock-pp_test.cc │ ├── gmock-spec-builders_test.cc │ ├── gmock_all_test.cc │ ├── gmock_ex_test.cc │ ├── gmock_leak_test.py │ ├── gmock_leak_test_.cc │ ├── gmock_link2_test.cc │ ├── gmock_link_test.cc │ ├── gmock_link_test.h │ ├── gmock_output_test.py │ ├── gmock_output_test_.cc │ ├── gmock_output_test_golden.txt │ ├── gmock_stress_test.cc │ ├── gmock_test.cc │ └── gmock_test_utils.py ├── googletest ├── CMakeLists.txt ├── README.md ├── cmake │ ├── Config.cmake.in │ ├── gtest.pc.in │ ├── gtest_main.pc.in │ ├── internal_utils.cmake │ └── libgtest.la.in ├── docs │ └── README.md ├── include │ └── gtest │ │ ├── gtest-assertion-result.h │ │ ├── gtest-death-test.h │ │ ├── gtest-matchers.h │ │ ├── gtest-message.h │ │ ├── gtest-param-test.h │ │ ├── gtest-printers.h │ │ ├── gtest-spi.h │ │ ├── gtest-test-part.h │ │ ├── gtest-typed-test.h │ │ ├── gtest.h │ │ ├── gtest_pred_impl.h │ │ ├── gtest_prod.h │ │ └── internal │ │ ├── custom │ │ ├── README.md │ │ ├── gtest-port.h │ │ ├── gtest-printers.h │ │ └── gtest.h │ │ ├── gtest-death-test-internal.h │ │ ├── gtest-filepath.h │ │ ├── gtest-internal.h │ │ ├── gtest-param-util.h │ │ ├── gtest-port-arch.h │ │ ├── gtest-port.h │ │ ├── gtest-string.h │ │ └── gtest-type-util.h ├── samples │ ├── prime_tables.h │ ├── sample1.cc │ ├── sample1.h │ ├── sample10_unittest.cc │ ├── sample1_unittest.cc │ ├── sample2.cc │ ├── sample2.h │ ├── sample2_unittest.cc │ ├── sample3-inl.h │ ├── sample3_unittest.cc │ ├── sample4.cc │ ├── sample4.h │ ├── sample4_unittest.cc │ ├── sample5_unittest.cc │ ├── sample6_unittest.cc │ ├── sample7_unittest.cc │ ├── sample8_unittest.cc │ └── sample9_unittest.cc ├── src │ ├── gtest-all.cc │ ├── gtest-assertion-result.cc │ ├── gtest-death-test.cc │ ├── gtest-filepath.cc │ ├── gtest-internal-inl.h │ ├── gtest-matchers.cc │ ├── gtest-port.cc │ ├── gtest-printers.cc │ ├── gtest-test-part.cc │ ├── gtest-typed-test.cc │ ├── gtest.cc │ └── gtest_main.cc └── test │ ├── BUILD.bazel │ ├── googletest-break-on-failure-unittest.py │ ├── googletest-break-on-failure-unittest_.cc │ ├── googletest-catch-exceptions-test.py │ ├── googletest-catch-exceptions-test_.cc │ ├── googletest-color-test.py │ ├── googletest-color-test_.cc │ ├── googletest-death-test-test.cc │ ├── googletest-death-test_ex_test.cc │ ├── googletest-env-var-test.py │ ├── googletest-env-var-test_.cc │ ├── googletest-failfast-unittest.py │ ├── googletest-failfast-unittest_.cc │ ├── googletest-filepath-test.cc │ ├── googletest-filter-unittest.py │ ├── googletest-filter-unittest_.cc │ ├── googletest-global-environment-unittest.py │ ├── googletest-global-environment-unittest_.cc │ ├── googletest-json-outfiles-test.py │ ├── googletest-json-output-unittest.py │ ├── googletest-list-tests-unittest.py │ ├── googletest-list-tests-unittest_.cc │ ├── googletest-listener-test.cc │ ├── googletest-message-test.cc │ ├── googletest-options-test.cc │ ├── googletest-output-test-golden-lin.txt │ ├── googletest-output-test.py │ ├── googletest-output-test_.cc │ ├── googletest-param-test-invalid-name1-test.py │ ├── googletest-param-test-invalid-name1-test_.cc │ ├── googletest-param-test-invalid-name2-test.py │ ├── googletest-param-test-invalid-name2-test_.cc │ ├── googletest-param-test-test.cc │ ├── googletest-param-test-test.h │ ├── googletest-param-test2-test.cc │ ├── googletest-port-test.cc │ ├── googletest-printers-test.cc │ ├── googletest-setuptestsuite-test.py │ ├── googletest-setuptestsuite-test_.cc │ ├── googletest-shuffle-test.py │ ├── googletest-shuffle-test_.cc │ ├── googletest-test-part-test.cc │ ├── googletest-throw-on-failure-test.py │ ├── googletest-throw-on-failure-test_.cc │ ├── googletest-uninitialized-test.py │ ├── googletest-uninitialized-test_.cc │ ├── gtest-typed-test2_test.cc │ ├── gtest-typed-test_test.cc │ ├── gtest-typed-test_test.h │ ├── gtest-unittest-api_test.cc │ ├── gtest_all_test.cc │ ├── gtest_assert_by_exception_test.cc │ ├── gtest_dirs_test.cc │ ├── gtest_environment_test.cc │ ├── gtest_help_test.py │ ├── gtest_help_test_.cc │ ├── gtest_json_test_utils.py │ ├── gtest_list_output_unittest.py │ ├── gtest_list_output_unittest_.cc │ ├── gtest_main_unittest.cc │ ├── gtest_no_test_unittest.cc │ ├── gtest_pred_impl_unittest.cc │ ├── gtest_premature_exit_test.cc │ ├── gtest_prod_test.cc │ ├── gtest_repeat_test.cc │ ├── gtest_skip_check_output_test.py │ ├── gtest_skip_environment_check_output_test.py │ ├── gtest_skip_in_environment_setup_test.cc │ ├── gtest_skip_test.cc │ ├── gtest_sole_header_test.cc │ ├── gtest_stress_test.cc │ ├── gtest_test_macro_stack_footprint_test.cc │ ├── gtest_test_utils.py │ ├── gtest_testbridge_test.py │ ├── gtest_testbridge_test_.cc │ ├── gtest_throw_on_failure_ex_test.cc │ ├── gtest_unittest.cc │ ├── gtest_xml_outfile1_test_.cc │ ├── gtest_xml_outfile2_test_.cc │ ├── gtest_xml_outfiles_test.py │ ├── gtest_xml_output_unittest.py │ ├── gtest_xml_output_unittest_.cc │ ├── gtest_xml_test_utils.py │ ├── production.cc │ └── production.h └── googletest_deps.bzl /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | 8 | jobs: 9 | base: 10 | name: ${{ matrix.platform }} with FGT ${{ matrix.fgt }} 11 | runs-on: ${{ matrix.platform }} 12 | strategy: 13 | fail-fast: true 14 | matrix: 15 | platform: ['ubuntu-latest', 'macos-latest'] 16 | fgt: ['ON', 'OFF'] 17 | env: 18 | PLATFORM: ${{ matrix.platform }} 19 | steps: 20 | - uses: actions/checkout@v4 21 | - uses: conda-incubator/setup-miniconda@v3 22 | with: 23 | channels: conda-forge 24 | auto-update-conda: true 25 | - name: Setup 26 | shell: bash -l {0} 27 | run: | 28 | conda update -n base -c defaults conda -y 29 | conda install ninja cmake ninja eigen compilers jsoncpp -y 30 | - name: JSONCPP 31 | shell: bash -l {0} 32 | run: | 33 | git clone https://github.com/open-source-parsers/jsoncpp.git 34 | cd jsoncpp 35 | git checkout 1.9.3 36 | mkdir build 37 | cd build 38 | cmake .. \ 39 | -G Ninja \ 40 | -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ 41 | -DBUILD_SHARED_LIBS=ON \ 42 | -DJSONCPP_WITH_CMAKE_PACKAGE=ON \ 43 | -DJSONCPP_WITH_TESTS=OFF \ 44 | -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF \ 45 | -DCMAKE_BUILD_TYPE=Release 46 | ninja install 47 | - name: FGT 48 | shell: bash -l {0} 49 | if: matrix.fgt == 'ON' 50 | run: | 51 | git clone https://github.com/gadomski/fgt.git 52 | mkdir fgt/build 53 | cd fgt/build 54 | cmake .. \ 55 | -G Ninja \ 56 | -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ 57 | -DWITH_TESTS=OFF \ 58 | -DCMAKE_BUILD_TYPE=Release \ 59 | -DBUILD_SHARED_LIBS=OFF 60 | ninja 61 | ninja install 62 | - name: Configure 63 | shell: bash -l {0} 64 | run: | 65 | mkdir build; cd build; 66 | cmake .. \ 67 | -G Ninja \ 68 | -DBUILD_SHARED_LIBS=ON \ 69 | -DCMAKE_BUILD_TYPE=Release \ 70 | -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ 71 | -DWITH_DOCS=OFF \ 72 | -DWITH_FGT=${{ matrix.fgt }} \ 73 | -DWITH_JSONCPP=OFF \ 74 | -DWITH_STRICT_WARNINGS=ON \ 75 | -DWITH_TESTS=ON 76 | - name: Build 77 | shell: bash -l {0} 78 | working-directory: ./build 79 | run: ninja 80 | - name: Test 81 | shell: bash -l {0} 82 | working-directory: ./build 83 | run: ctest 84 | -------------------------------------------------------------------------------- /cmake/cpd_test.cmake: -------------------------------------------------------------------------------- 1 | function(cpd_test name) 2 | set(src ${name}.cpp) 3 | set(target ${name}-test) 4 | add_executable(${target} ${src}) 5 | set_target_properties(${target} PROPERTIES OUTPUT_NAME ${name}) 6 | add_test(NAME ${name} COMMAND ${target}) 7 | target_link_libraries(${target} PRIVATE Library-C++ ${ARGN} gtest_main) 8 | target_include_directories(${target} PRIVATE "${PROJECT_BINARY_DIR}") 9 | endfunction() 10 | -------------------------------------------------------------------------------- /components/jsoncpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(Jsoncpp STATIC src/jsoncpp.cpp) 2 | if(${BUILD_SHARED_LIBS}) 3 | if(NOT TARGET jsoncpp_lib) 4 | message(FATAL_ERROR "Target jsoncpp_lib is not defined, but is required because cpd is building shared libs. Make sure `BUILD_SHARED_LIBS` is enabled in your jsoncpp installation.") 5 | else() 6 | set(jsoncpp_lib jsoncpp_lib) 7 | endif() 8 | else() 9 | if(NOT TARGET jsoncpp_lib_static) 10 | message(FATAL_ERROR "Target jsoncpp_lib_static is not defined, but is required because cpd is building static libs. Make sure `BUILD_STATIC_LIBS` is enabled in your jsoncpp installation.") 11 | else() 12 | set(jsoncpp_lib jsoncpp_lib_static) 13 | endif() 14 | endif() 15 | target_link_libraries(Jsoncpp PUBLIC Library-C++ ${jsoncpp_lib}) 16 | set_target_properties(Jsoncpp PROPERTIES 17 | OUTPUT_NAME cpd-jsoncpp 18 | VERSION ${CPD_VERSION} 19 | SOVERSION ${CPD_SOVERSION} 20 | ) 21 | target_include_directories(Jsoncpp 22 | PUBLIC 23 | $ 24 | $ 25 | ) 26 | target_compile_definitions(Jsoncpp PUBLIC CPD_WITH_JSONCPP) 27 | 28 | install(TARGETS Jsoncpp DESTINATION lib EXPORT cpd-jsoncpp-targets) 29 | install(DIRECTORY include/cpd DESTINATION include) 30 | install(EXPORT cpd-jsoncpp-targets NAMESPACE Cpd:: DESTINATION lib/cmake/cpd) 31 | 32 | if(WITH_TESTS) 33 | add_subdirectory(tests) 34 | endif() 35 | -------------------------------------------------------------------------------- /components/jsoncpp/include/cpd/jsoncpp.hpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #pragma once 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | namespace cpd { 27 | 28 | Json::Value to_json(const Result& result); 29 | Json::Value to_json(const RigidResult& result); 30 | Json::Value to_json(const AffineResult& result); 31 | Json::Value to_json(const NonrigidResult& result); 32 | Json::Value to_json(const Matrix& matrix); 33 | } 34 | -------------------------------------------------------------------------------- /components/jsoncpp/src/jsoncpp.cpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include 19 | 20 | namespace cpd { 21 | 22 | Json::Value to_json(const Result& result) { 23 | Json::Value root; 24 | root["sigma2"] = result.sigma2; 25 | root["runtime"] = double(result.runtime.count()) / 1e6; 26 | root["iterations"] = Json::UInt64(result.iterations); 27 | return root; 28 | } 29 | 30 | Json::Value to_json(const RigidResult& result) { 31 | const Result* base = &result; 32 | Json::Value root = to_json(*base); 33 | root["rotation"] = cpd::to_json(result.rotation); 34 | root["translation"] = cpd::to_json(result.translation); 35 | root["scale"] = result.scale; 36 | return root; 37 | } 38 | 39 | Json::Value to_json(const AffineResult& result) { 40 | const Result* base = &result; 41 | Json::Value root = to_json(*base); 42 | root["transform"] = cpd::to_json(result.transform); 43 | root["translation"] = cpd::to_json(result.translation); 44 | return root; 45 | } 46 | 47 | Json::Value to_json(const NonrigidResult& result) { 48 | const Result* base = &result; 49 | return to_json(*base); 50 | } 51 | 52 | Json::Value to_json(const Matrix& matrix) { 53 | Json::Value root; 54 | for (Matrix::Index row = 0; row < matrix.rows(); ++row) { 55 | root[Json::ArrayIndex(row)] = Json::Value(Json::ValueType::arrayValue); 56 | for (Matrix::Index col = 0; col < matrix.cols(); ++col) { 57 | root[Json::ArrayIndex(row)][Json::ArrayIndex(col)] = 58 | matrix(row, col); 59 | } 60 | } 61 | return root; 62 | } 63 | 64 | std::ostream& operator<<(std::ostream& ostream, const Result& result) { 65 | return ostream; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /components/jsoncpp/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(cpd_test) 2 | 3 | cpd_test(jsoncpp Jsoncpp) 4 | -------------------------------------------------------------------------------- /components/jsoncpp/tests/jsoncpp.cpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include "gtest/gtest.h" 19 | #include 20 | #include 21 | 22 | namespace cpd { 23 | 24 | TEST(RigidResult, ConvertsToJson) { 25 | RigidResult result; 26 | Json::Value json = cpd::to_json(result); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /docs/namespace.dox: -------------------------------------------------------------------------------- 1 | /// \namespace cpd 2 | /// Top-level cpd namespace. 3 | -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(cpd-examples CXX) 2 | cmake_minimum_required(VERSION 2.8.12) 3 | 4 | find_package(Cpd REQUIRED) 5 | 6 | if("${CPD_WITH_JSONCPP}") 7 | find_package(Cpd COMPONENTS jsoncpp) 8 | add_executable(cpd-rigid rigid.cpp) 9 | target_link_libraries(cpd-rigid PRIVATE Cpd::Library-C++ Cpd::Jsoncpp) 10 | 11 | if("${Fgt_FOUND}") 12 | add_executable(cpd-fgt fgt.cpp) 13 | target_link_libraries(cpd-fgt PRIVATE Cpd::Library-C++ Cpd::Jsoncpp) 14 | endif() 15 | endif() 16 | 17 | add_executable(cpd-version version.cpp) 18 | target_link_libraries(cpd-version PRIVATE Cpd::Library-C++) 19 | 20 | add_executable(cpd-random random.cpp) 21 | target_link_libraries(cpd-random PRIVATE Cpd::Library-C++) 22 | 23 | add_executable(cpd-callback callback.cpp) 24 | target_link_libraries(cpd-callback PRIVATE Cpd::Library-C++) 25 | 26 | add_executable(cpd-transform transform.cpp) 27 | target_link_libraries(cpd-transform PRIVATE Cpd::Library-C++) 28 | -------------------------------------------------------------------------------- /examples/callback.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | void RigidCallback(const cpd::Result &r) { 8 | std::cout << r.points << std::endl << std::endl; 9 | } 10 | 11 | void NonrigidCallback(const cpd::NonrigidResult &r) { 12 | std::cout << r.points << std::endl << std::endl; 13 | } 14 | 15 | int main(int argc, char** argv) { 16 | if (argc != 4) { 17 | std::cout << "Invalid usage: cpd-random " 18 | << std::endl; 19 | return 1; 20 | } 21 | std::string method = argv[1]; 22 | size_t rows = std::stoi(argv[2]); 23 | size_t cols = std::stoi(argv[3]); 24 | cpd::Matrix fixed = cpd::Matrix::Random(rows, cols); 25 | cpd::Matrix moving = cpd::Matrix::Random(rows, cols); 26 | 27 | if (method == "rigid") { 28 | cpd::Rigid rigid; 29 | auto *cb = RigidCallback; 30 | rigid.add_callback(cb); 31 | auto rigid_result = rigid.run(fixed, moving); 32 | } else if (method == "nonrigid") { 33 | cpd::Nonrigid nonrigid; 34 | auto *cb = NonrigidCallback; 35 | nonrigid.add_callback(cb); 36 | auto nonrigid_result = nonrigid.run(fixed, moving); 37 | } else { 38 | std::cout << "Invalid method: " << method << std::endl; 39 | return 1; 40 | } 41 | std::cout << "Registration completed OK" << std::endl; 42 | return 0; 43 | } 44 | 45 | 46 | -------------------------------------------------------------------------------- /examples/fgt.cpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | int main(int argc, char** argv) { 24 | if (argc != 3) { 25 | std::cout << "ERROR: invalid usage" << std::endl; 26 | std::cout << "USAGE: cpd-fgt " << std::endl; 27 | return 1; 28 | } 29 | cpd::Matrix fixed = cpd::matrix_from_path(argv[1]); 30 | cpd::Matrix moving = cpd::matrix_from_path(argv[2]); 31 | cpd::Rigid rigid; 32 | rigid.gauss_transform(std::move( 33 | std::unique_ptr(new cpd::GaussTransformFgt()))); 34 | cpd::RigidResult result = rigid.run(fixed, moving); 35 | std::cout << cpd::to_json(result) << std::endl; 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /examples/random.cpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | /// Create two random datasets and run cpd on them. 19 | /// 20 | /// This is mostly to test for behavior when running overly-large data through 21 | /// nonrigid (#104). 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | int main(int argc, char** argv) { 30 | if (argc != 4) { 31 | std::cout << "Invalid usage: cpd-random " 32 | << std::endl; 33 | return 1; 34 | } 35 | std::string method = argv[1]; 36 | size_t rows = std::stoi(argv[2]); 37 | size_t cols = std::stoi(argv[3]); 38 | cpd::Matrix fixed = cpd::Matrix::Random(rows, cols); 39 | cpd::Matrix moving = cpd::Matrix::Random(rows, cols); 40 | 41 | if (method == "rigid") { 42 | cpd::rigid(fixed, moving); 43 | } else if (method == "nonrigid") { 44 | cpd::nonrigid(fixed, moving); 45 | } else { 46 | std::cout << "Invalid method: " << method << std::endl; 47 | return 1; 48 | } 49 | std::cout << "Registration completed OK" << std::endl; 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /examples/rigid.cpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | int main(int argc, char** argv) { 24 | if (!(argc == 3 || argc == 4)) { 25 | std::cout << "ERROR: invalid usage" << std::endl; 26 | std::cout << "USAGE: cpd-rigid [outfile]" << std::endl; 27 | return 1; 28 | } 29 | cpd::Matrix fixed = cpd::matrix_from_path(argv[1]); 30 | cpd::Matrix moving = cpd::matrix_from_path(argv[2]); 31 | cpd::Rigid rigid; 32 | rigid.scale(true); 33 | cpd::RigidResult result = rigid.run(fixed, moving); 34 | std::cout << cpd::to_json(result) << std::endl; 35 | if (argc == 4) { 36 | std::ofstream outfile(argv[3]); 37 | outfile << result.points << std::endl; 38 | outfile.close(); 39 | } 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /examples/transform.cpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | int main(int argc, char** argv) { 24 | if (argc == 1) { 25 | std::cerr << "ERROR: invalid usage" << std::endl; 26 | return 1; 27 | } 28 | cpd::Matrix fixed = cpd::matrix_from_path(argv[2]); 29 | cpd::Matrix moving = cpd::matrix_from_path(argv[3]); 30 | if (std::strcmp(argv[1], "rigid") == 0) { 31 | cpd::Rigid rigid; 32 | rigid.scale(true); 33 | cpd::RigidResult result = rigid.run(fixed, moving); 34 | cpd::Matrix transform = result.matrix(); 35 | std::cout << transform << std::endl; 36 | } else if (std::strcmp(argv[1], "affine") == 0) { 37 | cpd::AffineResult result = cpd::affine(fixed, moving); 38 | cpd::Matrix transform = result.matrix(); 39 | std::cout << transform << std::endl; 40 | } else if (std::strcmp(argv[1], "apply") == 0) { 41 | cpd::Matrix transform = cpd::matrix_from_path(argv[2]); 42 | cpd::Matrix points = cpd::matrix_from_path(argv[3]); 43 | points = cpd::apply_transformation_matrix(points, transform); 44 | std::ofstream outfile(argv[4]); 45 | outfile << points << std::endl; 46 | outfile.close(); 47 | } else { 48 | std::cerr << "ERROR: invalid method '" << argv[1] << "'" << std::endl; 49 | return 1; 50 | } 51 | return 0; 52 | } 53 | -------------------------------------------------------------------------------- /examples/version.cpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include 19 | #include 20 | 21 | int main(int argc, char** argv) { 22 | std::cout << cpd::version() << std::endl; 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /include/cpd/affine.hpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | /// \file 19 | /// 20 | /// Affine (translation, rotation, skew, scaling) transformation. 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace cpd { 27 | 28 | /// The result of a affine coherent point drift run. 29 | struct AffineResult : public Result { 30 | /// The affine transformation. 31 | Matrix transform; 32 | 33 | /// The translation vector. 34 | Vector translation; 35 | 36 | /// Returns the transform and the translation as one matrix. 37 | Matrix matrix() const; 38 | 39 | /// Denormalize this result. 40 | void denormalize(const Normalization& normalization); 41 | }; 42 | 43 | /// Affine coherent point drift. 44 | class Affine : public Transform { 45 | public: 46 | Affine() 47 | : Transform() 48 | , m_linked(DEFAULT_LINKED) {} 49 | 50 | /// Computes one iteration of the affine transformation. 51 | AffineResult compute_one(const Matrix& fixed, const Matrix& moving, 52 | const Probabilities& probabilities, 53 | double sigma2) const; 54 | 55 | /// Sets whether the scalings of the two datasets are linked. 56 | Affine& linked(bool linked) { 57 | m_linked = linked; 58 | return *this; 59 | } 60 | 61 | virtual bool linked() const { return m_linked; } 62 | 63 | private: 64 | bool m_linked; 65 | }; 66 | 67 | /// Runs a affine registration on two matrices. 68 | AffineResult affine(const Matrix& fixed, const Matrix& moving); 69 | } // namespace cpd 70 | -------------------------------------------------------------------------------- /include/cpd/gauss_transform.hpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | /// \file 19 | /// 20 | /// Basic correspondence/error calculation between two datasets, using the 21 | /// direct method of the Gauss transform. 22 | 23 | #pragma once 24 | 25 | #include 26 | #include 27 | 28 | namespace cpd { 29 | 30 | /// Probability matrices produced by comparing two data sets with a 31 | /// `GaussTransform`. 32 | struct Probabilities { 33 | /// The probability matrix, multiplied by the identity matrix. 34 | Vector p1; 35 | /// The probability matrix, transposes, multiplied by the identity matrix. 36 | Vector pt1; 37 | /// The probability matrix multiplied by the fixed points. 38 | Matrix px; 39 | /// The total error. 40 | double l; 41 | /// The correspondence vector between the two datasets. 42 | IndexVector correspondence; 43 | }; 44 | 45 | /// Abstract base class for Gauss transforms. 46 | class GaussTransform { 47 | public: 48 | /// Returns the default Gauss transform as a unique ptr. 49 | static std::unique_ptr make_default(); 50 | 51 | /// Computes the Gauss transform. 52 | virtual Probabilities compute(const Matrix& fixed, const Matrix& moving, 53 | double sigma2, double outliers) const = 0; 54 | 55 | virtual ~GaussTransform() {} 56 | }; 57 | 58 | /// The direct Gauss transform. 59 | class GaussTransformDirect : public GaussTransform { 60 | public: 61 | Probabilities compute(const Matrix& fixed, const Matrix& moving, 62 | double sigma2, double outliers) const; 63 | }; 64 | } // namespace cpd 65 | -------------------------------------------------------------------------------- /include/cpd/gauss_transform_fgt.hpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | /// \file 19 | /// 20 | /// Gauss transforms using the [fgt](https://github.com/gadomski/fgt) library. 21 | 22 | #pragma once 23 | 24 | #include 25 | #include 26 | 27 | namespace cpd { 28 | 29 | /// The method(s) by which the fgt Gauss transform will compute the differences. 30 | enum FgtMethod { 31 | /// Use only the direct-tree fgt method. 32 | DirectTree, 33 | /// Use only the improved fast Gauss transform method. 34 | Ifgt, 35 | /// Switch between direct-tree and ifgt at a certain breakpoint. 36 | Switched, 37 | }; 38 | 39 | /// The default fgt method 40 | const FgtMethod DEFAULT_FGT_METHOD = FgtMethod::DirectTree; 41 | /// The default switched fgt breakpoint. 42 | const double DEFAULT_BREAKPOINT = 0.2; 43 | /// The default fgt epsilon. 44 | const double DEFAULT_EPSILON = 1e-4; 45 | 46 | /// The Gauss transform using the fgt library. 47 | class GaussTransformFgt : public GaussTransform { 48 | public: 49 | GaussTransformFgt() 50 | : GaussTransform() 51 | , m_breakpoint(DEFAULT_BREAKPOINT) 52 | , m_epsilon(DEFAULT_EPSILON) 53 | , m_method(DEFAULT_FGT_METHOD) {} 54 | 55 | /// Sets the ifgt->direct-tree breakpoint. 56 | GaussTransformFgt& breakpoint(double breakpoint) { 57 | m_breakpoint = breakpoint; 58 | return *this; 59 | } 60 | 61 | /// Sets the epsilon. 62 | GaussTransformFgt& epsilon(double epsilon) { 63 | m_epsilon = epsilon; 64 | return *this; 65 | } 66 | 67 | /// Sets the method. 68 | GaussTransformFgt& method(FgtMethod method) { 69 | m_method = method; 70 | return *this; 71 | } 72 | 73 | Probabilities compute(const Matrix& fixed, const Matrix& moving, 74 | double sigma2, double outliers) const; 75 | 76 | private: 77 | std::unique_ptr create_transform(const Matrix& points, 78 | double bandwidth) const; 79 | 80 | double m_breakpoint; 81 | double m_epsilon; 82 | FgtMethod m_method; 83 | }; 84 | } // namespace cpd 85 | -------------------------------------------------------------------------------- /include/cpd/matrix.hpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | /// \file 19 | /// 20 | /// Basic typedefs for our flavors of Eigen matrices. 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace cpd { 27 | 28 | /// Our base matrix class. 29 | typedef Eigen::MatrixXd Matrix; 30 | 31 | /// Typedef for our specific type of vector. 32 | typedef Eigen::VectorXd Vector; 33 | 34 | /// Typedef for an index vector, used to index other matrices. 35 | typedef Eigen::Matrix IndexVector; 36 | 37 | /// Typedef for our specific type of array. 38 | typedef Eigen::ArrayXd Array; 39 | 40 | /// Apply a transformation matrix to a set of points. 41 | /// 42 | /// The transformation matrix should be one column wider than the point matrix. 43 | Matrix apply_transformation_matrix(Matrix points, const Matrix& transform); 44 | } // namespace cpd 45 | -------------------------------------------------------------------------------- /include/cpd/nonrigid.hpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | /// \file 19 | /// 20 | /// Nonrigid coherent point drift transform. 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace cpd { 27 | 28 | /// Default value for beta. 29 | const double DEFAULT_BETA = 3.0; 30 | /// Default value for lambda. 31 | const double DEFAULT_LAMBDA = 3.0; 32 | 33 | /// The result of a nonrigid coherent point drift run. 34 | struct NonrigidResult : public Result {}; 35 | 36 | /// Nonrigid coherent point drift. 37 | class Nonrigid : public Transform { 38 | public: 39 | Nonrigid() 40 | : Transform() 41 | , m_lambda(DEFAULT_LAMBDA) 42 | , m_beta(DEFAULT_BETA) 43 | , m_linked(DEFAULT_LINKED) {} 44 | 45 | /// Initialize this transform for the provided matrices. 46 | void init(const Matrix& fixed, const Matrix& moving); 47 | 48 | /// Modifies the probabilities with some affinity and weight information. 49 | void modify_probabilities(Probabilities& probabilities) const; 50 | 51 | /// Sets the beta. 52 | Nonrigid& beta(double beta) { 53 | m_beta = beta; 54 | return *this; 55 | } 56 | 57 | /// Sets the lambda. 58 | Nonrigid& lambda(double lambda) { 59 | m_lambda = lambda; 60 | return *this; 61 | } 62 | 63 | /// Computes one iteration of the nonrigid transformation. 64 | NonrigidResult compute_one(const Matrix& fixed, const Matrix& moving, 65 | const Probabilities& probabilities, 66 | double sigma2) const; 67 | 68 | /// Sets whether the scalings of the two datasets are linked. 69 | Nonrigid& linked(bool linked) { 70 | m_linked = linked; 71 | return *this; 72 | } 73 | 74 | virtual bool linked() const { return m_linked; } 75 | 76 | private: 77 | Matrix m_g; 78 | Matrix m_w; 79 | double m_lambda; 80 | double m_beta; 81 | bool m_linked; 82 | }; 83 | 84 | /// Runs a nonrigid registration on two matrices. 85 | NonrigidResult nonrigid(const Matrix& fixed, const Matrix& moving); 86 | } // namespace cpd 87 | -------------------------------------------------------------------------------- /include/cpd/normalization.hpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | /// \file 19 | /// 20 | /// Utility to scale/offset points to (roughly) conform to unit shape centered 21 | /// at zero. 22 | 23 | #pragma once 24 | 25 | #include 26 | 27 | namespace cpd { 28 | 29 | /// The results of normalizing data to a unit cube (or whatever dimensionality). 30 | struct Normalization { 31 | /// The average of the fixed points, that was subtracted from those data. 32 | Vector fixed_mean; 33 | /// The fixed points. 34 | Matrix fixed; 35 | /// The scaling factor for the fixed points. 36 | double fixed_scale; 37 | /// The average of the moving points, that was subtracted from those data. 38 | Vector moving_mean; 39 | /// The moving points. 40 | Matrix moving; 41 | /// The scaling factor for the moving points. 42 | double moving_scale; 43 | 44 | /// Creates a new normalization for the provided matrices. 45 | /// 46 | /// If `linked = true`, apply the same scaling to both sets of points. This 47 | /// is recommended if you are working with data that should not be scaled, 48 | /// e.g. LiDAR data. If `linked = false`, each point set is scaled 49 | /// seperately. 50 | /// 51 | /// Myronenko's original implementation only had `linked = false` logic. 52 | Normalization(const Matrix& fixed, const Matrix& moving, 53 | bool linked = true); 54 | }; 55 | } // namespace cpd 56 | -------------------------------------------------------------------------------- /include/cpd/rigid.hpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | /// \file 19 | /// 20 | /// Rigid coherent point drift. 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace cpd { 27 | 28 | /// Should rigid registrations allow reflections by default? 29 | const bool DEFAULT_REFLECTIONS = false; 30 | /// Should rigid registrations scale the data by default? 31 | const bool DEFAULT_SCALE = !DEFAULT_LINKED; 32 | 33 | /// The result of a rigid coherent point drift run. 34 | struct RigidResult : public Result { 35 | /// The rotation component of the transformation. 36 | Matrix rotation; 37 | /// The translation component of the transformation. 38 | Vector translation; 39 | /// The scaling component of the transformation. 40 | double scale; 41 | 42 | /// Returns a single matrix that contains all the transformation 43 | /// information. 44 | Matrix matrix() const; 45 | 46 | void denormalize(const Normalization& normalization); 47 | }; 48 | 49 | /// Rigid coherent point drift. 50 | /// 51 | /// Scaling and reflections can be turned on and off. 52 | class Rigid : public Transform { 53 | public: 54 | Rigid() 55 | : Transform() 56 | , m_reflections(DEFAULT_REFLECTIONS) 57 | , m_scale(DEFAULT_SCALE) {} 58 | 59 | /// Sets whether this rigid transform allows reflections. 60 | Rigid& reflections(bool reflections) { 61 | m_reflections = reflections; 62 | return *this; 63 | } 64 | 65 | /// Sets whether this rigid transform allows scaling. 66 | Rigid& scale(bool scale) { 67 | m_scale = scale; 68 | return *this; 69 | } 70 | 71 | /// Computes one iteration of the rigid transformation. 72 | RigidResult compute_one(const Matrix& fixed, const Matrix& moving, 73 | const Probabilities& probabilities, 74 | double sigma2) const; 75 | 76 | virtual bool linked() const { return !m_scale; } 77 | 78 | private: 79 | bool m_reflections; 80 | bool m_scale; 81 | }; 82 | 83 | /// Runs a rigid registration on two matrices. 84 | RigidResult rigid(const Matrix& fixed, const Matrix& moving); 85 | } // namespace cpd 86 | -------------------------------------------------------------------------------- /include/cpd/utils.hpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | /// \file 19 | /// 20 | /// The always-present, always-ambiguous utils file. 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace cpd { 27 | 28 | /// Loads a matrix from a delimited text file. 29 | Matrix matrix_from_path(const std::string& path); 30 | 31 | /// Computes the default sigma2 for the given matrices. 32 | double default_sigma2(const Matrix& fixed, const Matrix& moving); 33 | 34 | /// Computes the affinity matrix between the two matrices. 35 | Matrix affinity(const Matrix& fixed, const Matrix& moving, double beta); 36 | } // namespace cpd 37 | -------------------------------------------------------------------------------- /include/cpd/version.hpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2016 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | /// \file 19 | /// Query the cpd library version. 20 | 21 | #pragma once 22 | 23 | namespace cpd { 24 | 25 | /// Returns this library's version. 26 | const char* version(); 27 | } // namespace cpd 28 | -------------------------------------------------------------------------------- /scripts/gh-pages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Push doxygen documentation to `gh-pages`. 3 | # Expects to be run from the top level directory. 4 | # 5 | # Inspired by travis-doxygen.sh from miloyip/rapidjson 6 | 7 | set -ex 8 | 9 | skip() { 10 | echo "SKIPPING: $@" 1>&2 11 | echo "Exiting..." 12 | exit 0 13 | } 14 | 15 | abort() { 16 | echo "ERROR: $@" 1>&2 17 | echo "Exiting..." 18 | exit 1 19 | } 20 | 21 | [ -f scripts/gh-pages.sh ] || abort "scripts/gh-pages.sh must be run from PROJECT_SOURCE_DIR" 22 | 23 | if [ "${TRAVIS}" = "true" ]; then 24 | [ "${TRAVIS_PULL_REQUEST}" = "false" ] || skip "Not building docs for pull requests" 25 | [ "${TRAVIS_BRANCH}" = "master" ] || skip "Only building docs for master branch" 26 | [ "${TRAVIS_JOB_NUMBER}" = "${TRAVIS_BUILD_NUMBER}.1" ] || skip "Only build docs once" 27 | 28 | git config --global user.name "Travis CI" 29 | git config --global user.email "travis@localhost" 30 | fi 31 | 32 | mkdir -p build/docs 33 | cd build/docs 34 | rm -rf html 35 | git clone -b gh-pages https://github.com/gadomski/cpd html 36 | cd html 37 | rm -rf .git/index 38 | git clean -df 39 | cd ../.. 40 | make doc 41 | cd docs/html 42 | git add --all 43 | git diff-index --quiet HEAD || git commit -m "scripts/gh-pages.sh" 44 | 45 | if [ "${TRAVIS}" = "true" ]; then 46 | git push "https://${GH_TOKEN}@github.com/gadomski/cpd.git" gh-pages 47 | else 48 | git push git@github.com:gadomski/cpd gh-pages 49 | fi 50 | -------------------------------------------------------------------------------- /scripts/travis-install-cmake.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # Installs a pre-built cmake 3 | 4 | set -ex 5 | 6 | wget https://github.com/Viq111/travis-container-packets/releases/download/cmake-3.1.2/cmake.tar.bz2 7 | tar xjf cmake.tar.bz2 8 | rm cmake.tar.bz2 9 | -------------------------------------------------------------------------------- /scripts/travis-install-doxygen.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # Installs Doxygen 3 | 4 | set -ex 5 | 6 | DOXYGEN_VER=doxygen-1.8.15 7 | DOXYGEN_TAR=${DOXYGEN_VER}.linux.bin.tar.gz 8 | DOXYGEN_URL="http://doxygen.nl/files/${DOXYGEN_TAR}" 9 | 10 | mkdir -p $HOME/local/bin 11 | wget -O - "${DOXYGEN_URL}" | tar xz -C ${TMPDIR-/tmp} ${DOXYGEN_VER}/bin/doxygen 12 | mv ${TMPDIR-/tmp}/${DOXYGEN_VER}/bin/doxygen $HOME/local/bin/doxygen 13 | -------------------------------------------------------------------------------- /scripts/travis-install-eigen3.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # Installs eigen to $HOME/local 3 | 4 | set -ex 5 | 6 | wget http://bitbucket.org/eigen/eigen/get/3.2.8.tar.gz 7 | tar xzf 3.2.8.tar.gz 8 | rm 3.2.8.tar.gz 9 | cd eigen-eigen-07105f7124f9 10 | mkdir build 11 | cd build 12 | cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/local 13 | make install 14 | -------------------------------------------------------------------------------- /scripts/travis-install-fgt.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # Installs fgt to $HOME/local 3 | 4 | set -ex 5 | 6 | git clone https://github.com/gadomski/fgt.git 7 | mkdir fgt/build 8 | cd fgt/build 9 | cmake .. \ 10 | -DCMAKE_INSTALL_PREFIX=$HOME/local \ 11 | -DWITH_TESTS=OFF \ 12 | -DCMAKE_BUILD_TYPE=Release \ 13 | -DBUILD_SHARED_LIBS=ON 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /scripts/travis-install-jsoncpp.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # Installs jsoncpp to $HOME/local 3 | 4 | set -ex 5 | 6 | wget https://github.com/open-source-parsers/jsoncpp/archive/1.8.0.tar.gz 7 | tar xzf 1.8.0.tar.gz 8 | rm 1.8.0.tar.gz 9 | cd jsoncpp-1.8.0 10 | mkdir build 11 | cd build 12 | cmake .. \ 13 | -DCMAKE_INSTALL_PREFIX=$HOME/local \ 14 | -DBUILD_SHARED_LIBS=ON \ 15 | -DJSONCPP_WITH_CMAKE_PACKAGE=ON \ 16 | -DJSONCPP_WITH_TESTS=OFF \ 17 | -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF 18 | make install 19 | -------------------------------------------------------------------------------- /scripts/travis-script.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # Travis's build and test script 3 | 4 | set -ex 5 | 6 | mkdir build 7 | cd build 8 | cmake .. \ 9 | -DBUILD_SHARED_LIBS=ON \ 10 | -DCMAKE_BUILD_TYPE=Release \ 11 | -DCMAKE_INSTALL_PREFIX=$HOME/local \ 12 | -DWITH_DOCS=OFF \ 13 | -DWITH_FGT=$CPD_WITH_FGT \ 14 | -DWITH_JSONCPP=ON \ 15 | -DWITH_STRICT_WARNINGS=ON \ 16 | -DWITH_TESTS=ON 17 | make 18 | CTEST_OUTPUT_ON_FAIULRE=1 make test 19 | make install 20 | cd ../examples 21 | mkdir build 22 | cd build 23 | cmake .. -DCMAKE_PREFIX_PATH=$HOME/local 24 | make 25 | -------------------------------------------------------------------------------- /src/gauss_transform.cpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #define _USE_MATH_DEFINES 19 | 20 | #include 21 | #include 22 | 23 | namespace cpd { 24 | Probabilities GaussTransformDirect::compute(const Matrix& fixed, 25 | const Matrix& moving, double sigma2, 26 | double outliers) const { 27 | double ksig = -2.0 * sigma2; 28 | size_t cols = fixed.cols(); 29 | double outlier_tmp = 30 | (outliers * moving.rows() * std::pow(-ksig * M_PI, 0.5 * cols)) / 31 | ((1 - outliers) * fixed.rows()); 32 | Vector p = Vector::Zero(moving.rows()); 33 | Vector p1 = Vector::Zero(moving.rows()); 34 | Vector p1_max = Vector::Zero(moving.rows()); 35 | Vector pt1 = Vector::Zero(fixed.rows()); 36 | Matrix px = Matrix::Zero(moving.rows(), cols); 37 | IndexVector correspondence = IndexVector::Zero(moving.rows()); 38 | double l = 0.0; 39 | 40 | for (Matrix::Index i = 0; i < fixed.rows(); ++i) { 41 | double sp = 0; 42 | for (Matrix::Index j = 0; j < moving.rows(); ++j) { 43 | double razn = (fixed.row(i) - moving.row(j)).array().pow(2).sum(); 44 | p(j) = std::exp(razn / ksig); 45 | sp += p(j); 46 | } 47 | sp += outlier_tmp; 48 | pt1(i) = 1 - outlier_tmp / sp; 49 | for (Matrix::Index j = 0; j < moving.rows(); ++j) { 50 | p1(j) += p(j) / sp; 51 | px.row(j) += fixed.row(i) * p(j) / sp; 52 | if (p(j) / sp > p1_max(j)) { 53 | correspondence(j) = i; 54 | p1_max(j) = p(j) / sp; 55 | } 56 | } 57 | l += -std::log(sp); 58 | } 59 | l += cols * fixed.rows() * std::log(sigma2) / 2; 60 | return { p1, pt1, px, l, correspondence }; 61 | } 62 | } // namespace cpd 63 | -------------------------------------------------------------------------------- /src/gauss_transform_make_default.cpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include 19 | 20 | namespace cpd { 21 | std::unique_ptr GaussTransform::make_default() { 22 | return std::unique_ptr(new GaussTransformDirect()); 23 | } 24 | } // namespace cpd 25 | -------------------------------------------------------------------------------- /src/matrix.cpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include 19 | 20 | namespace cpd { 21 | 22 | Matrix apply_transformation_matrix(Matrix points, const Matrix& transform) { 23 | Matrix::Index rows = points.rows(); 24 | Matrix::Index cols = points.cols() + 1; 25 | points.conservativeResize(rows, cols); 26 | points.col(cols - 1) = Vector::Ones(rows); 27 | Matrix transformed_points = points * transform.transpose(); 28 | return transformed_points.leftCols(cols - 1); 29 | } 30 | } // namespace cpd 31 | -------------------------------------------------------------------------------- /src/nonrigid.cpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include 19 | 20 | namespace cpd { 21 | 22 | void Nonrigid::init(const Matrix& fixed, const Matrix& moving) { 23 | m_g = affinity(moving, moving, m_beta); 24 | m_w = Matrix::Zero(moving.rows(), moving.cols()); 25 | } 26 | 27 | void Nonrigid::modify_probabilities(Probabilities& probabilities) const { 28 | probabilities.l += m_lambda / 2.0 * (m_w.transpose() * m_g * m_w).trace(); 29 | } 30 | 31 | NonrigidResult Nonrigid::compute_one(const Matrix& fixed, const Matrix& moving, 32 | const Probabilities& probabilities, 33 | double sigma2) const { 34 | size_t cols = fixed.cols(); 35 | auto dp = probabilities.p1.asDiagonal(); 36 | Matrix w = (dp * m_g + m_lambda * sigma2 * 37 | Matrix::Identity(moving.rows(), moving.rows())) 38 | .colPivHouseholderQr() 39 | .solve(probabilities.px - dp * moving); 40 | NonrigidResult result; 41 | result.points = moving + m_g * w; 42 | double np = probabilities.p1.sum(); 43 | result.sigma2 = std::abs( 44 | ((fixed.array().pow(2) * probabilities.pt1.replicate(1, cols).array()) 45 | .sum() + 46 | (result.points.array().pow(2) * 47 | probabilities.p1.replicate(1, cols).array()) 48 | .sum() - 49 | 2 * (probabilities.px.transpose() * result.points).trace()) / 50 | (np * cols)); 51 | return result; 52 | } 53 | 54 | NonrigidResult nonrigid(const Matrix& fixed, const Matrix& moving) { 55 | Nonrigid nonrigid; 56 | return nonrigid.run(fixed, moving); 57 | } 58 | } // namespace cpd 59 | -------------------------------------------------------------------------------- /src/normalization.cpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include 19 | 20 | namespace cpd { 21 | 22 | Normalization::Normalization(const Matrix& f, const Matrix& m, bool linked) 23 | : fixed_mean(f.colwise().mean()) 24 | , fixed(f - fixed_mean.transpose().replicate(f.rows(), 1)) 25 | , fixed_scale(std::sqrt(fixed.array().pow(2).sum() / fixed.rows())) 26 | , moving_mean(m.colwise().mean()) 27 | , moving(m - moving_mean.transpose().replicate(m.rows(), 1)) 28 | , moving_scale(std::sqrt(moving.array().pow(2).sum() / moving.rows())) { 29 | if (linked) { 30 | double scale = std::max(fixed_scale, moving_scale); 31 | fixed_scale = scale; 32 | moving_scale = scale; 33 | } 34 | fixed /= fixed_scale; 35 | moving /= moving_scale; 36 | } 37 | } // namespace cpd 38 | -------------------------------------------------------------------------------- /src/transform.cpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include 19 | 20 | namespace cpd { 21 | 22 | void Result::denormalize(const Normalization& normalization) { 23 | points = points * normalization.fixed_scale + 24 | normalization.fixed_mean.transpose().replicate(points.rows(), 1); 25 | } 26 | } // namespace cpd 27 | -------------------------------------------------------------------------------- /src/version.cpp.in: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2016 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include "cpd/version.hpp" 19 | 20 | namespace cpd { 21 | 22 | const char* version() { 23 | return "@CPD_VERSION@"; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | configure_file(support.hpp.in "${CMAKE_CURRENT_BINARY_DIR}/support.hpp") 2 | 3 | include(cpd_test) 4 | 5 | cpd_test(affine) 6 | cpd_test(gauss_transform) 7 | cpd_test(nonrigid) 8 | cpd_test(normalization) 9 | cpd_test(rigid) 10 | cpd_test(utils) 11 | cpd_test(version) 12 | 13 | if(WITH_FGT) 14 | cpd_test(gauss_transform_fgt) 15 | endif() 16 | -------------------------------------------------------------------------------- /tests/fixtures/face.hpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include "tests/support.hpp" 19 | #include "gtest/gtest.h" 20 | 21 | namespace cpd { 22 | 23 | class FaceTest : public ::testing::Test { 24 | public: 25 | FaceTest() 26 | : ::testing::Test() 27 | , m_face(tests::fixture("face.csv")) 28 | , m_face_distorted(tests::fixture("face_distorted.csv")) {} 29 | 30 | Matrix m_face; 31 | Matrix m_face_distorted; 32 | }; 33 | } // namespace cpd 34 | -------------------------------------------------------------------------------- /tests/fixtures/fish.csv: -------------------------------------------------------------------------------- 1 | -0.91542,-0.16535 2 | -0.89051,-0.10213 3 | -0.8573,-0.10213 4 | -0.82408,-0.14955 5 | -0.8739,-0.19696 6 | -0.92372,-0.16535 7 | -1.0649,-0.2918 8 | -1.0234,-0.16535 9 | -0.98185,-0.054712 10 | -0.95694,0.024316 11 | -0.91542,0.11915 12 | -0.88221,0.18237 13 | -0.80747,0.2614 14 | -0.75765,0.34043 15 | -0.67462,0.46687 16 | -0.58328,0.5459 17 | -0.51686,0.60912 18 | -0.40061,0.70396 19 | -0.33418,0.8146 20 | -0.26775,1.1623 21 | -0.20133,1.4626 22 | -0.15151,1.7629 23 | -0.1432,1.8894 24 | -0.11829,2.1107 25 | -0.10169,1.9684 26 | -0.093383,1.7471 27 | -0.093383,1.5417 28 | -0.085079,1.3046 29 | -0.093383,1.1149 30 | -0.076776,0.90943 31 | -0.076776,0.71976 32 | -0.043562,0.56171 33 | -0.035259,0.48268 34 | 0.047775,0.40365 35 | 0.1142,0.34043 36 | 0.16402,0.27721 37 | 0.22215,0.21398 38 | 0.29688,0.10334 39 | 0.3633,-0.0072949 40 | 0.44634,-0.086323 41 | 0.50446,-0.054712 42 | 0.57089,0.040122 43 | 0.6041,0.18237 44 | 0.67053,0.38784 45 | 0.72865,0.62493 46 | 0.81999,0.67235 47 | 0.90302,0.76718 48 | 0.88642,0.62493 49 | 0.86981,0.46687 50 | 0.86151,0.2614 51 | 0.8366,0.10334 52 | 0.8449,-0.13374 53 | 0.8449,-0.3076 54 | 0.8449,-0.52888 55 | 0.87811,-0.73435 56 | 0.92794,-0.89241 57 | 0.98606,-1.003 58 | 1.0359,-1.1295 59 | 1.0442,-1.2085 60 | 0.96945,-1.1453 61 | 0.88642,-1.0505 62 | 0.79508,-0.97144 63 | 0.68714,-0.92402 64 | 0.5958,-0.82919 65 | 0.53768,-0.75016 66 | 0.47125,-0.63952 67 | 0.41312,-0.5763 68 | 0.28857,-0.52888 69 | 0.18893,-0.46566 70 | 0.089292,-0.46566 71 | -0.035259,-0.49727 72 | -0.085079,-0.49727 73 | -0.0020454,-0.5763 74 | 0.097595,-0.65532 75 | 0.17233,-0.68694 76 | 0.26366,-0.73435 77 | 0.21384,-0.73435 78 | 0.039472,-0.73435 79 | -0.15151,-0.73435 80 | -0.26775,-0.71855 81 | -0.40061,-0.67113 82 | -0.46704,-0.60791 83 | -0.55837,-0.52888 84 | -0.59989,-0.51307 85 | -0.77426,-0.46566 86 | -0.89051,-0.48146 87 | -0.98185,-0.43405 88 | -1.04,-0.37082 89 | -1.0566,-0.2918 90 | -0.050482,-0.75806 91 | 0.099671,-0.75806 92 | -------------------------------------------------------------------------------- /tests/fixtures/fish.hpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include "tests/support.hpp" 19 | #include "gtest/gtest.h" 20 | 21 | namespace cpd { 22 | 23 | class FishTest : public ::testing::Test { 24 | public: 25 | FishTest() 26 | : ::testing::Test() 27 | , m_fish(tests::fixture("fish.csv")) 28 | , m_fish_distorted(tests::fixture("fish_distorted.csv")) {} 29 | 30 | Matrix m_fish; 31 | Matrix m_fish_distorted; 32 | }; 33 | } // namespace cpd 34 | -------------------------------------------------------------------------------- /tests/fixtures/fish_correspondence.csv: -------------------------------------------------------------------------------- 1 | 6 2 | 6 3 | 6 4 | 6 5 | 6 6 | 6 7 | 6 8 | 6 9 | 6 10 | 6 11 | 6 12 | 6 13 | 6 14 | 7 15 | 9 16 | 10 17 | 11 18 | 14 19 | 14 20 | 21 21 | 23 22 | 23 23 | 23 24 | 23 25 | 23 26 | 23 27 | 23 28 | 23 29 | 21 30 | 20 31 | 19 32 | 16 33 | 15 34 | 16 35 | 30 36 | 31 37 | 33 38 | 36 39 | 42 40 | 50 41 | 49 42 | 48 43 | 46 44 | 46 45 | 46 46 | 46 47 | 46 48 | 46 49 | 46 50 | 46 51 | 46 52 | 49 53 | 56 54 | 58 55 | 58 56 | 58 57 | 58 58 | 58 59 | 58 60 | 58 61 | 58 62 | 58 63 | 58 64 | 58 65 | 58 66 | 58 67 | 59 68 | 62 69 | 75 70 | 89 71 | 78 72 | 79 73 | 89 74 | 90 75 | 62 76 | 59 77 | 62 78 | 90 79 | 79 80 | 80 81 | 80 82 | 85 83 | 86 84 | 86 85 | 87 86 | 87 87 | 6 88 | 6 89 | 6 90 | 89 91 | 90 92 | -------------------------------------------------------------------------------- /tests/fixtures/fish_distorted.csv: -------------------------------------------------------------------------------- 1 | -1.3115,-0.22736 2 | -1.3029,-0.19567 3 | -1.2713,-0.19891 4 | -1.2271,-0.22859 5 | -1.2635,-0.24933 6 | -1.3194,-0.2265 7 | -1.425,-0.28026 8 | -1.4135,-0.21691 9 | -1.3989,-0.16282 10 | -1.3931,-0.1239 11 | -1.3757,-0.077594 12 | -1.3594,-0.046481 13 | -1.3102,-0.0079498 14 | -1.2839,0.033245 15 | -1.2406,0.10284 16 | -1.1821,0.14904 17 | -1.1424,0.18841 18 | -1.0718,0.2521 19 | -1.0448,0.33189 20 | -1.0428,0.62082 21 | -0.98523,0.934 22 | -0.86965,1.3009 23 | -0.80657,1.4657 24 | -0.66146,1.7638 25 | -0.73119,1.5747 26 | -0.83198,1.2873 27 | -0.89533,1.0364 28 | -0.91771,0.77657 29 | -0.91641,0.59211 30 | -0.87134,0.41739 31 | -0.8217,0.27141 32 | -0.74106,0.15846 33 | -0.7039,0.10322 34 | -0.59798,0.047716 35 | -0.50946,0.0026175 36 | -0.43383,-0.04299 37 | -0.34851,-0.089439 38 | -0.22266,-0.17244 39 | -0.10401,-0.25835 40 | 0.01764,-0.32307 41 | 0.064168,-0.29873 42 | 0.090197,-0.22143 43 | 0.057433,-0.10529 44 | 0.032851,0.066164 45 | -0.0016944,0.27036 46 | 0.096055,0.32778 47 | 0.17831,0.42933 48 | 0.20041,0.29964 49 | 0.23869,0.16041 50 | 0.31604,-0.015223 51 | 0.35761,-0.15252 52 | 0.47445,-0.3579 53 | 0.55027,-0.5139 54 | 0.63997,-0.71835 55 | 0.75012,-0.91332 56 | 0.85229,-1.0656 57 | 0.94261,-1.1722 58 | 1.02,-1.2936 59 | 1.0404,-1.3696 60 | 0.95189,-1.3098 61 | 0.84359,-1.2176 62 | 0.72303,-1.1382 63 | 0.58645,-1.085 64 | 0.45451,-0.98555 65 | 0.3646,-0.90472 66 | 0.25561,-0.79516 67 | 0.17084,-0.7311 68 | 0.019928,-0.67177 69 | -0.1049,-0.60375 70 | -0.20819,-0.58728 71 | -0.32618,-0.5897 72 | -0.3764,-0.5804 73 | -0.27196,-0.65785 74 | -0.15051,-0.74205 75 | -0.063961,-0.78399 76 | 0.04688,-0.84353 77 | -0.0082454,-0.83322 78 | -0.19446,-0.79505 79 | -0.38674,-0.7522 80 | -0.50348,-0.71379 81 | -0.64496,-0.64784 82 | -0.72848,-0.58608 83 | -0.84491,-0.51006 84 | -0.89264,-0.49061 85 | -1.0885,-0.42503 86 | -1.2047,-0.41439 87 | -1.3103,-0.37106 88 | -1.3832,-0.32675 89 | -1.4171,-0.28112 90 | -0.28181,-0.79432 91 | -0.1267,-0.82851 92 | -------------------------------------------------------------------------------- /tests/fixtures/helheim.hpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include "tests/support.hpp" 19 | #include "gtest/gtest.h" 20 | 21 | namespace cpd { 22 | 23 | class HelheimTest : public ::testing::Test { 24 | public: 25 | HelheimTest() 26 | : ::testing::Test() 27 | , m_helheim(tests::fixture("helheim.csv")) {} 28 | 29 | Matrix m_helheim; 30 | }; 31 | } // namespace cpd 32 | -------------------------------------------------------------------------------- /tests/nonrigid.cpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2016 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include "fixtures/face.hpp" 19 | #include "fixtures/fish.hpp" 20 | #include "tests/support.hpp" 21 | #include "gtest/gtest.h" 22 | #include 23 | 24 | namespace cpd { 25 | 26 | TEST_F(FishTest, Works) { 27 | NonrigidResult result = nonrigid(m_fish, m_fish_distorted); 28 | EXPECT_TRUE(result.points.isApprox(m_fish, 0.1)); 29 | } 30 | 31 | TEST_F(FaceTest, Works) { 32 | Nonrigid nonrigid; 33 | nonrigid.normalize(false).sigma2(1.0).outliers(0.1); 34 | NonrigidResult result = nonrigid.run(m_face, m_face_distorted); 35 | EXPECT_TRUE(result.points.row(0).isApprox(m_face.row(0), 0.01)); 36 | EXPECT_TRUE(result.points.row(391).isApprox(m_face.row(391), 0.5)); 37 | } 38 | 39 | TEST(Nonrigid, Linked) { 40 | Nonrigid nonrigid; 41 | nonrigid.linked(true); 42 | EXPECT_TRUE(nonrigid.linked()); 43 | nonrigid.linked(false); 44 | EXPECT_FALSE(nonrigid.linked()); 45 | } 46 | 47 | TEST_F(FishTest, Correspondences) { 48 | Nonrigid nonrigid; 49 | nonrigid.correspondence(true); 50 | NonrigidResult result = nonrigid.run(m_fish_distorted, m_fish); 51 | EXPECT_TRUE((result.correspondence.array() > 0).any()); 52 | } 53 | } // namespace cpd 54 | -------------------------------------------------------------------------------- /tests/normalization.cpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include "fixtures/fish.hpp" 19 | #include "gtest/gtest.h" 20 | #include 21 | 22 | namespace cpd { 23 | 24 | TEST_F(FishTest, CanBeRetrieved) { 25 | Normalization normalization(m_fish, m_fish); 26 | ASSERT_EQ(m_fish.rows(), normalization.fixed.rows()); 27 | EXPECT_TRUE( 28 | m_fish.isApprox(normalization.fixed * normalization.fixed_scale + 29 | normalization.fixed_mean.transpose().replicate( 30 | normalization.fixed.rows(), 1), 31 | 1e-4)); 32 | } 33 | 34 | TEST_F(FishTest, Unlinked) { 35 | Normalization normalization(m_fish, m_fish * 2, false); 36 | EXPECT_NEAR(normalization.fixed_scale, normalization.moving_scale / 2.0, 37 | 1e-4); 38 | } 39 | } // namespace cpd 40 | -------------------------------------------------------------------------------- /tests/support.hpp.in: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #pragma once 19 | 20 | #include "gtest/gtest.h" 21 | #include 22 | 23 | namespace cpd { 24 | namespace tests { 25 | Matrix fixture(const std::string& filename) { 26 | return matrix_from_path("@PROJECT_SOURCE_DIR@/tests/fixtures/" + filename); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tests/utils.cpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2017 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include "fixtures/fish.hpp" 19 | #include "fixtures/helheim.hpp" 20 | #include "gtest/gtest.h" 21 | 22 | namespace cpd { 23 | TEST_F(FishTest, DefaultSigma2) { 24 | double sigma2 = cpd::default_sigma2(m_fish, m_fish_distorted); 25 | EXPECT_NEAR(1.0, sigma2, 0.1); 26 | } 27 | 28 | TEST_F(HelheimTest, DefaultSigma2) { 29 | double sigma2 = cpd::default_sigma2(m_helheim, m_helheim); 30 | EXPECT_NEAR(23235., sigma2, 1.0); 31 | } 32 | 33 | TEST_F(FishTest, AffinityMatrix) { 34 | Matrix matrix = cpd::affinity(m_fish, m_fish_distorted, 3.0); 35 | ASSERT_EQ(91, matrix.rows()); 36 | ASSERT_EQ(91, matrix.cols()); 37 | EXPECT_NEAR(0.9911, matrix(0, 0), 1e-4); 38 | EXPECT_NEAR(0.9969, matrix(90, 90), 1e-4); 39 | } 40 | } // namespace cpd 41 | -------------------------------------------------------------------------------- /tests/version.cpp: -------------------------------------------------------------------------------- 1 | // cpd - Coherent Point Drift 2 | // Copyright (C) 2016 Pete Gadomski 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License along 15 | // with this program; if not, write to the Free Software Foundation, Inc., 16 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | 18 | #include "cpd/version.hpp" 19 | #include "gtest/gtest.h" 20 | 21 | namespace cpd { 22 | 23 | TEST(Version, Links) { 24 | cpd::version(); 25 | } 26 | } // namespace cpd 27 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/.clang-format: -------------------------------------------------------------------------------- 1 | # Run manually to reformat a file: 2 | # clang-format -i --style=file 3 | Language: Cpp 4 | BasedOnStyle: Google 5 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/.github/ISSUE_TEMPLATE/00-bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: Let us know that something does not work as expected. 3 | title: "[Bug]: Please title this bug report" 4 | body: 5 | - type: textarea 6 | id: what-happened 7 | attributes: 8 | label: Describe the issue 9 | description: What happened, and what did you expect to happen? 10 | validations: 11 | required: true 12 | - type: textarea 13 | id: steps 14 | attributes: 15 | label: Steps to reproduce the problem 16 | description: It is important that we are able to reproduce the problem that you are experiencing. Please provide all code and relevant steps to reproduce the problem, including your `BUILD`/`CMakeLists.txt` file and build commands. Links to a GitHub branch or [godbolt.org](https://godbolt.org/) that demonstrate the problem are also helpful. 17 | validations: 18 | required: true 19 | - type: textarea 20 | id: version 21 | attributes: 22 | label: What version of GoogleTest are you using? 23 | description: Please include the output of `git rev-parse HEAD` or the GoogleTest release version number that you are using. 24 | validations: 25 | required: true 26 | - type: textarea 27 | id: os 28 | attributes: 29 | label: What operating system and version are you using? 30 | description: If you are using a Linux distribution please include the name and version of the distribution as well. 31 | validations: 32 | required: true 33 | - type: textarea 34 | id: compiler 35 | attributes: 36 | label: What compiler and version are you using? 37 | description: Please include the output of `gcc -v` or `clang -v`, or the equivalent for your compiler. 38 | validations: 39 | required: true 40 | - type: textarea 41 | id: buildsystem 42 | attributes: 43 | label: What build system are you using? 44 | description: Please include the output of `bazel --version` or `cmake --version`, or the equivalent for your build system. 45 | validations: 46 | required: true 47 | - type: textarea 48 | id: additional 49 | attributes: 50 | label: Additional context 51 | description: Add any other context about the problem here. 52 | validations: 53 | required: false 54 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/.github/ISSUE_TEMPLATE/10-feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Propose a new feature. 3 | title: "[FR]: Please title this feature request" 4 | labels: "enhancement" 5 | body: 6 | - type: textarea 7 | id: version 8 | attributes: 9 | label: Does the feature exist in the most recent commit? 10 | description: We recommend using the latest commit from GitHub in your projects. 11 | validations: 12 | required: true 13 | - type: textarea 14 | id: why 15 | attributes: 16 | label: Why do we need this feature? 17 | description: Ideally, explain why a combination of existing features cannot be used instead. 18 | validations: 19 | required: true 20 | - type: textarea 21 | id: proposal 22 | attributes: 23 | label: Describe the proposal. 24 | description: Include a detailed description of the feature, with usage examples. 25 | validations: 26 | required: true 27 | - type: textarea 28 | id: platform 29 | attributes: 30 | label: Is the feature specific to an operating system, compiler, or build system version? 31 | description: If it is, please specify which versions. 32 | validations: 33 | required: true 34 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Get Help 4 | url: https://github.com/google/googletest/discussions 5 | about: Please ask and answer questions here. 6 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/.github/workflows/gtest-ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | 3 | on: 4 | push: 5 | pull_request: 6 | 7 | env: 8 | BAZEL_CXXOPTS: -std=c++14 9 | 10 | jobs: 11 | Linux: 12 | runs-on: ubuntu-latest 13 | steps: 14 | 15 | - uses: actions/checkout@v3 16 | with: 17 | fetch-depth: 0 18 | 19 | - name: Tests 20 | run: bazel test --cxxopt=-std=c++14 --features=external_include_paths --test_output=errors ... 21 | 22 | macOS: 23 | runs-on: macos-latest 24 | steps: 25 | 26 | - uses: actions/checkout@v3 27 | with: 28 | fetch-depth: 0 29 | 30 | - name: Tests 31 | run: bazel test --cxxopt=-std=c++14 --features=external_include_paths --test_output=errors ... 32 | 33 | 34 | Windows: 35 | runs-on: windows-latest 36 | steps: 37 | 38 | - uses: actions/checkout@v3 39 | with: 40 | fetch-depth: 0 41 | 42 | - name: Tests 43 | run: bazel test --cxxopt=/std:c++14 --features=external_include_paths --test_output=errors ... 44 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore CI build directory 2 | build/ 3 | xcuserdata 4 | cmake-build-debug/ 5 | .idea/ 6 | bazel-bin 7 | bazel-genfiles 8 | bazel-googletest 9 | bazel-out 10 | bazel-testlogs 11 | # python 12 | *.pyc 13 | 14 | # Visual Studio files 15 | .vs 16 | *.sdf 17 | *.opensdf 18 | *.VC.opendb 19 | *.suo 20 | *.user 21 | _ReSharper.Caches/ 22 | Win32-Debug/ 23 | Win32-Release/ 24 | x64-Debug/ 25 | x64-Release/ 26 | 27 | # VSCode files 28 | .cache/ 29 | cmake-variants.yaml 30 | 31 | # Ignore autoconf / automake files 32 | Makefile.in 33 | aclocal.m4 34 | configure 35 | build-aux/ 36 | autom4te.cache/ 37 | googletest/m4/libtool.m4 38 | googletest/m4/ltoptions.m4 39 | googletest/m4/ltsugar.m4 40 | googletest/m4/ltversion.m4 41 | googletest/m4/lt~obsolete.m4 42 | googlemock/m4 43 | 44 | # Ignore generated directories. 45 | googlemock/fused-src/ 46 | googletest/fused-src/ 47 | 48 | # macOS files 49 | .DS_Store 50 | googletest/.DS_Store 51 | googletest/xcode/.DS_Store 52 | 53 | # Ignore cmake generated directories and files. 54 | CMakeFiles 55 | CTestTestfile.cmake 56 | Makefile 57 | cmake_install.cmake 58 | googlemock/CMakeFiles 59 | googlemock/CTestTestfile.cmake 60 | googlemock/Makefile 61 | googlemock/cmake_install.cmake 62 | googlemock/gtest 63 | /bin 64 | /googlemock/gmock.dir 65 | /googlemock/gmock_main.dir 66 | /googlemock/RUN_TESTS.vcxproj.filters 67 | /googlemock/RUN_TESTS.vcxproj 68 | /googlemock/INSTALL.vcxproj.filters 69 | /googlemock/INSTALL.vcxproj 70 | /googlemock/gmock_main.vcxproj.filters 71 | /googlemock/gmock_main.vcxproj 72 | /googlemock/gmock.vcxproj.filters 73 | /googlemock/gmock.vcxproj 74 | /googlemock/gmock.sln 75 | /googlemock/ALL_BUILD.vcxproj.filters 76 | /googlemock/ALL_BUILD.vcxproj 77 | /lib 78 | /Win32 79 | /ZERO_CHECK.vcxproj.filters 80 | /ZERO_CHECK.vcxproj 81 | /RUN_TESTS.vcxproj.filters 82 | /RUN_TESTS.vcxproj 83 | /INSTALL.vcxproj.filters 84 | /INSTALL.vcxproj 85 | /googletest-distribution.sln 86 | /CMakeCache.txt 87 | /ALL_BUILD.vcxproj.filters 88 | /ALL_BUILD.vcxproj 89 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Note: CMake support is community-based. The maintainers do not use CMake 2 | # internally. 3 | 4 | cmake_minimum_required(VERSION 3.13) 5 | 6 | project(googletest-distribution) 7 | set(GOOGLETEST_VERSION 1.14.0) 8 | 9 | if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX) 10 | set(CMAKE_CXX_EXTENSIONS OFF) 11 | endif() 12 | 13 | enable_testing() 14 | 15 | include(CMakeDependentOption) 16 | include(GNUInstallDirs) 17 | 18 | #Note that googlemock target already builds googletest 19 | option(BUILD_GMOCK "Builds the googlemock subproject" ON) 20 | option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON) 21 | option(GTEST_HAS_ABSL "Use Abseil and RE2. Requires Abseil and RE2 to be separately added to the build." OFF) 22 | 23 | if(BUILD_GMOCK) 24 | add_subdirectory( googlemock ) 25 | else() 26 | add_subdirectory( googletest ) 27 | endif() 28 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This file contains a list of people who've made non-trivial 2 | # contribution to the Google C++ Testing Framework project. People 3 | # who commit code to the project are encouraged to add their names 4 | # here. Please keep the list sorted by first names. 5 | 6 | Ajay Joshi 7 | Balázs Dán 8 | Benoit Sigoure 9 | Bharat Mediratta 10 | Bogdan Piloca 11 | Chandler Carruth 12 | Chris Prince 13 | Chris Taylor 14 | Dan Egnor 15 | Dave MacLachlan 16 | David Anderson 17 | Dean Sturtevant 18 | Eric Roman 19 | Gene Volovich 20 | Hady Zalek 21 | Hal Burch 22 | Jeffrey Yasskin 23 | Jim Keller 24 | Joe Walnes 25 | Jon Wray 26 | Jói Sigurðsson 27 | Keir Mierle 28 | Keith Ray 29 | Kenton Varda 30 | Kostya Serebryany 31 | Krystian Kuzniarek 32 | Lev Makhlis 33 | Manuel Klimek 34 | Mario Tanev 35 | Mark Paskin 36 | Markus Heule 37 | Martijn Vels 38 | Matthew Simmons 39 | Mika Raento 40 | Mike Bland 41 | Miklós Fazekas 42 | Neal Norwitz 43 | Nermin Ozkiranartli 44 | Owen Carlsen 45 | Paneendra Ba 46 | Pasi Valminen 47 | Patrick Hanna 48 | Patrick Riley 49 | Paul Menage 50 | Peter Kaminski 51 | Piotr Kaminski 52 | Preston Jackson 53 | Rainer Klaffenboeck 54 | Russ Cox 55 | Russ Rufer 56 | Sean Mcafee 57 | Sigurður Ásgeirsson 58 | Sverre Sundsdal 59 | Szymon Sobik 60 | Takeshi Yoshino 61 | Tracy Bialik 62 | Vadim Berman 63 | Vlad Losev 64 | Wolfgang Klier 65 | Zhanyong Wan 66 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/WORKSPACE: -------------------------------------------------------------------------------- 1 | workspace(name = "com_google_googletest") 2 | 3 | load("//:googletest_deps.bzl", "googletest_deps") 4 | googletest_deps() 5 | 6 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 7 | 8 | http_archive( 9 | name = "rules_python", # 2023-07-31T20:39:27Z 10 | sha256 = "1250b59a33c591a1c4ba68c62e95fc88a84c334ec35a2e23f46cbc1b9a5a8b55", 11 | strip_prefix = "rules_python-e355becc30275939d87116a4ec83dad4bb50d9e1", 12 | urls = ["https://github.com/bazelbuild/rules_python/archive/e355becc30275939d87116a4ec83dad4bb50d9e1.zip"], 13 | ) 14 | 15 | http_archive( 16 | name = "bazel_skylib", # 2023-05-31T19:24:07Z 17 | sha256 = "08c0386f45821ce246bbbf77503c973246ed6ee5c3463e41efc197fa9bc3a7f4", 18 | strip_prefix = "bazel-skylib-288731ef9f7f688932bd50e704a91a45ec185f9b", 19 | urls = ["https://github.com/bazelbuild/bazel-skylib/archive/288731ef9f7f688932bd50e704a91a45ec185f9b.zip"], 20 | ) 21 | 22 | http_archive( 23 | name = "platforms", # 2023-07-28T19:44:27Z 24 | sha256 = "40eb313613ff00a5c03eed20aba58890046f4d38dec7344f00bb9a8867853526", 25 | strip_prefix = "platforms-4ad40ef271da8176d4fc0194d2089b8a76e19d7b", 26 | urls = ["https://github.com/bazelbuild/platforms/archive/4ad40ef271da8176d4fc0194d2089b8a76e19d7b.zip"], 27 | ) 28 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/ci/windows-presubmit.bat: -------------------------------------------------------------------------------- 1 | SETLOCAL ENABLEDELAYEDEXPANSION 2 | 3 | SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-5.1.1-windows-x86_64.exe 4 | 5 | SET PATH=C:\Python34;%PATH% 6 | SET BAZEL_PYTHON=C:\python34\python.exe 7 | SET BAZEL_SH=C:\tools\msys64\usr\bin\bash.exe 8 | SET CMAKE_BIN="cmake.exe" 9 | SET CTEST_BIN="ctest.exe" 10 | SET CTEST_OUTPUT_ON_FAILURE=1 11 | SET CMAKE_BUILD_PARALLEL_LEVEL=16 12 | SET CTEST_PARALLEL_LEVEL=16 13 | 14 | IF EXIST git\googletest ( 15 | CD git\googletest 16 | ) ELSE IF EXIST github\googletest ( 17 | CD github\googletest 18 | ) 19 | 20 | IF %errorlevel% neq 0 EXIT /B 1 21 | 22 | :: ---------------------------------------------------------------------------- 23 | :: CMake 24 | MKDIR cmake_msvc2022 25 | CD cmake_msvc2022 26 | 27 | %CMAKE_BIN% .. ^ 28 | -G "Visual Studio 17 2022" ^ 29 | -DPYTHON_EXECUTABLE:FILEPATH=c:\python37\python.exe ^ 30 | -DPYTHON_INCLUDE_DIR:PATH=c:\python37\include ^ 31 | -DPYTHON_LIBRARY:FILEPATH=c:\python37\lib\site-packages\pip ^ 32 | -Dgtest_build_samples=ON ^ 33 | -Dgtest_build_tests=ON ^ 34 | -Dgmock_build_tests=ON 35 | IF %errorlevel% neq 0 EXIT /B 1 36 | 37 | %CMAKE_BIN% --build . --target ALL_BUILD --config Debug -- -maxcpucount 38 | IF %errorlevel% neq 0 EXIT /B 1 39 | 40 | %CTEST_BIN% -C Debug --timeout 600 41 | IF %errorlevel% neq 0 EXIT /B 1 42 | 43 | CD .. 44 | RMDIR /S /Q cmake_msvc2022 45 | 46 | :: ---------------------------------------------------------------------------- 47 | :: Bazel 48 | 49 | SET BAZEL_VS=C:\Program Files\Microsoft Visual Studio\2022\Community 50 | %BAZEL_EXE% test ... ^ 51 | --compilation_mode=dbg ^ 52 | --copt=/std:c++14 ^ 53 | --copt=/WX ^ 54 | --features=external_include_paths ^ 55 | --keep_going ^ 56 | --test_output=errors ^ 57 | --test_tag_filters=-no_test_msvc2017 58 | IF %errorlevel% neq 0 EXIT /B 1 59 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/docs/_config.yml: -------------------------------------------------------------------------------- 1 | title: GoogleTest 2 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/docs/_data/navigation.yml: -------------------------------------------------------------------------------- 1 | nav: 2 | - section: "Get Started" 3 | items: 4 | - title: "Supported Platforms" 5 | url: "/platforms.html" 6 | - title: "Quickstart: Bazel" 7 | url: "/quickstart-bazel.html" 8 | - title: "Quickstart: CMake" 9 | url: "/quickstart-cmake.html" 10 | - section: "Guides" 11 | items: 12 | - title: "GoogleTest Primer" 13 | url: "/primer.html" 14 | - title: "Advanced Topics" 15 | url: "/advanced.html" 16 | - title: "Mocking for Dummies" 17 | url: "/gmock_for_dummies.html" 18 | - title: "Mocking Cookbook" 19 | url: "/gmock_cook_book.html" 20 | - title: "Mocking Cheat Sheet" 21 | url: "/gmock_cheat_sheet.html" 22 | - section: "References" 23 | items: 24 | - title: "Testing Reference" 25 | url: "/reference/testing.html" 26 | - title: "Mocking Reference" 27 | url: "/reference/mocking.html" 28 | - title: "Assertions" 29 | url: "/reference/assertions.html" 30 | - title: "Matchers" 31 | url: "/reference/matchers.html" 32 | - title: "Actions" 33 | url: "/reference/actions.html" 34 | - title: "Testing FAQ" 35 | url: "/faq.html" 36 | - title: "Mocking FAQ" 37 | url: "/gmock_faq.html" 38 | - title: "Code Samples" 39 | url: "/samples.html" 40 | - title: "Using pkg-config" 41 | url: "/pkgconfig.html" 42 | - title: "Community Documentation" 43 | url: "/community_created_documentation.html" 44 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/docs/_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {% seo %} 9 | 10 | 18 | 19 | 20 | 21 | 44 |
45 |
46 | {{ content }} 47 |
48 | 54 |
55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/docs/assets/css/style.scss: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | @import "jekyll-theme-primer"; 5 | @import "main"; 6 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/docs/community_created_documentation.md: -------------------------------------------------------------------------------- 1 | # Community-Created Documentation 2 | 3 | The following is a list, in no particular order, of links to documentation 4 | created by the Googletest community. 5 | 6 | * [Googlemock Insights](https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/blob/master/googletest/insights.md), 7 | by [ElectricRCAircraftGuy](https://github.com/ElectricRCAircraftGuy) 8 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/docs/index.md: -------------------------------------------------------------------------------- 1 | # GoogleTest User's Guide 2 | 3 | ## Welcome to GoogleTest! 4 | 5 | GoogleTest is Google's C++ testing and mocking framework. This user's guide has 6 | the following contents: 7 | 8 | * [GoogleTest Primer](primer.md) - Teaches you how to write simple tests using 9 | GoogleTest. Read this first if you are new to GoogleTest. 10 | * [GoogleTest Advanced](advanced.md) - Read this when you've finished the 11 | Primer and want to utilize GoogleTest to its full potential. 12 | * [GoogleTest Samples](samples.md) - Describes some GoogleTest samples. 13 | * [GoogleTest FAQ](faq.md) - Have a question? Want some tips? Check here 14 | first. 15 | * [Mocking for Dummies](gmock_for_dummies.md) - Teaches you how to create mock 16 | objects and use them in tests. 17 | * [Mocking Cookbook](gmock_cook_book.md) - Includes tips and approaches to 18 | common mocking use cases. 19 | * [Mocking Cheat Sheet](gmock_cheat_sheet.md) - A handy reference for 20 | matchers, actions, invariants, and more. 21 | * [Mocking FAQ](gmock_faq.md) - Contains answers to some mocking-specific 22 | questions. 23 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/docs/platforms.md: -------------------------------------------------------------------------------- 1 | # Supported Platforms 2 | 3 | GoogleTest follows Google's 4 | [Foundational C++ Support Policy](https://opensource.google/documentation/policies/cplusplus-support). 5 | See 6 | [this table](https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md) 7 | for a list of currently supported versions compilers, platforms, and build 8 | tools. 9 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/docs/samples.md: -------------------------------------------------------------------------------- 1 | # Googletest Samples 2 | 3 | If you're like us, you'd like to look at 4 | [googletest samples.](https://github.com/google/googletest/blob/main/googletest/samples) 5 | The sample directory has a number of well-commented samples showing how to use a 6 | variety of googletest features. 7 | 8 | * Sample #1 shows the basic steps of using googletest to test C++ functions. 9 | * Sample #2 shows a more complex unit test for a class with multiple member 10 | functions. 11 | * Sample #3 uses a test fixture. 12 | * Sample #4 teaches you how to use googletest and `googletest.h` together to 13 | get the best of both libraries. 14 | * Sample #5 puts shared testing logic in a base test fixture, and reuses it in 15 | derived fixtures. 16 | * Sample #6 demonstrates type-parameterized tests. 17 | * Sample #7 teaches the basics of value-parameterized tests. 18 | * Sample #8 shows using `Combine()` in value-parameterized tests. 19 | * Sample #9 shows use of the listener API to modify Google Test's console 20 | output and the use of its reflection API to inspect test results. 21 | * Sample #10 shows use of the listener API to implement a primitive memory 22 | leak checker. 23 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googlemock/README.md: -------------------------------------------------------------------------------- 1 | # Googletest Mocking (gMock) Framework 2 | 3 | ### Overview 4 | 5 | Google's framework for writing and using C++ mock classes. It can help you 6 | derive better designs of your system and write better tests. 7 | 8 | It is inspired by: 9 | 10 | * [jMock](http://www.jmock.org/) 11 | * [EasyMock](http://www.easymock.org/) 12 | * [Hamcrest](http://code.google.com/p/hamcrest/) 13 | 14 | It is designed with C++'s specifics in mind. 15 | 16 | gMock: 17 | 18 | - Provides a declarative syntax for defining mocks. 19 | - Can define partial (hybrid) mocks, which are a cross of real and mock 20 | objects. 21 | - Handles functions of arbitrary types and overloaded functions. 22 | - Comes with a rich set of matchers for validating function arguments. 23 | - Uses an intuitive syntax for controlling the behavior of a mock. 24 | - Does automatic verification of expectations (no record-and-replay needed). 25 | - Allows arbitrary (partial) ordering constraints on function calls to be 26 | expressed. 27 | - Lets a user extend it by defining new matchers and actions. 28 | - Does not use exceptions. 29 | - Is easy to learn and use. 30 | 31 | Details and examples can be found here: 32 | 33 | * [gMock for Dummies](https://google.github.io/googletest/gmock_for_dummies.html) 34 | * [Legacy gMock FAQ](https://google.github.io/googletest/gmock_faq.html) 35 | * [gMock Cookbook](https://google.github.io/googletest/gmock_cook_book.html) 36 | * [gMock Cheat Sheet](https://google.github.io/googletest/gmock_cheat_sheet.html) 37 | 38 | GoogleMock is a part of 39 | [GoogleTest C++ testing framework](http://github.com/google/googletest/) and a 40 | subject to the same requirements. 41 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googlemock/cmake/gmock.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gmock 5 | Description: GoogleMock (without main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Requires: gtest = @PROJECT_VERSION@ 9 | Libs: -L${libdir} -lgmock @CMAKE_THREAD_LIBS_INIT@ 10 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 11 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googlemock/cmake/gmock_main.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gmock_main 5 | Description: GoogleMock (with main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Requires: gmock = @PROJECT_VERSION@ 9 | Libs: -L${libdir} -lgmock_main @CMAKE_THREAD_LIBS_INIT@ 10 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 11 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googlemock/docs/README.md: -------------------------------------------------------------------------------- 1 | # Content Moved 2 | 3 | We are working on updates to the GoogleTest documentation, which has moved to 4 | the top-level [docs](../../docs) directory. 5 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googlemock/include/gmock/internal/custom/README.md: -------------------------------------------------------------------------------- 1 | # Customization Points 2 | 3 | The custom directory is an injection point for custom user configurations. 4 | 5 | ## Header `gmock-port.h` 6 | 7 | The following macros can be defined: 8 | 9 | ### Flag related macros: 10 | 11 | * `GMOCK_DECLARE_bool_(name)` 12 | * `GMOCK_DECLARE_int32_(name)` 13 | * `GMOCK_DECLARE_string_(name)` 14 | * `GMOCK_DEFINE_bool_(name, default_val, doc)` 15 | * `GMOCK_DEFINE_int32_(name, default_val, doc)` 16 | * `GMOCK_DEFINE_string_(name, default_val, doc)` 17 | * `GMOCK_FLAG_GET(flag_name)` 18 | * `GMOCK_FLAG_SET(flag_name, value)` 19 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googlemock/include/gmock/internal/custom/gmock-generated-actions.h: -------------------------------------------------------------------------------- 1 | // IWYU pragma: private, include "gmock/gmock.h" 2 | // IWYU pragma: friend gmock/.* 3 | 4 | #ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 5 | #define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 6 | 7 | #endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 8 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googlemock/include/gmock/internal/custom/gmock-matchers.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Injection point for custom user configurations. See README for details 31 | 32 | // IWYU pragma: private, include "gmock/gmock.h" 33 | // IWYU pragma: friend gmock/.* 34 | 35 | #ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_ 36 | #define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_ 37 | #endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_ 38 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googlemock/include/gmock/internal/custom/gmock-port.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Injection point for custom user configurations. See README for details 31 | // 32 | // ** Custom implementation starts here ** 33 | 34 | // IWYU pragma: private, include "gmock/gmock.h" 35 | // IWYU pragma: friend gmock/.* 36 | 37 | #ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_ 38 | #define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_ 39 | 40 | #endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_ 41 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googlemock/src/gmock-all.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // 31 | // Google C++ Mocking Framework (Google Mock) 32 | // 33 | // This file #includes all Google Mock implementation .cc files. The 34 | // purpose is to allow a user to build Google Mock by compiling this 35 | // file alone. 36 | 37 | // This line ensures that gmock.h can be compiled on its own, even 38 | // when it's fused. 39 | #include "gmock/gmock.h" 40 | 41 | // The following lines pull in the real gmock *.cc files. 42 | #include "src/gmock-cardinalities.cc" 43 | #include "src/gmock-internal-utils.cc" 44 | #include "src/gmock-matchers.cc" 45 | #include "src/gmock-spec-builders.cc" 46 | #include "src/gmock.cc" 47 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googlemock/test/gmock-port_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Google Mock - a framework for writing C++ mock classes. 31 | // 32 | // This file tests the internal cross-platform support utilities. 33 | 34 | #include "gmock/internal/gmock-port.h" 35 | 36 | #include "gtest/gtest.h" 37 | 38 | // NOTE: if this file is left without tests for some reason, put a dummy 39 | // test here to make references to symbols in the gtest library and avoid 40 | // 'undefined symbol' linker errors in gmock_main: 41 | 42 | TEST(DummyTest, Dummy) {} 43 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googlemock/test/gmock_all_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // 31 | // Tests for Google C++ Mocking Framework (Google Mock) 32 | // 33 | // Some users use a build system that Google Mock doesn't support directly, 34 | // yet they still want to build and run Google Mock's own tests. This file 35 | // includes most such tests, making it easier for these users to maintain 36 | // their build scripts (they just need to build this file, even though the 37 | // below list of actual *_test.cc files might change). 38 | #include "test/gmock-actions_test.cc" 39 | #include "test/gmock-cardinalities_test.cc" 40 | #include "test/gmock-internal-utils_test.cc" 41 | #include "test/gmock-matchers-arithmetic_test.cc" 42 | #include "test/gmock-matchers-comparisons_test.cc" 43 | #include "test/gmock-matchers-containers_test.cc" 44 | #include "test/gmock-matchers-misc_test.cc" 45 | #include "test/gmock-more-actions_test.cc" 46 | #include "test/gmock-nice-strict_test.cc" 47 | #include "test/gmock-port_test.cc" 48 | #include "test/gmock-spec-builders_test.cc" 49 | #include "test/gmock_test.cc" 50 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googlemock/test/gmock_link2_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Google Mock - a framework for writing C++ mock classes. 31 | // 32 | // This file is for verifying that various Google Mock constructs do not 33 | // produce linker errors when instantiated in different translation units. 34 | // Please see gmock_link_test.h for details. 35 | 36 | #define LinkTest LinkTest2 37 | 38 | #include "test/gmock_link_test.h" 39 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googlemock/test/gmock_link_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Google Mock - a framework for writing C++ mock classes. 31 | // 32 | // This file is for verifying that various Google Mock constructs do not 33 | // produce linker errors when instantiated in different translation units. 34 | // Please see gmock_link_test.h for details. 35 | 36 | #define LinkTest LinkTest1 37 | 38 | #include "test/gmock_link_test.h" 39 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/cmake/Config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | include(CMakeFindDependencyMacro) 3 | if (@GTEST_HAS_PTHREAD@) 4 | set(THREADS_PREFER_PTHREAD_FLAG @THREADS_PREFER_PTHREAD_FLAG@) 5 | find_dependency(Threads) 6 | endif() 7 | 8 | include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake") 9 | check_required_components("@project_name@") 10 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/cmake/gtest.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gtest 5 | Description: GoogleTest (without main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Libs: -L${libdir} -lgtest @CMAKE_THREAD_LIBS_INIT@ 9 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 10 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/cmake/gtest_main.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gtest_main 5 | Description: GoogleTest (with main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Requires: gtest = @PROJECT_VERSION@ 9 | Libs: -L${libdir} -lgtest_main @CMAKE_THREAD_LIBS_INIT@ 10 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 11 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/cmake/libgtest.la.in: -------------------------------------------------------------------------------- 1 | # libgtest.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.6 3 | 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Names of this library. 8 | library_names='libgtest.so' 9 | 10 | # Is this an already installed library? 11 | installed=yes 12 | 13 | # Should we warn about portability when linking against -modules? 14 | shouldnotlink=no 15 | 16 | # Files to dlopen/dlpreopen 17 | dlopen='' 18 | dlpreopen='' 19 | 20 | # Directory that this library needs to be installed in: 21 | libdir='@CMAKE_INSTALL_FULL_LIBDIR@' 22 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/docs/README.md: -------------------------------------------------------------------------------- 1 | # Content Moved 2 | 3 | We are working on updates to the GoogleTest documentation, which has moved to 4 | the top-level [docs](../../docs) directory. 5 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/include/gtest/gtest_prod.h: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Google C++ Testing and Mocking Framework definitions useful in production 31 | // code. 32 | 33 | #ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_PROD_H_ 34 | #define GOOGLETEST_INCLUDE_GTEST_GTEST_PROD_H_ 35 | 36 | // When you need to test the private or protected members of a class, 37 | // use the FRIEND_TEST macro to declare your tests as friends of the 38 | // class. For example: 39 | // 40 | // class MyClass { 41 | // private: 42 | // void PrivateMethod(); 43 | // FRIEND_TEST(MyClassTest, PrivateMethodWorks); 44 | // }; 45 | // 46 | // class MyClassTest : public testing::Test { 47 | // // ... 48 | // }; 49 | // 50 | // TEST_F(MyClassTest, PrivateMethodWorks) { 51 | // // Can call MyClass::PrivateMethod() here. 52 | // } 53 | // 54 | // Note: The test class must be in the same namespace as the class being tested. 55 | // For example, putting MyClassTest in an anonymous namespace will not work. 56 | 57 | #define FRIEND_TEST(test_case_name, test_name) \ 58 | friend class test_case_name##_##test_name##_Test 59 | 60 | #endif // GOOGLETEST_INCLUDE_GTEST_GTEST_PROD_H_ 61 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/include/gtest/internal/custom/README.md: -------------------------------------------------------------------------------- 1 | # Customization Points 2 | 3 | The custom directory is an injection point for custom user configurations. 4 | 5 | ## Header `gtest.h` 6 | 7 | ### The following macros can be defined: 8 | 9 | * `GTEST_OS_STACK_TRACE_GETTER_` - The name of an implementation of 10 | `OsStackTraceGetterInterface`. 11 | * `GTEST_CUSTOM_TEMPDIR_FUNCTION_` - An override for `testing::TempDir()`. See 12 | `testing::TempDir` for semantics and signature. 13 | 14 | ## Header `gtest-port.h` 15 | 16 | The following macros can be defined: 17 | 18 | ### Logging: 19 | 20 | * `GTEST_LOG_(severity)` 21 | * `GTEST_CHECK_(condition)` 22 | * Functions `LogToStderr()` and `FlushInfoLog()` have to be provided too. 23 | 24 | ### Threading: 25 | 26 | * `GTEST_HAS_NOTIFICATION_` - Enabled if Notification is already provided. 27 | * `GTEST_HAS_MUTEX_AND_THREAD_LOCAL_` - Enabled if `Mutex` and `ThreadLocal` 28 | are already provided. Must also provide `GTEST_DECLARE_STATIC_MUTEX_(mutex)` 29 | and `GTEST_DEFINE_STATIC_MUTEX_(mutex)` 30 | * `GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)` 31 | * `GTEST_LOCK_EXCLUDED_(locks)` 32 | 33 | ### Underlying library support features 34 | 35 | * `GTEST_HAS_CXXABI_H_` 36 | 37 | ### Exporting API symbols: 38 | 39 | * `GTEST_API_` - Specifier for exported symbols. 40 | 41 | ## Header `gtest-printers.h` 42 | 43 | * See documentation at `gtest/gtest-printers.h` for details on how to define a 44 | custom printer. 45 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/include/gtest/internal/custom/gtest-port.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Injection point for custom user configurations. See README for details 31 | // 32 | // ** Custom implementation starts here ** 33 | 34 | #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ 35 | #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ 36 | 37 | #endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ 38 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/include/gtest/internal/custom/gtest-printers.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // This file provides an injection point for custom printers in a local 31 | // installation of gTest. 32 | // It will be included from gtest-printers.h and the overrides in this file 33 | // will be visible to everyone. 34 | // 35 | // Injection point for custom user configurations. See README for details 36 | // 37 | // ** Custom implementation starts here ** 38 | 39 | #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ 40 | #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ 41 | 42 | #endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ 43 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/include/gtest/internal/custom/gtest.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Injection point for custom user configurations. See README for details 31 | // 32 | // ** Custom implementation starts here ** 33 | 34 | #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 35 | #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 36 | 37 | #endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 38 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/samples/sample1.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | 32 | #include "sample1.h" 33 | 34 | // Returns n! (the factorial of n). For negative n, n! is defined to be 1. 35 | int Factorial(int n) { 36 | int result = 1; 37 | for (int i = 1; i <= n; i++) { 38 | result *= i; 39 | } 40 | 41 | return result; 42 | } 43 | 44 | // Returns true if and only if n is a prime number. 45 | bool IsPrime(int n) { 46 | // Trivial case 1: small numbers 47 | if (n <= 1) return false; 48 | 49 | // Trivial case 2: even numbers 50 | if (n % 2 == 0) return n == 2; 51 | 52 | // Now, we have that n is odd and n >= 3. 53 | 54 | // Try to divide n by every odd number i, starting from 3 55 | for (int i = 3;; i += 2) { 56 | // We only have to try i up to the square root of n 57 | if (i > n / i) break; 58 | 59 | // Now, we have i <= n/i < n. 60 | // If n is divisible by i, n is not prime. 61 | if (n % i == 0) return false; 62 | } 63 | 64 | // n has no integer factor in the range (1, n), and thus is prime. 65 | return true; 66 | } 67 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/samples/sample1.h: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | 32 | #ifndef GOOGLETEST_SAMPLES_SAMPLE1_H_ 33 | #define GOOGLETEST_SAMPLES_SAMPLE1_H_ 34 | 35 | // Returns n! (the factorial of n). For negative n, n! is defined to be 1. 36 | int Factorial(int n); 37 | 38 | // Returns true if and only if n is a prime number. 39 | bool IsPrime(int n); 40 | 41 | #endif // GOOGLETEST_SAMPLES_SAMPLE1_H_ 42 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/samples/sample2.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | 32 | #include "sample2.h" 33 | 34 | #include 35 | 36 | // Clones a 0-terminated C string, allocating memory using new. 37 | const char* MyString::CloneCString(const char* a_c_string) { 38 | if (a_c_string == nullptr) return nullptr; 39 | 40 | const size_t len = strlen(a_c_string); 41 | char* const clone = new char[len + 1]; 42 | memcpy(clone, a_c_string, len + 1); 43 | 44 | return clone; 45 | } 46 | 47 | // Sets the 0-terminated C string this MyString object 48 | // represents. 49 | void MyString::Set(const char* a_c_string) { 50 | // Makes sure this works when c_string == c_string_ 51 | const char* const temp = MyString::CloneCString(a_c_string); 52 | delete[] c_string_; 53 | c_string_ = temp; 54 | } 55 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/samples/sample4.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | 32 | #include "sample4.h" 33 | 34 | #include 35 | 36 | // Returns the current counter value, and increments it. 37 | int Counter::Increment() { return counter_++; } 38 | 39 | // Returns the current counter value, and decrements it. 40 | // counter can not be less than 0, return 0 in this case 41 | int Counter::Decrement() { 42 | if (counter_ == 0) { 43 | return counter_; 44 | } else { 45 | return counter_--; 46 | } 47 | } 48 | 49 | // Prints the current counter value to STDOUT. 50 | void Counter::Print() const { printf("%d", counter_); } 51 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/samples/sample4.h: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | #ifndef GOOGLETEST_SAMPLES_SAMPLE4_H_ 32 | #define GOOGLETEST_SAMPLES_SAMPLE4_H_ 33 | 34 | // A simple monotonic counter. 35 | class Counter { 36 | private: 37 | int counter_; 38 | 39 | public: 40 | // Creates a counter that starts at 0. 41 | Counter() : counter_(0) {} 42 | 43 | // Returns the current counter value, and increments it. 44 | int Increment(); 45 | 46 | // Returns the current counter value, and decrements it. 47 | int Decrement(); 48 | 49 | // Prints the current counter value to STDOUT. 50 | void Print() const; 51 | }; 52 | 53 | #endif // GOOGLETEST_SAMPLES_SAMPLE4_H_ 54 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/samples/sample4_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include "sample4.h" 31 | 32 | #include "gtest/gtest.h" 33 | 34 | namespace { 35 | // Tests the Increment() method. 36 | 37 | TEST(Counter, Increment) { 38 | Counter c; 39 | 40 | // Test that counter 0 returns 0 41 | EXPECT_EQ(0, c.Decrement()); 42 | 43 | // EXPECT_EQ() evaluates its arguments exactly once, so they 44 | // can have side effects. 45 | 46 | EXPECT_EQ(0, c.Increment()); 47 | EXPECT_EQ(1, c.Increment()); 48 | EXPECT_EQ(2, c.Increment()); 49 | 50 | EXPECT_EQ(3, c.Decrement()); 51 | } 52 | 53 | } // namespace 54 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/src/gtest-all.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // 31 | // Google C++ Testing and Mocking Framework (Google Test) 32 | // 33 | // Sometimes it's desirable to build Google Test by compiling a single file. 34 | // This file serves this purpose. 35 | 36 | // This line ensures that gtest.h can be compiled on its own, even 37 | // when it's fused. 38 | #include "gtest/gtest.h" 39 | 40 | // The following lines pull in the real gtest *.cc files. 41 | #include "src/gtest-assertion-result.cc" 42 | #include "src/gtest-death-test.cc" 43 | #include "src/gtest-filepath.cc" 44 | #include "src/gtest-matchers.cc" 45 | #include "src/gtest-port.cc" 46 | #include "src/gtest-printers.cc" 47 | #include "src/gtest-test-part.cc" 48 | #include "src/gtest-typed-test.cc" 49 | #include "src/gtest.cc" 50 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/src/gtest_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include 31 | 32 | #include "gtest/gtest.h" 33 | 34 | #if defined(GTEST_OS_ESP8266) || defined(GTEST_OS_ESP32) || \ 35 | (defined(GTEST_OS_NRF52) && defined(ARDUINO)) 36 | // Arduino-like platforms: program entry points are setup/loop instead of main. 37 | 38 | #ifdef GTEST_OS_ESP8266 39 | extern "C" { 40 | #endif 41 | 42 | void setup() { testing::InitGoogleTest(); } 43 | 44 | void loop() { RUN_ALL_TESTS(); } 45 | 46 | #ifdef GTEST_OS_ESP8266 47 | } 48 | #endif 49 | 50 | #elif defined(GTEST_OS_QURT) 51 | // QuRT: program entry point is main, but argc/argv are unusable. 52 | 53 | GTEST_API_ int main() { 54 | printf("Running main() from %s\n", __FILE__); 55 | testing::InitGoogleTest(); 56 | return RUN_ALL_TESTS(); 57 | } 58 | #else 59 | // Normal platforms: program entry point is main, argc/argv are initialized. 60 | 61 | GTEST_API_ int main(int argc, char **argv) { 62 | printf("Running main() from %s\n", __FILE__); 63 | testing::InitGoogleTest(&argc, argv); 64 | return RUN_ALL_TESTS(); 65 | } 66 | #endif 67 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/googletest-color-test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A helper program for testing how Google Test determines whether to use 31 | // colors in the output. It prints "YES" and returns 1 if Google Test 32 | // decides to use colors, and prints "NO" and returns 0 otherwise. 33 | 34 | #include 35 | 36 | #include "gtest/gtest.h" 37 | #include "src/gtest-internal-inl.h" 38 | 39 | using testing::internal::ShouldUseColor; 40 | 41 | // The purpose of this is to ensure that the UnitTest singleton is 42 | // created before main() is entered, and thus that ShouldUseColor() 43 | // works the same way as in a real Google-Test-based test. We don't actual 44 | // run the TEST itself. 45 | TEST(GTestColorTest, Dummy) {} 46 | 47 | int main(int argc, char** argv) { 48 | testing::InitGoogleTest(&argc, argv); 49 | 50 | if (ShouldUseColor(true)) { 51 | // Google Test decides to use colors in the output (assuming it 52 | // goes to a TTY). 53 | printf("YES\n"); 54 | return 1; 55 | } else { 56 | // Google Test decides not to use colors in the output. 57 | printf("NO\n"); 58 | return 0; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/googletest-global-environment-unittest_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Unit test for Google Test global test environments. 31 | // 32 | // The program will be invoked from a Python unit test. Don't run it 33 | // directly. 34 | 35 | #include "gtest/gtest.h" 36 | 37 | namespace { 38 | 39 | // An environment that always fails in its SetUp method. 40 | class FailingEnvironment final : public ::testing::Environment { 41 | public: 42 | void SetUp() override { FAIL() << "Canned environment setup error"; } 43 | }; 44 | 45 | // Register the environment. 46 | auto* const g_environment_ = 47 | ::testing::AddGlobalTestEnvironment(new FailingEnvironment); 48 | 49 | // A test that doesn't actually run. 50 | TEST(SomeTest, DoesFoo) { FAIL() << "Unexpected call"; } 51 | 52 | } // namespace 53 | 54 | int main(int argc, char** argv) { 55 | ::testing::InitGoogleTest(&argc, argv); 56 | 57 | return RUN_ALL_TESTS(); 58 | } 59 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/googletest-param-test-invalid-name1-test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2015 Google Inc. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are 7 | # met: 8 | # 9 | # * Redistributions of source code must retain the above copyright 10 | # notice, this list of conditions and the following disclaimer. 11 | # * Redistributions in binary form must reproduce the above 12 | # copyright notice, this list of conditions and the following disclaimer 13 | # in the documentation and/or other materials provided with the 14 | # distribution. 15 | # * Neither the name of Google Inc. nor the names of its 16 | # contributors may be used to endorse or promote products derived from 17 | # this software without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | """Verifies that Google Test warns the user when not initialized properly.""" 32 | 33 | from googletest.test import gtest_test_utils 34 | 35 | binary_name = 'googletest-param-test-invalid-name1-test_' 36 | COMMAND = gtest_test_utils.GetTestExecutablePath(binary_name) 37 | 38 | 39 | def Assert(condition): 40 | if not condition: 41 | raise AssertionError 42 | 43 | 44 | def TestExitCodeAndOutput(command): 45 | """Runs the given command and verifies its exit code and output.""" 46 | 47 | err = 'Parameterized test name \'"InvalidWithQuotes"\' is invalid' 48 | 49 | p = gtest_test_utils.Subprocess(command) 50 | Assert(p.terminated_by_signal) 51 | 52 | # Verify the output message contains appropriate output 53 | Assert(err in p.output) 54 | 55 | 56 | class GTestParamTestInvalidName1Test(gtest_test_utils.TestCase): 57 | 58 | def testExitCodeAndOutput(self): 59 | TestExitCodeAndOutput(COMMAND) 60 | 61 | 62 | if __name__ == '__main__': 63 | gtest_test_utils.Main() 64 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/googletest-param-test-invalid-name1-test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include "gtest/gtest.h" 31 | 32 | namespace { 33 | class DummyTest : public ::testing::TestWithParam {}; 34 | 35 | TEST_P(DummyTest, Dummy) {} 36 | 37 | INSTANTIATE_TEST_SUITE_P(InvalidTestName, DummyTest, 38 | ::testing::Values("InvalidWithQuotes"), 39 | ::testing::PrintToStringParamName()); 40 | 41 | } // namespace 42 | 43 | int main(int argc, char *argv[]) { 44 | testing::InitGoogleTest(&argc, argv); 45 | return RUN_ALL_TESTS(); 46 | } 47 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/googletest-param-test-invalid-name2-test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2015 Google Inc. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are 7 | # met: 8 | # 9 | # * Redistributions of source code must retain the above copyright 10 | # notice, this list of conditions and the following disclaimer. 11 | # * Redistributions in binary form must reproduce the above 12 | # copyright notice, this list of conditions and the following disclaimer 13 | # in the documentation and/or other materials provided with the 14 | # distribution. 15 | # * Neither the name of Google Inc. nor the names of its 16 | # contributors may be used to endorse or promote products derived from 17 | # this software without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | """Verifies that Google Test warns the user when not initialized properly.""" 32 | 33 | from googletest.test import gtest_test_utils 34 | 35 | binary_name = 'googletest-param-test-invalid-name2-test_' 36 | COMMAND = gtest_test_utils.GetTestExecutablePath(binary_name) 37 | 38 | 39 | def Assert(condition): 40 | if not condition: 41 | raise AssertionError 42 | 43 | 44 | def TestExitCodeAndOutput(command): 45 | """Runs the given command and verifies its exit code and output.""" 46 | 47 | err = "Duplicate parameterized test name 'a'" 48 | 49 | p = gtest_test_utils.Subprocess(command) 50 | Assert(p.terminated_by_signal) 51 | 52 | # Check for appropriate output 53 | Assert(err in p.output) 54 | 55 | 56 | class GTestParamTestInvalidName2Test(gtest_test_utils.TestCase): 57 | 58 | def testExitCodeAndOutput(self): 59 | TestExitCodeAndOutput(COMMAND) 60 | 61 | 62 | if __name__ == '__main__': 63 | gtest_test_utils.Main() 64 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/googletest-param-test-invalid-name2-test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include 31 | 32 | #include "gtest/gtest.h" 33 | 34 | namespace { 35 | class DummyTest : public ::testing::TestWithParam {}; 36 | 37 | std::string StringParamTestSuffix( 38 | const testing::TestParamInfo &info) { 39 | return std::string(info.param); 40 | } 41 | 42 | TEST_P(DummyTest, Dummy) {} 43 | 44 | INSTANTIATE_TEST_SUITE_P(DuplicateTestNames, DummyTest, 45 | ::testing::Values("a", "b", "a", "c"), 46 | StringParamTestSuffix); 47 | } // namespace 48 | 49 | int main(int argc, char *argv[]) { 50 | testing::InitGoogleTest(&argc, argv); 51 | return RUN_ALL_TESTS(); 52 | } 53 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/googletest-param-test-test.h: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // The Google C++ Testing and Mocking Framework (Google Test) 31 | // 32 | // This header file provides classes and functions used internally 33 | // for testing Google Test itself. 34 | 35 | #ifndef GOOGLETEST_TEST_GOOGLETEST_PARAM_TEST_TEST_H_ 36 | #define GOOGLETEST_TEST_GOOGLETEST_PARAM_TEST_TEST_H_ 37 | 38 | #include "gtest/gtest.h" 39 | 40 | // Test fixture for testing definition and instantiation of a test 41 | // in separate translation units. 42 | class ExternalInstantiationTest : public ::testing::TestWithParam {}; 43 | 44 | // Test fixture for testing instantiation of a test in multiple 45 | // translation units. 46 | class InstantiationInMultipleTranslationUnitsTest 47 | : public ::testing::TestWithParam {}; 48 | 49 | #endif // GOOGLETEST_TEST_GOOGLETEST_PARAM_TEST_TEST_H_ 50 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/googletest-setuptestsuite-test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2019, Google Inc. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above 13 | # copyright notice, this list of conditions and the following disclaimer 14 | # in the documentation and/or other materials provided with the 15 | # distribution. 16 | # * Neither the name of Google Inc. nor the names of its 17 | # contributors may be used to endorse or promote products derived from 18 | # this software without specific prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | """Verifies that SetUpTestSuite and TearDownTestSuite errors are noticed.""" 33 | 34 | from googletest.test import gtest_test_utils 35 | 36 | COMMAND = gtest_test_utils.GetTestExecutablePath( 37 | 'googletest-setuptestsuite-test_' 38 | ) 39 | 40 | 41 | class GTestSetUpTestSuiteTest(gtest_test_utils.TestCase): 42 | 43 | def testSetupErrorAndTearDownError(self): 44 | p = gtest_test_utils.Subprocess(COMMAND) 45 | self.assertNotEqual(p.exit_code, 0, msg=p.output) 46 | 47 | self.assertIn( 48 | ( 49 | '[ FAILED ] SetupFailTest: SetUpTestSuite or TearDownTestSuite\n[' 50 | ' FAILED ] TearDownFailTest: SetUpTestSuite or' 51 | ' TearDownTestSuite\n\n 2 FAILED TEST SUITES\n' 52 | ), 53 | p.output, 54 | ) 55 | 56 | 57 | if __name__ == '__main__': 58 | gtest_test_utils.Main() 59 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/googletest-setuptestsuite-test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include "gtest/gtest.h" 31 | 32 | class SetupFailTest : public ::testing::Test { 33 | protected: 34 | static void SetUpTestSuite() { ASSERT_EQ("", "SET_UP_FAIL"); } 35 | }; 36 | 37 | TEST_F(SetupFailTest, NoopPassingTest) {} 38 | 39 | class TearDownFailTest : public ::testing::Test { 40 | protected: 41 | static void TearDownTestSuite() { ASSERT_EQ("", "TEAR_DOWN_FAIL"); } 42 | }; 43 | 44 | TEST_F(TearDownFailTest, NoopPassingTest) {} 45 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/googletest-uninitialized-test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2008, Google Inc. 4 | # All rights reserved. 5 | # 6 | # Redistribution and use in source and binary forms, with or without 7 | # modification, are permitted provided that the following conditions are 8 | # met: 9 | # 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above 13 | # copyright notice, this list of conditions and the following disclaimer 14 | # in the documentation and/or other materials provided with the 15 | # distribution. 16 | # * Neither the name of Google Inc. nor the names of its 17 | # contributors may be used to endorse or promote products derived from 18 | # this software without specific prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | """Verifies that Google Test warns the user when not initialized properly.""" 33 | 34 | from googletest.test import gtest_test_utils 35 | 36 | COMMAND = gtest_test_utils.GetTestExecutablePath( 37 | 'googletest-uninitialized-test_' 38 | ) 39 | 40 | 41 | def Assert(condition): 42 | if not condition: 43 | raise AssertionError 44 | 45 | 46 | def AssertEq(expected, actual): 47 | if expected != actual: 48 | print('Expected: %s' % (expected,)) 49 | print(' Actual: %s' % (actual,)) 50 | raise AssertionError 51 | 52 | 53 | def TestExitCodeAndOutput(command): 54 | """Runs the given command and verifies its exit code and output.""" 55 | 56 | # Verifies that 'command' exits with code 1. 57 | p = gtest_test_utils.Subprocess(command) 58 | if p.exited and p.exit_code == 0: 59 | Assert('IMPORTANT NOTICE' in p.output) 60 | Assert('InitGoogleTest' in p.output) 61 | 62 | 63 | class GTestUninitializedTest(gtest_test_utils.TestCase): 64 | 65 | def testExitCodeAndOutput(self): 66 | TestExitCodeAndOutput(COMMAND) 67 | 68 | 69 | if __name__ == '__main__': 70 | gtest_test_utils.Main() 71 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/googletest-uninitialized-test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include "gtest/gtest.h" 31 | 32 | TEST(DummyTest, Dummy) { 33 | // This test doesn't verify anything. We just need it to create a 34 | // realistic stage for testing the behavior of Google Test when 35 | // RUN_ALL_TESTS() is called without 36 | // testing::InitGoogleTest() being called first. 37 | } 38 | 39 | int main() { return RUN_ALL_TESTS(); } 40 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/gtest-typed-test2_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Google Inc. 2 | // All Rights Reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include 31 | 32 | #include "gtest/gtest.h" 33 | #include "test/gtest-typed-test_test.h" 34 | 35 | // Tests that the same type-parameterized test case can be 36 | // instantiated in different translation units linked together. 37 | // (ContainerTest is also instantiated in gtest-typed-test_test.cc.) 38 | INSTANTIATE_TYPED_TEST_SUITE_P(Vector, ContainerTest, 39 | testing::Types >); 40 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/gtest-typed-test_test.h: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Google Inc. 2 | // All Rights Reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #ifndef GOOGLETEST_TEST_GTEST_TYPED_TEST_TEST_H_ 31 | #define GOOGLETEST_TEST_GTEST_TYPED_TEST_TEST_H_ 32 | 33 | #include "gtest/gtest.h" 34 | 35 | using testing::Test; 36 | 37 | // For testing that the same type-parameterized test case can be 38 | // instantiated in different translation units linked together. 39 | // ContainerTest will be instantiated in both gtest-typed-test_test.cc 40 | // and gtest-typed-test2_test.cc. 41 | 42 | template 43 | class ContainerTest : public Test {}; 44 | 45 | TYPED_TEST_SUITE_P(ContainerTest); 46 | 47 | TYPED_TEST_P(ContainerTest, CanBeDefaultConstructed) { TypeParam container; } 48 | 49 | TYPED_TEST_P(ContainerTest, InitialSizeIsZero) { 50 | TypeParam container; 51 | EXPECT_EQ(0U, container.size()); 52 | } 53 | 54 | REGISTER_TYPED_TEST_SUITE_P(ContainerTest, CanBeDefaultConstructed, 55 | InitialSizeIsZero); 56 | 57 | #endif // GOOGLETEST_TEST_GTEST_TYPED_TEST_TEST_H_ 58 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/gtest_all_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // 31 | // Tests for Google C++ Testing and Mocking Framework (Google Test) 32 | // 33 | // Sometimes it's desirable to build most of Google Test's own tests 34 | // by compiling a single file. This file serves this purpose. 35 | #include "test/googletest-filepath-test.cc" 36 | #include "test/googletest-message-test.cc" 37 | #include "test/googletest-options-test.cc" 38 | #include "test/googletest-port-test.cc" 39 | #include "test/googletest-test-part-test.cc" 40 | #include "test/gtest-typed-test2_test.cc" 41 | #include "test/gtest-typed-test_test.cc" 42 | #include "test/gtest_pred_impl_unittest.cc" 43 | #include "test/gtest_prod_test.cc" 44 | #include "test/gtest_skip_test.cc" 45 | #include "test/gtest_unittest.cc" 46 | #include "test/production.cc" 47 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/gtest_help_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // This program is meant to be run by gtest_help_test.py. Do not run 31 | // it directly. 32 | 33 | #include "gtest/gtest.h" 34 | 35 | // When a help flag is specified, this program should skip the tests 36 | // and exit with 0; otherwise the following test will be executed, 37 | // causing this program to exit with a non-zero code. 38 | TEST(HelpFlagTest, ShouldNotBeRun) { 39 | ASSERT_TRUE(false) << "Tests shouldn't be run when --help is specified."; 40 | } 41 | 42 | #ifdef GTEST_HAS_DEATH_TEST 43 | TEST(DeathTest, UsedByPythonScriptToDetectSupportForDeathTestsInThisBinary) {} 44 | #endif 45 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/gtest_json_test_utils.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018, Google Inc. 2 | # All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are 6 | # met: 7 | # 8 | # * Redistributions of source code must retain the above copyright 9 | # notice, this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above 11 | # copyright notice, this list of conditions and the following disclaimer 12 | # in the documentation and/or other materials provided with the 13 | # distribution. 14 | # * Neither the name of Google Inc. nor the names of its 15 | # contributors may be used to endorse or promote products derived from 16 | # this software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | """Unit test utilities for gtest_json_output.""" 31 | 32 | import re 33 | 34 | 35 | def normalize(obj): 36 | """Normalize output object. 37 | 38 | Args: 39 | obj: Google Test's JSON output object to normalize. 40 | 41 | Returns: 42 | Normalized output without any references to transient information that may 43 | change from run to run. 44 | """ 45 | 46 | def _normalize(key, value): 47 | if key == 'time': 48 | return re.sub(r'^\d+(\.\d+)?s$', '*', value) 49 | elif key == 'timestamp': 50 | return re.sub(r'^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\dZ$', '*', value) 51 | elif key == 'failure': 52 | value = re.sub(r'^.*[/\\](.*:)\d+\n', '\\1*\n', value) 53 | return re.sub(r'Stack trace:\n(.|\n)*', 'Stack trace:\n*', value) 54 | elif key == 'file': 55 | return re.sub(r'^.*[/\\](.*)', '\\1', value) 56 | else: 57 | return normalize(value) 58 | 59 | if isinstance(obj, dict): 60 | return {k: _normalize(k, v) for k, v in obj.items()} 61 | if isinstance(obj, list): 62 | return [normalize(x) for x in obj] 63 | else: 64 | return obj 65 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/gtest_main_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include "gtest/gtest.h" 31 | 32 | // Tests that we don't have to define main() when we link to 33 | // gtest_main instead of gtest. 34 | 35 | namespace { 36 | 37 | TEST(GTestMainTest, ShouldSucceed) {} 38 | 39 | } // namespace 40 | 41 | // We are using the main() function defined in gtest_main.cc, so we 42 | // don't define it here. 43 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/gtest_no_test_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Tests that a Google Test program that has no test defined can run 31 | // successfully. 32 | 33 | #include "gtest/gtest.h" 34 | 35 | int main(int argc, char **argv) { 36 | testing::InitGoogleTest(&argc, argv); 37 | 38 | // An ad-hoc assertion outside of all tests. 39 | // 40 | // This serves three purposes: 41 | // 42 | // 1. It verifies that an ad-hoc assertion can be executed even if 43 | // no test is defined. 44 | // 2. It verifies that a failed ad-hoc assertion causes the test 45 | // program to fail. 46 | // 3. We had a bug where the XML output won't be generated if an 47 | // assertion is executed before RUN_ALL_TESTS() is called, even 48 | // though --gtest_output=xml is specified. This makes sure the 49 | // bug is fixed and doesn't regress. 50 | EXPECT_EQ(1, 2); 51 | 52 | // The above EXPECT_EQ() should cause RUN_ALL_TESTS() to return non-zero. 53 | return RUN_ALL_TESTS() ? 0 : 1; 54 | } 55 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/gtest_prod_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // 31 | // Unit test for gtest_prod.h. 32 | 33 | #include "production.h" 34 | #include "gtest/gtest.h" 35 | 36 | // Tests that private members can be accessed from a TEST declared as 37 | // a friend of the class. 38 | TEST(PrivateCodeTest, CanAccessPrivateMembers) { 39 | PrivateCode a; 40 | EXPECT_EQ(0, a.x_); 41 | 42 | a.set_x(1); 43 | EXPECT_EQ(1, a.x_); 44 | } 45 | 46 | typedef testing::Test PrivateCodeFixtureTest; 47 | 48 | // Tests that private members can be accessed from a TEST_F declared 49 | // as a friend of the class. 50 | TEST_F(PrivateCodeFixtureTest, CanAccessPrivateMembers) { 51 | PrivateCode a; 52 | EXPECT_EQ(0, a.x_); 53 | 54 | a.set_x(2); 55 | EXPECT_EQ(2, a.x_); 56 | } 57 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/gtest_skip_check_output_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2019 Google LLC. All Rights Reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are 7 | # met: 8 | # 9 | # * Redistributions of source code must retain the above copyright 10 | # notice, this list of conditions and the following disclaimer. 11 | # * Redistributions in binary form must reproduce the above 12 | # copyright notice, this list of conditions and the following disclaimer 13 | # in the documentation and/or other materials provided with the 14 | # distribution. 15 | # * Neither the name of Google Inc. nor the names of its 16 | # contributors may be used to endorse or promote products derived from 17 | # this software without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | """Tests Google Test's gtest skip in environment setup behavior. 31 | 32 | This script invokes gtest_skip_in_environment_setup_test_ and verifies its 33 | output. 34 | """ 35 | 36 | import re 37 | 38 | from googletest.test import gtest_test_utils 39 | 40 | # Path to the gtest_skip_in_environment_setup_test binary 41 | EXE_PATH = gtest_test_utils.GetTestExecutablePath('gtest_skip_test') 42 | 43 | OUTPUT = gtest_test_utils.Subprocess([EXE_PATH]).output 44 | 45 | 46 | # Test. 47 | class SkipEntireEnvironmentTest(gtest_test_utils.TestCase): 48 | 49 | def testSkipEntireEnvironmentTest(self): 50 | self.assertIn('Skipped\nskipping single test\n', OUTPUT) 51 | skip_fixture = 'Skipped\nskipping all tests for this fixture\n' 52 | self.assertIsNotNone( 53 | re.search(skip_fixture + '.*' + skip_fixture, OUTPUT, flags=re.DOTALL), 54 | repr(OUTPUT), 55 | ) 56 | self.assertNotIn('FAILED', OUTPUT) 57 | 58 | 59 | if __name__ == '__main__': 60 | gtest_test_utils.Main() 61 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/gtest_skip_environment_check_output_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2019 Google LLC. All Rights Reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are 7 | # met: 8 | # 9 | # * Redistributions of source code must retain the above copyright 10 | # notice, this list of conditions and the following disclaimer. 11 | # * Redistributions in binary form must reproduce the above 12 | # copyright notice, this list of conditions and the following disclaimer 13 | # in the documentation and/or other materials provided with the 14 | # distribution. 15 | # * Neither the name of Google Inc. nor the names of its 16 | # contributors may be used to endorse or promote products derived from 17 | # this software without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | """Tests Google Test's gtest skip in environment setup behavior. 31 | 32 | This script invokes gtest_skip_in_environment_setup_test_ and verifies its 33 | output. 34 | """ 35 | 36 | from googletest.test import gtest_test_utils 37 | 38 | # Path to the gtest_skip_in_environment_setup_test binary 39 | EXE_PATH = gtest_test_utils.GetTestExecutablePath( 40 | 'gtest_skip_in_environment_setup_test' 41 | ) 42 | 43 | OUTPUT = gtest_test_utils.Subprocess([EXE_PATH]).output 44 | 45 | 46 | # Test. 47 | class SkipEntireEnvironmentTest(gtest_test_utils.TestCase): 48 | 49 | def testSkipEntireEnvironmentTest(self): 50 | self.assertIn('Skipping the entire environment', OUTPUT) 51 | self.assertNotIn('FAILED', OUTPUT) 52 | 53 | 54 | if __name__ == '__main__': 55 | gtest_test_utils.Main() 56 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/gtest_skip_in_environment_setup_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Google LLC. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google LLC. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // This test verifies that skipping in the environment results in the 31 | // testcases being skipped. 32 | 33 | #include 34 | 35 | #include "gtest/gtest.h" 36 | 37 | class SetupEnvironment : public testing::Environment { 38 | public: 39 | void SetUp() override { GTEST_SKIP() << "Skipping the entire environment"; } 40 | }; 41 | 42 | TEST(Test, AlwaysFails) { EXPECT_EQ(true, false); } 43 | 44 | int main(int argc, char **argv) { 45 | testing::InitGoogleTest(&argc, argv); 46 | 47 | testing::AddGlobalTestEnvironment(new SetupEnvironment()); 48 | 49 | return RUN_ALL_TESTS(); 50 | } 51 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/gtest_skip_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Google Inc. 2 | // All Rights Reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: arseny.aprelev@gmail.com (Arseny Aprelev) 31 | // 32 | 33 | #include "gtest/gtest.h" 34 | 35 | using ::testing::Test; 36 | 37 | TEST(SkipTest, DoesSkip) { 38 | GTEST_SKIP() << "skipping single test"; 39 | EXPECT_EQ(0, 1); 40 | } 41 | 42 | class Fixture : public Test { 43 | protected: 44 | void SetUp() override { 45 | GTEST_SKIP() << "skipping all tests for this fixture"; 46 | } 47 | }; 48 | 49 | TEST_F(Fixture, SkipsOneTest) { EXPECT_EQ(5, 7); } 50 | 51 | TEST_F(Fixture, SkipsAnotherTest) { EXPECT_EQ(99, 100); } 52 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/gtest_sole_header_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // 31 | // This test verifies that it's possible to use Google Test by including 32 | // the gtest.h header file alone. 33 | 34 | #include "gtest/gtest.h" 35 | 36 | namespace { 37 | 38 | void Subroutine() { EXPECT_EQ(42, 42); } 39 | 40 | TEST(NoFatalFailureTest, ExpectNoFatalFailure) { 41 | EXPECT_NO_FATAL_FAILURE(;); 42 | EXPECT_NO_FATAL_FAILURE(SUCCEED()); 43 | EXPECT_NO_FATAL_FAILURE(Subroutine()); 44 | EXPECT_NO_FATAL_FAILURE({ SUCCEED(); }); 45 | } 46 | 47 | TEST(NoFatalFailureTest, AssertNoFatalFailure) { 48 | ASSERT_NO_FATAL_FAILURE(;); 49 | ASSERT_NO_FATAL_FAILURE(SUCCEED()); 50 | ASSERT_NO_FATAL_FAILURE(Subroutine()); 51 | ASSERT_NO_FATAL_FAILURE({ SUCCEED(); }); 52 | } 53 | 54 | } // namespace 55 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/gtest_testbridge_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2018 Google LLC. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are 7 | # met: 8 | # 9 | # * Redistributions of source code must retain the above copyright 10 | # notice, this list of conditions and the following disclaimer. 11 | # * Redistributions in binary form must reproduce the above 12 | # copyright notice, this list of conditions and the following disclaimer 13 | # in the documentation and/or other materials provided with the 14 | # distribution. 15 | # * Neither the name of Google Inc. nor the names of its 16 | # contributors may be used to endorse or promote products derived from 17 | # this software without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | """Verifies that Google Test uses filter provided via testbridge.""" 31 | 32 | import os 33 | 34 | from googletest.test import gtest_test_utils 35 | 36 | binary_name = 'gtest_testbridge_test_' 37 | COMMAND = gtest_test_utils.GetTestExecutablePath(binary_name) 38 | TESTBRIDGE_NAME = 'TESTBRIDGE_TEST_ONLY' 39 | 40 | 41 | def Assert(condition): 42 | if not condition: 43 | raise AssertionError 44 | 45 | 46 | class GTestTestFilterTest(gtest_test_utils.TestCase): 47 | 48 | def testTestExecutionIsFiltered(self): 49 | """Tests that the test filter is picked up from the testbridge env var.""" 50 | subprocess_env = os.environ.copy() 51 | 52 | subprocess_env[TESTBRIDGE_NAME] = '*.TestThatSucceeds' 53 | p = gtest_test_utils.Subprocess(COMMAND, env=subprocess_env) 54 | 55 | self.assertEqual(0, p.exit_code) 56 | 57 | Assert('filter = *.TestThatSucceeds' in p.output) 58 | Assert('[ OK ] TestFilterTest.TestThatSucceeds' in p.output) 59 | Assert('[ PASSED ] 1 test.' in p.output) 60 | 61 | 62 | if __name__ == '__main__': 63 | gtest_test_utils.Main() 64 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/gtest_testbridge_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2018, Google LLC. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // This program is meant to be run by gtest_test_filter_test.py. Do not run 31 | // it directly. 32 | 33 | #include "gtest/gtest.h" 34 | 35 | // These tests are used to detect if filtering is working. Only 36 | // 'TestThatSucceeds' should ever run. 37 | 38 | TEST(TestFilterTest, TestThatSucceeds) {} 39 | 40 | TEST(TestFilterTest, TestThatFails) { 41 | ASSERT_TRUE(false) << "This test should never be run."; 42 | } 43 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/gtest_xml_outfile1_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // gtest_xml_outfile1_test_ writes some xml via TestProperty used by 31 | // gtest_xml_outfiles_test.py 32 | 33 | #include "gtest/gtest.h" 34 | 35 | class PropertyOne : public testing::Test { 36 | protected: 37 | void SetUp() override { RecordProperty("SetUpProp", 1); } 38 | void TearDown() override { RecordProperty("TearDownProp", 1); } 39 | }; 40 | 41 | TEST_F(PropertyOne, TestSomeProperties) { 42 | RecordProperty("TestSomeProperty", 1); 43 | } 44 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/production.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // 31 | // This is part of the unit test for gtest_prod.h. 32 | 33 | #include "production.h" 34 | 35 | PrivateCode::PrivateCode() : x_(0) {} 36 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest/test/production.h: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // 31 | // This is part of the unit test for gtest_prod.h. 32 | 33 | #ifndef GOOGLETEST_TEST_PRODUCTION_H_ 34 | #define GOOGLETEST_TEST_PRODUCTION_H_ 35 | 36 | #include "gtest/gtest_prod.h" 37 | 38 | class PrivateCode { 39 | public: 40 | // Declares a friend test that does not use a fixture. 41 | FRIEND_TEST(PrivateCodeTest, CanAccessPrivateMembers); 42 | 43 | // Declares a friend test that uses a fixture. 44 | FRIEND_TEST(PrivateCodeFixtureTest, CanAccessPrivateMembers); 45 | 46 | PrivateCode(); 47 | 48 | int x() const { return x_; } 49 | 50 | private: 51 | void set_x(int an_x) { x_ = an_x; } 52 | int x_; 53 | }; 54 | 55 | #endif // GOOGLETEST_TEST_PRODUCTION_H_ 56 | -------------------------------------------------------------------------------- /vendor/googletest-1.14.0/googletest_deps.bzl: -------------------------------------------------------------------------------- 1 | """Load dependencies needed to use the googletest library as a 3rd-party consumer.""" 2 | 3 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 4 | 5 | def googletest_deps(): 6 | """Loads common dependencies needed to use the googletest library.""" 7 | 8 | if not native.existing_rule("com_googlesource_code_re2"): 9 | http_archive( 10 | name = "com_googlesource_code_re2", # 2023-03-17T11:36:51Z 11 | sha256 = "cb8b5312a65f2598954545a76e8bce913f35fbb3a21a5c88797a4448e9f9b9d9", 12 | strip_prefix = "re2-578843a516fd1da7084ae46209a75f3613b6065e", 13 | urls = ["https://github.com/google/re2/archive/578843a516fd1da7084ae46209a75f3613b6065e.zip"], 14 | ) 15 | 16 | if not native.existing_rule("com_google_absl"): 17 | http_archive( 18 | name = "com_google_absl", # 2023-08-01T14:59:13Z 19 | sha256 = "d2c09bf3b3aba57ad87a56082020bee2948445407756e92ddaf3595396086853", 20 | strip_prefix = "abseil-cpp-22091f4c0d6626b3ef40446ce3d4ccab19425ca3", 21 | urls = ["https://github.com/abseil/abseil-cpp/archive/22091f4c0d6626b3ef40446ce3d4ccab19425ca3.zip"], 22 | ) 23 | --------------------------------------------------------------------------------