Ejemplo n.º 1
0
void run_test(void)
{
	test_reset();

	RUN_TEST(test_initialization);
	RUN_TEST(test_priority);
	RUN_TEST(test_charge_ceil);
	RUN_TEST(test_new_power_request);
	RUN_TEST(test_override);
	RUN_TEST(test_dual_role);
	RUN_TEST(test_rejected_port);
	RUN_TEST(test_unknown_dualrole_capability);

	test_print_result();
}
Ejemplo n.º 2
0
void test_malloc(){
  test_print_hdr("malloc");
  //Dynamic memory allocation, malloc
  extern char _end;
  test_print_result("&_end <= 0x800000 (no stack collision)",&_end<(char*)0x800000);
  

  void* p0=0;
  p0=malloc(50);
  test_print_result("malloc(50) valid location  :",p0 > &_BSS_END_ && p0< &_BSS_END_ + 0x100000);
    
  
  int B1=1000;
  int* p1=(int*)malloc(B1);
  p1[500]=0xBEEF1;


  int B2=5000;
  int* p2=(int*)malloc(B2);
  p2[2500]=0xBEEF2;  
  test_print_result("malloc(5000) valid location :",p2-p1 <= B1);


  int B3=10000;
  int* p3=(int*)malloc(B3);
  p3[5000]=0xBEEF3;

  test_print_result("malloc(10000) valid location :",p3-p2 <= B2);

  int B4=50000;
  int* p4=(int*)malloc(B4);
  p4[25000]=0xBEEF4;

  test_print_result("malloc(50000) valid location :",p4-p3 <= B3);

  test_print_result("malloc(1000) read/write",p1[500]==0xBEEF1);
  test_print_result("malloc(5000) read/write:",p2[2500]==0xBEEF2);
  test_print_result("malloc(10000) read/write:",p3[5000]==0xBEEF3);
  test_print_result("malloc(50000) read/write:",p4[25000]==0xBEEF4);

}
Ejemplo n.º 3
0
void run_test(void)
{
	test_reset();
	wait_for_task_started();

	if (system_get_image_copy() == SYSTEM_IMAGE_RO) {
		RUN_TEST(test_single_key_press);
		RUN_TEST(test_disable_keystroke);
		RUN_TEST(test_typematic);
		RUN_TEST(test_scancode_set2);
		RUN_TEST(test_power_button);
		RUN_TEST(test_sysjump);
	} else {
		RUN_TEST(test_sysjump_cont);
	}

	test_print_result();
}
Ejemplo n.º 4
0
void run_test(void)
{
	test_reset();

	RUN_TEST(test_no_ramp);
	RUN_TEST(test_full_ramp);
	RUN_TEST(test_vbus_dip);
	RUN_TEST(test_overcurrent);
	RUN_TEST(test_switch_outlet);
	RUN_TEST(test_fast_switch);
	RUN_TEST(test_overcurrent_after_switch_outlet);
	RUN_TEST(test_partial_load);
	RUN_TEST(test_charge_supplier_stable);
	RUN_TEST(test_charge_supplier_stable_ramp);
	RUN_TEST(test_charge_supplier_change);
	RUN_TEST(test_charge_port_change);
	RUN_TEST(test_vbus_shift);
	RUN_TEST(test_equal_priority_overcurrent);
	RUN_TEST(test_ramp_limit);

	test_print_result();
}