From 3cf63b2f122f1fd9a967ee9dc7a21436f4a94077 Mon Sep 17 00:00:00 2001 From: "jan.reininghaus" Date: Tue, 23 Apr 2013 09:46:54 +0000 Subject: new vector interface for boundary_matrix git-svn-id: https://phat.googlecode.com/svn/trunk@38 8e3bb3c2-eed4-f18f-5264-0b6c94e6926d --- src/self_test.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/self_test.cpp b/src/self_test.cpp index 858a475..9ce44bc 100644 --- a/src/self_test.cpp +++ b/src/self_test.cpp @@ -161,5 +161,22 @@ int main( int argc, char** argv ) else std::cout << "All results are identical (as they should be)" << std::endl; } + std::cout << "Testing vector interface ..." << std::endl; + { + std::vector< std::vector< int > > vector_vector_matrix; + std::vector< int > vector_dims; + boundary_matrix.save_vector_vector( vector_vector_matrix, vector_dims ); + phat::boundary_matrix< BitTree > vector_vector_boundary_matrix; + vector_vector_boundary_matrix.load_vector_vector( vector_vector_matrix, vector_dims ); + + if( vector_vector_boundary_matrix != boundary_matrix ) { + std::cerr << "Error: [load|save]_vector_vector bug" << std::endl; + error = true; + } + + if( error ) return EXIT_FAILURE; + else std::cout << "Test passed!" << std::endl; + } + return EXIT_SUCCESS; } -- cgit v1.2.3