1
0
mirror of https://github.com/taigrr/gopher-os synced 2025-01-18 04:43:13 -08:00

Fix broken unit tests

This commit is contained in:
Achilleas Anagnostopoulos
2017-07-08 13:02:15 +01:00
parent ffb8f86a9c
commit b1084c1362
4 changed files with 18 additions and 48 deletions

View File

@@ -260,8 +260,10 @@ func (t *VT) DriverVersion() (uint16, uint16, uint16) {
// DriverInit initializes this driver.
func (t *VT) DriverInit() *kernel.Error { return nil }
func init() {
ProbeFuncs = append(ProbeFuncs, func() device.Driver {
return NewVT(DefaultTabWidth, DefaultScrollback)
})
func probeForVT() device.Driver {
return NewVT(DefaultTabWidth, DefaultScrollback)
}
func init() {
ProbeFuncs = append(ProbeFuncs, probeForVT)
}

View File

@@ -5,7 +5,6 @@ import (
"gopheros/device/video/console"
"image/color"
"io"
"reflect"
"testing"
)
@@ -339,22 +338,6 @@ func TestVTDriverInterface(t *testing.T) {
}
func TestVTProbe(t *testing.T) {
var (
expProbePtr = reflect.ValueOf(probeForVT).Pointer()
foundProbe bool
)
for _, probeFn := range HWProbes() {
if reflect.ValueOf(probeFn).Pointer() == expProbePtr {
foundProbe = true
break
}
}
if !foundProbe {
t.Fatal("expected probeForVT to be part of the probes returned by HWProbes")
}
if drv := probeForVT(); drv == nil {
t.Fatal("expected probeForVT to return a driver")
}