| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Tests of the circular queue. | 3 // Tests of the circular queue. |
| 4 | 4 |
| 5 #include "v8.h" | 5 #include "v8.h" |
| 6 #include "circular-queue-inl.h" | 6 #include "circular-queue-inl.h" |
| 7 #include "cctest.h" | 7 #include "cctest.h" |
| 8 | 8 |
| 9 namespace i = v8::internal; | |
| 10 | |
| 11 using i::SamplingCircularQueue; | 9 using i::SamplingCircularQueue; |
| 12 | 10 |
| 13 | 11 |
| 14 TEST(SamplingCircularQueue) { | 12 TEST(SamplingCircularQueue) { |
| 15 typedef SamplingCircularQueue::Cell Record; | 13 typedef SamplingCircularQueue::Cell Record; |
| 16 const int kRecordsPerChunk = 4; | 14 const int kRecordsPerChunk = 4; |
| 17 SamplingCircularQueue scq(sizeof(Record), | 15 SamplingCircularQueue scq(sizeof(Record), |
| 18 kRecordsPerChunk * sizeof(Record), | 16 kRecordsPerChunk * sizeof(Record), |
| 19 3); | 17 3); |
| 20 | 18 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 CHECK_EQ(static_cast<int64_t>(i), static_cast<int64_t>(*rec)); | 167 CHECK_EQ(static_cast<int64_t>(i), static_cast<int64_t>(*rec)); |
| 170 CHECK_EQ(rec, reinterpret_cast<Record*>(scq.StartDequeue())); | 168 CHECK_EQ(rec, reinterpret_cast<Record*>(scq.StartDequeue())); |
| 171 scq.FinishDequeue(); | 169 scq.FinishDequeue(); |
| 172 CHECK_NE(rec, reinterpret_cast<Record*>(scq.StartDequeue())); | 170 CHECK_NE(rec, reinterpret_cast<Record*>(scq.StartDequeue())); |
| 173 } | 171 } |
| 174 | 172 |
| 175 CHECK_EQ(NULL, scq.StartDequeue()); | 173 CHECK_EQ(NULL, scq.StartDequeue()); |
| 176 | 174 |
| 177 delete semaphore; | 175 delete semaphore; |
| 178 } | 176 } |
| OLD | NEW |