Skip to content

Commit

Permalink
videocore: do not fail on RPi running as root
Browse files Browse the repository at this point in the history
It just 'works too well'.

Need to fix issue google#126 sooner than later.
  • Loading branch information
maruel committed Apr 14, 2017
1 parent 2ce56f3 commit d0c4371
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions host/videocore/videocore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ func TestAlloc_fail(t *testing.T) {
}
mailboxErr = nil
mailbox = &dummy{}
// TODO(maruel): https://github.com/google/periph/issues/126
/* pmem.Map() may just work fine.
if m, err := Alloc(4096); m != nil || err == nil {
t.Fatal("can't map arbitrary physical pages")
}
*/
mailbox = &playback{}
if m, err := Alloc(4096); m != nil || err == nil {
t.Fatal("mailbox failed")
Expand Down Expand Up @@ -89,7 +92,8 @@ func TestAlloc_fail(t *testing.T) {

func TestOpenMailbox(t *testing.T) {
defer reset()
// It is expected to fail unless running as root.
// TODO(maruel): https://github.com/google/periph/issues/126
mailbox = &playback{}
if err := openMailbox(); err != nil {
if mailboxErr != err {
t.Fatal("error is different")
Expand Down Expand Up @@ -131,14 +135,6 @@ func TestGenPacket(t *testing.T) {
}
}

func TestIOCTL(t *testing.T) {
// Sends an invalid ioctl to stdin. Not a big deal.
m := messageBox{}
if m.sendMessage([]uint32{0}) == nil {
t.Fatal("can't send arbitrary ioctl to stdin")
}
}

//

type dummy struct{}
Expand Down

0 comments on commit d0c4371

Please sign in to comment.