Repository: incubator-mynewt-core Updated Branches: refs/heads/develop 18ef5db15 -> 3c3ca3f3e
oic; if unittest fails on catch-all timeout, print the phase test is in. Increase catch-all timeout from 2 seconds to 4. Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/3c3ca3f3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/3c3ca3f3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/3c3ca3f3 Branch: refs/heads/develop Commit: 3c3ca3f3eecf97bd7e8016636592d765b4545a85 Parents: 18ef5db Author: Marko Kiiskila <[email protected]> Authored: Wed Jan 18 15:17:35 2017 -0800 Committer: Marko Kiiskila <[email protected]> Committed: Wed Jan 18 15:17:35 2017 -0800 ---------------------------------------------------------------------- net/oic/test/src/test_discovery.c | 6 +++--- net/oic/test/src/test_getset.c | 2 +- net/oic/test/src/test_oic.h | 2 +- net/oic/test/src/testcases/oic_tests.c | 8 +++++--- 4 files changed, 10 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/3c3ca3f3/net/oic/test/src/test_discovery.c ---------------------------------------------------------------------- diff --git a/net/oic/test/src/test_discovery.c b/net/oic/test/src/test_discovery.c index f787a44..4722a1e 100644 --- a/net/oic/test/src/test_discovery.c +++ b/net/oic/test/src/test_discovery.c @@ -112,13 +112,13 @@ test_discovery_next_step(struct os_event *ev) * No resources registered yet. */ oc_do_ip_discovery(NULL, test_discovery_cb); - oic_test_reset_tmo(); + oic_test_reset_tmo("1st discovery"); break; case 2: oc_add_device("/oic/d", "oic.d.light", "TestDev", "1.0", "1.1", NULL, NULL); oc_do_ip_discovery(NULL, test_discovery_cb); - oic_test_reset_tmo(); + oic_test_reset_tmo("2nd discovery"); break; case 3: { oc_resource_t *res = oc_new_resource("/light/test", 1, 0); @@ -131,7 +131,7 @@ test_discovery_next_step(struct os_event *ev) oc_resource_set_request_handler(res, OC_GET, test_discovery_get); oc_add_resource(res); oc_do_ip_discovery(NULL, test_discovery_cb); - oic_test_reset_tmo(); + oic_test_reset_tmo("3rd discovery"); break; } default: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/3c3ca3f3/net/oic/test/src/test_getset.c ---------------------------------------------------------------------- diff --git a/net/oic/test/src/test_getset.c b/net/oic/test/src/test_getset.c index 9a0f5e3..73e6c60 100644 --- a/net/oic/test/src/test_getset.c +++ b/net/oic/test/src/test_getset.c @@ -102,7 +102,7 @@ test_getset_next_step(struct os_event *ev) b_rc = oc_do_get("/getset", &server, NULL, test_getset_rsp1, LOW_QOS); TEST_ASSERT_FATAL(b_rc == true); - oic_test_reset_tmo(); + oic_test_reset_tmo("getset"); break; case 4: test_getset_done = 1; http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/3c3ca3f3/net/oic/test/src/test_oic.h ---------------------------------------------------------------------- diff --git a/net/oic/test/src/test_oic.h b/net/oic/test/src/test_oic.h index 1511ef5..5aef7b7 100644 --- a/net/oic/test/src/test_oic.h +++ b/net/oic/test/src/test_oic.h @@ -35,7 +35,7 @@ TEST_CASE_DECL(oic_tests); extern struct os_eventq oic_tapp_evq; -void oic_test_reset_tmo(void); +void oic_test_reset_tmo(const char *phase); struct oc_server_handle; void oic_test_set_endpoint(struct oc_server_handle *); void oic_test_get_endpoint(struct oc_server_handle *); http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/3c3ca3f3/net/oic/test/src/testcases/oic_tests.c ---------------------------------------------------------------------- diff --git a/net/oic/test/src/testcases/oic_tests.c b/net/oic/test/src/testcases/oic_tests.c index 2a4c270..cacd731 100644 --- a/net/oic/test/src/testcases/oic_tests.c +++ b/net/oic/test/src/testcases/oic_tests.c @@ -29,9 +29,10 @@ /* * How long to wait before declaring discovery process failure. */ -#define OIC_TEST_FAIL_DLY (OS_TICKS_PER_SEC * 2) +#define OIC_TEST_FAIL_DLY (OS_TICKS_PER_SEC * 4) static struct os_task oic_tapp; +static const char *oic_test_phase; static os_stack_t oic_tapp_stack[OS_STACK_ALIGN(OIC_TAPP_STACK_SIZE)]; struct os_eventq oic_tapp_evq; static struct os_callout oic_test_timer; @@ -40,12 +41,13 @@ static struct oc_server_handle oic_tgt; static void oic_test_timer_cb(struct os_event *ev) { - TEST_ASSERT_FATAL(0); + TEST_ASSERT_FATAL(0, "test_phase: %s\n", oic_test_phase ? oic_test_phase : "unknwn"); } void -oic_test_reset_tmo(void) +oic_test_reset_tmo(const char *phase) { + oic_test_phase = phase; os_callout_reset(&oic_test_timer, OIC_TEST_FAIL_DLY); }
