summaryrefslogtreecommitdiffstats
path: root/googletest/test/googletest-port-test.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fix RE::Init for Android and NetBSD.Abseil Team2023-10-051-2/+2
| | | | | | | | | This is a somewhat recent change for Android (I'm not clear on whether it's a recent change for NetBSD, or if Android was just very behind on its implementation), so while this worked fine as recently as API 32 devices, REG_GNU is required for API 34 (API 33 untested). A test actually caught this, but https://github.com/google/googletest/pull/4334 "fixed" the test rather than the implementation. This CL also reverts the test change so it can catch the failure. PiperOrigin-RevId: 571126374 Change-Id: I420dfcedea58f2c8b605f699515d744006c0a9d9
* Count threads after thread-creation while still holding mutex lockrefs/pull/4365/headTanzinul Islam2023-09-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `Mutex` is locked with the `MutexLock` before spawning the thread, so that the thread is prevented from completing (by being blocked on `Mutex`) before the new thread count is obtained. However, the existing bug (introduced in 22e6055) releases `Mutex` before obtaining the new thread count, which allows the thread to run to completion in the meantime. Also, since the `(thread_count_after_create != starting_count + 1)` condition (line 328) skips the remainder of the `for`-loop body on every iteration, `thread_count_after_join` stays uninitialized. I believe this is why [this test failed][1] on the macOS CI with this trace: ``` [----------] 1 test from GetThreadCountTest [ RUN ] GetThreadCountTest.ReturnsCorrectValue googletest/test/googletest-port-test.cc:350: Failure Expected equality of these values: thread_count_after_create Which is: 1 starting_count + 1 Which is: 2 googletest/test/googletest-port-test.cc:351: Failure Expected equality of these values: thread_count_after_join Which is: 140493185949400 starting_count Which is: 1 [ FAILED ] GetThreadCountTest.ReturnsCorrectValue (2 ms) [----------] 1 test from GetThreadCountTest (2 ms total) ``` [1]: https://github.com/google/googletest/actions/runs/6064919420/job/16453860690?pr=3049
* Fix RETest/1.ImplicitConstructorWorks on non-ABSL platformsrefs/pull/4334/headEnji Cooper2023-08-081-2/+2
| | | | | | | | The last regular expression specified in the test is not technically POSIX compatible. Use `[[:alnum:]_]` instead of `\w+`; the latter is a Perl-compatible regular expression. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* Use '=default' to define trivial constructor/destructorsrefs/pull/4221/headTom Hughes2023-04-211-2/+2
| | | | | | | https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html PiperOrigin-RevId: 526079054 Change-Id: Ia4db21e3e5f58b90de05d52fd94b291ed06d785d
* Fix spellingTom Hughes2023-04-201-4/+4
| | | | | PiperOrigin-RevId: 525820426 Change-Id: Ib5baa8da4a54ebb17b6ace12240ed03eedb46091
* Apply clang-tidy fixesAbseil Team2023-03-091-2/+2
| | | | | PiperOrigin-RevId: 515265927 Change-Id: Iea11668fa4bbf08f6d418a3823e836fb5b874dcc
* Replace "#if GTEST_HAS_ABSL" with "#ifdef GTEST_HAS_ABSL"Tom Hughes2023-03-061-1/+1
| | | | | | | This allows compilation with "-Wundef" (#3267). PiperOrigin-RevId: 513945230 Change-Id: I45ef19c7ff3d20e97216bd031d406a03365471da
* Use "#ifdef" with public macrosTom Hughes2023-03-061-5/+5
| | | | | | | This allows compilation with "-Wundef" (#3267). PiperOrigin-RevId: 513944726 Change-Id: I1a3854bb2333d5dec6c0ff91ee1eddd9a766ab91
* Use "#ifdef GTEST_OS_..." instead of "#if GTEST_OS_..."Tom Hughes2023-03-061-12/+14
| | | | | | | This is compatible with compiling with "-Wundef" (#3267). PiperOrigin-RevId: 513943378 Change-Id: I47cf5fabbb77be061c4483a0adc54511af6b191c
* IWYU: Add missing std includesTom Hughes2023-01-051-0/+1
| | | | | PiperOrigin-RevId: 499893032 Change-Id: I33304802b7c82ae2d008f3ee89df38866e5f57ba
* Use RE2 for the regex implementation when building with Bazel and using AbseilDerek Mauro2022-04-261-7/+3
| | | | | | | | | | | | | | | | | | | bazel build --define=absl=1 ... A dependency on RE2 is now required when building GoogleTest with Abseil. Using RE2 will provide a consistent cross-platform regex experience. Users will need to add the com_googlesource_code_re2, bazel_skylib, and platforms repository to their WORKSPACE files. See our WORKSPACE file in the root directory of this project for an example of how to add the dependencies. Please note that the com_googlesource_code_re2 dependency must use a commit from the `abseil` branch of the project: https://github.com/google/re2/tree/abseil PiperOrigin-RevId: 444650118 Change-Id: I45c55b26684c0c50d721a05b81c5f8a0c092400f
* Remove the legacy internal GTEST_DISALLOW_* macrosDerek Mauro2022-04-221-1/+2
| | | | | PiperOrigin-RevId: 443715444 Change-Id: I3ffd54b63d2728ae4a668ee7875c8c3c8188087c
* Running clang-format over all of GoogleTestAbseil Team2022-03-151-50/+46
| | | | | | | | | | | | | | | | A few tests are examining code locations and looking af the resulting line numbers to verify that GoogleTest shows those to users correctly. Some of those locations change when clang-format is run. For those locations, I've wrapped portions in: // clang-format off ... // clang-format on There may be other locations that are currently not tickled by running clang-format. PiperOrigin-RevId: 434844712 Change-Id: I3a9f0a6f39eff741c576b6de389bef9b1d11139d
* Googletest exportdmauro2021-11-031-4/+8
| | | | | | | Remove GoogleTest's SleepMilliseconds function. It is only used in tests and a portable implementation is available. PiperOrigin-RevId: 405437102
* Googletest exportAbseil Team2021-06-301-24/+49
| | | | | | | | | | Make multiple attempts to verify GetThreadCount() Testing GetThreadCount() is inheritently noisy, as other threads can be started or destroyed between two calls to GetThreadCount(). This is especially true under certain analyzer configurations, such as TSAN. PiperOrigin-RevId: 381951799
* Merge pull request #3200 from ellert:port-to-GNU/HurdCJ Johnson2021-06-171-1/+1
|\ | | | | | | PiperOrigin-RevId: 379383941
| * Port to GNU/Hurdrefs/pull/3200/headMattias Ellert2020-12-301-1/+1
| |
* | Googletest exportAbseil Team2021-02-051-4/+0
|/ | | | | | Remove uses of GTEST_HAS_TYPED_TEST_P and GTEST_HAS_TYPED_TEST. PiperOrigin-RevId: 353935996
* Googletest exportdmauro2020-10-141-0/+10
| | | | | | Disable warnings on code that intentionally tests a suboptimal syntax PiperOrigin-RevId: 337138442
* Fix a -Wdeprecated warning.Arthur O'Dwyer2020-04-241-2/+2
| | | | | | | | googletest-port-test.cc:97:11: error: definition of implicit copy constructor for 'Base' is deprecated because it has a user-declared destructor [-Werror,-Wdeprecated] virtual ~Base() {} ^
* Remove all uses of GTEST_DISALLOW_{MOVE_,}ASSIGN_.Arthur O'Dwyer2020-04-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | None of these are strictly needed for correctness. A large number of them (maybe all of them?) trigger `-Wdeprecated` warnings on Clang trunk as soon as you try to use the implicitly defaulted (but deprecated) copy constructor of a class that has deleted its copy assignment operator. By declaring a deleted copy assignment operator, the old code also caused the move constructor and move assignment operator to be non-declared. This means that the old code never got move semantics -- "move-construction" would simply call the defaulted (but deprecated) copy constructor instead. With the new code, "move-construction" calls the defaulted move constructor, which I believe is what we want to happen. So this is a runtime performance optimization. Unfortunately we can't yet physically remove the definitions of these macros from gtest-port.h, because they are being used by other code internally at Google (according to zhangxy988). But no new uses should be added going forward.
* remove a custom implementation of std::iterator_traitsKrystian Kuzniarek2019-08-131-18/+0
|
* clang: fix `-Wsign-conversion` errorsEnji Cooper2019-04-061-2/+2
| | | | | | | | | | | Cast some values as their unsigned equivalents or `size_t` to match the parameter type used for the template object under test. Also, provide UInt32 equivalent delegate methods for some callers (with int-equivalents for backwards compatibility). This closes #2146. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* Googletest exportAbseil Team2019-04-011-6/+1
| | | | | | | | Remove support for "global" ::string and ::wstring types. This support existed for legacy codebases that existed from before namespaces where a thing. It is no longer necessary. PiperOrigin-RevId: 241335738
* Import `patch-bsd-defines` from FreeBSD ports [1]Enji Cooper2019-02-131-1/+3
| | | | | | | | | | As noted in the patch description: * Add DragonFly and GNU/kFreeBSD support. * Implement GetThreadCount() for BSDs. 1. https://svnweb.freebsd.org/ports/head/devel/googletest/files/patch-bsd-defines?revision=488934 Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* Googletest exportmisterg2019-01-111-1/+1
| | | | | | Change tests to use new Test Suite API PiperOrigin-RevId: 228908894
* Googletest exportmisterg2018-10-311-9/+2
| | | | | | Remove scoped_ptr replace with std::unique_ptr PiperOrigin-RevId: 219291284
* Apply clang-tidy modernize-use-nullptr to googletest.Abseil Team2018-10-051-13/+13
| | | | | | | | | | | Now that googletest has moved to C++11, it should no longer use NULL or 0 for the null pointer. This patch converts all such usages to nullptr using clang-tidy. This prevents LLVM from issuing -Wzero-as-null-pointer-constant warnings. PiperOrigin-RevId: 215814400
* Comments changes, no functionality changes. Gennadiy Civil2018-08-141-1/+1
|
* Comments changes, no functionality changesrefs/pull/1740/headGennadiy Civil2018-08-141-2/+0
|
* Formatting tweaks, no functionality changesGennadiy Civil2018-08-081-2/+1
|
* more test changesGennadiy Civil2018-08-011-0/+1303