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

Side by Side Diff: net/base/prioritized_dispatcher_unittest.cc

Issue 826973002: replace COMPILE_ASSERT with static_assert in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 5 years, 11 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <ctype.h> 5 #include <ctype.h>
6 #include <string> 6 #include <string>
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/scoped_vector.h" 11 #include "base/memory/scoped_vector.h"
12 #include "net/base/prioritized_dispatcher.h" 12 #include "net/base/prioritized_dispatcher.h"
13 #include "net/base/request_priority.h" 13 #include "net/base/request_priority.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 namespace net { 16 namespace net {
17 17
18 namespace { 18 namespace {
19 19
20 // We rely on the priority enum values being sequential having starting at 0, 20 // We rely on the priority enum values being sequential having starting at 0,
21 // and increasing for higher priorities. 21 // and increasing for higher priorities.
22 COMPILE_ASSERT(MINIMUM_PRIORITY == 0u && 22 static_assert(MINIMUM_PRIORITY == 0u && MINIMUM_PRIORITY == IDLE &&
23 MINIMUM_PRIORITY == IDLE && 23 IDLE < LOWEST &&
Deprecated (see juliatuttle) 2015/01/05 22:22:38 Is there a reason that this line and the next aren
Mostyn Bramley-Moore 2015/01/06 00:07:07 I was just following the original style of this co
24 IDLE < LOWEST && 24 LOWEST < HIGHEST &&
25 LOWEST < HIGHEST && 25 HIGHEST <= MAXIMUM_PRIORITY,
26 HIGHEST <= MAXIMUM_PRIORITY, 26 "priority indexes incompatible");
27 priority_indexes_incompatible);
28 27
29 class PrioritizedDispatcherTest : public testing::Test { 28 class PrioritizedDispatcherTest : public testing::Test {
30 public: 29 public:
31 typedef PrioritizedDispatcher::Priority Priority; 30 typedef PrioritizedDispatcher::Priority Priority;
32 // A job that appends |tag| to |log| when started and '.' when finished. 31 // A job that appends |tag| to |log| when started and '.' when finished.
33 // This is intended to confirm the execution order of a sequence of jobs added 32 // This is intended to confirm the execution order of a sequence of jobs added
34 // to the dispatcher. Note that finishing order of jobs does not matter. 33 // to the dispatcher. Note that finishing order of jobs does not matter.
35 class TestJob : public PrioritizedDispatcher::Job { 34 class TestJob : public PrioritizedDispatcher::Job {
36 public: 35 public:
37 TestJob(PrioritizedDispatcher* dispatcher, 36 TestJob(PrioritizedDispatcher* dispatcher,
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 Prepare(limits); 559 Prepare(limits);
561 AddJob('a', IDLE); 560 AddJob('a', IDLE);
562 AddJob('b', IDLE); 561 AddJob('b', IDLE);
563 EXPECT_DEBUG_DEATH(dispatcher_->Cancel(handle), ""); 562 EXPECT_DEBUG_DEATH(dispatcher_->Cancel(handle), "");
564 } 563 }
565 #endif // GTEST_HAS_DEATH_TEST && !defined(NDEBUG) 564 #endif // GTEST_HAS_DEATH_TEST && !defined(NDEBUG)
566 565
567 } // namespace 566 } // namespace
568 567
569 } // namespace net 568 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698