Index: library/tests/test_kalman.cpp
===================================================================
--- library/tests/test_kalman.cpp (revision 477)
+++ library/tests/test_kalman.cpp (revision 527)
@@ -82,8 +82,8 @@
 
 	// EKF
-	bilinfn fxu ( A, B );
-	bilinfn hxu ( C, D );
+	shared_ptr<bilinfn> fxu = new bilinfn ( A, B );
+	shared_ptr<bilinfn> hxu = new bilinfn ( C, D );
 	EKFCh KFE;
-	KFE.set_parameters ( &fxu, &hxu, Q, R );
+	KFE.set_parameters ( fxu, hxu, Q, R );
 	KFE.set_est ( mu0, chmat ( P0 ) );
 	const epdf& KFEep = KFE.posterior();
Index: library/tests/square_mat_stress.cpp
===================================================================
--- library/tests/square_mat_stress.cpp (revision 495)
+++ library/tests/square_mat_stress.cpp (revision 527)
@@ -17,4 +17,5 @@
 using bdm::chmat;
 using bdm::ldmat;
+using bdm::shared_ptr;
 using bdm::UIFile;
 using bdm::UI;
@@ -174,16 +175,10 @@
 void test_agenda ( FTestMatrix test ) {
 	UIFile fag ( agenda_file_name );
-	Array<square_mat_point *> mag;
+	Array<shared_ptr<square_mat_point> > mag;
 	UI::get ( mag, fag, "agenda", UI::compulsory );
 	int sz = mag.size();
 	CHECK ( sz > 0 );
 	for ( int i = 0; i < sz; ++i ) {
-		test ( i, mag ( i ) );
-	}
-
-	for ( int i = 0; i < sz; ++i ) {
-		square_mat_point *p = mag ( i );
-		mag ( i ) = 0;
-		delete p;
+		test ( i, mag ( i ).get() );
 	}
 }
Index: library/tests/square_mat_prep.cpp
===================================================================
--- library/tests/square_mat_prep.cpp (revision 480)
+++ library/tests/square_mat_prep.cpp (revision 527)
@@ -7,5 +7,4 @@
 #include <iostream>
 #include <iomanip>
-#include <memory>
 #include <stdlib.h>
 
@@ -62,8 +61,8 @@
 		cerr << "usage: " << argv[0] << " [ -g generator.cfg ] [ -a agenda_output.cfg ] [ -l agenda_length ]" << endl;
 	} else {
-		Array<square_mat_point *> mag ( agenda_length );
+		Array<shared_ptr<square_mat_point> > mag ( agenda_length );
 
 		UIFile gspec ( generator_file_name );
-		auto_ptr<generator> gen ( UI::build<generator> ( gspec, "generator", UI::compulsory ) );
+		shared_ptr<generator> gen ( UI::build<generator> ( gspec, "generator", UI::compulsory ) );
 		for ( int i = 0; i < agenda_length; ++i ) {
 			mat m = gen->next();
@@ -76,10 +75,4 @@
 		UI::save ( mag, fag, "agenda" );
 		fag.save ( agenda_file_name );
-
-		for ( int i = 0; i < agenda_length; ++i ) {
-			square_mat_point *p = mag ( i );
-			mag ( i ) = 0;
-			delete p;
-		}
 	}
 }
Index: library/tests/epdf_harness.cpp
===================================================================
--- library/tests/epdf_harness.cpp (revision 507)
+++ library/tests/epdf_harness.cpp (revision 527)
@@ -14,5 +14,5 @@
 
 	UIFile in ( config_file_name );
-	Array<epdf_harness *> input;
+	Array<shared_ptr<epdf_harness> > input;
 	UI::get ( input, in, "data", UI::compulsory );
 	int sz = input.size();
Index: library/tests/mpdf_harness.cpp
===================================================================
--- library/tests/mpdf_harness.cpp (revision 493)
+++ library/tests/mpdf_harness.cpp (revision 527)
@@ -13,5 +13,5 @@
 
 	UIFile in ( config_file_name );
-	Array<mpdf_harness *> input;
+	Array<shared_ptr<mpdf_harness> > input;
 	UI::get ( input, in, "data", UI::compulsory );
 	int sz = input.size();
Index: library/tests/user_info_test.cpp
===================================================================
--- library/tests/user_info_test.cpp (revision 499)
+++ library/tests/user_info_test.cpp (revision 527)
@@ -1,3 +1,2 @@
-#include <memory>
 #include <string>
 #include <string.h>
@@ -103,5 +102,5 @@
 public:
 	int kilometers;
-	Array<Passenger*> passengers;
+	Array<shared_ptr<Passenger> > passengers;
 
 	Car() : Transport() {
@@ -192,17 +191,17 @@
 TEST ( test_load ) {
 	UIFile in ( "test_user_info_input.cfg" );
-	auto_ptr<Transport> pepikovo ( UI::build<Transport> ( in, "pepikovo", UI::compulsory ) );
+	shared_ptr<Transport> pepikovo ( UI::build<Transport> ( in, "pepikovo", UI::compulsory ) );
 	CHECK_EQUAL ( string ( "A car made in 1998 by audi, having 25000 kilometers on the clock.The names of passengers are as follows: Karlos Novak -1_CygWin_Matlab_Aimsun Karlosik Novacek " ), pepikovo->to_string() );
 
-	auto_ptr<Transport> jardovo ( UI::build<Transport> ( in, "jardovo", UI::compulsory ) );
+	shared_ptr<Transport> jardovo ( UI::build<Transport> ( in, "jardovo", UI::compulsory ) );
 	CHECK_EQUAL ( string ( "A car made in 1992 by liaz, having 1555000 kilometers on the clock." ), jardovo->to_string() );
 
-	auto_ptr<Transport> ondrejovo ( UI::build<Transport> ( in, "ondrejovo", UI::compulsory ) );
+	shared_ptr<Transport> ondrejovo ( UI::build<Transport> ( in, "ondrejovo", UI::compulsory ) );
 	CHECK_EQUAL ( string ( "a bike made in 1996 by author with electric lights included" ), ondrejovo->to_string() );
 
-	auto_ptr<Transport> elisky ( UI::build<Transport> ( in, "elisky", UI::compulsory ) );
+	shared_ptr<Transport> elisky ( UI::build<Transport> ( in, "elisky", UI::compulsory ) );
 	CHECK_EQUAL ( string ( "A car made in 1992 by liaz, having 1555000 kilometers on the clock." ), elisky->to_string() );
 
-	auto_ptr<Transport> kati ( UI::build<Transport> ( in, "kati", UI::compulsory ) );
+	shared_ptr<Transport> kati ( UI::build<Transport> ( in, "kati", UI::compulsory ) );
 	CHECK_EQUAL ( string ( "A car made in 1980 by vecernicek, having 250000 kilometers on the clock." ), kati->to_string() );
 }
@@ -210,5 +209,5 @@
 TEST ( test_save ) {
 	UIFile in ( "test_user_info_input.cfg" );
-	auto_ptr<Transport> pepikovo ( UI::build<Transport> ( in, "pepikovo", UI::compulsory ) );
+	shared_ptr<Transport> pepikovo ( UI::build<Transport> ( in, "pepikovo", UI::compulsory ) );
 
 	Car audi ( 1968, "zyl", 200 );
@@ -220,5 +219,5 @@
 	UI::save ( &liaz, out, "bohousovo" );
 	UI::save ( &author, out, "karlovo" );
-	UI::save ( pepikovo.get(), out, "pepikovo" );
+	UI::save ( pepikovo, out, "pepikovo" );
 	out.save ( "testUI_out.cfg" );
 
