fixed compile errors.

This commit is contained in:
Andreas Krennmair 2012-01-29 02:05:47 +01:00
parent bf7cc3a37c
commit c6367f3454
1 changed files with 5 additions and 5 deletions

View File

@ -48,16 +48,16 @@ var testSet = []interface{}{
func TestBuild(t *testing.T) {
c, err := ReadConfigBytes([]byte(confFile))
if err != nil {
t.Error(err.String())
t.Error(err.Error())
}
for _, element := range testSet {
switch i := element.(type) {
switch element.(type) {
case stringtest:
e := element.(stringtest)
ans, err := c.GetString(e.section, e.option)
if err != nil {
t.Error("c.GetString(\"" + e.section + "\",\"" + e.option + "\") returned error: " + err.String())
t.Error("c.GetString(\"" + e.section + "\",\"" + e.option + "\") returned error: " + err.Error())
}
if ans != e.answer {
t.Error("c.GetString(\"" + e.section + "\",\"" + e.option + "\") returned incorrect answer: " + ans)
@ -66,7 +66,7 @@ func TestBuild(t *testing.T) {
e := element.(inttest)
ans, err := c.GetInt(e.section, e.option)
if err != nil {
t.Error("c.GetInt(\"" + e.section + "\",\"" + e.option + "\") returned error: " + err.String())
t.Error("c.GetInt(\"" + e.section + "\",\"" + e.option + "\") returned error: " + err.Error())
}
if ans != e.answer {
t.Error("c.GetInt(\"" + e.section + "\",\"" + e.option + "\") returned incorrect answer: " + strconv.Itoa(ans))
@ -75,7 +75,7 @@ func TestBuild(t *testing.T) {
e := element.(booltest)
ans, err := c.GetBool(e.section, e.option)
if err != nil {
t.Error("c.GetBool(\"" + e.section + "\",\"" + e.option + "\") returned error: " + err.String())
t.Error("c.GetBool(\"" + e.section + "\",\"" + e.option + "\") returned error: " + err.Error())
}
if ans != e.answer {
t.Error("c.GetBool(\"" + e.section + "\",\"" + e.option + "\") returned incorrect answer")