mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-05-01 13:48:57 +08:00
gpio: avoid possible race condition in button test
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
parent
3aa0cf5b89
commit
e3ca19eaa3
@ -91,13 +91,13 @@ func TestButtonDriverStart(t *testing.T) {
|
||||
sem <- true
|
||||
})
|
||||
|
||||
d.halt <- true
|
||||
|
||||
a.TestAdaptorDigitalRead(func() (val int, err error) {
|
||||
val = 1
|
||||
return
|
||||
})
|
||||
|
||||
d.halt <- true
|
||||
|
||||
select {
|
||||
case <-sem:
|
||||
t.Errorf("Button Event \"Press\" should not published")
|
||||
|
Loading…
x
Reference in New Issue
Block a user