mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-16 04:43:25 +00:00
gps: revamp validSentence() to avoid heap allocation for errors. This error can occur too frequently to allow for such allocations
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -8,13 +8,13 @@ import (
|
||||
)
|
||||
|
||||
func TestParseUnknownSentence(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
|
||||
p := NewParser()
|
||||
|
||||
val := "$GPGSV,3,1,09,07,14,317,22,08,31,284,25,10,32,133,39,16,85,232,29*7F"
|
||||
_, err := p.Parse(val)
|
||||
c.Assert(err.Error(), qt.Contains, "unsupported NMEA sentence type")
|
||||
if err == nil {
|
||||
t.Error("should have unknown sentence err")
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseGGA(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user