OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 printf("diff at offset %d (%p): is %d, should be %d\n", | 133 printf("diff at offset %d (%p): is %d, should be %d\n", |
134 i, reinterpret_cast<void*>(area2 + i), area2[i], area3[i]); | 134 i, reinterpret_cast<void*>(area2 + i), area2[i], area3[i]); |
135 } | 135 } |
136 CHECK(false); | 136 CHECK(false); |
137 } | 137 } |
138 } | 138 } |
139 | 139 |
140 | 140 |
141 TEST(MemMove) { | 141 TEST(MemMove) { |
142 v8::V8::Initialize(); | 142 v8::V8::Initialize(); |
143 OS::SetUp(); | |
144 byte* area1 = new byte[kAreaSize]; | 143 byte* area1 = new byte[kAreaSize]; |
145 byte* area2 = new byte[kAreaSize]; | 144 byte* area2 = new byte[kAreaSize]; |
146 byte* area3 = new byte[kAreaSize]; | 145 byte* area3 = new byte[kAreaSize]; |
147 | 146 |
148 static const int kMinOffset = 32; | 147 static const int kMinOffset = 32; |
149 static const int kMaxOffset = 64; | 148 static const int kMaxOffset = 64; |
150 static const int kMaxLength = 128; | 149 static const int kMaxLength = 128; |
151 STATIC_ASSERT(kMaxOffset + kMaxLength < kAreaSize); | 150 STATIC_ASSERT(kMaxOffset + kMaxLength < kAreaSize); |
152 | 151 |
153 for (int src_offset = kMinOffset; src_offset <= kMaxOffset; src_offset++) { | 152 for (int src_offset = kMinOffset; src_offset <= kMaxOffset; src_offset++) { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 TEST(SequenceCollectorRegression) { | 226 TEST(SequenceCollectorRegression) { |
228 SequenceCollector<char> collector(16); | 227 SequenceCollector<char> collector(16); |
229 collector.StartSequence(); | 228 collector.StartSequence(); |
230 collector.Add('0'); | 229 collector.Add('0'); |
231 collector.AddBlock( | 230 collector.AddBlock( |
232 i::Vector<const char>("12345678901234567890123456789012", 32)); | 231 i::Vector<const char>("12345678901234567890123456789012", 32)); |
233 i::Vector<char> seq = collector.EndSequence(); | 232 i::Vector<char> seq = collector.EndSequence(); |
234 CHECK_EQ(0, strncmp("0123456789012345678901234567890123", | 233 CHECK_EQ(0, strncmp("0123456789012345678901234567890123", |
235 seq.start(), seq.length())); | 234 seq.start(), seq.length())); |
236 } | 235 } |
OLD | NEW |