Przeglądaj źródła

Repair test suite

Jakob Borg 11 lat temu
rodzic
commit
e22ddae3a8

+ 2 - 2
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)
 	}

+ 1 - 1
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,
 	}

+ 8 - 7
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")
 

+ 0 - 0
cmd/syncthing/testdata/.stignore → model/testdata/.stignore


+ 0 - 0
cmd/syncthing/testdata/bar → model/testdata/bar


+ 0 - 0
cmd/syncthing/testdata/baz/quux → model/testdata/baz/quux


+ 0 - 0
cmd/syncthing/testdata/empty → model/testdata/empty


+ 0 - 0
cmd/syncthing/testdata/foo → model/testdata/foo


+ 1 - 1
cmd/syncthing/util_test.go → model/util_test.go

@@ -1,4 +1,4 @@
-package main
+package model
 
 import (
 	"testing"