| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 static void RunAllTests(); | 137 static void RunAllTests(); |
| 138 static void TearDown(); | 138 static void TearDown(); |
| 139 // This method switches threads if we are running the Threading test. | 139 // This method switches threads if we are running the Threading test. |
| 140 // Otherwise it does nothing. | 140 // Otherwise it does nothing. |
| 141 static void Fuzz(); | 141 static void Fuzz(); |
| 142 | 142 |
| 143 private: | 143 private: |
| 144 explicit ApiTestFuzzer(int num) | 144 explicit ApiTestFuzzer(int num) |
| 145 : Thread("ApiTestFuzzer"), | 145 : Thread("ApiTestFuzzer"), |
| 146 test_number_(num), | 146 test_number_(num), |
| 147 gate_(v8::internal::OS::CreateSemaphore(0)), | 147 gate_(0), |
| 148 active_(true) { | 148 active_(true) { |
| 149 } | 149 } |
| 150 ~ApiTestFuzzer() { delete gate_; } | 150 ~ApiTestFuzzer() {} |
| 151 | 151 |
| 152 static bool fuzzing_; | 152 static bool fuzzing_; |
| 153 static int tests_being_run_; | 153 static int tests_being_run_; |
| 154 static int current_; | 154 static int current_; |
| 155 static int active_tests_; | 155 static int active_tests_; |
| 156 static bool NextThread(); | 156 static bool NextThread(); |
| 157 int test_number_; | 157 int test_number_; |
| 158 v8::internal::Semaphore* gate_; | 158 v8::internal::Semaphore gate_; |
| 159 bool active_; | 159 bool active_; |
| 160 void ContextSwitch(); | 160 void ContextSwitch(); |
| 161 static int GetNextTestNumber(); | 161 static int GetNextTestNumber(); |
| 162 static v8::internal::Semaphore* all_tests_done_; | 162 static v8::internal::Semaphore all_tests_done_; |
| 163 }; | 163 }; |
| 164 | 164 |
| 165 | 165 |
| 166 #define THREADED_TEST(Name) \ | 166 #define THREADED_TEST(Name) \ |
| 167 static void Test##Name(); \ | 167 static void Test##Name(); \ |
| 168 RegisterThreadedTest register_##Name(Test##Name, #Name); \ | 168 RegisterThreadedTest register_##Name(Test##Name, #Name); \ |
| 169 /* */ TEST(Name) | 169 /* */ TEST(Name) |
| 170 | 170 |
| 171 | 171 |
| 172 class RegisterThreadedTest { | 172 class RegisterThreadedTest { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 static inline void SimulateFullSpace(v8::internal::PagedSpace* space) { | 294 static inline void SimulateFullSpace(v8::internal::PagedSpace* space) { |
| 295 int old_linear_size = static_cast<int>(space->limit() - space->top()); | 295 int old_linear_size = static_cast<int>(space->limit() - space->top()); |
| 296 space->Free(space->top(), old_linear_size); | 296 space->Free(space->top(), old_linear_size); |
| 297 space->SetTop(space->limit(), space->limit()); | 297 space->SetTop(space->limit(), space->limit()); |
| 298 space->ResetFreeList(); | 298 space->ResetFreeList(); |
| 299 space->ClearStats(); | 299 space->ClearStats(); |
| 300 } | 300 } |
| 301 | 301 |
| 302 | 302 |
| 303 #endif // ifndef CCTEST_H_ | 303 #endif // ifndef CCTEST_H_ |
| OLD | NEW |