Skip to content

Commit 6f35f89

Browse files
deps: update googletest to 1b96fa13f549387b7549cc89e1a785cf143a1a50
PR-URL: nodejs#60739 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ulises Gascón <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent e72da8c commit 6f35f89

File tree

3 files changed

+33
-33
lines changed

3 files changed

+33
-33
lines changed

deps/googletest/include/gtest/internal/gtest-port.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,12 +1424,11 @@ class GTEST_API_ Mutex {
14241424
// "MutexLock l(&mu)". Hence the typedef trick below.
14251425
class GTestMutexLock {
14261426
public:
1427-
explicit GTestMutexLock(Mutex* mutex) : mutex_(mutex) { mutex_->lock(); }
1428-
1429-
~GTestMutexLock() { mutex_->unlock(); }
1427+
explicit GTestMutexLock(Mutex& mutex) : mutex_(mutex) { mutex_.lock(); }
1428+
~GTestMutexLock() { mutex_.unlock(); }
14301429

14311430
private:
1432-
Mutex* const mutex_;
1431+
Mutex& mutex_;
14331432

14341433
GTestMutexLock(const GTestMutexLock&) = delete;
14351434
GTestMutexLock& operator=(const GTestMutexLock&) = delete;
@@ -1716,12 +1715,11 @@ class Mutex : public MutexBase {
17161715
// "MutexLock l(&mu)". Hence the typedef trick below.
17171716
class GTestMutexLock {
17181717
public:
1719-
explicit GTestMutexLock(MutexBase* mutex) : mutex_(mutex) { mutex_->lock(); }
1720-
1721-
~GTestMutexLock() { mutex_->unlock(); }
1718+
explicit GTestMutexLock(MutexBase& mutex) : mutex_(mutex) { mutex_.lock(); }
1719+
~GTestMutexLock() { mutex_.unlock(); }
17221720

17231721
private:
1724-
MutexBase* const mutex_;
1722+
MutexBase& mutex_;
17251723

17261724
GTestMutexLock(const GTestMutexLock&) = delete;
17271725
GTestMutexLock& operator=(const GTestMutexLock&) = delete;
@@ -1881,7 +1879,7 @@ class Mutex {
18811879
// "MutexLock l(&mu)". Hence the typedef trick below.
18821880
class GTestMutexLock {
18831881
public:
1884-
explicit GTestMutexLock(Mutex*) {} // NOLINT
1882+
explicit GTestMutexLock(Mutex&) {} // NOLINT
18851883
};
18861884

18871885
typedef GTestMutexLock MutexLock;

deps/googletest/src/gtest-port.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ class ThreadLocalRegistryImpl {
499499
MemoryIsNotDeallocated memory_is_not_deallocated;
500500
#endif // _MSC_VER
501501
DWORD current_thread = ::GetCurrentThreadId();
502-
MutexLock lock(&mutex_);
502+
MutexLock lock(mutex_);
503503
ThreadIdToThreadLocals* const thread_to_thread_locals =
504504
GetThreadLocalsMapLocked();
505505
ThreadIdToThreadLocals::iterator thread_local_pos =
@@ -532,7 +532,7 @@ class ThreadLocalRegistryImpl {
532532
// Clean up the ThreadLocalValues data structure while holding the lock, but
533533
// defer the destruction of the ThreadLocalValueHolderBases.
534534
{
535-
MutexLock lock(&mutex_);
535+
MutexLock lock(mutex_);
536536
ThreadIdToThreadLocals* const thread_to_thread_locals =
537537
GetThreadLocalsMapLocked();
538538
for (ThreadIdToThreadLocals::iterator it =
@@ -559,7 +559,7 @@ class ThreadLocalRegistryImpl {
559559
// Clean up the ThreadIdToThreadLocals data structure while holding the
560560
// lock, but defer the destruction of the ThreadLocalValueHolderBases.
561561
{
562-
MutexLock lock(&mutex_);
562+
MutexLock lock(mutex_);
563563
ThreadIdToThreadLocals* const thread_to_thread_locals =
564564
GetThreadLocalsMapLocked();
565565
ThreadIdToThreadLocals::iterator thread_local_pos =

deps/googletest/src/gtest.cc

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,14 +1086,14 @@ void DefaultPerThreadTestPartResultReporter::ReportTestPartResult(
10861086
// Returns the global test part result reporter.
10871087
TestPartResultReporterInterface*
10881088
UnitTestImpl::GetGlobalTestPartResultReporter() {
1089-
internal::MutexLock lock(&global_test_part_result_reporter_mutex_);
1089+
internal::MutexLock lock(global_test_part_result_reporter_mutex_);
10901090
return global_test_part_result_reporter_;
10911091
}
10921092

10931093
// Sets the global test part result reporter.
10941094
void UnitTestImpl::SetGlobalTestPartResultReporter(
10951095
TestPartResultReporterInterface* reporter) {
1096-
internal::MutexLock lock(&global_test_part_result_reporter_mutex_);
1096+
internal::MutexLock lock(global_test_part_result_reporter_mutex_);
10971097
global_test_part_result_reporter_ = reporter;
10981098
}
10991099

@@ -2347,7 +2347,7 @@ void TestResult::RecordProperty(const std::string& xml_element,
23472347
if (!ValidateTestProperty(xml_element, test_property)) {
23482348
return;
23492349
}
2350-
internal::MutexLock lock(&test_properties_mutex_);
2350+
internal::MutexLock lock(test_properties_mutex_);
23512351
const std::vector<TestProperty>::iterator property_with_matching_key =
23522352
std::find_if(test_properties_.begin(), test_properties_.end(),
23532353
internal::TestPropertyKeyIs(test_property.key()));
@@ -5088,7 +5088,7 @@ std::string OsStackTraceGetter::CurrentStackTrace(int max_depth, int skip_count)
50885088

50895089
void* caller_frame = nullptr;
50905090
{
5091-
MutexLock lock(&mutex_);
5091+
MutexLock lock(mutex_);
50925092
caller_frame = caller_frame_;
50935093
}
50945094

@@ -5127,7 +5127,7 @@ void OsStackTraceGetter::UponLeavingGTest() GTEST_LOCK_EXCLUDED_(mutex_) {
51275127
caller_frame = nullptr;
51285128
}
51295129

5130-
MutexLock lock(&mutex_);
5130+
MutexLock lock(mutex_);
51315131
caller_frame_ = caller_frame;
51325132
#endif // GTEST_HAS_ABSL
51335133
}
@@ -5390,13 +5390,13 @@ void UnitTest::UponLeavingGTest() {
53905390

53915391
// Sets the TestSuite object for the test that's currently running.
53925392
void UnitTest::set_current_test_suite(TestSuite* a_current_test_suite) {
5393-
internal::MutexLock lock(&mutex_);
5393+
internal::MutexLock lock(mutex_);
53945394
impl_->set_current_test_suite(a_current_test_suite);
53955395
}
53965396

53975397
// Sets the TestInfo object for the test that's currently running.
53985398
void UnitTest::set_current_test_info(TestInfo* a_current_test_info) {
5399-
internal::MutexLock lock(&mutex_);
5399+
internal::MutexLock lock(mutex_);
54005400
impl_->set_current_test_info(a_current_test_info);
54015401
}
54025402

@@ -5435,7 +5435,7 @@ void UnitTest::AddTestPartResult(TestPartResult::Type result_type,
54355435
Message msg;
54365436
msg << message;
54375437

5438-
internal::MutexLock lock(&mutex_);
5438+
internal::MutexLock lock(mutex_);
54395439
if (!impl_->gtest_trace_stack().empty()) {
54405440
msg << "\n" << GTEST_NAME_ << " trace:";
54415441

@@ -5618,15 +5618,15 @@ const char* UnitTest::original_working_dir() const {
56185618
// or NULL if no test is running.
56195619
const TestSuite* UnitTest::current_test_suite() const
56205620
GTEST_LOCK_EXCLUDED_(mutex_) {
5621-
internal::MutexLock lock(&mutex_);
5621+
internal::MutexLock lock(mutex_);
56225622
return impl_->current_test_suite();
56235623
}
56245624

56255625
// Legacy API is still available but deprecated
56265626
#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
56275627
const TestCase* UnitTest::current_test_case() const
56285628
GTEST_LOCK_EXCLUDED_(mutex_) {
5629-
internal::MutexLock lock(&mutex_);
5629+
internal::MutexLock lock(mutex_);
56305630
return impl_->current_test_suite();
56315631
}
56325632
#endif
@@ -5635,7 +5635,7 @@ const TestCase* UnitTest::current_test_case() const
56355635
// or NULL if no test is running.
56365636
const TestInfo* UnitTest::current_test_info() const
56375637
GTEST_LOCK_EXCLUDED_(mutex_) {
5638-
internal::MutexLock lock(&mutex_);
5638+
internal::MutexLock lock(mutex_);
56395639
return impl_->current_test_info();
56405640
}
56415641

@@ -5659,13 +5659,13 @@ UnitTest::~UnitTest() { delete impl_; }
56595659
// Google Test trace stack.
56605660
void UnitTest::PushGTestTrace(const internal::TraceInfo& trace)
56615661
GTEST_LOCK_EXCLUDED_(mutex_) {
5662-
internal::MutexLock lock(&mutex_);
5662+
internal::MutexLock lock(mutex_);
56635663
impl_->gtest_trace_stack().push_back(trace);
56645664
}
56655665

56665666
// Pops a trace from the per-thread Google Test trace stack.
56675667
void UnitTest::PopGTestTrace() GTEST_LOCK_EXCLUDED_(mutex_) {
5668-
internal::MutexLock lock(&mutex_);
5668+
internal::MutexLock lock(mutex_);
56695669
impl_->gtest_trace_stack().pop_back();
56705670
}
56715671

@@ -6088,15 +6088,17 @@ bool UnitTestImpl::RunAllTests() {
60886088
repeater->OnEnvironmentsTearDownEnd(*parent_);
60896089
}
60906090
} else if (GTEST_FLAG_GET(fail_if_no_test_selected)) {
6091-
// If there were no tests to run, bail if we were requested to be strict.
6091+
// If there were no tests to run, bail if we were requested to be
6092+
// strict.
60926093
constexpr char kNoTestsSelectedMessage[] =
6093-
"No tests were selected to run. Please make sure at least one test "
6094-
"exists and is not disabled! If the test is sharded, you may have "
6095-
"defined more shards than test cases, which is wasteful. If you also "
6096-
"defined --gtest_filter, that filter is taken into account, so "
6097-
"shards with no matching test cases will hit this error. Either "
6098-
"disable sharding, set --gtest_fail_if_no_test_selected=false, or "
6099-
"remove the filter to resolve this error.";
6094+
"No tests ran. Check that tests exist and are not disabled or "
6095+
"filtered out.\n\n"
6096+
"For sharded runs, this error indicates an empty shard. This can "
6097+
"happen if you have more shards than tests, or if --gtest_filter "
6098+
"leaves a shard with no tests.\n\n"
6099+
"To permit empty shards (e.g., when debugging with a filter), "
6100+
"specify \n"
6101+
"--gtest_fail_if_no_test_selected=false.";
61006102
ColoredPrintf(GTestColor::kRed, "%s\n", kNoTestsSelectedMessage);
61016103
return false;
61026104
}

0 commit comments

Comments
 (0)