Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(571)

Side by Side Diff: test/cctest/cctest.cc

Issue 53089: Fixed test memory leaks (Closed)
Patch Set: Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 12 matching lines...) Expand all
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #include <v8.h> 28 #include <v8.h>
29 #include <cstdlib> 29 #include <cstdlib>
30 #include <cstring> 30 #include <cstring>
31 #include <cstdio> 31 #include <cstdio>
32 #include "cctest.h" 32 #include "cctest.h"
33 #include "debug.h"
33 34
34 35
35 CcTest* CcTest::last_ = NULL; 36 CcTest* CcTest::last_ = NULL;
36 37
37 38
38 CcTest::CcTest(TestFunction* callback, const char* file, const char* name, 39 CcTest::CcTest(TestFunction* callback, const char* file, const char* name,
39 const char* dependency, bool enabled) 40 const char* dependency, bool enabled)
40 : callback_(callback), name_(name), dependency_(dependency), prev_(last_) { 41 : callback_(callback), name_(name), dependency_(dependency), prev_(last_) {
41 // Find the base name of this test (const_cast required on Windows). 42 // Find the base name of this test (const_cast required on Windows).
42 char *basename = strrchr(const_cast<char *>(file), '/'); 43 char *basename = strrchr(const_cast<char *>(file), '/');
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 tests_run++; 114 tests_run++;
114 } 115 }
115 test = test->prev(); 116 test = test->prev();
116 } 117 }
117 } 118 }
118 v8::internal::DeleteArray<char>(arg_copy); 119 v8::internal::DeleteArray<char>(arg_copy);
119 } 120 }
120 } 121 }
121 if (print_run_count && tests_run != 1) 122 if (print_run_count && tests_run != 1)
122 printf("Ran %i tests.\n", tests_run); 123 printf("Ran %i tests.\n", tests_run);
124 v8::V8::Dispose();
123 return 0; 125 return 0;
124 } 126 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698