Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/GSL.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2022-10-11Clean up `final_act` and `finally`, closes #846 (#977)Herb Sutter
Somewhere along the way, GSL's implementation of final_act and finally seems to have become way overthought. This PR is to re-simplify these facilities back to what C++ Core Guidelines C.30 said which is simple and clear and works. It just copies the invocable thing, and doesn't bother trying to optimize the copy. This should be fine, because we're typically passing something that's cheap to copy, often a stateless lambda. The problem in #846 appears to be because finally looks like was originally written as a const&/&& overload (its state at the time that issue was opened)... to eliminate a copy when you invoke it with a temporary. If so, then the && was probably never intended to be a forwarder, but an rvalue reference that tripped over the horrid C++ syntax collision where a && parameter magically instead means a forwarding reference because the type happens to be a template parameter type here. So I suspect the original author was just trying to write an rvalue overload, and the forwarder that's there now was never intended at all.
2022-10-06Fix Clang-tidy 15 warnings (#1058)Rose
These warnings were found by running clang-tidy 15.
2022-04-14Suppress -Wfloat-equal warning in implementation of gsl::narrow (#1043)dmitrykobets-msft
In the implementation of gsl::narrow, there is a comparison `static_cast<U>(t) != u` which may be comparing two floats. The comparison here is done purposefully to categorize ill effects of narrowing conversion, since the values being compared *should* be the same when compared with `operator==`. Note, using #pragma GCC will suppress this warning for both GCC and Clang.
2022-03-22Make gsl::span's iterators use the contiguous_iterator concept (#1035)dmitrykobets-msft
Resolves #1016 Co-authored-by: Casey Carter <Casey@Carter.net>
2022-03-22Suppress reserved identifier warning (#1041)dmitrykobets-msft
The following reserved identifiers are being used specifically to target certain MSVC constructs, so suppress the warning in VS 2022 (LLVM) "... is reserved because it starts with '_' followed by a capital letter": - _Unchecked_type - _Verify_range - _Verify_offset - _Unwrapped - _Unwrap_when_unverified - _Seek_to - _Unchecked_begin - _Unchecked_end
2021-12-10Update compiler support (#1019)dmitrykobets-msft
2021-12-10Fix/implement C++2020 compilation, tests, and CI (#1017)dmitrykobets-msft
* Fix C++20 bugs and tests * Rework CI for C++2020 tests * Update readme compiler versions
2021-11-17Fix googletest build failure with gcc 11.1+ (#1015)dmitrykobets-msft
2021-10-27make zstring family don't require empty angle brackets any more (#998)Werner Henze
Co-authored-by: Werner Henze <werner.henze+gitcommits@posteo.de>
2021-06-24feat: narrow for non totally ordered types (#986)Johel Ernesto Guerrero Peña
2021-05-21gsl::at behavior change regarding gsl::span (#985)Jordan Maples [MSFT]
* move span specialization of 'at' to <gsl/span> and update the parameter to be taken by reference * undid previous changes and acted upon decisions made in maintainer sync. Fixed tests failing in /kernel mode * ran clang-format on the include folder * ran clang-format on the test folder Co-authored-by: Jordan Maples <jordan.maples@microsoft.com>
2021-05-13Fix iPhone simulator CI (#981)Tushar Maheshwari
* Run iOS simulator CI * Fix link errors - scope function linkage using anonymous namespace * Update noexcept test for consistency
2021-01-08Improve build script for standalone tests (#963)Nicholas Guriev
* Require Git for build tests only if installed GTest is not found Cloning via Git is not the only path to obtain Google Test framework. In Linux, using a system package manager is the preferred way, and gtest can be installed through APK, APT, DNF, pacman, or many other. Now we make Git mandatory after checking GTest existence. See also: https://github.com/microsoft/GSL/pull/961#discussion_r548959056 * Support standalone tests The patch makes possible to run auto-tests against globally installed GSL, ignoring local headers. To do this, run CMake in the tests/ folder. cmake -B build -S tests -DGSL_CXX_STANDARD=14 This feature should not break existing build recipes. Co-authored-by: Nicholas Guriev <nicholas@guriev.su>
2021-01-05Reintroduce CMake changes that were reverted in #966 (#967)Jordan Maples [MSFT]
* [cmake] Adding options for INSTALL and TEST (#964) * [cmake] Adding GSL_INSTALL option Not all consumers of GSL automatically want to have this install logic. It's good practice to gate install logic behind an option. For an example look at magic_enum: https://github.com/Neargye/magic_enum/blob/master/CMakeLists.txt If the client wants to install GSL they still can. But they should ask for it by overriding GSL_INSTALL. * Update cmake/guidelineSupportLibrary.cmake added nl@eof * Update CMakeLists.txt * Update CMakeLists.txt Co-authored-by: Juan Ramos <juanr0911@gmail.com> Co-authored-by: Jordan Maples [MSFT] <49793787+JordanMaples@users.noreply.github.com> * missing config line restored by moving GNUInstallDirs back to main file Co-authored-by: hdf89shfdfs <31327577+hdf89shfdfs@users.noreply.github.com> Co-authored-by: Juan Ramos <juanr0911@gmail.com>
2021-01-05Revert "[cmake] Adding options for INSTALL and TEST (#964)" (#966)Jordan Maples [MSFT]
This reverts commit eca0eca6f1ae12c80f73bdfb73bbcf912289fe34.
2021-01-04update gtest (#965)Jordan Maples [MSFT]
2021-01-04[cmake] Adding options for INSTALL and TEST (#964)hdf89shfdfs
* [cmake] Adding GSL_INSTALL option Not all consumers of GSL automatically want to have this install logic. It's good practice to gate install logic behind an option. For an example look at magic_enum: https://github.com/Neargye/magic_enum/blob/master/CMakeLists.txt If the client wants to install GSL they still can. But they should ask for it by overriding GSL_INSTALL. * Update cmake/guidelineSupportLibrary.cmake added nl@eof * Update CMakeLists.txt * Update CMakeLists.txt Co-authored-by: Juan Ramos <juanr0911@gmail.com> Co-authored-by: Jordan Maples [MSFT] <49793787+JordanMaples@users.noreply.github.com>
2020-12-15Minor cmake changes (#961)hdf89shfdfs
Abstract adding natvis file. Move call to find_package(Git) as well as making it required/quiet.
2020-12-10remove multi_span (#958)Jordan Maples [MSFT]
2020-11-04Adding std::hash<not_null<T>> tests to notnull_tests.cpp (#947)Jordan Maples [MSFT]
* added std::hash<not_null> tests * nl
2020-10-30renaming main logic files. Added warning message of the removal and include ↵Jordan Maples [MSFT]
passthrough. Renamed includes in the source files. Ran Clang-Format (#946) Header rename
2020-08-14Fix finally with mutable lvalue invokablePascal Menuet
2020-08-13Merge branch 'master' into exception_fix_new_fileJordan Maples
2020-08-13Merge pull request #868 from mymedia2/masterJordan Maples [MSFT]
Search for GoogleTest via pkg-config first
2020-08-12created new file for gsl_narrow, might want to rename if we go this approach ↵Jordan Maples
to have all exception prone logic to live here
2020-05-30adding template type to the vector to suppress clang-10 warning that vector ↵Jordan Maples
may not intend for type deduction.
2020-05-29fixed typoJordan Maples
2020-05-29wrapping string_view checks in deduction guide checks to prevent 'macro ↵Jordan Maples
unused' errors
2020-05-29Add string_view test case and modify deduction guidesCasey Carter
2020-05-29adding a test to verify that the additional ctad worksJordan Maples
2020-05-27Merge pull request #886 from JordanMaples/dev/jomaples/build_matrixJordan Maples [MSFT]
compiler support revision
2020-05-21fixing clang build breakJordan Maples
2020-05-20Finished integrating CaseyCarter's changes into spanJordan Maples
2020-05-20string_span_tests CLRF -> LFJordan Maples
2020-05-20addressing most of Casey's commentsJordan Maples
2020-05-20initial impl of P1976R2Jordan Maples
2020-05-13missed a GSL_CONSTEXPR_NARROW for removalJordan Maples
2020-04-23Removed unused contant from testNicholas Londey
2020-04-23Fixed narrow unit test EXPECT_THROWNicholas Londey
2020-04-23Removed no_exception_throw_tests.cppNicholas Londey
as per review feedback
2020-04-22Changed implementation of gsl::narrow to throw gsl::narrowing_errorNicholas Londey
Implementation now behaves as described in the C++ Core Guidlines
2020-04-18Search for GoogleTest via pkg-config firstNicholas Guriev
2020-04-15adding back free functions for [c|cr][begin|end]Jordan Maples
2020-04-14implement LWG3320 by deleting const_iterator and const_reverse_iteratorJordan Maples
2020-04-10testing one of CaseyCarter's commentsJordan Maples
2020-04-10apply clang-format to the span_compatibility_tests.Jordan Maples
2020-04-10another testJordan Maples
2020-04-10prevent comparison for apple clang versions older than 11Jordan Maples
2020-04-10another attempt at apple clang version filteringJordan Maples
2020-04-09testing different major/minor for Apple suppressionJordan Maples