OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 { } | 122 { } |
123 | 123 |
124 ~DestructCounter() { ++(*m_destructNumber); } | 124 ~DestructCounter() { ++(*m_destructNumber); } |
125 int get() const { return m_i; } | 125 int get() const { return m_i; } |
126 | 126 |
127 private: | 127 private: |
128 int m_i; | 128 int m_i; |
129 int* m_destructNumber; | 129 int* m_destructNumber; |
130 }; | 130 }; |
131 | 131 |
132 typedef WTF::Vector<OwnPtr<DestructCounter> > OwnPtrVector; | 132 typedef WTF::Vector<OwnPtr<DestructCounter>> OwnPtrVector; |
133 | 133 |
134 TEST(VectorTest, OwnPtr) | 134 TEST(VectorTest, OwnPtr) |
135 { | 135 { |
136 int destructNumber = 0; | 136 int destructNumber = 0; |
137 OwnPtrVector vector; | 137 OwnPtrVector vector; |
138 vector.append(adoptPtr(new DestructCounter(0, &destructNumber))); | 138 vector.append(adoptPtr(new DestructCounter(0, &destructNumber))); |
139 vector.append(adoptPtr(new DestructCounter(1, &destructNumber))); | 139 vector.append(adoptPtr(new DestructCounter(1, &destructNumber))); |
140 EXPECT_EQ(2u, vector.size()); | 140 EXPECT_EQ(2u, vector.size()); |
141 | 141 |
142 OwnPtr<DestructCounter>& counter0 = vector.first(); | 142 OwnPtr<DestructCounter>& counter0 = vector.first(); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 EXPECT_TRUE(Vector<T>(1) == Vector<T>(1)); | 296 EXPECT_TRUE(Vector<T>(1) == Vector<T>(1)); |
297 } | 297 } |
298 | 298 |
299 TEST(VectorTest, Compare) | 299 TEST(VectorTest, Compare) |
300 { | 300 { |
301 compare<int>(); | 301 compare<int>(); |
302 compare<Comparable>(); | 302 compare<Comparable>(); |
303 compare<WTF::String>(); | 303 compare<WTF::String>(); |
304 } | 304 } |
305 } // namespace | 305 } // namespace |
OLD | NEW |