Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(646)

Side by Side Diff: mojo/public/cpp/utility/tests/thread_unittest.cc

Issue 1755003002: Remove MOJO_DISALLOW_COPY_AND_ASSIGN and MOJO_ALLOW_UNUSED_LOCAL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/public/cpp/utility/tests/run_loop_unittest.cc ('k') | mojo/public/cpp/utility/thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/public/cpp/utility/thread.h" 5 #include "mojo/public/cpp/utility/thread.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "mojo/public/cpp/system/macros.h" 9 #include "mojo/public/cpp/system/macros.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 ~SetIntThread() override {} 27 ~SetIntThread() override {}
28 28
29 void Run() override { *int_to_set_ = value_; } 29 void Run() override { *int_to_set_ = value_; }
30 30
31 private: 31 private:
32 int* const int_to_set_; 32 int* const int_to_set_;
33 const int value_; 33 const int value_;
34 34
35 MOJO_DISALLOW_COPY_AND_ASSIGN(SetIntThread); 35 DISALLOW_COPY_AND_ASSIGN(SetIntThread);
36 }; 36 };
37 37
38 TEST(ThreadTest, CreateAndJoin) { 38 TEST(ThreadTest, CreateAndJoin) {
39 int value = 0; 39 int value = 0;
40 40
41 // Not starting the thread should result in a no-op. 41 // Not starting the thread should result in a no-op.
42 { 42 {
43 SetIntThread thread(&value, 1234567); 43 SetIntThread thread(&value, 1234567);
44 } 44 }
45 EXPECT_EQ(0, value); 45 EXPECT_EQ(0, value);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 options.set_stack_size(static_cast<size_t>(-1)); 99 options.set_stack_size(static_cast<size_t>(-1));
100 SetIntThread thread(options, &value, 4); 100 SetIntThread thread(options, &value, 4);
101 thread.Start(); 101 thread.Start();
102 thread.Join(); 102 thread.Join();
103 }, ""); 103 }, "");
104 } 104 }
105 #endif // !defined(NDEBUG) 105 #endif // !defined(NDEBUG)
106 106
107 } // namespace 107 } // namespace
108 } // namespace mojo 108 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/utility/tests/run_loop_unittest.cc ('k') | mojo/public/cpp/utility/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698