+12
-13
@@ -21,6 +21,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/d4l3k/messagediff"
|
||||
|
||||
"github.com/syncthing/syncthing/lib/events"
|
||||
"github.com/syncthing/syncthing/lib/fs"
|
||||
"github.com/syncthing/syncthing/lib/protocol"
|
||||
@@ -523,9 +524,6 @@ func TestNewSaveLoad(t *testing.T) {
|
||||
intCfg := New(device1)
|
||||
cfg := wrap(path, intCfg)
|
||||
|
||||
// To make the equality pass later
|
||||
cfg.(*wrapper).cfg.XMLName.Local = "configuration"
|
||||
|
||||
if exists(path) {
|
||||
t.Error(path, "exists")
|
||||
}
|
||||
@@ -614,14 +612,14 @@ func TestPullOrder(t *testing.T) {
|
||||
name string
|
||||
order PullOrder
|
||||
}{
|
||||
{"f1", OrderRandom}, // empty value, default
|
||||
{"f2", OrderRandom}, // explicit
|
||||
{"f3", OrderAlphabetic}, // explicit
|
||||
{"f4", OrderRandom}, // unknown value, default
|
||||
{"f5", OrderSmallestFirst}, // explicit
|
||||
{"f6", OrderLargestFirst}, // explicit
|
||||
{"f7", OrderOldestFirst}, // explicit
|
||||
{"f8", OrderNewestFirst}, // explicit
|
||||
{"f1", PullOrderRandom}, // empty value, default
|
||||
{"f2", PullOrderRandom}, // explicit
|
||||
{"f3", PullOrderAlphabetic}, // explicit
|
||||
{"f4", PullOrderRandom}, // unknown value, default
|
||||
{"f5", PullOrderSmallestFirst}, // explicit
|
||||
{"f6", PullOrderLargestFirst}, // explicit
|
||||
{"f7", PullOrderOldestFirst}, // explicit
|
||||
{"f8", PullOrderNewestFirst}, // explicit
|
||||
}
|
||||
|
||||
// Verify values are deserialized correctly
|
||||
@@ -640,7 +638,7 @@ func TestPullOrder(t *testing.T) {
|
||||
|
||||
t.Logf("%s", buf.Bytes())
|
||||
|
||||
cfg, err = ReadXML(buf, device1)
|
||||
cfg, _, err = ReadXML(buf, device1)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -1169,7 +1167,8 @@ func defaultConfigAsMap() map[string]interface{} {
|
||||
}
|
||||
|
||||
func load(path string, myID protocol.DeviceID) (Wrapper, error) {
|
||||
return Load(path, myID, events.NoopLogger)
|
||||
cfg, _, err := Load(path, myID, events.NoopLogger)
|
||||
return cfg, err
|
||||
}
|
||||
|
||||
func wrap(path string, cfg Configuration) Wrapper {
|
||||
|
||||
Reference in New Issue
Block a user