X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=ETL%2Ftrunk%2Ftest%2Fhandle.cpp;h=77be9f5a7f75774989788c24583c97f07da00c20;hb=cee5940bae97612105db8b7e1ffcf513f9d9150c;hp=fd40e2557fb1ec294337f2965710b6cf1cfbf9db;hpb=dee84efa006428fdfbf0e84b66ee94eb23113ad9;p=synfig.git diff --git a/ETL/trunk/test/handle.cpp b/ETL/trunk/test/handle.cpp index fd40e25..77be9f5 100644 --- a/ETL/trunk/test/handle.cpp +++ b/ETL/trunk/test/handle.cpp @@ -44,14 +44,14 @@ struct my_test_obj : public etl::rshared_object { instance_count++; } - + virtual ~my_test_obj() { if(instance_count==0) printf("Error, instance count is going past zero!\n"); instance_count--; } - + bool operator<(const my_test_obj &rhs)const { return my_id obj_handle(new my_test_obj(rand())); - if(obj_handle != obj_handle.constant()) + if(obj_handle != obj_handle.constant()) { printf("FAILED!\n"); printf(__FILE__":%d: on call to handle<>::constant().\n",__LINE__); return 1; } - + printf("PASSED\n"); return 0; @@ -136,13 +136,13 @@ int handle_general_use_test(void) { printf("handle: General-use test: "); my_test_obj::instance_count=0; - + obj_list my_list, my_other_list; int i; - + for(i=0;i my_item_list; for(i=0;i=2); } - + my_item_list.clear(); if(my_test_obj::instance_count) @@ -319,7 +319,7 @@ int rhandle_general_use_test(void) } printf("PASSED\n"); - + return 0; } @@ -328,13 +328,13 @@ int handle_inheritance_test(void) printf("handle: Inheritance test: "); my_test_obj::instance_count=0; my_other_test_obj::instance_count=0; - + other_obj_list my_other_list; int i; - + for(i=0;i obj; etl::handle other_obj; etl::loose_handle loose_obj; - + other_obj.spawn(); loose_obj=other_obj; - + obj=etl::handle::cast_dynamic(loose_obj); - + if(obj!=other_obj) { printf("FAILED!\n"); printf(__FILE__":%d: on handle assignment from loose_handle.\n",__LINE__); return 1; } - + printf("PASSED\n"); return 0; } @@ -477,6 +477,6 @@ int main() error+=handle_inheritance_test(); error+=loose_handle_test(); error+=rhandle_general_use_test(); - + return error; }