OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 24 matching lines...) Expand all Loading... |
35 public: | 35 public: |
36 using FieldType = DateTimeFormat::FieldType; | 36 using FieldType = DateTimeFormat::FieldType; |
37 | 37 |
38 struct Token { | 38 struct Token { |
39 String string; | 39 String string; |
40 int count; | 40 int count; |
41 FieldType field_type; | 41 FieldType field_type; |
42 | 42 |
43 Token(FieldType field_type, int count = 1) | 43 Token(FieldType field_type, int count = 1) |
44 : count(count), field_type(field_type) { | 44 : count(count), field_type(field_type) { |
45 ASSERT(field_type != DateTimeFormat::kFieldTypeLiteral); | 45 DCHECK_NE(field_type, DateTimeFormat::kFieldTypeLiteral); |
46 } | 46 } |
47 | 47 |
48 Token(const String& string) | 48 Token(const String& string) |
49 : string(string), | 49 : string(string), |
50 count(0), | 50 count(0), |
51 field_type(DateTimeFormat::kFieldTypeLiteral) {} | 51 field_type(DateTimeFormat::kFieldTypeLiteral) {} |
52 | 52 |
53 bool operator==(const Token& other) const { | 53 bool operator==(const Token& other) const { |
54 return field_type == other.field_type && count == other.count && | 54 return field_type == other.field_type && count == other.count && |
55 string == other.string; | 55 string == other.string; |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 EXPECT_EQ(DateTimeFormat::kFieldTypeInvalid, Single('O')); | 295 EXPECT_EQ(DateTimeFormat::kFieldTypeInvalid, Single('O')); |
296 EXPECT_EQ(DateTimeFormat::kFieldTypeInvalid, Single('P')); | 296 EXPECT_EQ(DateTimeFormat::kFieldTypeInvalid, Single('P')); |
297 EXPECT_EQ(DateTimeFormat::kFieldTypeInvalid, Single('R')); | 297 EXPECT_EQ(DateTimeFormat::kFieldTypeInvalid, Single('R')); |
298 EXPECT_EQ(DateTimeFormat::kFieldTypeInvalid, Single('T')); | 298 EXPECT_EQ(DateTimeFormat::kFieldTypeInvalid, Single('T')); |
299 EXPECT_EQ(DateTimeFormat::kFieldTypeInvalid, Single('U')); | 299 EXPECT_EQ(DateTimeFormat::kFieldTypeInvalid, Single('U')); |
300 EXPECT_EQ(DateTimeFormat::kFieldTypeInvalid, Single('V')); | 300 EXPECT_EQ(DateTimeFormat::kFieldTypeInvalid, Single('V')); |
301 EXPECT_EQ(DateTimeFormat::kFieldTypeInvalid, Single('X')); | 301 EXPECT_EQ(DateTimeFormat::kFieldTypeInvalid, Single('X')); |
302 } | 302 } |
303 | 303 |
304 } // namespace blink | 304 } // namespace blink |
OLD | NEW |