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

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

Issue 93120: Changed the ASSERT's in the cctest's to CHECK's (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-decls.cc ('k') | test/cctest/test-list.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 25 matching lines...) Expand all
36 static bool DefaultMatchFun(void* a, void* b) { 36 static bool DefaultMatchFun(void* a, void* b) {
37 return a == b; 37 return a == b;
38 } 38 }
39 39
40 40
41 class IntSet { 41 class IntSet {
42 public: 42 public:
43 IntSet() : map_(DefaultMatchFun) {} 43 IntSet() : map_(DefaultMatchFun) {}
44 44
45 void Insert(int x) { 45 void Insert(int x) {
46 ASSERT(x != 0); // 0 corresponds to (void*)NULL - illegal key value 46 CHECK(x != 0); // 0 corresponds to (void*)NULL - illegal key value
47 HashMap::Entry* p = map_.Lookup(reinterpret_cast<void*>(x), Hash(x), true); 47 HashMap::Entry* p = map_.Lookup(reinterpret_cast<void*>(x), Hash(x), true);
48 CHECK(p != NULL); // insert is set! 48 CHECK(p != NULL); // insert is set!
49 CHECK_EQ(reinterpret_cast<void*>(x), p->key); 49 CHECK_EQ(reinterpret_cast<void*>(x), p->key);
50 // we don't care about p->value 50 // we don't care about p->value
51 } 51 }
52 52
53 bool Present(int x) { 53 bool Present(int x) {
54 HashMap::Entry* p = map_.Lookup(reinterpret_cast<void*>(x), Hash(x), false); 54 HashMap::Entry* p = map_.Lookup(reinterpret_cast<void*>(x), Hash(x), false);
55 if (p != NULL) { 55 if (p != NULL) {
56 CHECK_EQ(reinterpret_cast<void*>(x), p->key); 56 CHECK_EQ(reinterpret_cast<void*>(x), p->key);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 // Verify the same sequence of values. 115 // Verify the same sequence of values.
116 x = start; 116 x = start;
117 for (uint32_t i = 0; i < n; i++) { 117 for (uint32_t i = 0; i < n; i++) {
118 CHECK(set.Present(x)); 118 CHECK(set.Present(x));
119 x = x*factor + offset; 119 x = x*factor + offset;
120 } 120 }
121 121
122 CHECK_EQ(n, static_cast<double>(set.occupancy())); 122 CHECK_EQ(n, static_cast<double>(set.occupancy()));
123 } 123 }
OLDNEW
« no previous file with comments | « test/cctest/test-decls.cc ('k') | test/cctest/test-list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698