OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "core/editing/markers/DocumentMarker.h" | |
6 | |
7 #include "testing/gtest/include/gtest/gtest.h" | |
8 | |
9 namespace blink { | |
10 | |
11 class DocumentMarkerTest : public ::testing::Test {}; | |
12 | |
13 TEST_F(DocumentMarkerTest, MarkerTypesIterator) { | |
yosin_UTC9
2017/03/22 04:06:26
I would like to have explicit test cases rather th
| |
14 for (unsigned markerTypesIndex = 0; | |
15 markerTypesIndex < (1 << DocumentMarker::MarkerTypeIndexesCount); | |
16 ++markerTypesIndex) { | |
17 DocumentMarker::MarkerTypes markerTypes(markerTypesIndex); | |
18 Vector<DocumentMarker::MarkerType> typesFromIterator; | |
19 | |
20 for (DocumentMarker::MarkerType type : markerTypes) | |
21 typesFromIterator.push_back(type); | |
22 | |
23 for (int markerTypeIndex = 0; | |
24 markerTypeIndex < DocumentMarker::MarkerTypeIndexesCount; | |
25 ++markerTypeIndex) { | |
26 DocumentMarker::MarkerType type = | |
27 static_cast<DocumentMarker::MarkerType>(1 << markerTypeIndex); | |
28 ASSERT_EQ(markerTypes.contains(type), typesFromIterator.contains(type)) | |
29 << "MarkerTypeIterator returned wrong result for MarkerType " | |
30 << (1 << markerTypeIndex) << " in MarkerTypes with mask " | |
31 << markerTypesIndex; | |
32 } | |
33 } | |
34 } | |
35 } | |
OLD | NEW |