mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 15:17:25 +00:00
Repair test suite
This commit is contained in:
parent
68afc897d6
commit
e22ddae3a8
@ -5,11 +5,11 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/calmh/syncthing/mc"
|
"github.com/calmh/syncthing/beacon"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
b, err := mc.NewBeacon(21025)
|
b, err := beacon.NewBeacon(21025)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ func TestDefaultValues(t *testing.T) {
|
|||||||
MaxSendKbps: 0,
|
MaxSendKbps: 0,
|
||||||
RescanIntervalS: 60,
|
RescanIntervalS: 60,
|
||||||
ReconnectIntervalS: 60,
|
ReconnectIntervalS: 60,
|
||||||
MaxChangeKbps: 1000,
|
MaxChangeKbps: 10000,
|
||||||
StartBrowser: true,
|
StartBrowser: true,
|
||||||
UPnPEnabled: true,
|
UPnPEnabled: true,
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/calmh/syncthing/cid"
|
"github.com/calmh/syncthing/cid"
|
||||||
|
"github.com/calmh/syncthing/config"
|
||||||
"github.com/calmh/syncthing/protocol"
|
"github.com/calmh/syncthing/protocol"
|
||||||
"github.com/calmh/syncthing/scanner"
|
"github.com/calmh/syncthing/scanner"
|
||||||
)
|
)
|
||||||
@ -47,7 +48,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestRequest(t *testing.T) {
|
func TestRequest(t *testing.T) {
|
||||||
m := NewModel(1e6)
|
m := NewModel("/tmp", &config.Configuration{}, "syncthing", "dev")
|
||||||
m.AddRepo("default", "testdata", nil)
|
m.AddRepo("default", "testdata", nil)
|
||||||
m.ScanRepo("default")
|
m.ScanRepo("default")
|
||||||
|
|
||||||
@ -83,7 +84,7 @@ func genFiles(n int) []protocol.FileInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkIndex10000(b *testing.B) {
|
func BenchmarkIndex10000(b *testing.B) {
|
||||||
m := NewModel(1e6)
|
m := NewModel("/tmp", nil, "syncthing", "dev")
|
||||||
m.AddRepo("default", "testdata", nil)
|
m.AddRepo("default", "testdata", nil)
|
||||||
m.ScanRepo("default")
|
m.ScanRepo("default")
|
||||||
files := genFiles(10000)
|
files := genFiles(10000)
|
||||||
@ -95,7 +96,7 @@ func BenchmarkIndex10000(b *testing.B) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkIndex00100(b *testing.B) {
|
func BenchmarkIndex00100(b *testing.B) {
|
||||||
m := NewModel(1e6)
|
m := NewModel("/tmp", nil, "syncthing", "dev")
|
||||||
m.AddRepo("default", "testdata", nil)
|
m.AddRepo("default", "testdata", nil)
|
||||||
m.ScanRepo("default")
|
m.ScanRepo("default")
|
||||||
files := genFiles(100)
|
files := genFiles(100)
|
||||||
@ -107,7 +108,7 @@ func BenchmarkIndex00100(b *testing.B) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkIndexUpdate10000f10000(b *testing.B) {
|
func BenchmarkIndexUpdate10000f10000(b *testing.B) {
|
||||||
m := NewModel(1e6)
|
m := NewModel("/tmp", nil, "syncthing", "dev")
|
||||||
m.AddRepo("default", "testdata", nil)
|
m.AddRepo("default", "testdata", nil)
|
||||||
m.ScanRepo("default")
|
m.ScanRepo("default")
|
||||||
files := genFiles(10000)
|
files := genFiles(10000)
|
||||||
@ -120,7 +121,7 @@ func BenchmarkIndexUpdate10000f10000(b *testing.B) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkIndexUpdate10000f00100(b *testing.B) {
|
func BenchmarkIndexUpdate10000f00100(b *testing.B) {
|
||||||
m := NewModel(1e6)
|
m := NewModel("/tmp", nil, "syncthing", "dev")
|
||||||
m.AddRepo("default", "testdata", nil)
|
m.AddRepo("default", "testdata", nil)
|
||||||
m.ScanRepo("default")
|
m.ScanRepo("default")
|
||||||
files := genFiles(10000)
|
files := genFiles(10000)
|
||||||
@ -134,7 +135,7 @@ func BenchmarkIndexUpdate10000f00100(b *testing.B) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkIndexUpdate10000f00001(b *testing.B) {
|
func BenchmarkIndexUpdate10000f00001(b *testing.B) {
|
||||||
m := NewModel(1e6)
|
m := NewModel("/tmp", nil, "syncthing", "dev")
|
||||||
m.AddRepo("default", "testdata", nil)
|
m.AddRepo("default", "testdata", nil)
|
||||||
m.ScanRepo("default")
|
m.ScanRepo("default")
|
||||||
files := genFiles(10000)
|
files := genFiles(10000)
|
||||||
@ -181,7 +182,7 @@ func (FakeConnection) Statistics() protocol.Statistics {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkRequest(b *testing.B) {
|
func BenchmarkRequest(b *testing.B) {
|
||||||
m := NewModel(1e6)
|
m := NewModel("/tmp", nil, "syncthing", "dev")
|
||||||
m.AddRepo("default", "testdata", nil)
|
m.AddRepo("default", "testdata", nil)
|
||||||
m.ScanRepo("default")
|
m.ScanRepo("default")
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package main
|
package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
Loading…
Reference in New Issue
Block a user