OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 5746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5757 { | 5757 { |
5758 HeapVector<PartObjectWithRef> vector1; | 5758 HeapVector<PartObjectWithRef> vector1; |
5759 HeapVector<PartObjectWithRef> vector2; | 5759 HeapVector<PartObjectWithRef> vector2; |
5760 | 5760 |
5761 for (int i = 0; i < 10; ++i) { | 5761 for (int i = 0; i < 10; ++i) { |
5762 vector1.append(PartObjectWithRef(i)); | 5762 vector1.append(PartObjectWithRef(i)); |
5763 vector2.append(PartObjectWithRef(i)); | 5763 vector2.append(PartObjectWithRef(i)); |
5764 } | 5764 } |
5765 | 5765 |
5766 vector1.reserveCapacity(150); | 5766 vector1.reserveCapacity(150); |
5767 EXPECT_EQ(150u, vector1.capacity()); | 5767 EXPECT_LE(150u, vector1.capacity()); |
5768 EXPECT_EQ(10u, vector1.size()); | 5768 EXPECT_EQ(10u, vector1.size()); |
5769 | 5769 |
5770 vector2.reserveCapacity(100); | 5770 vector2.reserveCapacity(100); |
5771 EXPECT_EQ(100u, vector2.capacity()); | 5771 EXPECT_LE(100u, vector2.capacity()); |
5772 EXPECT_EQ(10u, vector2.size()); | 5772 EXPECT_EQ(10u, vector2.size()); |
5773 | 5773 |
5774 for (int i = 0; i < 4; ++i) { | 5774 for (int i = 0; i < 4; ++i) { |
5775 vector1.append(PartObjectWithRef(10 + i)); | 5775 vector1.append(PartObjectWithRef(10 + i)); |
5776 vector2.append(PartObjectWithRef(10 + i)); | 5776 vector2.append(PartObjectWithRef(10 + i)); |
5777 vector2.append(PartObjectWithRef(10 + i)); | 5777 vector2.append(PartObjectWithRef(10 + i)); |
5778 } | 5778 } |
5779 | 5779 |
5780 // Shrinking heap vector backing stores always succeeds, | 5780 // Shrinking heap vector backing stores always succeeds, |
5781 // so these two will not currently exercise the code path | 5781 // so these two will not currently exercise the code path |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5924 { | 5924 { |
5925 Persistent<ClassWithMember> object = ClassWithMember::create(); | 5925 Persistent<ClassWithMember> object = ClassWithMember::create(); |
5926 EXPECT_EQ(0, object->traceCount()); | 5926 EXPECT_EQ(0, object->traceCount()); |
5927 TestMixinAllocatingObject* mixin = TestMixinAllocatingObject::create(object.
get()); | 5927 TestMixinAllocatingObject* mixin = TestMixinAllocatingObject::create(object.
get()); |
5928 EXPECT_TRUE(mixin); | 5928 EXPECT_TRUE(mixin); |
5929 EXPECT_GT(object->traceCount(), 0); | 5929 EXPECT_GT(object->traceCount(), 0); |
5930 EXPECT_GT(mixin->traceCount(), 0); | 5930 EXPECT_GT(mixin->traceCount(), 0); |
5931 } | 5931 } |
5932 | 5932 |
5933 } // namespace blink | 5933 } // namespace blink |
OLD | NEW |