Revert "fix tests"

This reverts commit d9265aa9a8.
This commit is contained in:
Simon Zolin 2019-08-16 14:54:11 +03:00
parent 28cc9dc973
commit 56c69cdb79
2 changed files with 3 additions and 11 deletions

View File

@ -30,13 +30,13 @@ var setts RequestFilteringSettings
func purgeCaches() {
if gctx.safebrowsingCache != nil {
gctx.safebrowsingCache.Reset()
gctx.safebrowsingCache.Purge()
}
if gctx.parentalCache != nil {
gctx.parentalCache.Reset()
gctx.parentalCache.Purge()
}
if gctx.safeSearchCache != nil {
gctx.safeSearchCache.Reset()
gctx.safeSearchCache.Purge()
}
}
@ -51,10 +51,6 @@ func NewForTest(c *Config, filters map[int]string) *Dnsfilter {
setts = RequestFilteringSettings{}
setts.FilteringEnabled = true
if c != nil {
c.SafeBrowsingCacheSize = 1024
c.SafeSearchCacheSize = 1024
c.ParentalCacheSize = 1024
setts.SafeSearchEnabled = c.SafeSearchEnabled
setts.SafeBrowsingEnabled = c.SafeBrowsingEnabled
setts.ParentalEnabled = c.ParentalEnabled

View File

@ -458,10 +458,6 @@ func createTestServer(t *testing.T) *Server {
s.conf.FilteringConfig.SafeBrowsingEnabled = true
s.conf.Filters = make([]dnsfilter.Filter, 0)
s.conf.SafeBrowsingCacheSize = 1024
s.conf.SafeSearchCacheSize = 1024
s.conf.ParentalCacheSize = 1024
rules := "||nxdomain.example.org^\n||null.example.org^\n127.0.0.1 host.example.org\n"
filter := dnsfilter.Filter{ID: 0, Data: []byte(rules)}
s.conf.Filters = append(s.conf.Filters, filter)