// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: wan@google.com (Zhanyong Wan)
+
// Tests that SCOPED_TRACE() and various Google Test assertions can be
// used in a large number of threads concurrently.
#include "gtest/gtest.h"
-#include <iostream>
#include <vector>
-// We must define this macro in order to #include
-// gtest-internal-inl.h. This is how Google Test prevents a user from
-// accidentally depending on its internal implementation.
-#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
#if GTEST_IS_THREADSAFE
using internal::Notification;
using internal::TestPropertyKeyIs;
using internal::ThreadWithParam;
-using internal::scoped_ptr;
// In order to run tests in this file, for platforms where Google Test is
// thread safe, implement ThreadWithParam. See the description of its API
// concurrently.
TEST(StressTest, CanUseScopedTraceAndAssertionsInManyThreads) {
{
- scoped_ptr<ThreadWithParam<int> > threads[kThreadCount];
+ std::unique_ptr<ThreadWithParam<int> > threads[kThreadCount];
Notification threads_can_start;
for (int i = 0; i != kThreadCount; i++)
threads[i].reset(new ThreadWithParam<int>(&ManyAsserts,
}
void GenerateFatalFailureInAnotherThread(bool is_fatal) {
- ThreadWithParam<bool> thread(&FailingThread, is_fatal, NULL);
+ ThreadWithParam<bool> thread(&FailingThread, is_fatal, nullptr);
thread.Join();
}