From e22ddae3a836f363f5d597ec2836542808bbcaa2 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Thu, 15 May 2014 00:47:11 -0300 Subject: [PATCH] Repair test suite --- beacon/cmd/mctest/main.go | 4 ++-- config/config_test.go | 2 +- model/model_test.go | 15 ++++++++------- {cmd/syncthing => model}/testdata/.stignore | 0 {cmd/syncthing => model}/testdata/bar | 0 {cmd/syncthing => model}/testdata/baz/quux | 0 {cmd/syncthing => model}/testdata/empty | 0 {cmd/syncthing => model}/testdata/foo | 0 {cmd/syncthing => model}/util_test.go | 2 +- 9 files changed, 12 insertions(+), 11 deletions(-) rename {cmd/syncthing => model}/testdata/.stignore (100%) rename {cmd/syncthing => model}/testdata/bar (100%) rename {cmd/syncthing => model}/testdata/baz/quux (100%) rename {cmd/syncthing => model}/testdata/empty (100%) rename {cmd/syncthing => model}/testdata/foo (100%) rename {cmd/syncthing => model}/util_test.go (99%) diff --git a/beacon/cmd/mctest/main.go b/beacon/cmd/mctest/main.go index d334b4929..a34e461a7 100644 --- a/beacon/cmd/mctest/main.go +++ b/beacon/cmd/mctest/main.go @@ -5,11 +5,11 @@ import ( "log" "time" - "github.com/calmh/syncthing/mc" + "github.com/calmh/syncthing/beacon" ) func main() { - b, err := mc.NewBeacon(21025) + b, err := beacon.NewBeacon(21025) if err != nil { log.Fatal(err) } diff --git a/config/config_test.go b/config/config_test.go index 3025a3d30..70a7603ce 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -18,7 +18,7 @@ func TestDefaultValues(t *testing.T) { MaxSendKbps: 0, RescanIntervalS: 60, ReconnectIntervalS: 60, - MaxChangeKbps: 1000, + MaxChangeKbps: 10000, StartBrowser: true, UPnPEnabled: true, } diff --git a/model/model_test.go b/model/model_test.go index 315f57ecf..19e6acd9a 100644 --- a/model/model_test.go +++ b/model/model_test.go @@ -8,6 +8,7 @@ import ( "time" "github.com/calmh/syncthing/cid" + "github.com/calmh/syncthing/config" "github.com/calmh/syncthing/protocol" "github.com/calmh/syncthing/scanner" ) @@ -47,7 +48,7 @@ func init() { } func TestRequest(t *testing.T) { - m := NewModel(1e6) + m := NewModel("/tmp", &config.Configuration{}, "syncthing", "dev") m.AddRepo("default", "testdata", nil) m.ScanRepo("default") @@ -83,7 +84,7 @@ func genFiles(n int) []protocol.FileInfo { } func BenchmarkIndex10000(b *testing.B) { - m := NewModel(1e6) + m := NewModel("/tmp", nil, "syncthing", "dev") m.AddRepo("default", "testdata", nil) m.ScanRepo("default") files := genFiles(10000) @@ -95,7 +96,7 @@ func BenchmarkIndex10000(b *testing.B) { } func BenchmarkIndex00100(b *testing.B) { - m := NewModel(1e6) + m := NewModel("/tmp", nil, "syncthing", "dev") m.AddRepo("default", "testdata", nil) m.ScanRepo("default") files := genFiles(100) @@ -107,7 +108,7 @@ func BenchmarkIndex00100(b *testing.B) { } func BenchmarkIndexUpdate10000f10000(b *testing.B) { - m := NewModel(1e6) + m := NewModel("/tmp", nil, "syncthing", "dev") m.AddRepo("default", "testdata", nil) m.ScanRepo("default") files := genFiles(10000) @@ -120,7 +121,7 @@ func BenchmarkIndexUpdate10000f10000(b *testing.B) { } func BenchmarkIndexUpdate10000f00100(b *testing.B) { - m := NewModel(1e6) + m := NewModel("/tmp", nil, "syncthing", "dev") m.AddRepo("default", "testdata", nil) m.ScanRepo("default") files := genFiles(10000) @@ -134,7 +135,7 @@ func BenchmarkIndexUpdate10000f00100(b *testing.B) { } func BenchmarkIndexUpdate10000f00001(b *testing.B) { - m := NewModel(1e6) + m := NewModel("/tmp", nil, "syncthing", "dev") m.AddRepo("default", "testdata", nil) m.ScanRepo("default") files := genFiles(10000) @@ -181,7 +182,7 @@ func (FakeConnection) Statistics() protocol.Statistics { } func BenchmarkRequest(b *testing.B) { - m := NewModel(1e6) + m := NewModel("/tmp", nil, "syncthing", "dev") m.AddRepo("default", "testdata", nil) m.ScanRepo("default") diff --git a/cmd/syncthing/testdata/.stignore b/model/testdata/.stignore similarity index 100% rename from cmd/syncthing/testdata/.stignore rename to model/testdata/.stignore diff --git a/cmd/syncthing/testdata/bar b/model/testdata/bar similarity index 100% rename from cmd/syncthing/testdata/bar rename to model/testdata/bar diff --git a/cmd/syncthing/testdata/baz/quux b/model/testdata/baz/quux similarity index 100% rename from cmd/syncthing/testdata/baz/quux rename to model/testdata/baz/quux diff --git a/cmd/syncthing/testdata/empty b/model/testdata/empty similarity index 100% rename from cmd/syncthing/testdata/empty rename to model/testdata/empty diff --git a/cmd/syncthing/testdata/foo b/model/testdata/foo similarity index 100% rename from cmd/syncthing/testdata/foo rename to model/testdata/foo diff --git a/cmd/syncthing/util_test.go b/model/util_test.go similarity index 99% rename from cmd/syncthing/util_test.go rename to model/util_test.go index 1db9f762b..b4f821ffc 100644 --- a/cmd/syncthing/util_test.go +++ b/model/util_test.go @@ -1,4 +1,4 @@ -package main +package model import ( "testing"