Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/filterClasses.js

Issue 29573044: Issue 5147 - Invalidate wrapper on delete (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Added tests Created Oct. 11, 2017, 12:49 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « compiled/bindings/generator.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/filterClasses.js
===================================================================
--- a/test/filterClasses.js
+++ b/test/filterClasses.js
@@ -159,16 +159,20 @@
test.equal(filter2.hitCount, 432, "Known filter returned");
filter2.hitCount = 234;
test.equal(filter1.hitCount, 234, "Changing second wrapper modifies original as well");
filter1.delete();
filter2.delete();
+ 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
+ test.throws(() => { filter1.hitCount == 0; });
+ 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.
+
let filter3 = Filter.fromText("someknownfilter");
test.equal(filter3.hitCount, 0, "Filter data has been reset once previous instances have been released");
filter3.delete();
test.done();
};
exports.testNormalize = function(test)
« no previous file with comments | « compiled/bindings/generator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld