12345678910111213141516171819202122232425 |
- package controller
- import "testing"
- import "os"
- import "syscall"
- // import "fmt"
- const IN = "/dev/input/by-id/usb-0583_USB_2-axis_8-button_gamepad-event-joystick"
- func Test1(t * testing.T) {
- file , err := os.OpenFile(IN, syscall.O_RDWR, 0666)
- if err != nil {
- t.Errorf("Error OpenFile: %s\n", err)
- return
- }
- defer file.Close()
- version, err := GetDriverVersion(file)
- if err != nil {
- t.Errorf("Error GetDriverVersion: %s\n", err)
- return
- }
- t.Logf("GetDriverVersion: %d", version)
- }
|