Exemple #1
0
PROCESS_THREAD(test_process, ev, data)
{
  PROCESS_BEGIN();

  UNIT_TEST_RUN(arithmetic);
  UNIT_TEST_RUN(string);

  PROCESS_END();
}
PROCESS_THREAD(test_process, ev, data)
{
  PROCESS_BEGIN();

  printf("Run unit-test\n");
  printf("---\n");

  UNIT_TEST_RUN(panid_frame_ver_0b00);
  UNIT_TEST_RUN(panid_frame_ver_0b01);
  UNIT_TEST_RUN(panid_frame_ver_0b10);

  printf("=check-me= DONE\n");
  PROCESS_END();
}
int main()
{
	init_graph();

	//p_hop_t *get_hop_counts(uint8_t *count);
	UNIT_TEST_RUN(empty_hop);
	UNIT_TEST_RUN(null_hop);
	UNIT_TEST_RUN(cyclic_hop);
	UNIT_TEST_RUN(no_hop);
	UNIT_TEST_RUN(omnidirectional_hop);

	//void purge();
	UNIT_TEST_RUN(empty_purge);
	UNIT_TEST_RUN(delete_and_decrement_purge);

	return EXIT_SUCCESS;
}
PROCESS_THREAD(test_process, ev, data)
{
  static struct etimer et;

  PROCESS_BEGIN();

  tsch_set_coordinator(1);

  etimer_set(&et, CLOCK_SECOND);
  while(tsch_is_associated == 0) {
    PROCESS_YIELD_UNTIL(etimer_expired(&et));
    etimer_reset(&et);
  }

  printf("Run unit-test\n");
  printf("---\n");

  UNIT_TEST_RUN(test);

  printf("=check-me= DONE\n");
  PROCESS_END();
}