Left: | ||
Right: |
OLD | NEW |
---|---|
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 | 157 |
158 let filter2 = Filter.fromText("someknownfilter"); | 158 let filter2 = Filter.fromText("someknownfilter"); |
159 test.equal(filter2.hitCount, 432, "Known filter returned"); | 159 test.equal(filter2.hitCount, 432, "Known filter returned"); |
160 | 160 |
161 filter2.hitCount = 234; | 161 filter2.hitCount = 234; |
162 test.equal(filter1.hitCount, 234, "Changing second wrapper modifies original a s well"); | 162 test.equal(filter1.hitCount, 234, "Changing second wrapper modifies original a s well"); |
163 | 163 |
164 filter1.delete(); | 164 filter1.delete(); |
165 filter2.delete(); | 165 filter2.delete(); |
166 | 166 |
167 test.throws(() => { filter1.delete() == 0; }); | |
sergei
2017/10/11 12:52:55
What about putting them into a separate test?
sergei
2017/10/11 12:52:56
IMO it would be better to remove these comparisons
hub
2017/10/11 14:47:01
I don't know was I put the '== 0' here.
I think t
| |
168 test.throws(() => { filter1.hitCount == 0; }); | |
169 test.throws(() => { filter1._pointer == 0xdeadbeef; }); | |
Wladimir Palant
2017/10/11 13:51:52
I agree, comparisons aren't necessary. Also, you s
hub
2017/10/11 14:47:01
Done.
| |
170 | |
167 let filter3 = Filter.fromText("someknownfilter"); | 171 let filter3 = Filter.fromText("someknownfilter"); |
168 test.equal(filter3.hitCount, 0, "Filter data has been reset once previous inst ances have been released"); | 172 test.equal(filter3.hitCount, 0, "Filter data has been reset once previous inst ances have been released"); |
169 filter3.delete(); | 173 filter3.delete(); |
170 | 174 |
171 test.done(); | 175 test.done(); |
172 }; | 176 }; |
173 | 177 |
174 exports.testNormalize = function(test) | 178 exports.testNormalize = function(test) |
175 { | 179 { |
176 let tests = [ | 180 let tests = [ |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
424 filter.hitCount++; | 428 filter.hitCount++; |
425 }, ["filter.hitCount", "foobar"], "Increasing filter hit counts"); | 429 }, ["filter.hitCount", "foobar"], "Increasing filter hit counts"); |
426 checkNotifications(() => | 430 checkNotifications(() => |
427 { | 431 { |
428 filter.hitCount = 0; | 432 filter.hitCount = 0; |
429 }, ["filter.hitCount", "foobar"], "Resetting filter hit counts"); | 433 }, ["filter.hitCount", "foobar"], "Resetting filter hit counts"); |
430 | 434 |
431 filter.delete(); | 435 filter.delete(); |
432 test.done(); | 436 test.done(); |
433 }; | 437 }; |
OLD | NEW |