From 56c69cdb793df5938f45ea56ac7c9a180063cf52 Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Fri, 16 Aug 2019 14:54:11 +0300 Subject: [PATCH] Revert "fix tests" This reverts commit d9265aa9a8c21d97206b0e43a03b448f2c33a510. --- dnsfilter/dnsfilter_test.go | 10 +++------- dnsforward/dnsforward_test.go | 4 ---- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/dnsfilter/dnsfilter_test.go b/dnsfilter/dnsfilter_test.go index 15ecec80..06658afd 100644 --- a/dnsfilter/dnsfilter_test.go +++ b/dnsfilter/dnsfilter_test.go @@ -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 diff --git a/dnsforward/dnsforward_test.go b/dnsforward/dnsforward_test.go index d190ea37..6b685510 100644 --- a/dnsforward/dnsforward_test.go +++ b/dnsforward/dnsforward_test.go @@ -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)