cout << "### Test 20: return value behavior?" << endl;
printf("### Test 20: return value behavior?\n");
main()  {    cout << ">>main()" << endl;		cout << "sizeof(nsCOMPtr<IFoo>) --> " << sizeof(nsCOMPtr<IFoo>) << endl;#ifdef TEST_EXCEPTIONS		TestBloat_Raw();#endif // TEST_EXCEPTIONS		TestBloat_Raw_Unsafe();		TestBloat_Smart();    {      cout << endl << "### Test  1: will a |nsCOMPtr| call |AddRef| on a pointer assigned into it?" << endl;      nsCOMPtr<IFoo> foop( do_QueryInterface(new IFoo) );      cout << endl << "### Test  2: will a |nsCOMPtr| |Release| its old pointer when a new one is assigned in?" << endl;      foop = do_QueryInterface(new IFoo);        // [Shouldn't compile] Is it a compile time error to try to |AddRef| by hand?      //foop->AddRef();        // [Shouldn't compile] Is it a compile time error to try to |Release| be hand?      //foop->Release();				// [Shouldn't compile] Is it a compile time error to try to |delete| an |nsCOMPtr|?			//delete foop;      cout << endl << "### Test  3: can you |AddRef| if you must?" << endl;      STATIC_CAST(IFoo*, foop)->AddRef();      cout << endl << "### Test  4: can you |Release| if you must?" << endl;      STATIC_CAST(IFoo*, foop)->Release();      cout << endl << "### Test  5: will a |nsCOMPtr| |Release| when it goes out of scope?" << endl;    }    {      cout << endl << "### Test  6: will a |nsCOMPtr| call the correct destructor?" << endl;      nsCOMPtr<IFoo> foop( do_QueryInterface(new IBar) );    }    {      cout << endl << "### Test  7: can you compare one |nsCOMPtr| with another [!=]?" << endl;      nsCOMPtr<IFoo> foo1p( do_QueryInterface(new IFoo) );        // [Shouldn't compile] Is it a compile time error to omit |getter_[doesnt_]AddRef[s]|?      //AnIFooPtrPtrContext(&foo1p);        // [Shouldn't compile] Is it a compile time error to omit |getter_[doesnt_]AddRef[s]|?      //AVoidPtrPtrContext(&foo1p);      nsCOMPtr<IFoo> foo2p( do_QueryInterface(new IFoo) );      if ( foo1p != foo2p )        cout << "foo1p != foo2p" << endl;      else        cout << "foo1p == foo2p" << endl;      cout << endl << "### Test  7.5: can you compare a |nsCOMPtr| with NULL, 0, nsnull [!=]?" << endl;      if ( foo1p != 0 )      	cout << "foo1p != 0" << endl;      if ( 0 != foo1p )      	cout << "0 != foo1p" << endl;      if ( foo1p == 0 )      	cout << "foo1p == 0" << endl;      if ( 0 == foo1p )      	cout << "0 == foo1p" << endl;			      IFoo* raw_foo2p = foo2p.get();      cout << endl << "### Test  8: can you compare a |nsCOMPtr| with a raw interface pointer [!=]?" << endl;      if ( foo1p.get() != raw_foo2p )        cout << "foo1p != raw_foo2p" << endl;      else        cout << "foo1p == raw_foo2p" << endl;      cout << endl << "### Test  9: can you assign one |nsCOMPtr| into another?" << endl;      foo1p = foo2p;      cout << endl << "### Test 10: can you compare one |nsCOMPtr| with another [==]?" << endl;      if ( foo1p == foo2p )        cout << "foo1p == foo2p" << endl;      else        cout << "foo1p != foo2p" << endl;      cout << endl << "### Test 11: can you compare a |nsCOMPtr| with a raw interface pointer [==]?" << endl;      if ( raw_foo2p == foo2p.get() )        cout << "raw_foo2p == foo2p" << endl;      else        cout << "raw_foo2p != foo2p" << endl;#if 1      cout << endl << "### Test 11.5: can you compare a |nsCOMPtr| with a raw interface pointer [==]?" << endl;      if ( nsCOMPtr<IFoo>( raw_foo2p ) == foo2p )        cout << "raw_foo2p == foo2p" << endl;      else        cout << "raw_foo2p != foo2p" << endl;#endif      cout << endl << "### Test 12: bare pointer test?" << endl;      if ( foo1p )        cout << "foo1p is not NULL" << endl;      else        cout << "foo1p is NULL" << endl;      cout << endl << "### Test 13: numeric pointer test?" << endl;      if ( foo1p == 0 )        cout << "foo1p is NULL" << endl;      else        cout << "foo1p is not NULL" << endl;#if 0			if ( foo1p == 1 )				cout << "foo1p allowed compare with in" << endl;#endif      cout << endl << "### Test 14: how about when two |nsCOMPtr|s referring to the same object go out of scope?" << endl;    }    {      cout << endl << "### Test 15,16 ...setup..." << endl;      IFoo* raw_foo1p = new IFoo;      raw_foo1p->AddRef();      IFoo* raw_foo2p = new IFoo;      raw_foo2p->AddRef();      cout << endl << "### Test 15: what if I don't want to |AddRef| when I construct?" << endl;      nsCOMPtr<IFoo> foo1p( dont_AddRef(raw_foo1p) );      //nsCOMPtr<IFoo> foo1p = dont_AddRef(raw_foo1p);      cout << endl << "### Test 16: what if I don't want to |AddRef| when I assign in?" << endl;      nsCOMPtr<IFoo> foo2p;      foo2p = dont_AddRef(raw_foo2p);    }    {    	cout << endl << "### setup for Test 17" << endl;      nsCOMPtr<IFoo> foop;      cout << "### Test 17: basic parameter behavior?" << endl;      CreateIFoo( nsGetterAddRefs<IFoo>(foop) );    }    cout << "### End Test 17" << endl;    {    	cout << endl << "### setup for Test 18" << endl;      nsCOMPtr<IFoo> foop;      cout << "### Test 18: basic parameter behavior, using the short form?" << endl;      CreateIFoo( getter_AddRefs(foop) );    }    cout << "### End Test 18" << endl;    {    	cout << endl << "### setup for Test 19, 20" << endl;      nsCOMPtr<IFoo> foop;      cout << "### Test 19: reference parameter behavior?" << endl;      set_a_IFoo(address_of(foop));      cout << "### Test 20: return value behavior?" << endl;      foop = return_a_IFoo();    }    cout << "### End Test 19, 20" << endl;		{    	cout << endl << "### setup for Test 21" << endl;			nsCOMPtr<IFoo> fooP;			cout << "### Test 21: is |QueryInterface| called on assigning in a raw pointer?" << endl;			fooP = do_QueryInterface(new IFoo);		}    cout << "### End Test 21" << endl;		{    	cout << endl << "### setup for Test 22" << endl;			nsCOMPtr<IFoo> fooP;			fooP = do_QueryInterface(new IFoo);			nsCOMPtr<IFoo> foo2P;			cout << "### Test 22: is |QueryInterface| _not_ called when assigning in a smart-pointer of the same type?" << endl;			foo2P = fooP;		}    cout << "### End Test 22" << endl;		{    	cout << endl << "### setup for Test 23" << endl;			nsCOMPtr<IBar> barP( do_QueryInterface(new IBar) );			cout << "### Test 23: is |QueryInterface| called when assigning in a smart-pointer of a different type?" << endl;			nsCOMPtr<IFoo> fooP( do_QueryInterface(barP) );			if ( fooP )				cout << "an IBar* is an IFoo*" << endl;		}    cout << "### End Test 23" << endl;		{			nsCOMPtr<IFoo> fooP;			AnIFooPtrPtrContext( getter_AddRefs(fooP) );			AVoidPtrPtrContext( getter_AddRefs(fooP) );			AnISupportsPtrPtrContext( getter_AddRefs(fooP) );		}		{			nsCOMPtr<nsISupports> supportsP;			AVoidPtrPtrContext( getter_AddRefs(supportsP) );			AnISupportsPtrPtrContext( getter_AddRefs(supportsP) );		}    cout << endl << "### Test 24: will a static |nsCOMPtr| |Release| before program termination?" << endl;    gFoop = do_QueryInterface(new IFoo);        cout << "<<main()" << endl;    return 0;  }