Bug 400795 - initial form fill and username autocomplete should share common code...
[wine-gecko.git] / xpcom / tests / SizeTest03.cpp
blob9ca71c72afa2fe8495631661246af9f8224e2729
1 // Test03.cpp
3 #include "nsIDOMNode.h"
4 #include "nsCOMPtr.h"
5 #include "nsString.h"
7 #ifdef __MWERKS__
8 #pragma exceptions off
9 #endif
11 NS_DEF_PTR(nsIDOMNode);
14 Windows:
15 nsCOMPtr_optimized* 45
16 raw_optimized 48
17 nsCOMPtr_optimized 50
18 nsCOMPtr 54
19 nsCOMPtr* 59
20 raw 62
22 Macintosh:
23 nsCOMPtr_optimized 112 (1.0000)
24 raw_optimized 124 bytes (1.1071) i.e., 10.71% bigger than nsCOMPtr_optimized
25 nsCOMPtr 144 (1.2857)
28 void // nsresult
29 Test03_raw( nsIDOMNode* aDOMNode, nsString* aResult )
30 // m140, w62
32 // -- the following code is assumed, but is commented out so we compare only
33 // the relevent generated code
35 // if ( !aDOMNode || !aResult )
36 // return NS_ERROR_NULL_POINTER;
38 nsIDOMNode* parent = 0;
39 nsresult status = aDOMNode->GetParentNode(&parent);
41 if ( NS_SUCCEEDED(status) )
43 parent->GetNodeName(*aResult);
46 NS_IF_RELEASE(parent);
48 // return status;
52 void // nsresult
53 Test03_raw_optimized( nsIDOMNode* aDOMNode, nsString* aResult )
54 // m124, w48
56 // if ( !aDOMNode || !aResult )
57 // return NS_ERROR_NULL_POINTER;
59 nsIDOMNode* parent;
60 nsresult status = aDOMNode->GetParentNode(&parent);
62 if ( NS_SUCCEEDED(status) )
64 parent->GetNodeName(*aResult);
65 NS_RELEASE(parent);
68 // return status;
72 void // nsresult
73 Test03_nsCOMPtr( nsIDOMNode* aDOMNode, nsString* aResult )
74 // m144, w54/59
76 // if ( !aDOMNode || !aResult )
77 // return NS_ERROR_NULL_POINTER;
79 nsCOMPtr<nsIDOMNode> parent;
80 nsresult status = aDOMNode->GetParentNode( getter_AddRefs(parent) );
81 if ( parent )
82 parent->GetNodeName(*aResult);
84 // return status;
87 void // nsresult
88 Test03_nsCOMPtr_optimized( nsIDOMNode* aDOMNode, nsString* aResult )
89 // m112, w50/45
91 // if ( !aDOMNode || !aResult )
92 // return NS_ERROR_NULL_POINTER;
94 nsIDOMNode* temp;
95 nsresult status = aDOMNode->GetParentNode(&temp);
96 nsCOMPtr<nsIDOMNode> parent( dont_AddRef(temp) );
97 if ( parent )
98 parent->GetNodeName(*aResult);
100 // return status;