Add NewCpu()

This commit is contained in:
Ariejan de Vroom 2014-08-12 21:28:30 +02:00
parent 0eaa592103
commit 57b940dce1
3 changed files with 34 additions and 0 deletions

9
.travis.yml Normal file
View File

@ -0,0 +1,9 @@
language: go
go:
- 1.3
- tip
matrix:
allow_failures:
- go: tip

8
cpu.go Normal file
View File

@ -0,0 +1,8 @@
package i6502
type Cpu struct {
}
func NewCpu() (*Cpu, error) {
return &Cpu{}, nil
}

17
cpu_test.go Normal file
View File

@ -0,0 +1,17 @@
package i6502
import (
"testing"
)
func TestNewCpu(t *testing.T) {
cpu, err := NewCpu()
if err != nil {
t.Errorf("Expected NewCPU() to not raise an error")
}
if cpu == nil {
t.Errorf("Expected NewCPU() to create a new CPU instance")
}
}