OLD | NEW |
| (Empty) |
1 Index header: | |
2 num_entries: 8 | |
3 num_bytes: 52 | |
4 this_id: 1 | |
5 table_len: 64k | |
6 | |
7 head: 0x90000004 | |
8 tail: 0x90000000 | |
9 | |
10 Address: 0xa0010007 | |
11 Address: 0xa0010003 | |
12 Address: 0xa001000b | |
13 Address: 0xa001000a | |
14 Address: 0xa0010009 | |
15 Address: 0xa0010006 | |
16 Address: 0xa0010005 | |
17 Address: 0xa0010002 | |
18 | |
19 | |
20 ------------------------------- | |
21 | |
22 entry: | |
23 Address: 0xa0010007 | |
24 hash: 0xcb30d119 | |
25 next: 0 | |
26 rankings_node: 0x90000004 | |
27 key_len: 5 | |
28 long_key: 0 | |
29 data_size[0]: 4 | |
30 data_addr[0]: 0xa0010008 | |
31 key: "fifth" | |
32 | |
33 rankings: | |
34 Address: 0x90000004 | |
35 next: 0x90000001 | |
36 prev: 0x90000004 | |
37 contents: 0xa0010007 | |
38 dirty: 0 | |
39 pointer: 0 | |
40 | |
41 ------------------------------- | |
42 | |
43 entry: | |
44 Address: 0xa0010003 | |
45 hash: 0x090fbce3 | |
46 next: 0 | |
47 rankings_node: 0x90000001 | |
48 key_len: 6 | |
49 long_key: 0 | |
50 data_size[0]: 4 | |
51 data_addr[0]: 0xa0010004 | |
52 key: "second" | |
53 | |
54 rankings: | |
55 Address: 0x90000001 | |
56 next: 0x90000007 | |
57 prev: 0x90000004 | |
58 contents: 0xa0010003 | |
59 dirty: 0 | |
60 pointer: 0 | |
61 | |
62 ------------------------------- | |
63 | |
64 entry: | |
65 Address: 0xa001000b | |
66 hash: 0xad80b702 | |
67 next: 0 | |
68 rankings_node: 0x90000007 | |
69 key_len: 5 | |
70 long_key: 0 | |
71 data_size: 0's | |
72 data_addr: 0's | |
73 key: "eight" | |
74 | |
75 rankings: | |
76 Address: 0x90000007 | |
77 next: 0x90000006 | |
78 prev: 0x90000001 | |
79 contents: 0xa001000b | |
80 dirty: 0 | |
81 pointer: 0 | |
82 | |
83 ------------------------------- | |
84 | |
85 entry: | |
86 Address: 0xa001000a | |
87 hash: 0xfdae1d2a | |
88 next: 0 | |
89 rankings_node: 0x90000006 | |
90 key_len: 7 | |
91 long_key: 0 | |
92 data_size: 0's | |
93 data_addr: 0's | |
94 key: "seventh" | |
95 | |
96 rankings: | |
97 Address: 0x90000006 | |
98 next: 0x90000005 | |
99 prev: 0x90000007 | |
100 contents: 0xa001000a | |
101 dirty: 0 | |
102 pointer: 0 | |
103 | |
104 ------------------------------- | |
105 | |
106 entry: | |
107 Address: 0xa0010009 | |
108 hash: 0x2129e026 | |
109 next: 0 | |
110 rankings_node: 0x90000005 | |
111 key_len: 5 | |
112 long_key: 0 | |
113 data_size: 0's | |
114 data_addr: 0's | |
115 key: "sixth" | |
116 | |
117 rankings: | |
118 Address: 0x90000005 | |
119 next: 0x90000003 | |
120 prev: 0x90000006 | |
121 contents: 0xa0010009 | |
122 dirty: 0 | |
123 pointer: 0 | |
124 | |
125 ------------------------------- | |
126 | |
127 entry: | |
128 Address: 0xa0010006 | |
129 hash: 0x3d9011cc | |
130 next: 0 | |
131 rankings_node: 0x90000003 | |
132 key_len: 6 | |
133 long_key: 0 | |
134 data_size: 0's | |
135 data_addr: 0's | |
136 key: "fourth" | |
137 | |
138 rankings: | |
139 Address: 0x90000003 | |
140 next: 0x90000002 | |
141 prev: 0x90000005 | |
142 contents: 0xa0010006 | |
143 dirty: 0 | |
144 pointer: 0 | |
145 | |
146 ------------------------------- | |
147 | |
148 entry: | |
149 Address: 0xa0010005 | |
150 hash: 0x8f04b77c | |
151 next: 0 | |
152 rankings_node: 0x90000002 | |
153 key_len: 5 | |
154 long_key: 0 | |
155 data_size: 0's | |
156 data_addr: 0's | |
157 key: "third" | |
158 | |
159 rankings: | |
160 Address: 0x90000002 | |
161 next: 0x90000001 <--------- wrong | |
162 prev: 0x90000003 | |
163 contents: 0xa0010005 | |
164 dirty: 0 | |
165 pointer: 0 | |
166 | |
167 ------------------------------- | |
168 | |
169 entry: | |
170 Address: 0xa0010002 | |
171 hash: 0x0138974a | |
172 next: 0 | |
173 rankings_node: 0x90000000 | |
174 key_len: 5 | |
175 long_key: 0 | |
176 data_size: 0's | |
177 data_addr: 0's | |
178 key: "first" | |
179 | |
180 rankings: | |
181 Address: 0x90000000 | |
182 next: 0x90000000 | |
183 prev: 0x90000002 | |
184 contents: 0xa0010002 | |
185 dirty: 0 | |
186 pointer: 0 | |
187 | |
188 ============================== | |
189 | |
190 Generated with: | |
191 | |
192 disk_cache::Entry *entry; | |
193 ASSERT_TRUE(cache_->CreateEntry("first", &entry)); | |
194 entry->Close(); | |
195 | |
196 char buffer[] = "abcd"; | |
197 ASSERT_TRUE(cache_->CreateEntry("second", &entry)); | |
198 entry->WriteData(0, 0, buffer, 4, NULL, false); | |
199 entry->Close(); | |
200 | |
201 ASSERT_TRUE(cache_->CreateEntry("third", &entry)); | |
202 entry->Close(); | |
203 | |
204 ASSERT_TRUE(cache_->CreateEntry("fourth", &entry)); | |
205 entry->Close(); | |
206 | |
207 ASSERT_TRUE(cache_->CreateEntry("fifth", &entry)); | |
208 entry->WriteData(0, 0, buffer, 4, NULL, false); | |
209 entry->Close(); | |
210 | |
211 ASSERT_TRUE(cache_->CreateEntry("sixth", &entry)); | |
212 entry->Close(); | |
213 | |
214 ASSERT_TRUE(cache_->CreateEntry("seventh", &entry)); | |
215 entry->Close(); | |
216 | |
217 ASSERT_TRUE(cache_->CreateEntry("eight", &entry)); | |
218 entry->Close(); | |
219 | |
220 ASSERT_TRUE(cache_->OpenEntry("second", &entry)); | |
221 entry->ReadData(0, 0, buffer, 4, NULL); <--- fix the values* | |
222 entry->Close(); | |
223 | |
224 ASSERT_TRUE(cache_->OpenEntry("fifth", &entry)); | |
225 entry->ReadData(0, 0, buffer, 4, NULL); | |
226 entry->Close(); | |
227 | |
228 * break on Rankings::Remove() and edit the values before they are saved. | |
OLD | NEW |