Reuse temporary files (fixes #4)

This commit is contained in:
Audrius Butkevicius
2014-10-03 23:15:54 +01:00
parent 41b8dd2863
commit 69e385e4cd
6 changed files with 87 additions and 23 deletions
+1
View File
@@ -145,6 +145,7 @@ type OptionsConfiguration struct {
URAccepted int `xml:"urAccepted"` // Accepted usage reporting version; 0 for off (undecided), -1 for off (permanently)
RestartOnWakeup bool `xml:"restartOnWakeup" default:"true"`
AutoUpgradeIntervalH int `xml:"autoUpgradeIntervalH" default:"12"` // 0 for off
KeepTemporariesH int `xml:"keepTemporariesH" default:"24"` // 0 for off
Deprecated_RescanIntervalS int `xml:"rescanIntervalS,omitempty" json:"-"`
Deprecated_UREnabled bool `xml:"urEnabled,omitempty" json:"-"`
+2
View File
@@ -49,6 +49,7 @@ func TestDefaultValues(t *testing.T) {
UPnPRenewal: 30,
RestartOnWakeup: true,
AutoUpgradeIntervalH: 12,
KeepTemporariesH: 24,
}
cfg := New("test", device1)
@@ -141,6 +142,7 @@ func TestOverriddenValues(t *testing.T) {
UPnPRenewal: 15,
RestartOnWakeup: false,
AutoUpgradeIntervalH: 24,
KeepTemporariesH: 48,
}
cfg, err := Load("testdata/overridenvalues.xml", device1)
+1
View File
@@ -17,5 +17,6 @@
<upnpRenewalMinutes>15</upnpRenewalMinutes>
<restartOnWakeup>false</restartOnWakeup>
<autoUpgradeIntervalH>24</autoUpgradeIntervalH>
<keepTemporariesH>48</keepTemporariesH>
</options>
</configuration>