您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ test_suite_run函数代码示例

51自学网 2021-06-03 08:46:05
  C++
这篇教程C++ test_suite_run函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中test_suite_run函数的典型用法代码示例。如果您正苦于以下问题:C++ test_suite_run函数的具体用法?C++ test_suite_run怎么用?C++ test_suite_run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了test_suite_run函数的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

/** * /brief Run unit tests for MT48LC16m16a2tg7 SDRAM * /return 0  which should never occur. */int main (void){	const usart_serial_options_t usart_serial_options = {		.baudrate   = CONF_TEST_BAUDRATE,		.charlength = CONF_TEST_CHARLENGTH,		.paritytype = CONF_TEST_PARITY,		.stopbits   = CONF_TEST_STOPBITS,	};	sysclk_init();	board_init();	stdio_serial_init(CONF_TEST_USART, &usart_serial_options);	sdramc_init(sysclk_get_cpu_hz());	// Define all the test cases	DEFINE_TEST_CASE(data_integrity_test, NULL, run_data_integrity_test,			NULL, "Data integrity test");	// Put test case addresses in an array	DEFINE_TEST_ARRAY(ebi_sdram_tests) = {		&data_integrity_test,	};	// Define the test suite	DEFINE_TEST_SUITE(ebi_sdram_suite, ebi_sdram_tests,			"UC3 EBI driver w/ SDRAM test suite");	// Set up the test data pointer and run all tests in the suite	test_set_data(&params);	test_suite_run(&ebi_sdram_suite);	while (true);	return (0);}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:39,


示例2: main

/** * /brief Run ili9325 driver unit tests. */int main(void){	const usart_serial_options_t usart_serial_options = {		.baudrate   = CONF_TEST_BAUDRATE,		.charlength = CONF_TEST_CHARLENGTH,		.paritytype = CONF_TEST_PARITY,		.stopbits   = CONF_TEST_STOPBITS	};	sysclk_init();	board_init();	sysclk_enable_peripheral_clock(CONSOLE_UART_ID);	stdio_serial_init(CONF_TEST_USART, &usart_serial_options);	/* Define all the test cases */	DEFINE_TEST_CASE(mma7341l_test_get_gravity_value, NULL, run_test_get_gravity_value, NULL,			"mma7341l get gravity value test");	/* Put test case addresses in an array */	DEFINE_TEST_ARRAY(mma7341l_test_array) = {		&mma7341l_test_get_gravity_value,};	/* Define the test suite */	DEFINE_TEST_SUITE(mma7341l_suite, mma7341l_test_array,			"mma7341l driver test suite");	/* Run all tests in the test suite */	test_suite_run(&mma7341l_suite);	while (1) {		/* Busy-wait forever */	}}
开发者ID:InSoonPark,项目名称:asf,代码行数:37,


示例3: main

/** * /brief Run GPBR driver unit tests */int main(void){	const usart_serial_options_t usart_serial_options = {		.baudrate = CONF_TEST_BAUDRATE,		.paritytype = CONF_TEST_PARITY	};	/* Initialize the system clock and board */	sysclk_init();	board_init();	/* Enable the debug uart */	sysclk_enable_peripheral_clock(CONSOLE_UART_ID);	stdio_serial_init(CONF_TEST_USART, &usart_serial_options);	/* Define all the test cases */	DEFINE_TEST_CASE(gpbr_test, NULL, run_gpbr_test, NULL,			"GPBR read/write test");	/* Put test case addresses in an array */	DEFINE_TEST_ARRAY(gpbr_tests) = {	&gpbr_test};	/* Define the test suite */	DEFINE_TEST_SUITE(gpbr_suite, gpbr_tests, "SAM GPBR driver test suite");	/* Run all tests in the test suite */	test_suite_run(&gpbr_suite);	while (1) {		/* Busy-wait forever. */	}}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:36,


示例4: main

/** * /brief Run TRNG unit tests * * Initializes the system and serial output, then sets up the * TRNG unit test suite and runs it. */int main(void){	system_init();	cdc_uart_init();	/* Define Test Cases */	DEFINE_TEST_CASE(trng_polling_read_test,			NULL,			run_trng_polling_read_test,			NULL,			"Testing TRNG polling read");	DEFINE_TEST_CASE(trng_callback_read_test,			NULL,			run_trng_callback_read_test,			NULL,			"Testing TRNG callback read");	/* Put test case addresses in an array */	DEFINE_TEST_ARRAY(trng_tests) = {		&trng_polling_read_test,		&trng_callback_read_test,	};	/* Define the test suite */	DEFINE_TEST_SUITE(trng_test_suite, trng_tests,			"SAM TRNG driver test suite");	/* Run all tests in the suite*/	test_suite_run(&trng_test_suite);	while (true) {		/* Intentionally left empty */	}}
开发者ID:InSoonPark,项目名称:asf,代码行数:41,


示例5: main

/** * /brief Run Sleep Manager unit tests * * Initializes the clock system, board and serial output, then sets up the * Sleep Manager unit test suite and runs it. */int main(void){    const usart_serial_options_t usart_serial_options = {        .baudrate   = CONF_TEST_BAUDRATE,        .charlength = CONF_TEST_CHARLENGTH,        .paritytype = CONF_TEST_PARITY,        .stopbits   = CONF_TEST_STOPBITS,    };    board_init();    sysclk_init();    stdio_serial_init(CONF_TEST_USART, &usart_serial_options);    DEFINE_TEST_CASE(sleep_trigger_test, NULL, run_sleep_trigger_test, NULL,                     "Test sleep interrupt is getting triggered");    DEFINE_TEST_CASE(set_functions_test, NULL, run_set_functions_test, NULL,                     "Test setting of various lock modes");    /* Put test case addresses in an array */    DEFINE_TEST_ARRAY(sleep_manager_tests) = {        &set_functions_test,        &sleep_trigger_test,    };    /* Define the test suite */    DEFINE_TEST_SUITE(sleep_manager_suite, sleep_manager_tests,                      "MEGARF SLEEP MANAGER test suite");    /* Run all tests in the suite */    test_suite_run(&sleep_manager_suite);    while (1) {        /* Intentionally left empty. */    }}
开发者ID:Gr3yR0n1n,项目名称:SAINTCON-2015-Badge,代码行数:41,


示例6: main

/** * /brief Run IOPORT unit tests * * Initializes the clock system, board and serial output, then sets up the * IOPORT Service unit test suite and runs it. */int main(void){	const usart_serial_options_t usart_serial_options = {		.baudrate   = CONF_TEST_BAUDRATE,		.charlength = CONF_TEST_CHARLENGTH,		.paritytype = CONF_TEST_PARITY,		.stopbits   = CONF_TEST_STOPBITS,	};	board_init();	sysclk_init();	stdio_serial_init(CONF_TEST_USART, &usart_serial_options);	DEFINE_TEST_CASE(ioport_port_test, NULL, run_ioport_port_test, NULL,			"Test setting of various IOPORT functions");	DEFINE_TEST_CASE(ioport_pin_test, NULL, run_ioport_pin_test, NULL,			"Test IOPORT pin level is getting changed");	/* Put test case addresses in an array */	DEFINE_TEST_ARRAY(ioport_test) = {		&ioport_port_test,		&ioport_pin_test,	};	/* Define the test suite */	DEFINE_TEST_SUITE(ioport_suite, ioport_test,			"MEGARF IOPORT test suite");	/* Run all tests in the suite */	test_suite_run(&ioport_suite);	while (1) {		/* Intentionally left empty. */	}}
开发者ID:70year,项目名称:MICO,代码行数:41,


示例7: main_cdc_set_dtr

void main_cdc_set_dtr(bool b_enable){	if (b_enable) {		DEFINE_TEST_CASE(nlme_reset_test, NULL, run_nlme_reset_test,				NULL, "NWK Reset request");		DEFINE_TEST_CASE(nlme_start_test, NULL, run_nlme_start_test,				NULL, "NWK Start request");		DEFINE_TEST_CASE(zid_rec_connect_test, NULL,				run_zid_rec_connect_test,				NULL, "Push button pairing Request");		/* Put test case addresses in an array. */		DEFINE_TEST_ARRAY(nwk_tests) = {			&nlme_reset_test,			&nlme_start_test,			&zid_rec_connect_test		};		/* Define the test suite. */		DEFINE_TEST_SUITE(nwk_suite, nwk_tests,				"NWK unit test suite");		/* Run all tests in the test suite. */		test_suite_run(&nwk_suite);	} else {	}}
开发者ID:InSoonPark,项目名称:asf,代码行数:27,


示例8: main

/** * /brief Run IISC driver unit tests. */int main(void){	sysclk_init();	board_init();	const usart_serial_options_t usart_serial_options = {		.baudrate = CONF_TEST_BAUDRATE,		.charlength = CONF_TEST_CHARLENGTH,		.paritytype = CONF_TEST_PARITY,		.stopbits = CONF_TEST_STOPBITS	};	stdio_serial_init(CONF_TEST_USART, &usart_serial_options);	/* Define all the test cases. */	DEFINE_TEST_CASE(iis_test, NULL, run_iis_test, NULL,			"SAM IIS transfer test");	/* Put test case addresses in an array. */	DEFINE_TEST_ARRAY(iis_tests) = {		&iis_test,	};	/* Define the test suite. */	DEFINE_TEST_SUITE(iis_suite, iis_tests, "SAM IIS driver test suite");	/* Run all tests in the test suite. */	test_suite_run(&iis_suite);	while (1) {		/* Busy-wait forever. */	}}
开发者ID:InSoonPark,项目名称:asf,代码行数:36,


示例9: main

/** * /brief Run TCC unit tests * * Initializes the system and serial output, then sets up the TCC unit test * suite and runs it. */int main(void){	system_init();	cdc_uart_init();	/* Define Test Cases */	DEFINE_TEST_CASE(init_test, NULL,			run_init_test, NULL,			"Initialize tcc_xmodules");	DEFINE_TEST_CASE(basic_functionality_test, NULL,			run_basic_functionality_test, NULL,			"test start stop and getters and setters");	DEFINE_TEST_CASE(callback_test, NULL,			run_callback_test, NULL,			"test callback API");	DEFINE_TEST_CASE(reset_test, NULL,			run_reset_test, NULL,			"Setup, reset TCC module");	DEFINE_TEST_CASE(capture_and_compare_test, NULL,			run_capture_and_compare_test, NULL,			"Test capture and compare");	DEFINE_TEST_CASE(faultx_test, NULL,			run_faultx_test, NULL,			"Test Non-Recoverable Fault");	DEFINE_TEST_CASE(faultn_test, NULL,			run_faultn_test, NULL,			"Test Recoverable Fault");	/* Put test case addresses in an array */	DEFINE_TEST_ARRAY(tcc_tests) = {		&init_test,		&basic_functionality_test,		&callback_test,		&reset_test,		&capture_and_compare_test,		&faultx_test,		&faultn_test,	};	/* Define the test suite */	DEFINE_TEST_SUITE(tcc_suite, tcc_tests,			"SAM D21/R21 TCC driver test suite");	/* Run all tests in the suite*/	test_suite_run(&tcc_suite);	tcc_reset(&tcc_test0_module);	tcc_reset(&tcc_test1_module);	while (true) {		/* Intentionally left empty */	}}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:65,


示例10: main

/** * /brief Run SPI unit tests * * Initializes the system and serial output, then sets up the * SPI unit test suite and runs it. */int main(void){	system_init();	cdc_uart_init();	cpu_irq_enable();	/* Fill the transmit buffers with some data */	for (uint16_t i = 0; i < BUFFER_LENGTH; i++) {		tx_buf[i] = i + 1;		slave_tx_buf[i] = i + 1;	}	/* Define Test Cases */	DEFINE_TEST_CASE(spi_init_test, NULL,			run_spi_init_test, NULL,			"Initialization test for SPI master & slave");	DEFINE_TEST_CASE(single_byte_polled_test, NULL,			run_single_byte_polled_test, NULL,			"Transfer single byte and readback by polling");	DEFINE_TEST_CASE(buffer_polled_write_interrupt_read_test,			setup_buffer_polled_write_interrupt_read_test,			run_buffer_polled_write_interrupt_read_test,			cleanup_buffer_polled_write_interrupt_read_test,			"Transfer bytes by polling and read back with interrupt");	DEFINE_TEST_CASE(transceive_buffer_test, NULL,			run_transceive_buffer_test, NULL,			"Transmit & receive bytes using transceive functions");	DEFINE_TEST_CASE(baud_test, NULL, run_baud_test, NULL,			"Transfer byte at different baud rates");	DEFINE_TEST_CASE(transfer_9bit_test, setup_transfer_9bit_test,			run_transfer_9bit_test, NULL,			"Transfer 9-bit character and readback by polling");	/* Put test case addresses in an array */	DEFINE_TEST_ARRAY(spi_tests) = {		&spi_init_test,		&single_byte_polled_test,		&buffer_polled_write_interrupt_read_test,		&transceive_buffer_test,		&baud_test,		&transfer_9bit_test,	};	/* Define the test suite */	DEFINE_TEST_SUITE(spi_test_suite, spi_tests,			"SAM SPI driver test suite");	/* Run all tests in the suite*/	test_suite_run(&spi_test_suite);	while (true) {		/* Intentionally left empty */	}}
开发者ID:ThucVD2704,项目名称:femto-usb-blink-example,代码行数:65,


示例11: main

int main( int argc, char* argv[] ) {  test_suite_t suite = {    "default",    &(tests[0]),  };    return (test_suite_run( &suite ) == TEST_PASS) ? 0 : 1;}
开发者ID:jpommerening,项目名称:fnmatch,代码行数:8,


示例12: main

/** * /brief Run ADC unit tests * * Initializes the system and serial output, then sets up the * ADC unit test suite and runs it. */int main(void){	system_init();	delay_init();	cdc_uart_init();	test_dac_init();	/* Define Test Cases */	DEFINE_TEST_CASE(adc_init_test,			NULL,			run_adc_init_test,			NULL,			"Testing ADC Initialization");	DEFINE_TEST_CASE(adc_polled_mode_test,			NULL,			run_adc_polled_mode_test,			NULL,			"Testing ADC single ended mode by polling");	DEFINE_TEST_CASE(adc_callback_mode_test,			setup_adc_callback_mode_test,			run_adc_callback_mode_test,			cleanup_adc_callback_mode_test,			"Testing ADC single ended mode by interrupt");	DEFINE_TEST_CASE(adc_average_mode_test,			setup_adc_average_mode_test,			run_adc_average_mode_test,			NULL,			"Testing ADC average mode");	DEFINE_TEST_CASE(adc_window_mode_test,			setup_adc_window_mode_test,			run_adc_window_mode_test,			cleanup_adc_window_mode_test,			"Testing ADC window mode");	/* Put test case addresses in an array */	DEFINE_TEST_ARRAY(adc_tests) = {		&adc_init_test,		&adc_polled_mode_test,		&adc_callback_mode_test,		&adc_average_mode_test,		&adc_window_mode_test,	};	/* Define the test suite */	DEFINE_TEST_SUITE(adc_test_suite, adc_tests,			"SAM ADC driver test suite");	/* Run all tests in the suite*/	test_suite_run(&adc_test_suite);	while (true) {		/* Intentionally left empty */	}}
开发者ID:InSoonPark,项目名称:asf,代码行数:64,


示例13: test_mod_enable

static int test_mod_enable(const struct mod *mod) {	struct test_mod *test_mod = (struct test_mod *) mod;	if (!test_mod->suite.autorun) {		return 0;	}	return test_suite_run(&test_mod->suite);}
开发者ID:AnastasiaSulyagina,项目名称:embox,代码行数:9,


示例14: main

/** * /brief Run AFEC driver unit tests. */int main(void){	const usart_serial_options_t usart_serial_options = {		.baudrate   = CONF_TEST_BAUDRATE,		.paritytype = CONF_TEST_PARITY	};	/* Initialize the system clock and board */	sysclk_init();	board_init();	sysclk_enable_peripheral_clock(CONSOLE_UART_ID);	stdio_serial_init(CONF_TEST_USART, &usart_serial_options);	afec_enable(AFEC0);	struct afec_config afec_cfg;	afec_get_config_defaults(&afec_cfg);	afec_init(AFEC0, &afec_cfg);	/*	 * Because the internal ADC offset is 0x800, it should cancel it and shift	 * down to 0.	 */	afec_channel_set_analog_offset(AFEC0, AFEC_CHANNEL_1, 0x800);	afec_channel_enable(AFEC0, AFEC_CHANNEL_1);#if defined(__GNUC__)	setbuf(stdout, NULL);#endif	/* Define all the test cases */	DEFINE_TEST_CASE(afec_tc_trig_test, NULL, run_afec_tc_trig_test, NULL,			"AFEC TC Trig test");	DEFINE_TEST_CASE(afec_comp_test, NULL, run_afec_comp_test,			NULL, "AFEC Comparison Window test");	/* Put test case addresses in an array */	DEFINE_TEST_ARRAY(afec_tests) = {		&afec_tc_trig_test,		&afec_comp_test,	};	/* Define the test suite */	DEFINE_TEST_SUITE(afec_suite, afec_tests,			"SAM AFEC driver test suite");	/* Run all tests in the test suite */	test_suite_run(&afec_suite);	while (1) {		/* Busy-wait forever. */	}}
开发者ID:ThucVD2704,项目名称:femto-usb-blink-example,代码行数:59,


示例15: main

/** * /brief Run WDT unit tests * * Initializes the system and serial output, then sets up the * WDT unit test suite and runs it. */int main(void){	/* Check whether reset cause was Watchdog */#if (SAML21)	wdr_flag = (system_get_reset_cause() & RSTC_RCAUSE_WDT);#else	wdr_flag = (system_get_reset_cause() & PM_RCAUSE_WDT);#endif	system_init();	/* Reset the Watchdog count */	wdt_reset_count();	struct wdt_conf config_wdt;	/* Get the Watchdog default configuration */	wdt_get_config_defaults(&config_wdt);	if(wdr_flag) {		config_wdt.enable = false;	}	/* Set the desired configuration */#if !(SAML21)	config_wdt.clock_source         = CONF_WDT_GCLK_GEN;#endif	config_wdt.timeout_period       = CONF_WDT_TIMEOUT_PERIOD;	config_wdt.early_warning_period = CONF_WDT_EARLY_WARNING_PERIOD;	wdt_set_config(&config_wdt);	cdc_uart_init();	DEFINE_TEST_CASE(wdt_early_warning_test, NULL,			run_wdt_early_warning_test, wait_for_wdt_reset,			"WDT Early Warning Test");	DEFINE_TEST_CASE(reset_cause_test, NULL,			run_reset_cause_test, NULL,			"Confirming Watchdog Reset");	/* Put test case addresses in an array */	DEFINE_TEST_ARRAY(wdt_tests) = {			&wdt_early_warning_test,			&reset_cause_test,			};	/* Define the test suite */	DEFINE_TEST_SUITE(wdt_suite, wdt_tests,			"SAM WDT driver test suite");	/* Run all tests in the suite*/	test_suite_run(&wdt_suite);	while (1) {		/* Intentionally left empty */	}}
开发者ID:ThucVD2704,项目名称:femto-usb-blink-example,代码行数:61,


示例16: main

/** * /brief Run spinner widget unit tests */int main (void){	const usart_serial_options_t usart_serial_options = {		.baudrate   = CONF_TEST_BAUDRATE,		.charlength = CONF_TEST_CHARLENGTH,		.paritytype = CONF_TEST_PARITY,		.stopbits   = CONF_TEST_STOPBITS,	};	sysclk_init();	board_init();	gfx_mono_init();	stdio_serial_init(CONF_TEST_USART, &usart_serial_options);	// Define all the test cases	DEFINE_TEST_CASE(single_spinner_spincollection_test, NULL,			run_single_spinner_spincollection_test, NULL,			"Single spinners in spincollection test");	DEFINE_TEST_CASE(two_spinners_spincollection_test, NULL,			run_two_spinners_spincollection_test, NULL,			"Two spinners in spincollection test");	DEFINE_TEST_CASE(three_spinners_spincollection_test, NULL,			run_three_spinners_spincollection_test, NULL,			"Three spinners in spincollection test");	DEFINE_TEST_CASE(cancel_spinner_spincollection_test, NULL,			run_cancel_spinner_spincollection_test, NULL,			"Cancel spinner choice test");	DEFINE_TEST_CASE(event_back_spincollection_test, NULL,			run_event_back_spincollection_test, NULL,			"Event back spincollection test");	// Put test case addresses in an array	DEFINE_TEST_ARRAY(spinctrl_tests) = {		&single_spinner_spincollection_test,		&two_spinners_spincollection_test,		&three_spinners_spincollection_test,		&event_back_spincollection_test,		&cancel_spinner_spincollection_test,	};	// Define the test suite	DEFINE_TEST_SUITE(spinctrl_suite, spinctrl_tests,			"Spinner widget with test suite");	// Set up the test data pointer and run all tests in the suite	test_suite_run(&spinctrl_suite);	while (1) {		/* Intentionally left empty. */	}}
开发者ID:Gr3yR0n1n,项目名称:SAINTCON-2015-Badge,代码行数:56,


示例17: main

int main(void){	system_init();	cdc_uart_init();	test_at25dfx_init();	DEFINE_TEST_CASE(check_presence_test, NULL,			run_check_presence_test, NULL,			"Testing presence checking");	DEFINE_TEST_CASE(read_write_buffer_test, NULL,			run_read_write_buffer_test, NULL,			"Testing read and write");	DEFINE_TEST_CASE(erase_test, NULL,			run_erase_test, NULL,			"Testing chip erase");	DEFINE_TEST_CASE(erase_block_test, NULL,			run_erase_block_test, NULL,			"Testing block erase");	DEFINE_TEST_CASE(global_sector_protect_test, NULL,			run_global_sector_protect_test, NULL,			"Testing global sector protect setting");	DEFINE_TEST_CASE(set_get_sector_protect_test, NULL,			run_set_get_sector_protect_test, NULL,			"Testing sector protect setting and getting");	DEFINE_TEST_CASE(sleep_wake_test, NULL,			run_sleep_wake_test, NULL,			"Testing sleep and wake");	DEFINE_TEST_ARRAY(at25dfx_tests) = {		&check_presence_test,		&read_write_buffer_test,		&erase_test,		&erase_block_test,		&global_sector_protect_test,		&set_get_sector_protect_test,		&sleep_wake_test,	};	DEFINE_TEST_SUITE(at25dfx_test_suite, at25dfx_tests,			"AT25DFx driver test suite");	test_suite_run(&at25dfx_test_suite);	while (true) {		/* Intentionally left empty */	}}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:53,


示例18: main

int main(int argc, char **argv) {	const struct test_suite *test = NULL;	int test_nr = -1;	int opt;	/* TODO it must be agreed with shell maximum command length */	char test_name[100] = { 0 };	getopt_init();	while (-1 != (opt = getopt(argc, argv, "hn:t:i"))) {		switch (opt) {		case 'n':			if ((optarg == NULL) || (!sscanf(optarg, "%d", &test_nr))) {				printf("test -n: number expected/n");				print_usage();				return -EINVAL;			}			break;		case 't':			if ((optarg == NULL) || (!sscanf(optarg, "%s", test_name))) {				printf("test -t: test name expected/n");				print_usage();				return -EINVAL;			}			break;		case '?':		case 'h':			print_usage();			/* FALLTHROUGH */		default:			return 0;		}	}	if (test_nr != -1) {		if (NULL == (test = get_test_by_nr(test_nr))) {			return -ENOENT;		}	}	if (*test_name != 0) {		if (NULL == (test = test_lookup(test_name))) {			printf("Can't find test named /"%s/"/n", test_name);			return -ENOENT;		}	}	if (NULL == test) {		print_tests();		return 0;	}	return test_suite_run(test);}
开发者ID:AleksandraButrova,项目名称:embox,代码行数:52,


示例19: main

/** * /brief Run ADC unit tests * * Initializes the clock system, board and serial output, then sets up the * ADC unit test suite and runs it. */int main(void){	const usart_serial_options_t usart_serial_options = {		.baudrate   = CONF_TEST_BAUDRATE,		.charlength = CONF_TEST_CHARLENGTH,		.paritytype = CONF_TEST_PARITY,		.stopbits   = CONF_TEST_STOPBITS,	};	board_init();	sysclk_init();	sleepmgr_init();	stdio_serial_init(CONF_TEST_USART, &usart_serial_options);	// Define single ended conversion test cases	DEFINE_TEST_CASE(single_ended_12bit_conversion_test, NULL,			run_single_ended_12bit_conversion_test, NULL,			"Single ended conversion with 12-bit result");	DEFINE_TEST_CASE(single_ended_8bit_conversion_test, NULL,			run_single_ended_8bit_conversion_test, NULL,			"Single ended conversion with 8-bit result");	// Define differential conversion test cases	DEFINE_TEST_CASE(differential_conversion_test, NULL,			run_differential_12bit_conversion_test, NULL,			"Differential conversion with 12-bit result");	DEFINE_TEST_CASE(differential_conversion_with_gain_test, NULL,			run_differential_12bit_with_gain_conversion_test, NULL,			"Differential conversion with 12-bit result and gain");	// Put test case addresses in an array	DEFINE_TEST_ARRAY(adc_tests) = {		&single_ended_12bit_conversion_test,		&single_ended_8bit_conversion_test,		&differential_conversion_test,		&differential_conversion_with_gain_test,	};	// Define the test suite	DEFINE_TEST_SUITE(adc_suite, adc_tests,			"XMEGA ADC driver test suite");	// Run all tests in the suite	test_suite_run(&adc_suite);	while (1) {		// Intentionally left empty.	}}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:56,


示例20: main

/** * /brief Run MEM2MEM driver unit tests. */int main(void){	uint32_t i;	const usart_serial_options_t uart_serial_options = {		.baudrate = CONF_TEST_BAUDRATE,		.paritytype = CONF_TEST_PARITY	};	/* Initialize the system. */	sysclk_init();	board_init();	/* Configure console UART. */	sysclk_enable_peripheral_clock(CONSOLE_UART_ID);	stdio_serial_init(CONF_TEST_UART, &uart_serial_options);	/* Initialize src buffer */	for (i = 0; i < MEM_SIZE8/2; i ++) {		src_mem8[i] = (i % 10) + '0';	}	for (;i < MEM_SIZE8; i ++) {		src_mem8[i] = (i % ('z'-'a')) + 'a';	}	/* Define all the test cases */	DEFINE_TEST_CASE(low_level_test, NULL, run_low_level_transfer_test,			NULL, "Low Level APIs data transfer test");	DEFINE_TEST_CASE(transfer_wait_test, NULL, run_transfer_wait_test,			NULL, "M2M APIs data transfer wait test");	DEFINE_TEST_CASE(transfer_job_test, NULL, run_transfer_job_test,			NULL, "M2M APIs data transfer job test");	/* Put test case addresses in an array */	DEFINE_TEST_ARRAY(mem2mem_tests) = {		&low_level_test,		&transfer_wait_test,		&transfer_job_test	};	/* Define the test suite */	DEFINE_TEST_SUITE(mem2mem_suite, mem2mem_tests,			"SAM MEM2MEM driver test suite");	/* Run all tests in the test suite */	test_suite_run(&mem2mem_suite);	while (1) {		/* Busy-wait forever */	}}
开发者ID:thegeek82000,项目名称:asf,代码行数:53,


示例21: main

/** * /brief Run CRC driver unit tests */int main (void){	const usart_serial_options_t usart_serial_options = {		.baudrate     = CONF_TEST_BAUDRATE,		.charlength   = CONF_TEST_CHARLENGTH,		.paritytype   = CONF_TEST_PARITY,		.stopbits     = CONF_TEST_STOPBITS,	};	sysclk_init();	board_init();	sleepmgr_init();	stdio_serial_init(CONF_TEST_USART, &usart_serial_options);	DEFINE_TEST_CASE(crc_32bit_io_test, NULL,		run_32bit_io_test,		NULL, "32bit CRC on simulated IO data test");	DEFINE_TEST_CASE(crc_16bit_io_test, NULL,		run_16bit_io_test,		NULL, "16bit CRC on simulated IO data test");	DEFINE_TEST_CASE(crc_32bit_dma_test, NULL, run_32bit_dma_test,		NULL, "32bit CRC DMA data test");	DEFINE_TEST_CASE(crc_16bit_dma_test, NULL, run_16bit_dma_test,		NULL, "16bit CRC DMA data test");	DEFINE_TEST_CASE(crc_32bit_flash_range_test, NULL, run_flash_test,		NULL, "32bit CRC flash range test");	// Put test case addresses in an array	DEFINE_TEST_ARRAY(crc_tests) = {		&crc_32bit_io_test,		&crc_16bit_io_test,		&crc_32bit_dma_test,		&crc_16bit_dma_test,		&crc_32bit_flash_range_test,	};	// Define the test suite	DEFINE_TEST_SUITE(crc_suite, crc_tests, "XMEGA CRC driver test suite");	test_suite_run(&crc_suite);	while (1) {		// Intentionally left blank	}}
开发者ID:InSoonPark,项目名称:asf,代码行数:53,



注:本文中的test_suite_run函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ test_teardown函数代码示例
C++ test_start函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。