コード例 #1
0
ファイル: vector_test.cpp プロジェクト: Artelnics/OpenNN
void VectorTest::run_test_case(void)
{
   message += "Running vector test case...\n";

   // Constructor and destructor methods

   test_constructor();
   test_destructor();

   // Arithmetic operators

   test_sum_operator();
   test_rest_operator();
   test_multiplication_operator();
   test_division_operator();

   // Operation and assignment operators

   test_sum_assignment_operator();
   test_rest_assignment_operator();
   test_multiplication_assignment_operator();
   test_division_assignment_operator();

   // Equality and relational operators

   test_equal_to_operator();
   test_not_equal_to_operator();

   test_greater_than_operator();
   test_greater_than_or_equal_to_operator();

   test_less_than_operator();
   test_less_than_or_equal_to_operator();

   // Output operator

   test_output_operator();

   // Get methods

   test_get_display();

   // Set methods

   test_set();
   test_set_display();

   // Resize methods

   test_resize();

   test_tuck_in();
   test_take_out();

   test_remove_element();

   test_get_assembly();

   // Initialization methods

   test_initialize();
   test_initialize_sequential();
   test_randomize_uniform();
   test_randomize_normal();

   // Checking methods

   test_contains();
   test_is_in();
   test_is_constant();
   test_is_crescent();
   test_is_decrescent();

   // Mathematical methods

   test_dot_vector();
   test_dot_matrix();

   test_calculate_sum();
   test_calculate_partial_sum();
   test_calculate_product();

   test_calculate_mean();
   test_calculate_standard_deviation();
   test_calculate_covariance();

   test_calculate_mean_standard_deviation();

   test_calculate_minimum();
   test_calculate_maximum();

   test_calculate_minimum_maximum();  

   test_calculate_minimum_missing_values();
   test_calculate_maximum_missing_values();

   test_calculate_minimum_maximum_missing_values();

   test_calculate_explained_variance();

   test_calculate_histogram();

   test_calculate_bin();
   test_calculate_frequency();
   test_calculate_total_frequencies();

   test_calculate_minimal_index();
   test_calculate_maximal_index();

   test_calculate_minimal_indices();
   test_calculate_maximal_indices();

   test_calculate_minimal_maximal_index();

   test_calculate_cumulative_index();
   test_calculate_closest_index();

   test_calculate_norm();
   test_calculate_normalized();

   test_calculate_sum_squared_error();
   test_calculate_mean_squared_error();
   test_calculate_root_mean_squared_error();

   test_apply_absolute_value();

   test_calculate_lower_bounded();
   test_calculate_upper_bounded();

   test_calculate_lower_upper_bounded();

   test_apply_lower_bound();
   test_apply_upper_bound();
   test_apply_lower_upper_bounds();

   test_calculate_less_rank();
   test_calculate_greater_rank();

   test_calculate_linear_correlation();
   test_calculate_linear_correlation_missing_values();
   test_calculate_linear_regression_parameters();

   // Scaling and unscaling

   test_scale_minimum_maximum();
   test_scale_mean_standard_deviation();

   // Parsing methods

   test_parse();

   // Serialization methods

   test_save();

   test_load();

   message += "End vector test case\n";

}
コード例 #2
0
ファイル: arrayListTestRunner.c プロジェクト: kaurTanbir/DSA
int main(){
	fixtureSetup();
	resetTestCount();

	testStarted("test_insert_element");
	setup();
		test_insert_element();
	tearDown();
	testEnded();
	testStarted("test_insert_multiple_elements");
	setup();
		test_insert_multiple_elements();
	tearDown();
	testEnded();
	testStarted("test_interns_grows_beyond_capacity");
	setup();
		test_interns_grows_beyond_capacity();
	tearDown();
	testEnded();
	testStarted("test_should_not_insert_at_index_beyond_length");
	setup();
		test_should_not_insert_at_index_beyond_length();
	tearDown();
	testEnded();
	testStarted("test_should_not_insert_at_negative_index");
	setup();
		test_should_not_insert_at_negative_index();
	tearDown();
	testEnded();
	testStarted("test_insert_at_middle_should_shift_the_elements");
	setup();
		test_insert_at_middle_should_shift_the_elements();
	tearDown();
	testEnded();
	testStarted("test_should_not_insert_when_list_is_null");
	setup();
		test_should_not_insert_when_list_is_null();
	tearDown();
	testEnded();
	testStarted("test_add_element");
	setup();
		test_add_element();
	tearDown();
	testEnded();
	testStarted("test_remove_element");
	setup();
		test_remove_element();
	tearDown();
	testEnded();
	testStarted("test_remove_element_from_empty_list");
	setup();
		test_remove_element_from_empty_list();
	tearDown();
	testEnded();
	testStarted("test_removes_and_shifts_elements_left");
	setup();
		test_removes_and_shifts_elements_left();
	tearDown();
	testEnded();
	testStarted("test_should_get_index_of_search_element");
	setup();
		test_should_get_index_of_search_element();
	tearDown();
	testEnded();
	testStarted("test_should_get_minus_1_if_element_not_found");
	setup();
		test_should_get_minus_1_if_element_not_found();
	tearDown();
	testEnded();
	testStarted("test_iterator_tells_that_next_data_is_present");
	setup();
		test_iterator_tells_that_next_data_is_present();
	tearDown();
	testEnded();
	testStarted("test_iterator_tells_that_next_data_is_not_present");
	setup();
		test_iterator_tells_that_next_data_is_not_present();
	tearDown();
	testEnded();
	testStarted("test_iterator_gives_the_data_of_next_index");
	setup();
		test_iterator_gives_the_data_of_next_index();
	tearDown();
	testEnded();
	testStarted("test_prints_data_of_each_element");
	setup();
		test_prints_data_of_each_element();
	tearDown();
	testEnded();

	summarizeTestCount();
	fixtureTearDown();
	return 0;
}