gobot.io/x/gobot@v1.16.0/platforms/parrot/ardrone/pitch_test.go (about)

     1  package ardrone
     2  
     3  import (
     4  	"testing"
     5  
     6  	"gobot.io/x/gobot/gobottest"
     7  )
     8  
     9  func TestArdroneValidatePitchWhenEqualOffset(t *testing.T) {
    10  	gobottest.Assert(t, ValidatePitch(32767.0, 32767.0), 1.0)
    11  }
    12  
    13  func TestArdroneValidatePitchWhenTiny(t *testing.T) {
    14  	gobottest.Assert(t, ValidatePitch(1.1, 32767.0), 0.0)
    15  }
    16  
    17  func TestArdroneValidatePitchWhenCentered(t *testing.T) {
    18  	gobottest.Assert(t, ValidatePitch(16383.5, 32767.0), 0.5)
    19  }