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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 CHECK_EQ(from[i], to[i]); | 98 CHECK_EQ(from[i], to[i]); |
99 } | 99 } |
100 CHECK_EQ(0xFF, to[-1]); | 100 CHECK_EQ(0xFF, to[-1]); |
101 CHECK_EQ(0xFF, to[length]); | 101 CHECK_EQ(0xFF, to[length]); |
102 } | 102 } |
103 | 103 |
104 | 104 |
105 | 105 |
106 TEST(MemCopy) { | 106 TEST(MemCopy) { |
107 v8::V8::Initialize(); | 107 v8::V8::Initialize(); |
108 OS::Setup(); | 108 OS::SetUp(); |
109 const int N = OS::kMinComplexMemCopy + 128; | 109 const int N = OS::kMinComplexMemCopy + 128; |
110 Vector<byte> buffer1 = Vector<byte>::New(N); | 110 Vector<byte> buffer1 = Vector<byte>::New(N); |
111 Vector<byte> buffer2 = Vector<byte>::New(N); | 111 Vector<byte> buffer2 = Vector<byte>::New(N); |
112 | 112 |
113 for (int i = 0; i < N; i++) { | 113 for (int i = 0; i < N; i++) { |
114 buffer1[i] = static_cast<byte>(i & 0x7F); | 114 buffer1[i] = static_cast<byte>(i & 0x7F); |
115 } | 115 } |
116 | 116 |
117 // Same alignment. | 117 // Same alignment. |
118 for (int i = 0; i < 32; i++) { | 118 for (int i = 0; i < 32; i++) { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 TEST(SequenceCollectorRegression) { | 200 TEST(SequenceCollectorRegression) { |
201 SequenceCollector<char> collector(16); | 201 SequenceCollector<char> collector(16); |
202 collector.StartSequence(); | 202 collector.StartSequence(); |
203 collector.Add('0'); | 203 collector.Add('0'); |
204 collector.AddBlock( | 204 collector.AddBlock( |
205 i::Vector<const char>("12345678901234567890123456789012", 32)); | 205 i::Vector<const char>("12345678901234567890123456789012", 32)); |
206 i::Vector<char> seq = collector.EndSequence(); | 206 i::Vector<char> seq = collector.EndSequence(); |
207 CHECK_EQ(0, strncmp("0123456789012345678901234567890123", | 207 CHECK_EQ(0, strncmp("0123456789012345678901234567890123", |
208 seq.start(), seq.length())); | 208 seq.start(), seq.length())); |
209 } | 209 } |
OLD | NEW |