xpcom/reflect/xptcall/tests/TestXPTCInvoke.cpp

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 /* Invoke tests xptcall. */
michael@0 7
michael@0 8 #include <stdio.h>
michael@0 9 #include "xptcall.h"
michael@0 10 #include "prinrval.h"
michael@0 11 #include "nsMemory.h"
michael@0 12
michael@0 13 // Allows us to mark unused functions as known-unused
michael@0 14 #ifdef __GNUC__
michael@0 15 #define UNUSED __attribute__ ((unused))
michael@0 16 #else
michael@0 17 #define UNUSED
michael@0 18 #endif
michael@0 19
michael@0 20 // forward declration
michael@0 21 static void DoMultipleInheritenceTest();
michael@0 22 static void DoMultipleInheritenceTest2();
michael@0 23 static void UNUSED DoSpeedTest();
michael@0 24
michael@0 25 // {AAC1FB90-E099-11d2-984E-006008962422}
michael@0 26 #define INVOKETESTTARGET_IID \
michael@0 27 { 0xaac1fb90, 0xe099, 0x11d2, \
michael@0 28 { 0x98, 0x4e, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
michael@0 29
michael@0 30
michael@0 31 class InvokeTestTargetInterface : public nsISupports
michael@0 32 {
michael@0 33 public:
michael@0 34 NS_DECLARE_STATIC_IID_ACCESSOR(INVOKETESTTARGET_IID)
michael@0 35 NS_IMETHOD AddTwoInts(int32_t p1, int32_t p2, int32_t* retval) = 0;
michael@0 36 NS_IMETHOD MultTwoInts(int32_t p1, int32_t p2, int32_t* retval) = 0;
michael@0 37 NS_IMETHOD AddTwoLLs(int64_t p1, int64_t p2, int64_t* retval) = 0;
michael@0 38 NS_IMETHOD MultTwoLLs(int64_t p1, int64_t p2, int64_t* retval) = 0;
michael@0 39
michael@0 40 NS_IMETHOD AddManyInts(int32_t p1, int32_t p2, int32_t p3, int32_t p4,
michael@0 41 int32_t p5, int32_t p6, int32_t p7, int32_t p8,
michael@0 42 int32_t p9, int32_t p10, int32_t* retval) = 0;
michael@0 43
michael@0 44 NS_IMETHOD AddTwoFloats(float p1, float p2, float* retval) = 0;
michael@0 45
michael@0 46 NS_IMETHOD AddManyDoubles(double p1, double p2, double p3, double p4,
michael@0 47 double p5, double p6, double p7, double p8,
michael@0 48 double p9, double p10, double* retval) = 0;
michael@0 49
michael@0 50 NS_IMETHOD AddManyFloats(float p1, float p2, float p3, float p4,
michael@0 51 float p5, float p6, float p7, float p8,
michael@0 52 float p9, float p10, float* retval) = 0;
michael@0 53
michael@0 54 NS_IMETHOD AddManyManyFloats(float p1, float p2, float p3, float p4,
michael@0 55 float p5, float p6, float p7, float p8,
michael@0 56 float p9, float p10, float p11, float p12,
michael@0 57 float p13, float p14, float p15, float p16,
michael@0 58 float p17, float p18, float p19, float p20,
michael@0 59 float *retval) = 0;
michael@0 60
michael@0 61 NS_IMETHOD AddMixedInts(int64_t p1, int32_t p2, int64_t p3, int32_t p4,
michael@0 62 int32_t p5, int64_t p6, int32_t p7, int32_t p8,
michael@0 63 int64_t p9, int32_t p10, int64_t* retval) = 0;
michael@0 64
michael@0 65 NS_IMETHOD AddMixedInts2(int32_t p1, int64_t p2, int32_t p3, int64_t p4,
michael@0 66 int64_t p5, int32_t p6, int64_t p7, int64_t p8,
michael@0 67 int32_t p9, int64_t p10, int64_t* retval) = 0;
michael@0 68
michael@0 69 NS_IMETHOD AddMixedFloats(float p1, float p2, double p3, double p4,
michael@0 70 float p5, float p6, double p7, double p8,
michael@0 71 float p9, double p10, float p11,
michael@0 72 double *retval) = 0;
michael@0 73
michael@0 74 NS_IMETHOD PassTwoStrings(const char* s1, const char* s2, char** retval) = 0;
michael@0 75
michael@0 76 NS_IMETHOD AddMixedInts3(int64_t p1, int64_t p2, int32_t p3, int64_t p4,
michael@0 77 int32_t p5, int32_t p6, int64_t p7, int64_t p8,
michael@0 78 int32_t p9, int64_t p10, int64_t* retval) = 0;
michael@0 79 NS_IMETHOD ShouldFail(int32_t p) = 0;
michael@0 80 };
michael@0 81
michael@0 82 NS_DEFINE_STATIC_IID_ACCESSOR(InvokeTestTargetInterface, INVOKETESTTARGET_IID)
michael@0 83
michael@0 84 class InvokeTestTarget : public InvokeTestTargetInterface
michael@0 85 {
michael@0 86 public:
michael@0 87 NS_DECL_ISUPPORTS
michael@0 88 NS_IMETHOD AddTwoInts(int32_t p1, int32_t p2, int32_t* retval);
michael@0 89 NS_IMETHOD MultTwoInts(int32_t p1, int32_t p2, int32_t* retval);
michael@0 90 NS_IMETHOD AddTwoLLs(int64_t p1, int64_t p2, int64_t* retval);
michael@0 91 NS_IMETHOD MultTwoLLs(int64_t p1, int64_t p2, int64_t* retval);
michael@0 92
michael@0 93 NS_IMETHOD AddManyInts(int32_t p1, int32_t p2, int32_t p3, int32_t p4,
michael@0 94 int32_t p5, int32_t p6, int32_t p7, int32_t p8,
michael@0 95 int32_t p9, int32_t p10, int32_t* retval);
michael@0 96
michael@0 97 NS_IMETHOD AddTwoFloats(float p1, float p2, float* retval);
michael@0 98
michael@0 99 NS_IMETHOD AddManyDoubles(double p1, double p2, double p3, double p4,
michael@0 100 double p5, double p6, double p7, double p8,
michael@0 101 double p9, double p10, double* retval);
michael@0 102
michael@0 103 NS_IMETHOD AddManyFloats(float p1, float p2, float p3, float p4,
michael@0 104 float p5, float p6, float p7, float p8,
michael@0 105 float p9, float p10, float* retval);
michael@0 106
michael@0 107 NS_IMETHOD AddMixedInts(int64_t p1, int32_t p2, int64_t p3, int32_t p4,
michael@0 108 int32_t p5, int64_t p6, int32_t p7, int32_t p8,
michael@0 109 int64_t p9, int32_t p10, int64_t* retval);
michael@0 110
michael@0 111 NS_IMETHOD AddMixedInts2(int32_t p1, int64_t p2, int32_t p3, int64_t p4,
michael@0 112 int64_t p5, int32_t p6, int64_t p7, int64_t p8,
michael@0 113 int32_t p9, int64_t p10, int64_t* retval);
michael@0 114
michael@0 115 NS_IMETHOD AddMixedFloats(float p1, float p2, double p3, double p4,
michael@0 116 float p5, float p6, double p7, double p8,
michael@0 117 float p9, double p10, float p11,
michael@0 118 double *retval);
michael@0 119
michael@0 120 NS_IMETHOD AddManyManyFloats(float p1, float p2, float p3, float p4,
michael@0 121 float p5, float p6, float p7, float p8,
michael@0 122 float p9, float p10, float p11, float p12,
michael@0 123 float p13, float p14, float p15, float p16,
michael@0 124 float p17, float p18, float p19, float p20,
michael@0 125 float *retval);
michael@0 126
michael@0 127 NS_IMETHOD PassTwoStrings(const char* s1, const char* s2, char** retval);
michael@0 128
michael@0 129 InvokeTestTarget();
michael@0 130
michael@0 131 NS_IMETHOD AddMixedInts3(int64_t p1, int64_t p2, int32_t p3, int64_t p4,
michael@0 132 int32_t p5, int32_t p6, int64_t p7, int64_t p8,
michael@0 133 int32_t p9, int64_t p10, int64_t* retval);
michael@0 134 NS_IMETHOD ShouldFail(int32_t p);
michael@0 135 };
michael@0 136
michael@0 137 NS_IMPL_ISUPPORTS(InvokeTestTarget, InvokeTestTargetInterface)
michael@0 138
michael@0 139 InvokeTestTarget::InvokeTestTarget()
michael@0 140 {
michael@0 141 NS_ADDREF_THIS();
michael@0 142 }
michael@0 143
michael@0 144 NS_IMETHODIMP
michael@0 145 InvokeTestTarget::ShouldFail(int32_t p) {
michael@0 146 return NS_ERROR_NULL_POINTER;
michael@0 147 }
michael@0 148 NS_IMETHODIMP
michael@0 149 InvokeTestTarget::AddTwoInts(int32_t p1, int32_t p2, int32_t* retval)
michael@0 150 {
michael@0 151 *retval = p1 + p2;
michael@0 152 return NS_OK;
michael@0 153 }
michael@0 154
michael@0 155 NS_IMETHODIMP
michael@0 156 InvokeTestTarget::MultTwoInts(int32_t p1, int32_t p2, int32_t* retval)
michael@0 157 {
michael@0 158 *retval = p1 * p2;
michael@0 159 return NS_OK;
michael@0 160 }
michael@0 161
michael@0 162 NS_IMETHODIMP
michael@0 163 InvokeTestTarget::AddTwoLLs(int64_t p1, int64_t p2, int64_t* retval)
michael@0 164 {
michael@0 165 *retval = p1 + p2;
michael@0 166 return NS_OK;
michael@0 167 }
michael@0 168
michael@0 169 NS_IMETHODIMP
michael@0 170 InvokeTestTarget::MultTwoLLs(int64_t p1, int64_t p2, int64_t* retval)
michael@0 171 {
michael@0 172 *retval = p1 * p2;
michael@0 173 return NS_OK;
michael@0 174 }
michael@0 175
michael@0 176 NS_IMETHODIMP
michael@0 177 InvokeTestTarget::AddManyInts(int32_t p1, int32_t p2, int32_t p3, int32_t p4,
michael@0 178 int32_t p5, int32_t p6, int32_t p7, int32_t p8,
michael@0 179 int32_t p9, int32_t p10, int32_t* retval)
michael@0 180 {
michael@0 181 #ifdef DEBUG_TESTINVOKE
michael@0 182 printf("%d, %d, %d, %d, %d, %d, %d, %d, %d, %d\n",
michael@0 183 p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
michael@0 184 #endif
michael@0 185 *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10;
michael@0 186 return NS_OK;
michael@0 187 }
michael@0 188
michael@0 189 NS_IMETHODIMP
michael@0 190 InvokeTestTarget::AddTwoFloats(float p1, float p2, float *retval)
michael@0 191 {
michael@0 192 #ifdef DEBUG_TESTINVOKE
michael@0 193 printf("%f, %f\n", p1, p2);
michael@0 194 #endif
michael@0 195 *retval = p1 + p2;
michael@0 196 return NS_OK;
michael@0 197 }
michael@0 198
michael@0 199 NS_IMETHODIMP
michael@0 200 InvokeTestTarget::AddManyDoubles(double p1, double p2, double p3, double p4,
michael@0 201 double p5, double p6, double p7, double p8,
michael@0 202 double p9, double p10, double* retval)
michael@0 203 {
michael@0 204 #ifdef DEBUG_TESTINVOKE
michael@0 205 printf("%lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf\n",
michael@0 206 p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
michael@0 207 #endif
michael@0 208 *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10;
michael@0 209 return NS_OK;
michael@0 210 }
michael@0 211
michael@0 212 NS_IMETHODIMP
michael@0 213 InvokeTestTarget::AddManyFloats(float p1, float p2, float p3, float p4,
michael@0 214 float p5, float p6, float p7, float p8,
michael@0 215 float p9, float p10, float* retval)
michael@0 216 {
michael@0 217 #ifdef DEBUG_TESTINVOKE
michael@0 218 printf("%f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n",
michael@0 219 p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
michael@0 220 #endif
michael@0 221 *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10;
michael@0 222 return NS_OK;
michael@0 223 }
michael@0 224
michael@0 225 NS_IMETHODIMP
michael@0 226 InvokeTestTarget::AddMixedFloats(float p1, float p2, double p3, double p4,
michael@0 227 float p5, float p6, double p7, double p8,
michael@0 228 float p9, double p10, float p11,
michael@0 229 double *retval)
michael@0 230 {
michael@0 231 #ifdef DEBUG_TESTINVOKE
michael@0 232 printf("%f, %f, %lf, %lf, %f, %f, %lf, %lf, %f, %lf, %f\n",
michael@0 233 p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
michael@0 234 #endif
michael@0 235 *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10 + p11;
michael@0 236 return NS_OK;
michael@0 237 }
michael@0 238
michael@0 239 NS_IMETHODIMP
michael@0 240 InvokeTestTarget::AddManyManyFloats(float p1, float p2, float p3, float p4,
michael@0 241 float p5, float p6, float p7, float p8,
michael@0 242 float p9, float p10, float p11, float p12,
michael@0 243 float p13, float p14, float p15, float p16,
michael@0 244 float p17, float p18, float p19, float p20,
michael@0 245 float *retval)
michael@0 246 {
michael@0 247 #ifdef DEBUG_TESTINVOKE
michael@0 248 printf("%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, "
michael@0 249 "%f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n",
michael@0 250 p1, p2, p3, p4, p5, p6, p7, p8, p9, p10,
michael@0 251 p11, p12, p13, p14, p15, p16, p17, p18, p19, p20);
michael@0 252 #endif
michael@0 253 *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10 +
michael@0 254 p11 + p12 + p13 + p14 + p15 + p16 + p17 + p18 + p19 + p20;
michael@0 255 return NS_OK;
michael@0 256 }
michael@0 257
michael@0 258 NS_IMETHODIMP
michael@0 259 InvokeTestTarget::AddMixedInts(int64_t p1, int32_t p2, int64_t p3, int32_t p4,
michael@0 260 int32_t p5, int64_t p6, int32_t p7, int32_t p8,
michael@0 261 int64_t p9, int32_t p10, int64_t* retval)
michael@0 262 {
michael@0 263 *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10;
michael@0 264 return NS_OK;
michael@0 265 }
michael@0 266
michael@0 267 NS_IMETHODIMP
michael@0 268 InvokeTestTarget::AddMixedInts2(int32_t p1, int64_t p2, int32_t p3, int64_t p4,
michael@0 269 int64_t p5, int32_t p6, int64_t p7, int64_t p8,
michael@0 270 int32_t p9, int64_t p10, int64_t* retval)
michael@0 271 {
michael@0 272 *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10;
michael@0 273 return NS_OK;
michael@0 274 }
michael@0 275
michael@0 276 NS_IMETHODIMP
michael@0 277 InvokeTestTarget::AddMixedInts3(int64_t p1, int64_t p2, int32_t p3, int64_t p4,
michael@0 278 int32_t p5, int32_t p6, int64_t p7, int64_t p8,
michael@0 279 int32_t p9, int64_t p10, int64_t* retval)
michael@0 280 {
michael@0 281 printf("P1 : %lld\n", p1);
michael@0 282 printf("P2 : %lld\n", p2);
michael@0 283 printf("P3 : %d\n", p3);
michael@0 284 printf("P4 : %lld\n", p4);
michael@0 285 printf("P5 : %d\n", p5);
michael@0 286 printf("P6 : %d\n", p6);
michael@0 287 printf("P7 : %lld\n", p7);
michael@0 288 printf("P8 : %lld\n", p8);
michael@0 289 printf("P9 : %d\n", p9);
michael@0 290 printf("P10: %lld\n", p10);
michael@0 291 printf("ret: %p\n", static_cast<void*>(retval));
michael@0 292 *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10;
michael@0 293 return NS_OK;
michael@0 294 }
michael@0 295
michael@0 296 NS_IMETHODIMP
michael@0 297 InvokeTestTarget::PassTwoStrings(const char* s1, const char* s2, char** retval)
michael@0 298 {
michael@0 299 const char milk[] = "milk";
michael@0 300 char *ret = (char*)nsMemory::Alloc(sizeof(milk));
michael@0 301 if (!ret)
michael@0 302 return NS_ERROR_OUT_OF_MEMORY;
michael@0 303 strncpy(ret, milk, sizeof(milk));
michael@0 304 printf("\t%s %s", s1, s2);
michael@0 305 *retval = ret;
michael@0 306 return NS_OK;
michael@0 307 }
michael@0 308
michael@0 309 int main()
michael@0 310 {
michael@0 311 InvokeTestTarget *test = new InvokeTestTarget();
michael@0 312
michael@0 313 /* here we make the global 'check for alloc failure' checker happy */
michael@0 314 if(!test)
michael@0 315 return 1;
michael@0 316
michael@0 317 int32_t out, tmp32 = 0;
michael@0 318 int64_t out64;
michael@0 319 nsresult failed_rv;
michael@0 320 printf("calling direct:\n");
michael@0 321 if(NS_SUCCEEDED(test->AddTwoInts(1,1,&out)))
michael@0 322 printf("\t1 + 1 = %d\n", out);
michael@0 323 else
michael@0 324 printf("\tFAILED");
michael@0 325 int64_t one = 1, two = 2;
michael@0 326 if(NS_SUCCEEDED(test->AddTwoLLs(one,one,&out64)))
michael@0 327 {
michael@0 328 tmp32 = (int)out64;
michael@0 329 printf("\t1L + 1L = %d\n", tmp32);
michael@0 330 }
michael@0 331 else
michael@0 332 printf("\tFAILED");
michael@0 333 if(NS_SUCCEEDED(test->MultTwoInts(2,2,&out)))
michael@0 334 printf("\t2 * 2 = %d\n", out);
michael@0 335 else
michael@0 336 printf("\tFAILED");
michael@0 337 if(NS_SUCCEEDED(test->MultTwoLLs(two,two,&out64)))
michael@0 338 {
michael@0 339 tmp32 = (int)out64;
michael@0 340 printf("\t2L * 2L = %d\n", tmp32);
michael@0 341 }
michael@0 342 else
michael@0 343 printf("\tFAILED");
michael@0 344
michael@0 345 double outD;
michael@0 346 float outF;
michael@0 347 int32_t outI;
michael@0 348 char *outS;
michael@0 349
michael@0 350 if(NS_SUCCEEDED(test->AddManyInts(1,2,3,4,5,6,7,8,9,10,&outI)))
michael@0 351 printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n", outI);
michael@0 352 else
michael@0 353 printf("\tFAILED");
michael@0 354
michael@0 355 if(NS_SUCCEEDED(test->AddTwoFloats(1,2,&outF)))
michael@0 356 printf("\t1 + 2 = %ff\n", (double)outF);
michael@0 357 else
michael@0 358 printf("\tFAILED");
michael@0 359
michael@0 360 if(NS_SUCCEEDED(test->AddManyDoubles(1,2,3,4,5,6,7,8,9,10,&outD)))
michael@0 361 printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %f\n", outD);
michael@0 362 else
michael@0 363 printf("\tFAILED");
michael@0 364
michael@0 365 if(NS_SUCCEEDED(test->AddManyFloats(1,2,3,4,5,6,7,8,9,10,&outF)))
michael@0 366 printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %ff\n", (double)outF);
michael@0 367 else
michael@0 368 printf("\tFAILED");
michael@0 369
michael@0 370 if(NS_SUCCEEDED(test->AddManyManyFloats(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,&outF)))
michael@0 371 printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 +1 15 + 16 + 17 + 18 + 19 + 20 = %ff\n", (double)outF);
michael@0 372 else
michael@0 373 printf("\tFAILED");
michael@0 374
michael@0 375 if(NS_SUCCEEDED(test->AddMixedInts(1,2,3,4,5,6,7,8,9,10,&out64)))
michael@0 376 {
michael@0 377 tmp32 = (int)out64;
michael@0 378 printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n", tmp32);
michael@0 379 }
michael@0 380 else
michael@0 381 printf("\tFAILED");
michael@0 382
michael@0 383 if(NS_SUCCEEDED(test->AddMixedInts2(1,2,3,4,5,6,7,8,9,10,&out64)))
michael@0 384 {
michael@0 385 tmp32 = (int)out64;
michael@0 386 printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n", tmp32);
michael@0 387 }
michael@0 388 else
michael@0 389 printf("\tFAILED");
michael@0 390
michael@0 391 if(NS_SUCCEEDED(test->AddMixedInts3(3,5,7,11,13,17,19,23,29,31,&out64)))
michael@0 392 {
michael@0 393 tmp32 = (int)out64;
michael@0 394 printf("\t3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 + 29 + 31 = %d\n", tmp32);
michael@0 395 }
michael@0 396 else
michael@0 397 printf("\tFAILED");
michael@0 398
michael@0 399 if(NS_SUCCEEDED(test->AddMixedFloats(1,2,3,4,5,6,7,8,9,10,11,&outD)))
michael@0 400 printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 = %f\n", (double)outD);
michael@0 401 else
michael@0 402 printf("\tFAILED");
michael@0 403
michael@0 404 if (NS_SUCCEEDED(test->PassTwoStrings("moo","cow",&outS))) {
michael@0 405 printf(" = %s\n", outS);
michael@0 406 nsMemory::Free(outS);
michael@0 407 } else
michael@0 408 printf("\tFAILED");
michael@0 409
michael@0 410 failed_rv = test->ShouldFail(5);
michael@0 411 printf("should fail %s, returned %x\n", failed_rv == NS_ERROR_NULL_POINTER ? "failed" :"passed", failed_rv);
michael@0 412
michael@0 413 printf("calling via invoke:\n");
michael@0 414
michael@0 415 nsXPTCVariant var[21];
michael@0 416
michael@0 417 var[0].val.i32 = 1;
michael@0 418 var[0].type = nsXPTType::T_I32;
michael@0 419 var[0].flags = 0;
michael@0 420
michael@0 421 var[1].val.i32 = 1;
michael@0 422 var[1].type = nsXPTType::T_I32;
michael@0 423 var[1].flags = 0;
michael@0 424
michael@0 425 var[2].val.i32 = 0;
michael@0 426 var[2].type = nsXPTType::T_I32;
michael@0 427 var[2].flags = nsXPTCVariant::PTR_IS_DATA;
michael@0 428 var[2].ptr = &var[2].val.i32;
michael@0 429
michael@0 430 if(NS_SUCCEEDED(NS_InvokeByIndex(test, 3, 3, var)))
michael@0 431 printf("\t1 + 1 = %d\n", var[2].val.i32);
michael@0 432 else
michael@0 433 printf("\tFAILED");
michael@0 434
michael@0 435 var[0].val.i64 = 1;
michael@0 436 var[0].type = nsXPTType::T_I64;
michael@0 437 var[0].flags = 0;
michael@0 438
michael@0 439 var[1].val.i64 = 1;
michael@0 440 var[1].type = nsXPTType::T_I64;
michael@0 441 var[1].flags = 0;
michael@0 442
michael@0 443 var[2].val.i64 = 0;
michael@0 444 var[2].type = nsXPTType::T_I64;
michael@0 445 var[2].flags = nsXPTCVariant::PTR_IS_DATA;
michael@0 446 var[2].ptr = &var[2].val.i64;
michael@0 447
michael@0 448 if(NS_SUCCEEDED(NS_InvokeByIndex(test, 5, 3, var)))
michael@0 449 printf("\t1L + 1L = %d\n", (int)var[2].val.i64);
michael@0 450 else
michael@0 451 printf("\tFAILED");
michael@0 452
michael@0 453 var[0].val.i32 = 2;
michael@0 454 var[0].type = nsXPTType::T_I32;
michael@0 455 var[0].flags = 0;
michael@0 456
michael@0 457 var[1].val.i32 = 2;
michael@0 458 var[1].type = nsXPTType::T_I32;
michael@0 459 var[1].flags = 0;
michael@0 460
michael@0 461 var[2].val.i32 = 0;
michael@0 462 var[2].type = nsXPTType::T_I32;
michael@0 463 var[2].flags = nsXPTCVariant::PTR_IS_DATA;
michael@0 464 var[2].ptr = &var[2].val.i32;
michael@0 465
michael@0 466 if(NS_SUCCEEDED(NS_InvokeByIndex(test, 4, 3, var)))
michael@0 467 printf("\t2 * 2 = %d\n", var[2].val.i32);
michael@0 468 else
michael@0 469 printf("\tFAILED");
michael@0 470
michael@0 471 var[0].val.i64 = 2;
michael@0 472 var[0].type = nsXPTType::T_I64;
michael@0 473 var[0].flags = 0;
michael@0 474
michael@0 475 var[1].val.i64 = 2;
michael@0 476 var[1].type = nsXPTType::T_I64;
michael@0 477 var[1].flags = 0;
michael@0 478
michael@0 479 var[2].val.i64 = 0;
michael@0 480 var[2].type = nsXPTType::T_I64;
michael@0 481 var[2].flags = nsXPTCVariant::PTR_IS_DATA;
michael@0 482 var[2].ptr = &var[2].val.i64;
michael@0 483
michael@0 484 if(NS_SUCCEEDED(NS_InvokeByIndex(test, 6, 3, var)))
michael@0 485 printf("\t2L * 2L = %d\n", (int)var[2].val.i64);
michael@0 486 else
michael@0 487 printf("\tFAILED");
michael@0 488
michael@0 489 var[0].val.i32 = 1;
michael@0 490 var[0].type = nsXPTType::T_I32;
michael@0 491 var[0].flags = 0;
michael@0 492
michael@0 493 var[1].val.i32 = 2;
michael@0 494 var[1].type = nsXPTType::T_I32;
michael@0 495 var[1].flags = 0;
michael@0 496
michael@0 497 var[2].val.i32 = 3;
michael@0 498 var[2].type = nsXPTType::T_I32;
michael@0 499 var[2].flags = 0;
michael@0 500
michael@0 501 var[3].val.i32 = 4;
michael@0 502 var[3].type = nsXPTType::T_I32;
michael@0 503 var[3].flags = 0;
michael@0 504
michael@0 505 var[4].val.i32 = 5;
michael@0 506 var[4].type = nsXPTType::T_I32;
michael@0 507 var[4].flags = 0;
michael@0 508
michael@0 509 var[5].val.i32 = 6;
michael@0 510 var[5].type = nsXPTType::T_I32;
michael@0 511 var[5].flags = 0;
michael@0 512
michael@0 513 var[6].val.i32 = 7;
michael@0 514 var[6].type = nsXPTType::T_I32;
michael@0 515 var[6].flags = 0;
michael@0 516
michael@0 517 var[7].val.i32 = 8;
michael@0 518 var[7].type = nsXPTType::T_I32;
michael@0 519 var[7].flags = 0;
michael@0 520
michael@0 521 var[8].val.i32 = 9;
michael@0 522 var[8].type = nsXPTType::T_I32;
michael@0 523 var[8].flags = 0;
michael@0 524
michael@0 525 var[9].val.i32 = 10;
michael@0 526 var[9].type = nsXPTType::T_I32;
michael@0 527 var[9].flags = 0;
michael@0 528
michael@0 529 var[10].val.i32 = 0;
michael@0 530 var[10].type = nsXPTType::T_I32;
michael@0 531 var[10].flags = nsXPTCVariant::PTR_IS_DATA;
michael@0 532 var[10].ptr = &var[10].val.i32;
michael@0 533
michael@0 534 if(NS_SUCCEEDED(NS_InvokeByIndex(test, 7, 11, var)))
michael@0 535 printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n",
michael@0 536 var[10].val.i32);
michael@0 537
michael@0 538 var[0].val.f = 1.0f;
michael@0 539 var[0].type = nsXPTType::T_FLOAT;
michael@0 540 var[0].flags = 0;
michael@0 541
michael@0 542 var[1].val.f = 2.0f;
michael@0 543 var[1].type = nsXPTType::T_FLOAT;
michael@0 544 var[1].flags = 0;
michael@0 545
michael@0 546 var[2].val.f = 0.0f;
michael@0 547 var[2].type = nsXPTType::T_FLOAT;
michael@0 548 var[2].flags = nsXPTCVariant::PTR_IS_DATA;
michael@0 549 var[2].ptr = &var[2].val.f;
michael@0 550
michael@0 551 if(NS_SUCCEEDED(NS_InvokeByIndex(test, 8, 3, var)))
michael@0 552 printf("\t1 + 2 = %ff\n",
michael@0 553 (double) var[2].val.f);
michael@0 554
michael@0 555
michael@0 556 var[0].val.d = 1.0;
michael@0 557 var[0].type = nsXPTType::T_DOUBLE;
michael@0 558 var[0].flags = 0;
michael@0 559
michael@0 560 var[1].val.d = 2.0;
michael@0 561 var[1].type = nsXPTType::T_DOUBLE;
michael@0 562 var[1].flags = 0;
michael@0 563
michael@0 564 var[2].val.d = 3.0;
michael@0 565 var[2].type = nsXPTType::T_DOUBLE;
michael@0 566 var[2].flags = 0;
michael@0 567
michael@0 568 var[3].val.d = 4.0;
michael@0 569 var[3].type = nsXPTType::T_DOUBLE;
michael@0 570 var[3].flags = 0;
michael@0 571
michael@0 572 var[4].val.d = 5.0;
michael@0 573 var[4].type = nsXPTType::T_DOUBLE;
michael@0 574 var[4].flags = 0;
michael@0 575
michael@0 576 var[5].val.d = 6.0;
michael@0 577 var[5].type = nsXPTType::T_DOUBLE;
michael@0 578 var[5].flags = 0;
michael@0 579
michael@0 580 var[6].val.d = 7.0;
michael@0 581 var[6].type = nsXPTType::T_DOUBLE;
michael@0 582 var[6].flags = 0;
michael@0 583
michael@0 584 var[7].val.d = 8.0;
michael@0 585 var[7].type = nsXPTType::T_DOUBLE;
michael@0 586 var[7].flags = 0;
michael@0 587
michael@0 588 var[8].val.d = 9.0;
michael@0 589 var[8].type = nsXPTType::T_DOUBLE;
michael@0 590 var[8].flags = 0;
michael@0 591
michael@0 592 var[9].val.d = 10.0;
michael@0 593 var[9].type = nsXPTType::T_DOUBLE;
michael@0 594 var[9].flags = 0;
michael@0 595
michael@0 596 var[10].val.d = 0.0;
michael@0 597 var[10].type = nsXPTType::T_DOUBLE;
michael@0 598 var[10].flags = nsXPTCVariant::PTR_IS_DATA;
michael@0 599 var[10].ptr = &var[10].val.d;
michael@0 600
michael@0 601 if(NS_SUCCEEDED(NS_InvokeByIndex(test, 9, 11, var)))
michael@0 602 printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %f\n",
michael@0 603 var[10].val.d);
michael@0 604 else
michael@0 605 printf("\tFAILED");
michael@0 606
michael@0 607 var[0].val.f = 1.0f;
michael@0 608 var[0].type = nsXPTType::T_FLOAT;
michael@0 609 var[0].flags = 0;
michael@0 610
michael@0 611 var[1].val.f = 2.0f;
michael@0 612 var[1].type = nsXPTType::T_FLOAT;
michael@0 613 var[1].flags = 0;
michael@0 614
michael@0 615 var[2].val.f = 3.0f;
michael@0 616 var[2].type = nsXPTType::T_FLOAT;
michael@0 617 var[2].flags = 0;
michael@0 618
michael@0 619 var[3].val.f = 4.0f;
michael@0 620 var[3].type = nsXPTType::T_FLOAT;
michael@0 621 var[3].flags = 0;
michael@0 622
michael@0 623 var[4].val.f = 5.0f;
michael@0 624 var[4].type = nsXPTType::T_FLOAT;
michael@0 625 var[4].flags = 0;
michael@0 626
michael@0 627 var[5].val.f = 6.0f;
michael@0 628 var[5].type = nsXPTType::T_FLOAT;
michael@0 629 var[5].flags = 0;
michael@0 630
michael@0 631 var[6].val.f = 7.0f;
michael@0 632 var[6].type = nsXPTType::T_FLOAT;
michael@0 633 var[6].flags = 0;
michael@0 634
michael@0 635 var[7].val.f = 8.0f;
michael@0 636 var[7].type = nsXPTType::T_FLOAT;
michael@0 637 var[7].flags = 0;
michael@0 638
michael@0 639 var[8].val.f = 9.0f;
michael@0 640 var[8].type = nsXPTType::T_FLOAT;
michael@0 641 var[8].flags = 0;
michael@0 642
michael@0 643 var[9].val.f = 10.0f;
michael@0 644 var[9].type = nsXPTType::T_FLOAT;
michael@0 645 var[9].flags = 0;
michael@0 646
michael@0 647 var[10].val.f = 0.0f;
michael@0 648 var[10].type = nsXPTType::T_FLOAT;
michael@0 649 var[10].flags = nsXPTCVariant::PTR_IS_DATA;
michael@0 650 var[10].ptr = &var[10].val.f;
michael@0 651
michael@0 652 if(NS_SUCCEEDED(NS_InvokeByIndex(test, 10, 11, var)))
michael@0 653 printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %ff\n",
michael@0 654 (double) var[10].val.f);
michael@0 655 else
michael@0 656 printf("\tFAILED");
michael@0 657
michael@0 658 var[0].val.f = 1.0f;
michael@0 659 var[0].type = nsXPTType::T_FLOAT;
michael@0 660 var[0].flags = 0;
michael@0 661
michael@0 662 var[1].val.f = 2.0f;
michael@0 663 var[1].type = nsXPTType::T_FLOAT;
michael@0 664 var[1].flags = 0;
michael@0 665
michael@0 666 var[2].val.f = 3.0f;
michael@0 667 var[2].type = nsXPTType::T_FLOAT;
michael@0 668 var[2].flags = 0;
michael@0 669
michael@0 670 var[3].val.f = 4.0f;
michael@0 671 var[3].type = nsXPTType::T_FLOAT;
michael@0 672 var[3].flags = 0;
michael@0 673
michael@0 674 var[4].val.f = 5.0f;
michael@0 675 var[4].type = nsXPTType::T_FLOAT;
michael@0 676 var[4].flags = 0;
michael@0 677
michael@0 678 var[5].val.f = 6.0f;
michael@0 679 var[5].type = nsXPTType::T_FLOAT;
michael@0 680 var[5].flags = 0;
michael@0 681
michael@0 682 var[6].val.f = 7.0f;
michael@0 683 var[6].type = nsXPTType::T_FLOAT;
michael@0 684 var[6].flags = 0;
michael@0 685
michael@0 686 var[7].val.f = 8.0f;
michael@0 687 var[7].type = nsXPTType::T_FLOAT;
michael@0 688 var[7].flags = 0;
michael@0 689
michael@0 690 var[8].val.f = 9.0f;
michael@0 691 var[8].type = nsXPTType::T_FLOAT;
michael@0 692 var[8].flags = 0;
michael@0 693
michael@0 694 var[9].val.f = 10.0f;
michael@0 695 var[9].type = nsXPTType::T_FLOAT;
michael@0 696 var[9].flags = 0;
michael@0 697
michael@0 698 var[10].val.f = 11.0f;
michael@0 699 var[10].type = nsXPTType::T_FLOAT;
michael@0 700 var[10].flags = 0;
michael@0 701
michael@0 702 var[11].val.f = 12.0f;
michael@0 703 var[11].type = nsXPTType::T_FLOAT;
michael@0 704 var[11].flags = 0;
michael@0 705
michael@0 706 var[12].val.f = 13.0f;
michael@0 707 var[12].type = nsXPTType::T_FLOAT;
michael@0 708 var[12].flags = 0;
michael@0 709
michael@0 710 var[13].val.f = 14.0f;
michael@0 711 var[13].type = nsXPTType::T_FLOAT;
michael@0 712 var[13].flags = 0;
michael@0 713
michael@0 714 var[14].val.f = 15.0f;
michael@0 715 var[14].type = nsXPTType::T_FLOAT;
michael@0 716 var[14].flags = 0;
michael@0 717
michael@0 718 var[15].val.f = 16.0f;
michael@0 719 var[15].type = nsXPTType::T_FLOAT;
michael@0 720 var[15].flags = 0;
michael@0 721
michael@0 722 var[16].val.f = 17.0f;
michael@0 723 var[16].type = nsXPTType::T_FLOAT;
michael@0 724 var[16].flags = 0;
michael@0 725
michael@0 726 var[17].val.f = 18.0f;
michael@0 727 var[17].type = nsXPTType::T_FLOAT;
michael@0 728 var[17].flags = 0;
michael@0 729
michael@0 730 var[18].val.f = 19.0f;
michael@0 731 var[18].type = nsXPTType::T_FLOAT;
michael@0 732 var[18].flags = 0;
michael@0 733
michael@0 734 var[19].val.f = 20.0f;
michael@0 735 var[19].type = nsXPTType::T_FLOAT;
michael@0 736 var[19].flags = 0;
michael@0 737
michael@0 738 var[20].val.f = 0.0f;
michael@0 739 var[20].type = nsXPTType::T_FLOAT;
michael@0 740 var[20].flags = nsXPTCVariant::PTR_IS_DATA;
michael@0 741 var[20].ptr = &var[20].val.f;
michael@0 742
michael@0 743 if(NS_SUCCEEDED(NS_InvokeByIndex(test, 11, 21, var)))
michael@0 744 printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 = %ff\n",
michael@0 745 (double) var[20].val.f);
michael@0 746
michael@0 747 var[0].val.i64 = 1;
michael@0 748 var[0].type = nsXPTType::T_I64;
michael@0 749 var[0].flags = 0;
michael@0 750
michael@0 751 var[1].val.i32 = 2;
michael@0 752 var[1].type = nsXPTType::T_I32;
michael@0 753 var[1].flags = 0;
michael@0 754
michael@0 755 var[2].val.i64 = 3;
michael@0 756 var[2].type = nsXPTType::T_I64;
michael@0 757 var[2].flags = 0;
michael@0 758
michael@0 759 var[3].val.i32 = 4;
michael@0 760 var[3].type = nsXPTType::T_I32;
michael@0 761 var[3].flags = 0;
michael@0 762
michael@0 763 var[4].val.i32 = 5;
michael@0 764 var[4].type = nsXPTType::T_I32;
michael@0 765 var[4].flags = 0;
michael@0 766
michael@0 767 var[5].val.i64 = 6;
michael@0 768 var[5].type = nsXPTType::T_I64;
michael@0 769 var[5].flags = 0;
michael@0 770
michael@0 771 var[6].val.i32 = 7;
michael@0 772 var[6].type = nsXPTType::T_I32;
michael@0 773 var[6].flags = 0;
michael@0 774
michael@0 775 var[7].val.i32 = 8;
michael@0 776 var[7].type = nsXPTType::T_I32;
michael@0 777 var[7].flags = 0;
michael@0 778
michael@0 779 var[8].val.i64 = 9;
michael@0 780 var[8].type = nsXPTType::T_I64;
michael@0 781 var[8].flags = 0;
michael@0 782
michael@0 783 var[9].val.i32 = 10;
michael@0 784 var[9].type = nsXPTType::T_I32;
michael@0 785 var[9].flags = 0;
michael@0 786
michael@0 787 var[10].val.i64 = 0;
michael@0 788 var[10].type = nsXPTType::T_I64;
michael@0 789 var[10].flags = nsXPTCVariant::PTR_IS_DATA;
michael@0 790 var[10].ptr = &var[10].val.i64;
michael@0 791
michael@0 792 if(NS_SUCCEEDED(NS_InvokeByIndex(test, 12, 11, var)))
michael@0 793 printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n",
michael@0 794 (int)var[10].val.i64);
michael@0 795 else
michael@0 796 printf("\tFAILED");
michael@0 797
michael@0 798 var[0].val.i32 = 1;
michael@0 799 var[0].type = nsXPTType::T_I32;
michael@0 800 var[0].flags = 0;
michael@0 801
michael@0 802 var[1].val.i64 = 2;
michael@0 803 var[1].type = nsXPTType::T_I64;
michael@0 804 var[1].flags = 0;
michael@0 805
michael@0 806 var[2].val.i32 = 3;
michael@0 807 var[2].type = nsXPTType::T_I32;
michael@0 808 var[2].flags = 0;
michael@0 809
michael@0 810 var[3].val.i64 = 4;
michael@0 811 var[3].type = nsXPTType::T_I64;
michael@0 812 var[3].flags = 0;
michael@0 813
michael@0 814 var[4].val.i64 = 5;
michael@0 815 var[4].type = nsXPTType::T_I64;
michael@0 816 var[4].flags = 0;
michael@0 817
michael@0 818 var[5].val.i32 = 6;
michael@0 819 var[5].type = nsXPTType::T_I32;
michael@0 820 var[5].flags = 0;
michael@0 821
michael@0 822 var[6].val.i64 = 7;
michael@0 823 var[6].type = nsXPTType::T_I64;
michael@0 824 var[6].flags = 0;
michael@0 825
michael@0 826 var[7].val.i64 = 8;
michael@0 827 var[7].type = nsXPTType::T_I64;
michael@0 828 var[7].flags = 0;
michael@0 829
michael@0 830 var[8].val.i32 = 9;
michael@0 831 var[8].type = nsXPTType::T_I32;
michael@0 832 var[8].flags = 0;
michael@0 833
michael@0 834 var[9].val.i64 = 10;
michael@0 835 var[9].type = nsXPTType::T_I64;
michael@0 836 var[9].flags = 0;
michael@0 837
michael@0 838 var[10].val.i64 = 0;
michael@0 839 var[10].type = nsXPTType::T_I64;
michael@0 840 var[10].flags = nsXPTCVariant::PTR_IS_DATA;
michael@0 841 var[10].ptr = &var[10].val.i64;
michael@0 842
michael@0 843 if(NS_SUCCEEDED(NS_InvokeByIndex(test, 13, 11, var)))
michael@0 844 printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n",
michael@0 845 (int)var[10].val.i64);
michael@0 846 else
michael@0 847 printf("\tFAILED");
michael@0 848
michael@0 849 var[0].val.f = 1.0f;
michael@0 850 var[0].type = nsXPTType::T_FLOAT;
michael@0 851 var[0].flags = 0;
michael@0 852
michael@0 853 var[1].val.f = 2.0f;
michael@0 854 var[1].type = nsXPTType::T_FLOAT;
michael@0 855 var[1].flags = 0;
michael@0 856
michael@0 857 var[2].val.d = 3.0;
michael@0 858 var[2].type = nsXPTType::T_DOUBLE;
michael@0 859 var[2].flags = 0;
michael@0 860
michael@0 861 var[3].val.d = 4.0;
michael@0 862 var[3].type = nsXPTType::T_DOUBLE;
michael@0 863 var[3].flags = 0;
michael@0 864
michael@0 865 var[4].val.f = 5.0f;
michael@0 866 var[4].type = nsXPTType::T_FLOAT;
michael@0 867 var[4].flags = 0;
michael@0 868
michael@0 869 var[5].val.f = 6.0f;
michael@0 870 var[5].type = nsXPTType::T_FLOAT;
michael@0 871 var[5].flags = 0;
michael@0 872
michael@0 873 var[6].val.d = 7.0;
michael@0 874 var[6].type = nsXPTType::T_DOUBLE;
michael@0 875 var[6].flags = 0;
michael@0 876
michael@0 877 var[7].val.d = 8.0;
michael@0 878 var[7].type = nsXPTType::T_DOUBLE;
michael@0 879 var[7].flags = 0;
michael@0 880
michael@0 881 var[8].val.f = 9.0f;
michael@0 882 var[8].type = nsXPTType::T_FLOAT;
michael@0 883 var[8].flags = 0;
michael@0 884
michael@0 885 var[9].val.d = 10.0;
michael@0 886 var[9].type = nsXPTType::T_DOUBLE;
michael@0 887 var[9].flags = 0;
michael@0 888
michael@0 889 var[10].val.f = 11.0f;
michael@0 890 var[10].type = nsXPTType::T_FLOAT;
michael@0 891 var[10].flags = 0;
michael@0 892
michael@0 893 var[11].val.d = 0.0;
michael@0 894 var[11].type = nsXPTType::T_DOUBLE;
michael@0 895 var[11].flags = nsXPTCVariant::PTR_IS_DATA;
michael@0 896 var[11].ptr = &var[11].val.d;
michael@0 897
michael@0 898 if(NS_SUCCEEDED(NS_InvokeByIndex(test, 14, 12, var)))
michael@0 899 printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 = %f\n",
michael@0 900 var[11].val.d);
michael@0 901 else
michael@0 902 printf("\tFAILED");
michael@0 903
michael@0 904 var[0].val.p = (void*)"moo";
michael@0 905 var[0].type = nsXPTType::T_CHAR_STR;
michael@0 906 var[0].flags = 0;
michael@0 907
michael@0 908 var[1].val.p = (void*)"cow";
michael@0 909 var[1].type = nsXPTType::T_CHAR_STR;
michael@0 910 var[1].flags = 0;
michael@0 911
michael@0 912 var[2].val.p = 0;
michael@0 913 var[2].type = nsXPTType::T_CHAR_STR;
michael@0 914 var[2].flags = nsXPTCVariant::PTR_IS_DATA;
michael@0 915 var[2].ptr = &var[2].val.p;
michael@0 916
michael@0 917 if(NS_SUCCEEDED(NS_InvokeByIndex(test, 15, 3, var)))
michael@0 918 printf(" = %s\n", static_cast<char*>(var[2].val.p));
michael@0 919 else
michael@0 920 printf("\tFAILED");
michael@0 921
michael@0 922 var[0].val.i32 = 5;
michael@0 923 var[0].type = nsXPTType::T_I32;
michael@0 924 var[0].flags = 0;
michael@0 925
michael@0 926 failed_rv = NS_InvokeByIndex(test, 17, 1, var);
michael@0 927 printf("should fail %s, returned %x\n", failed_rv == NS_ERROR_NULL_POINTER ? "failed" :"passed", failed_rv);
michael@0 928
michael@0 929 var[0].val.i64 = 3;
michael@0 930 var[0].type = nsXPTType::T_I64;
michael@0 931 var[0].flags = 0;
michael@0 932
michael@0 933 var[1].val.i64 = 5;
michael@0 934 var[1].type = nsXPTType::T_I64;
michael@0 935 var[1].flags = 0;
michael@0 936
michael@0 937 var[2].val.i32 = 7;
michael@0 938 var[2].type = nsXPTType::T_I32;
michael@0 939 var[2].flags = 0;
michael@0 940
michael@0 941 var[3].val.i64 = 11;
michael@0 942 var[3].type = nsXPTType::T_I64;
michael@0 943 var[3].flags = 0;
michael@0 944
michael@0 945 var[4].val.i32 = 13;
michael@0 946 var[4].type = nsXPTType::T_I32;
michael@0 947 var[4].flags = 0;
michael@0 948
michael@0 949 var[5].val.i32 = 17;
michael@0 950 var[5].type = nsXPTType::T_I32;
michael@0 951 var[5].flags = 0;
michael@0 952
michael@0 953 var[6].val.i64 = 19;
michael@0 954 var[6].type = nsXPTType::T_I64;
michael@0 955 var[6].flags = 0;
michael@0 956
michael@0 957 var[7].val.i64 = 23;
michael@0 958 var[7].type = nsXPTType::T_I64;
michael@0 959 var[7].flags = 0;
michael@0 960
michael@0 961 var[8].val.i32 = 29;
michael@0 962 var[8].type = nsXPTType::T_I32;
michael@0 963 var[8].flags = 0;
michael@0 964
michael@0 965 var[9].val.i64 = 31;
michael@0 966 var[9].type = nsXPTType::T_I64;
michael@0 967 var[9].flags = 0;
michael@0 968
michael@0 969 var[10].val.i64 = 0;
michael@0 970 var[10].type = nsXPTType::T_I64;
michael@0 971 var[10].flags = nsXPTCVariant::PTR_IS_DATA;
michael@0 972 var[10].ptr = &var[10].val.i64;
michael@0 973
michael@0 974 if(NS_SUCCEEDED(NS_InvokeByIndex(test, 16, 11, var)))
michael@0 975 printf("\t3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 + 29+ 31 = %d\n",
michael@0 976 (int)var[10].val.i64);
michael@0 977 else
michael@0 978 printf("\tFAILED");
michael@0 979
michael@0 980 DoMultipleInheritenceTest();
michael@0 981 DoMultipleInheritenceTest2();
michael@0 982 // Disabled by default - takes too much time on slow machines
michael@0 983 //DoSpeedTest();
michael@0 984
michael@0 985 return 0;
michael@0 986 }
michael@0 987
michael@0 988 /***************************************************************************/
michael@0 989 /***************************************************************************/
michael@0 990 /***************************************************************************/
michael@0 991
michael@0 992 // {491C65A0-3317-11d3-9885-006008962422}
michael@0 993 #define FOO_IID \
michael@0 994 { 0x491c65a0, 0x3317, 0x11d3, \
michael@0 995 { 0x98, 0x85, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
michael@0 996
michael@0 997 // {491C65A1-3317-11d3-9885-006008962422}
michael@0 998 #define BAR_IID \
michael@0 999 { 0x491c65a1, 0x3317, 0x11d3, \
michael@0 1000 { 0x98, 0x85, 0x0, 0x60, 0x8, 0x96, 0x24, 0x22 } }
michael@0 1001
michael@0 1002 /***************************/
michael@0 1003
michael@0 1004 class nsIFoo : public nsISupports
michael@0 1005 {
michael@0 1006 public:
michael@0 1007 NS_DECLARE_STATIC_IID_ACCESSOR(FOO_IID)
michael@0 1008 NS_IMETHOD FooMethod1(int32_t i) = 0;
michael@0 1009 NS_IMETHOD FooMethod2(int32_t i) = 0;
michael@0 1010 };
michael@0 1011
michael@0 1012 NS_DEFINE_STATIC_IID_ACCESSOR(nsIFoo, FOO_IID)
michael@0 1013
michael@0 1014 class nsIBar : public nsISupports
michael@0 1015 {
michael@0 1016 public:
michael@0 1017 NS_DECLARE_STATIC_IID_ACCESSOR(BAR_IID)
michael@0 1018 NS_IMETHOD BarMethod1(int32_t i) = 0;
michael@0 1019 NS_IMETHOD BarMethod2(int32_t i) = 0;
michael@0 1020 };
michael@0 1021
michael@0 1022 NS_DEFINE_STATIC_IID_ACCESSOR(nsIBar, BAR_IID)
michael@0 1023
michael@0 1024 /***************************/
michael@0 1025
michael@0 1026 class FooImpl : public nsIFoo
michael@0 1027 {
michael@0 1028 public:
michael@0 1029 NS_IMETHOD FooMethod1(int32_t i);
michael@0 1030 NS_IMETHOD FooMethod2(int32_t i);
michael@0 1031
michael@0 1032 FooImpl();
michael@0 1033
michael@0 1034 protected:
michael@0 1035 ~FooImpl() {}
michael@0 1036
michael@0 1037 public:
michael@0 1038 virtual const char* ImplName() = 0;
michael@0 1039
michael@0 1040 int SomeData1;
michael@0 1041 int SomeData2;
michael@0 1042 const char* Name;
michael@0 1043 };
michael@0 1044
michael@0 1045 class BarImpl : public nsIBar
michael@0 1046 {
michael@0 1047 public:
michael@0 1048 NS_IMETHOD BarMethod1(int32_t i);
michael@0 1049 NS_IMETHOD BarMethod2(int32_t i);
michael@0 1050
michael@0 1051 BarImpl();
michael@0 1052
michael@0 1053 protected:
michael@0 1054 ~BarImpl() {}
michael@0 1055
michael@0 1056 public:
michael@0 1057 virtual const char * ImplName() = 0;
michael@0 1058
michael@0 1059 int SomeData1;
michael@0 1060 int SomeData2;
michael@0 1061 const char* Name;
michael@0 1062 };
michael@0 1063
michael@0 1064 /***************************/
michael@0 1065
michael@0 1066 FooImpl::FooImpl() : Name("FooImpl")
michael@0 1067 {
michael@0 1068 }
michael@0 1069
michael@0 1070 NS_IMETHODIMP FooImpl::FooMethod1(int32_t i)
michael@0 1071 {
michael@0 1072 printf("\tFooImpl::FooMethod1 called with i == %d, %s part of a %s\n",
michael@0 1073 i, Name, ImplName());
michael@0 1074 return NS_OK;
michael@0 1075 }
michael@0 1076
michael@0 1077 NS_IMETHODIMP FooImpl::FooMethod2(int32_t i)
michael@0 1078 {
michael@0 1079 printf("\tFooImpl::FooMethod2 called with i == %d, %s part of a %s\n",
michael@0 1080 i, Name, ImplName());
michael@0 1081 return NS_OK;
michael@0 1082 }
michael@0 1083
michael@0 1084 /***************************/
michael@0 1085
michael@0 1086 BarImpl::BarImpl() : Name("BarImpl")
michael@0 1087 {
michael@0 1088 }
michael@0 1089
michael@0 1090 NS_IMETHODIMP BarImpl::BarMethod1(int32_t i)
michael@0 1091 {
michael@0 1092 printf("\tBarImpl::BarMethod1 called with i == %d, %s part of a %s\n",
michael@0 1093 i, Name, ImplName());
michael@0 1094 return NS_OK;
michael@0 1095 }
michael@0 1096
michael@0 1097 NS_IMETHODIMP BarImpl::BarMethod2(int32_t i)
michael@0 1098 {
michael@0 1099 printf("\tBarImpl::BarMethod2 called with i == %d, %s part of a %s\n",
michael@0 1100 i, Name, ImplName());
michael@0 1101 return NS_OK;
michael@0 1102 }
michael@0 1103
michael@0 1104 /***************************/
michael@0 1105
michael@0 1106 class FooBarImpl : public FooImpl, public BarImpl
michael@0 1107 {
michael@0 1108 public:
michael@0 1109 NS_DECL_ISUPPORTS
michael@0 1110
michael@0 1111 const char* ImplName();
michael@0 1112
michael@0 1113 FooBarImpl();
michael@0 1114
michael@0 1115 private:
michael@0 1116 ~FooBarImpl() {}
michael@0 1117
michael@0 1118 public:
michael@0 1119 const char* MyName;
michael@0 1120 };
michael@0 1121
michael@0 1122 FooBarImpl::FooBarImpl() : MyName("FooBarImpl")
michael@0 1123 {
michael@0 1124 NS_ADDREF_THIS();
michael@0 1125 }
michael@0 1126
michael@0 1127 const char* FooBarImpl::ImplName()
michael@0 1128 {
michael@0 1129 return MyName;
michael@0 1130 }
michael@0 1131
michael@0 1132 NS_IMETHODIMP
michael@0 1133 FooBarImpl::QueryInterface(REFNSIID aIID, void** aInstancePtr)
michael@0 1134 {
michael@0 1135 if (nullptr == aInstancePtr) {
michael@0 1136 return NS_ERROR_NULL_POINTER;
michael@0 1137 }
michael@0 1138
michael@0 1139 *aInstancePtr = nullptr;
michael@0 1140
michael@0 1141
michael@0 1142 if (aIID.Equals(NS_GET_IID(nsIFoo))) {
michael@0 1143 *aInstancePtr = (void*) static_cast<nsIFoo*>(this);
michael@0 1144 NS_ADDREF_THIS();
michael@0 1145 return NS_OK;
michael@0 1146 }
michael@0 1147 if (aIID.Equals(NS_GET_IID(nsIBar))) {
michael@0 1148 *aInstancePtr = (void*) static_cast<nsIBar*>(this);
michael@0 1149 NS_ADDREF_THIS();
michael@0 1150 return NS_OK;
michael@0 1151 }
michael@0 1152
michael@0 1153 if (aIID.Equals(NS_GET_IID(nsISupports))) {
michael@0 1154 *aInstancePtr = (void*) static_cast<nsISupports*>
michael@0 1155 (static_cast<nsIFoo*>(this));
michael@0 1156 NS_ADDREF_THIS();
michael@0 1157 return NS_OK;
michael@0 1158 }
michael@0 1159 return NS_NOINTERFACE;
michael@0 1160 }
michael@0 1161
michael@0 1162 NS_IMPL_ADDREF(FooBarImpl)
michael@0 1163 NS_IMPL_RELEASE(FooBarImpl)
michael@0 1164
michael@0 1165
michael@0 1166 static void DoMultipleInheritenceTest()
michael@0 1167 {
michael@0 1168 FooBarImpl* impl = new FooBarImpl();
michael@0 1169 if(!impl)
michael@0 1170 return;
michael@0 1171
michael@0 1172 nsIFoo* foo;
michael@0 1173 nsIBar* bar;
michael@0 1174
michael@0 1175 nsXPTCVariant var[1];
michael@0 1176
michael@0 1177 printf("\n");
michael@0 1178 if(NS_SUCCEEDED(impl->QueryInterface(NS_GET_IID(nsIFoo), (void**)&foo)) &&
michael@0 1179 NS_SUCCEEDED(impl->QueryInterface(NS_GET_IID(nsIBar), (void**)&bar)))
michael@0 1180 {
michael@0 1181 printf("impl == %p\n", static_cast<void*>(impl));
michael@0 1182 printf("foo == %p\n", static_cast<void*>(foo));
michael@0 1183 printf("bar == %p\n", static_cast<void*>(bar));
michael@0 1184
michael@0 1185 printf("Calling Foo...\n");
michael@0 1186 printf("direct calls:\n");
michael@0 1187 foo->FooMethod1(1);
michael@0 1188 foo->FooMethod2(2);
michael@0 1189
michael@0 1190 printf("invoke calls:\n");
michael@0 1191 var[0].val.i32 = 1;
michael@0 1192 var[0].type = nsXPTType::T_I32;
michael@0 1193 var[0].flags = 0;
michael@0 1194 NS_InvokeByIndex(foo, 3, 1, var);
michael@0 1195
michael@0 1196 var[0].val.i32 = 2;
michael@0 1197 var[0].type = nsXPTType::T_I32;
michael@0 1198 var[0].flags = 0;
michael@0 1199 NS_InvokeByIndex(foo, 4, 1, var);
michael@0 1200
michael@0 1201 printf("\n");
michael@0 1202
michael@0 1203 printf("Calling Bar...\n");
michael@0 1204 printf("direct calls:\n");
michael@0 1205 bar->BarMethod1(1);
michael@0 1206 bar->BarMethod2(2);
michael@0 1207
michael@0 1208 printf("invoke calls:\n");
michael@0 1209 var[0].val.i32 = 1;
michael@0 1210 var[0].type = nsXPTType::T_I32;
michael@0 1211 var[0].flags = 0;
michael@0 1212 NS_InvokeByIndex(bar, 3, 1, var);
michael@0 1213
michael@0 1214 var[0].val.i32 = 2;
michael@0 1215 var[0].type = nsXPTType::T_I32;
michael@0 1216 var[0].flags = 0;
michael@0 1217 NS_InvokeByIndex(bar, 4, 1, var);
michael@0 1218
michael@0 1219 printf("\n");
michael@0 1220
michael@0 1221 NS_RELEASE(foo);
michael@0 1222 NS_RELEASE(bar);
michael@0 1223 }
michael@0 1224 NS_RELEASE(impl);
michael@0 1225 }
michael@0 1226 /***************************************************************************/
michael@0 1227 /***************************************************************************/
michael@0 1228 /***************************************************************************/
michael@0 1229 /* This is a variation on the theme submitted by duncan@be.com (Duncan Wilcox).
michael@0 1230 * He was seeing the other test work and this test not work. They should both
michael@0 1231 * Work on any given platform
michael@0 1232 */
michael@0 1233
michael@0 1234 class nsIFoo2 : public nsISupports
michael@0 1235 {
michael@0 1236 public:
michael@0 1237 NS_IMETHOD FooMethod1(int32_t i) = 0;
michael@0 1238 NS_IMETHOD FooMethod2(int32_t i) = 0;
michael@0 1239 };
michael@0 1240
michael@0 1241 class nsIBar2 : public nsISupports
michael@0 1242 {
michael@0 1243 public:
michael@0 1244 NS_IMETHOD BarMethod1(int32_t i) = 0;
michael@0 1245 NS_IMETHOD BarMethod2(int32_t i) = 0;
michael@0 1246 };
michael@0 1247
michael@0 1248 class FooBarImpl2 : public nsIFoo2, public nsIBar2
michael@0 1249 {
michael@0 1250 public:
michael@0 1251 // Foo interface
michael@0 1252 NS_IMETHOD FooMethod1(int32_t i);
michael@0 1253 NS_IMETHOD FooMethod2(int32_t i);
michael@0 1254
michael@0 1255 // Bar interface
michael@0 1256 NS_IMETHOD BarMethod1(int32_t i);
michael@0 1257 NS_IMETHOD BarMethod2(int32_t i);
michael@0 1258
michael@0 1259 NS_DECL_ISUPPORTS
michael@0 1260
michael@0 1261 FooBarImpl2();
michael@0 1262
michael@0 1263 private:
michael@0 1264 ~FooBarImpl2() {}
michael@0 1265
michael@0 1266 public:
michael@0 1267 int32_t value;
michael@0 1268 };
michael@0 1269
michael@0 1270 FooBarImpl2::FooBarImpl2() : value(0x12345678)
michael@0 1271 {
michael@0 1272 NS_ADDREF_THIS();
michael@0 1273 }
michael@0 1274
michael@0 1275 NS_IMETHODIMP FooBarImpl2::FooMethod1(int32_t i)
michael@0 1276 {
michael@0 1277 printf("\tFooBarImpl2::FooMethod1 called with i == %d, local value = %x\n",
michael@0 1278 i, value);
michael@0 1279 return NS_OK;
michael@0 1280 }
michael@0 1281
michael@0 1282 NS_IMETHODIMP FooBarImpl2::FooMethod2(int32_t i)
michael@0 1283 {
michael@0 1284 printf("\tFooBarImpl2::FooMethod2 called with i == %d, local value = %x\n",
michael@0 1285 i, value);
michael@0 1286 return NS_OK;
michael@0 1287 }
michael@0 1288
michael@0 1289 NS_IMETHODIMP FooBarImpl2::BarMethod1(int32_t i)
michael@0 1290 {
michael@0 1291 printf("\tFooBarImpl2::BarMethod1 called with i == %d, local value = %x\n",
michael@0 1292 i, value);
michael@0 1293 return NS_OK;
michael@0 1294 }
michael@0 1295
michael@0 1296 NS_IMETHODIMP FooBarImpl2::BarMethod2(int32_t i)
michael@0 1297 {
michael@0 1298 printf("\tFooBarImpl2::BarMethod2 called with i == %d, local value = %x\n",
michael@0 1299 i, value);
michael@0 1300 return NS_OK;
michael@0 1301 }
michael@0 1302
michael@0 1303 NS_IMETHODIMP
michael@0 1304 FooBarImpl2::QueryInterface(REFNSIID aIID, void** aInstancePtr)
michael@0 1305 {
michael@0 1306 if (nullptr == aInstancePtr) {
michael@0 1307 return NS_ERROR_NULL_POINTER;
michael@0 1308 }
michael@0 1309
michael@0 1310 *aInstancePtr = nullptr;
michael@0 1311
michael@0 1312
michael@0 1313 if (aIID.Equals(NS_GET_IID(nsIFoo))) {
michael@0 1314 *aInstancePtr = (void*) static_cast<nsIFoo2*>(this);
michael@0 1315 NS_ADDREF_THIS();
michael@0 1316 return NS_OK;
michael@0 1317 }
michael@0 1318 if (aIID.Equals(NS_GET_IID(nsIBar))) {
michael@0 1319 *aInstancePtr = (void*) static_cast<nsIBar2*>(this);
michael@0 1320 NS_ADDREF_THIS();
michael@0 1321 return NS_OK;
michael@0 1322 }
michael@0 1323
michael@0 1324 if (aIID.Equals(NS_GET_IID(nsISupports))) {
michael@0 1325 *aInstancePtr = (void*) static_cast<nsISupports*>
michael@0 1326 (static_cast<nsIFoo2*>(this));
michael@0 1327 NS_ADDREF_THIS();
michael@0 1328 return NS_OK;
michael@0 1329 }
michael@0 1330 return NS_NOINTERFACE;
michael@0 1331 }
michael@0 1332
michael@0 1333 NS_IMPL_ADDREF(FooBarImpl2)
michael@0 1334 NS_IMPL_RELEASE(FooBarImpl2)
michael@0 1335
michael@0 1336 static void DoMultipleInheritenceTest2()
michael@0 1337 {
michael@0 1338 FooBarImpl2* impl = new FooBarImpl2();
michael@0 1339 if(!impl)
michael@0 1340 return;
michael@0 1341
michael@0 1342 nsIFoo2* foo;
michael@0 1343 nsIBar2* bar;
michael@0 1344
michael@0 1345 nsXPTCVariant var[1];
michael@0 1346
michael@0 1347 printf("\n");
michael@0 1348 if(NS_SUCCEEDED(impl->QueryInterface(NS_GET_IID(nsIFoo), (void**)&foo)) &&
michael@0 1349 NS_SUCCEEDED(impl->QueryInterface(NS_GET_IID(nsIBar), (void**)&bar)))
michael@0 1350 {
michael@0 1351 printf("impl == %p\n", static_cast<void*>(impl));
michael@0 1352 printf("foo == %p\n", static_cast<void*>(foo));
michael@0 1353 printf("bar == %p\n", static_cast<void*>(bar));
michael@0 1354
michael@0 1355 printf("Calling Foo...\n");
michael@0 1356 printf("direct calls:\n");
michael@0 1357 foo->FooMethod1(1);
michael@0 1358 foo->FooMethod2(2);
michael@0 1359
michael@0 1360 printf("invoke calls:\n");
michael@0 1361 var[0].val.i32 = 1;
michael@0 1362 var[0].type = nsXPTType::T_I32;
michael@0 1363 var[0].flags = 0;
michael@0 1364 NS_InvokeByIndex(foo, 3, 1, var);
michael@0 1365
michael@0 1366 var[0].val.i32 = 2;
michael@0 1367 var[0].type = nsXPTType::T_I32;
michael@0 1368 var[0].flags = 0;
michael@0 1369 NS_InvokeByIndex(foo, 4, 1, var);
michael@0 1370
michael@0 1371 printf("\n");
michael@0 1372
michael@0 1373 printf("Calling Bar...\n");
michael@0 1374 printf("direct calls:\n");
michael@0 1375 bar->BarMethod1(1);
michael@0 1376 bar->BarMethod2(2);
michael@0 1377
michael@0 1378 printf("invoke calls:\n");
michael@0 1379 var[0].val.i32 = 1;
michael@0 1380 var[0].type = nsXPTType::T_I32;
michael@0 1381 var[0].flags = 0;
michael@0 1382 NS_InvokeByIndex(bar, 3, 1, var);
michael@0 1383
michael@0 1384 var[0].val.i32 = 2;
michael@0 1385 var[0].type = nsXPTType::T_I32;
michael@0 1386 var[0].flags = 0;
michael@0 1387 NS_InvokeByIndex(bar, 4, 1, var);
michael@0 1388
michael@0 1389 printf("\n");
michael@0 1390
michael@0 1391 NS_RELEASE(foo);
michael@0 1392 NS_RELEASE(bar);
michael@0 1393 }
michael@0 1394 NS_RELEASE(impl);
michael@0 1395 }
michael@0 1396
michael@0 1397 static void DoSpeedTest()
michael@0 1398 {
michael@0 1399 InvokeTestTarget *test = new InvokeTestTarget();
michael@0 1400
michael@0 1401 nsXPTCVariant var[3];
michael@0 1402
michael@0 1403 var[0].val.i32 = 1;
michael@0 1404 var[0].type = nsXPTType::T_I32;
michael@0 1405 var[0].flags = 0;
michael@0 1406
michael@0 1407 var[1].val.i32 = 1;
michael@0 1408 var[1].type = nsXPTType::T_I32;
michael@0 1409 var[1].flags = 0;
michael@0 1410
michael@0 1411 var[2].val.i32 = 0;
michael@0 1412 var[2].type = nsXPTType::T_I32;
michael@0 1413 var[2].flags = nsXPTCVariant::PTR_IS_DATA;
michael@0 1414 var[2].ptr = &var[2].val.i32;
michael@0 1415
michael@0 1416 int32_t in1 = 1;
michael@0 1417 int32_t in2 = 1;
michael@0 1418 int32_t out;
michael@0 1419
michael@0 1420 // Crank this number down if your platform is slow :)
michael@0 1421 static const int count = 100000000;
michael@0 1422 int i;
michael@0 1423 PRIntervalTime start;
michael@0 1424 PRIntervalTime interval_direct;
michael@0 1425 PRIntervalTime interval_invoke;
michael@0 1426
michael@0 1427 printf("Speed test...\n\n");
michael@0 1428 printf("Doing %d direct call iterations...\n", count);
michael@0 1429 start = PR_IntervalNow();
michael@0 1430 for(i = count; i; i--)
michael@0 1431 (void)test->AddTwoInts(in1, in2, &out);
michael@0 1432 interval_direct = PR_IntervalNow() - start;
michael@0 1433
michael@0 1434 printf("Doing %d invoked call iterations...\n", count);
michael@0 1435 start = PR_IntervalNow();
michael@0 1436 for(i = count; i; i--)
michael@0 1437 (void)NS_InvokeByIndex(test, 3, 3, var);
michael@0 1438 interval_invoke = PR_IntervalNow() - start;
michael@0 1439
michael@0 1440 printf(" direct took %0.2f seconds\n",
michael@0 1441 (double)interval_direct/(double)PR_TicksPerSecond());
michael@0 1442 printf(" invoke took %0.2f seconds\n",
michael@0 1443 (double)interval_invoke/(double)PR_TicksPerSecond());
michael@0 1444 printf(" So, invoke overhead was ~ %0.2f seconds (~ %0.0f%%)\n",
michael@0 1445 (double)(interval_invoke-interval_direct)/(double)PR_TicksPerSecond(),
michael@0 1446 (double)(interval_invoke-interval_direct)/(double)interval_invoke*100);
michael@0 1447 }

mercurial