aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ananyev <konstantin.ananyev@intel.com>2017-01-19 13:42:36 +0000
committerGerrit Code Review <gerrit@fd.io>2017-01-19 13:42:36 +0000
commit116a24859ada50e7904092fd4f886493c322a8c7 (patch)
tree38c5477f26c48a2c6ccc8a5bc700d6d82524de92
parentdd8d338e79dddb3ca207e7284baa682d3fe03042 (diff)
parentc603d3ed138c0fe8a0944baf499c271aae620bc2 (diff)
Merge "tldk: fix possibility of tle_event_active() from DOWN to UP"
-rw-r--r--lib/libtle_udp/tle_event.h2
-rw-r--r--test/gtest/test_tle_udp_event.cpp1
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/libtle_udp/tle_event.h b/lib/libtle_udp/tle_event.h
index 1a5c436..9357def 100644
--- a/lib/libtle_udp/tle_event.h
+++ b/lib/libtle_udp/tle_event.h
@@ -168,7 +168,7 @@ tle_event_active(struct tle_event *ev, enum tle_ev_state st)
{
struct tle_evq *q;
- if (st == ev->state)
+ if (ev->state != TLE_SEV_IDLE)
return;
q = ev->head;
diff --git a/test/gtest/test_tle_udp_event.cpp b/test/gtest/test_tle_udp_event.cpp
index c7c25a0..c012ccc 100644
--- a/test/gtest/test_tle_udp_event.cpp
+++ b/test/gtest/test_tle_udp_event.cpp
@@ -125,6 +125,7 @@ INSTANTIATE_TEST_CASE_P(Default, udp_event_state_active_twice,
event_state_active_twice{TLE_SEV_IDLE, TLE_SEV_DOWN, TLE_SEV_DOWN},
event_state_active_twice{TLE_SEV_IDLE, TLE_SEV_UP, TLE_SEV_UP},
event_state_active_twice{TLE_SEV_DOWN, TLE_SEV_IDLE, TLE_SEV_DOWN},
+ event_state_active_twice{TLE_SEV_DOWN, TLE_SEV_UP, TLE_SEV_DOWN},
event_state_active_twice{TLE_SEV_DOWN, TLE_SEV_DOWN, TLE_SEV_DOWN},
event_state_active_twice{TLE_SEV_UP, TLE_SEV_IDLE, TLE_SEV_UP},
event_state_active_twice{TLE_SEV_UP, TLE_SEV_DOWN, TLE_SEV_UP},