Skip to content
Snippets Groups Projects
Commit 36e1e5da authored by Zygmunt Krynicki's avatar Zygmunt Krynicki
Browse files

ota: rename observerKey to stateObserverKey


Signed-off-by: default avatarZygmunt Krynicki <zygmunt.krynicki@huawei.com>
parent 3f194ee6
No related branches found
No related tags found
No related merge requests found
......@@ -228,14 +228,14 @@ func (s *stateGuardSuite) TestAlterStateSuccess(c *C) {
c.Check(s.saved, DeepEquals, &ota.SystemState{BootMode: boot.Try})
}
type observerKey struct{}
type stateObserverKey struct{}
func (s *stateGuardSuite) TestObserver(c *C) {
s.guard.RegisterObserver(observerKey{}, func(st *ota.SystemState) error {
s.guard.RegisterObserver(stateObserverKey{}, func(st *ota.SystemState) error {
c.Assert(st.BootMode, Equals, boot.Try)
return nil
})
defer s.guard.RemoveObserver(observerKey{})
defer s.guard.RemoveObserver(stateObserverKey{})
err := s.guard.AlterState(func(st *ota.SystemState) (bool, error) {
st.BootMode = boot.Try
......@@ -249,11 +249,11 @@ func (s *stateGuardSuite) TestObserver(c *C) {
}
func (s *stateGuardSuite) TestObserverError(c *C) {
s.guard.RegisterObserver(observerKey{}, func(st *ota.SystemState) error {
s.guard.RegisterObserver(stateObserverKey{}, func(st *ota.SystemState) error {
c.Assert(st.BootMode, Equals, boot.Try)
return errBoom
})
defer s.guard.RemoveObserver(observerKey{})
defer s.guard.RemoveObserver(stateObserverKey{})
err := s.guard.AlterState(func(st *ota.SystemState) (bool, error) {
st.BootMode = boot.Try
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment