First cut

This commit is contained in:
Kyle Lemons
2012-03-25 04:11:01 -07:00
commit 804a3c6ab8
11 changed files with 17791 additions and 0 deletions

24
usb/misc_test.go Normal file
View File

@@ -0,0 +1,24 @@
package usb
import (
"testing"
)
func TestBCD(t *testing.T) {
tests := []struct{
BCD
Int int
Str string
}{
{0x1234, 1234, "12.34"},
}
for _, test := range tests {
if got, want := test.BCD.Int(), test.Int; got != want {
t.Errorf("Int(%x) = %d, want %d", test.BCD, got, want)
}
if got, want := test.BCD.String(), test.Str; got != want {
t.Errorf("String(%x) = %q, want %q", test.BCD, got, want)
}
}
}