mirror of https://github.com/ARMmbed/mbed-os.git
validate base_time key received
This is required as greentea can send multiple __sync packets and cause the to be in unexpected state.pull/4599/head
parent
f535cb5ddc
commit
8a4dbff8d6
|
@ -93,12 +93,16 @@ void test_case_1x_ticker() {
|
|||
char _key[11] = { };
|
||||
char _value[128] = { };
|
||||
uint8_t results_size = 0;
|
||||
int expected_key = 1;
|
||||
|
||||
greentea_send_kv("timing_drift_check_start", 0);
|
||||
ticker1->attach_us(&ticker_callback_0, ONE_MILLI_SEC);
|
||||
|
||||
// wait for 1st signal from host
|
||||
greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value));
|
||||
do {
|
||||
greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value));
|
||||
expected_key = strcmp(_key, "base_time");
|
||||
} while (expected_key);
|
||||
greentea_send_kv(_key, callback_trigger_count * ONE_MILLI_SEC);
|
||||
|
||||
// wait for 2nd signal from host
|
||||
|
@ -116,6 +120,7 @@ void test_case_2x_callbacks() {
|
|||
char _key[11] = { };
|
||||
char _value[128] = { };
|
||||
uint8_t results_size = 0;
|
||||
int expected_key = 1;
|
||||
|
||||
led1 = 0;
|
||||
led2 = 0;
|
||||
|
@ -125,7 +130,10 @@ void test_case_2x_callbacks() {
|
|||
ticker1->attach_us(ticker_callback_1_switch_to_2, ONE_MILLI_SEC);
|
||||
|
||||
// wait for 1st signal from host
|
||||
greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value));
|
||||
do {
|
||||
greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value));
|
||||
expected_key = strcmp(_key, "base_time");
|
||||
} while (expected_key);
|
||||
greentea_send_kv(_key, callback_trigger_count * ONE_MILLI_SEC);
|
||||
|
||||
// wait for 2nd signal from host
|
||||
|
|
|
@ -52,13 +52,18 @@ void test_case_timeout() {
|
|||
|
||||
char _key[11] = { };
|
||||
char _value[128] = { };
|
||||
int expected_key = 1;
|
||||
uint8_t results_size = 0;
|
||||
|
||||
greentea_send_kv("timing_drift_check_start", 0);
|
||||
timeout.attach_us(set_incremeant_count, ONE_MILLI_SEC);
|
||||
|
||||
// wait for 1st signal from host
|
||||
greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value));
|
||||
do {
|
||||
greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value));
|
||||
expected_key = strcmp(_key, "base_time");
|
||||
} while (expected_key);
|
||||
|
||||
greentea_send_kv(_key, callback_trigger_count * ONE_MILLI_SEC);
|
||||
|
||||
// wait for 2nd signal from host
|
||||
|
|
|
@ -56,11 +56,15 @@ void update_tick_thread() {
|
|||
void gt_comm_wait_thread() {
|
||||
char _key[11] = { };
|
||||
char _value[128] = { };
|
||||
int expected_key = 1;
|
||||
|
||||
greentea_send_kv("timing_drift_check_start", 0);
|
||||
|
||||
// wait for 1st signal from host
|
||||
greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value));
|
||||
do {
|
||||
greentea_parse_kv(_key, _value, sizeof(_key), sizeof(_value));
|
||||
expected_key = strcmp(_key, "base_time");
|
||||
} while (expected_key);
|
||||
greentea_send_kv(_key, callback_trigger_count * ONE_MILLI_SEC);
|
||||
|
||||
// wait for 2nd signal from host
|
||||
|
|
Loading…
Reference in New Issue