javacommons/utils/functionserver/tsrc/src/testfunctionserver.cpp
changeset 23 98ccebc37403
equal deleted inserted replaced
21:2a9601315dfc 23:98ccebc37403
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Tests for function server
       
    15 *
       
    16 */
       
    17 
       
    18 #include "functionserver.h"
       
    19 #include "fs_methodcall.h"
       
    20 
       
    21 #include "TestHarness.h"
       
    22 #include "exceptionbase.h"
       
    23 #include "logger.h"
       
    24 using namespace java::util;
       
    25 
       
    26 int sIvokedMethod = -1;
       
    27 int sA = -1;
       
    28 int sB = -1;
       
    29 int sC = -1;
       
    30 int sD = -1;
       
    31 int sE = -1;
       
    32 int sF = -1;
       
    33 int sG = -1;
       
    34 int sH = -1;
       
    35 int sI = -1;
       
    36 int sIndex = 0;
       
    37 int sServerSideInitCalled = false;
       
    38 int sServerSideCleanCalled = false;
       
    39 int sStartServerCalled = false;
       
    40 
       
    41 void localMethod()
       
    42 {sIvokedMethod = 1;}
       
    43 void localMethod1(int a)
       
    44     {sIvokedMethod = 2; sA = a;} 
       
    45 void localMethod2(int a, int b)
       
    46     {sIvokedMethod = 3; sA = a; sB = b;} 
       
    47 void localMethod3(int a, int b, int c)
       
    48     {sIvokedMethod = 4; sA = a; sB = b; sC = c;} 
       
    49 void localMethod4(int a, int b, int c, int d)
       
    50     {sIvokedMethod = 5; sA = a; sB = b; sC = c; sD = d;} 
       
    51 void localMethod5(int a, int b, int c, int d, int e)
       
    52     {sIvokedMethod = 6; sA = a; sB = b; sC = c; sD = d; sE = e;} 
       
    53 void localMethod6(int a, int b, int c, int d, int e, int f)
       
    54     {sIvokedMethod = 7; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f;} 
       
    55 void localMethod7(int a, int b, int c, int d, int e, int f, int g)
       
    56     {sIvokedMethod = 8; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g;}
       
    57 void localMethod8(int a, int b, int c, int d, int e, int f, int g, int h)
       
    58     {sIvokedMethod = 9; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g; sH = h;}
       
    59 void localMethod9(int a, int b, int c, int d, int e, int f, int g, int h, int i)
       
    60     {sIvokedMethod = 10; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g; sH = h; sI = i;}
       
    61 
       
    62 int localMethodR()
       
    63     {sIvokedMethod = 11;return sIvokedMethod;}
       
    64 int localMethodR1(int a)
       
    65     {sIvokedMethod = 12; sA = a;return sIvokedMethod;}
       
    66 int localMethodR2(int a, int b)
       
    67     {sIvokedMethod = 13; sA = a; sB = b;return sIvokedMethod;}
       
    68 int localMethodR3(int a, int b, int c)
       
    69     {sIvokedMethod = 14; sA = a; sB = b; sC = c;return sIvokedMethod;}
       
    70 int localMethodR4(int a, int b, int c, int d)
       
    71     {sIvokedMethod = 15; sA = a; sB = b; sC = c; sD = d;return sIvokedMethod;}
       
    72 int localMethodR5(int a, int b, int c, int d, int e)
       
    73     {sIvokedMethod = 16; sA = a; sB = b; sC = c; sD = d; sE = e;return sIvokedMethod;}
       
    74 int localMethodR6(int a, int b, int c, int d, int e, int f)
       
    75     {sIvokedMethod = 17; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f;return sIvokedMethod;}
       
    76 int localMethodR7(int a, int b, int c, int d, int e, int f, int g)
       
    77     {sIvokedMethod = 18; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g;return sIvokedMethod;}
       
    78 int localMethodR8(int a, int b, int c, int d, int e, int f, int g, int h)
       
    79     {sIvokedMethod = 19; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g; sH = h;return sIvokedMethod;}
       
    80 int localMethodR9(int a, int b, int c, int d, int e, int f, int g, int h, int i) 
       
    81     {sIvokedMethod = 20; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g; sH = h; sI = i;return sIvokedMethod;}
       
    82 
       
    83 void localMethodTL()
       
    84     {sIvokedMethod = 21; }
       
    85 void localMethodT1L(int a)
       
    86     {sIvokedMethod = 22; sA = a;}
       
    87 void localMethodT2L(int a, int b)
       
    88     {sIvokedMethod = 23; sA = a; sB = b;}
       
    89 void localMethodT3L(int a, int b, int c)
       
    90     {sIvokedMethod = 24; sA = a; sB = b; sC = c;}
       
    91 void localMethodT4L(int a, int b, int c, int d)
       
    92     {sIvokedMethod = 25; sA = a; sB = b; sC = c; sD = d;}
       
    93 void localMethodT5L(int a, int b, int c, int d, int e)
       
    94     {sIvokedMethod = 26; sA = a; sB = b; sC = c; sD = d; sE = e;}
       
    95 void localMethodT6L(int a, int b, int c, int d, int e, int f)
       
    96     {sIvokedMethod = 27; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f;}
       
    97 void localMethodT7L(int a, int b, int c, int d, int e, int f, int g)
       
    98     {sIvokedMethod = 28; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g;}
       
    99 void localMethodT8L(int a, int b, int c, int d, int e, int f, int g, int h)
       
   100     {sIvokedMethod = 29; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g; sH = h;}
       
   101 void localMethodT9L(int a, int b, int c, int d, int e, int f, int g, int h, int i)
       
   102     {sIvokedMethod = 30; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g; sH = h; sI = i;}
       
   103 
       
   104 void localLeavingMethodTL()
       
   105     {sIvokedMethod = 31; User::Leave(-sIvokedMethod);}
       
   106 void localLeavingMethodT1L(int a)
       
   107     {sIvokedMethod = 32; sA = a;User::Leave(-sIvokedMethod);}
       
   108 void localLeavingMethodT2L(int a, int b)
       
   109     {sIvokedMethod = 33; sA = a; sB = b;User::Leave(-sIvokedMethod);}
       
   110 void localLeavingMethodT3L(int a, int b, int c)
       
   111     {sIvokedMethod = 34; sA = a; sB = b; sC = c;User::Leave(-sIvokedMethod);}
       
   112 void localLeavingMethodT4L(int a, int b, int c, int d)
       
   113     {sIvokedMethod = 35; sA = a; sB = b; sC = c; sD = d;User::Leave(-sIvokedMethod);}
       
   114 void localLeavingMethodT5L(int a, int b, int c, int d, int e)
       
   115     {sIvokedMethod = 36; sA = a; sB = b; sC = c; sD = d; sE = e;User::Leave(-sIvokedMethod);}
       
   116 void localLeavingMethodT6L(int a, int b, int c, int d, int e, int f)
       
   117     {sIvokedMethod = 37; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f;User::Leave(-sIvokedMethod);}
       
   118 void localLeavingMethodT7L(int a, int b, int c, int d, int e, int f, int g)
       
   119     {sIvokedMethod = 38; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g;User::Leave(-sIvokedMethod);}
       
   120 void localLeavingMethodT8L(int a, int b, int c, int d, int e, int f, int g, int h)
       
   121     {sIvokedMethod = 39; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g; sH = h;User::Leave(-sIvokedMethod);}
       
   122 void localLeavingMethodT9L(int a, int b, int c, int d, int e, int f, int g, int h, int i)
       
   123     {sIvokedMethod = 40; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g; sH = h; sI = i;User::Leave(-sIvokedMethod);}
       
   124 
       
   125 
       
   126 class TestClass
       
   127 {
       
   128 public:
       
   129     void classMethod()
       
   130         {sIvokedMethod = 41;}
       
   131     void classMethod1(int a)
       
   132         {sIvokedMethod = 42; sA = a;}
       
   133     void classMethod2(int a, int b)
       
   134         {sIvokedMethod = 43; sA = a; sB = b;}
       
   135     void classMethod3(int a, int b, int c)
       
   136         {sIvokedMethod = 44; sA = a; sB = b; sC = c;}
       
   137     void classMethod4(int a, int b, int c, int d)
       
   138         {sIvokedMethod = 45; sA = a; sB = b; sC = c; sD = d;}
       
   139     void classMethod5(int a, int b, int c, int d, int e)
       
   140         {sIvokedMethod = 46; sA = a; sB = b; sC = c; sD = d; sE = e;}
       
   141     void classMethod6(int a, int b, int c, int d, int e, int f)
       
   142         {sIvokedMethod = 47; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f;}
       
   143     void classMethod7(int a, int b, int c, int d, int e, int f, int g)
       
   144         {sIvokedMethod = 48; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g;}
       
   145 
       
   146     int classMethodR()
       
   147         {sIvokedMethod = 51;return sIvokedMethod;}
       
   148     int classMethodR1(int a)
       
   149         {sIvokedMethod = 52; sA = a;return sIvokedMethod;}
       
   150     int classMethodR2(int a, int b)
       
   151         {sIvokedMethod = 53; sA = a; sB = b;return sIvokedMethod;}
       
   152     int classMethodR3(int a, int b, int c)
       
   153         {sIvokedMethod = 54; sA = a; sB = b; sC = c;return sIvokedMethod;}
       
   154     int classMethodR4(int a, int b, int c, int d)
       
   155         {sIvokedMethod = 55; sA = a; sB = b; sC = c; sD = d;return sIvokedMethod;}
       
   156     int classMethodR5(int a, int b, int c, int d, int e)
       
   157         {sIvokedMethod = 56; sA = a; sB = b; sC = c; sD = d; sE = e;return sIvokedMethod;}
       
   158     int classMethodR6(int a, int b, int c, int d, int e, int f)
       
   159         {sIvokedMethod = 57; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f;return sIvokedMethod;}
       
   160     int classMethodR7(int a, int b, int c, int d, int e, int f, int g)
       
   161         {sIvokedMethod = 58; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g;return sIvokedMethod;}
       
   162 
       
   163     void classMethodL()
       
   164         {sIvokedMethod = 61;}
       
   165     void classMethodL1(int a)
       
   166         {sIvokedMethod = 62; sA = a;}
       
   167     void classMethodL2(int a, int b)
       
   168         {sIvokedMethod = 63; sA = a; sB = b;}
       
   169     void classMethodL3(int a, int b, int c)
       
   170         {sIvokedMethod = 64; sA = a; sB = b; sC = c;}
       
   171     void classMethodL4(int a, int b, int c, int d)
       
   172         {sIvokedMethod = 65; sA = a; sB = b; sC = c; sD = d;}
       
   173     void classMethodL5(int a, int b, int c, int d, int e)
       
   174         {sIvokedMethod = 66; sA = a; sB = b; sC = c; sD = d; sE = e;}
       
   175     void classMethodL6(int a, int b, int c, int d, int e, int f)
       
   176         {sIvokedMethod = 67; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f;}
       
   177     void classMethodL7(int a, int b, int c, int d, int e, int f, int g)
       
   178         {sIvokedMethod = 68; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g;}
       
   179 
       
   180     void classMethodWithLeaveL()
       
   181         {sIvokedMethod = 71;User::Leave(-sIvokedMethod);}
       
   182     void classMethodWithLeave1L(int a)
       
   183         {sIvokedMethod = 72; sA = a;User::Leave(-sIvokedMethod);}
       
   184     void classMethodWithLeave2L(int a, int b)
       
   185         {sIvokedMethod = 73; sA = a; sB = b;User::Leave(-sIvokedMethod);}
       
   186     void classMethodWithLeave3L(int a, int b, int c)
       
   187         {sIvokedMethod = 74; sA = a; sB = b; sC = c;User::Leave(-sIvokedMethod);}
       
   188     void classMethodWithLeave4L(int a, int b, int c, int d)
       
   189         {sIvokedMethod = 75; sA = a; sB = b; sC = c; sD = d;User::Leave(-sIvokedMethod);}
       
   190     void classMethodWithLeave5L(int a, int b, int c, int d, int e)
       
   191         {sIvokedMethod = 76; sA = a; sB = b; sC = c; sD = d; sE = e;User::Leave(-sIvokedMethod);}
       
   192     void classMethodWithLeave6L(int a, int b, int c, int d, int e, int f)
       
   193         {sIvokedMethod = 77; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f;User::Leave(-sIvokedMethod);}
       
   194     void classMethodWithLeave7L(int a, int b, int c, int d, int e, int f, int g)
       
   195         {sIvokedMethod = 78; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g;User::Leave(-sIvokedMethod);}
       
   196 
       
   197     int classMethodRL()
       
   198         {sIvokedMethod = 81;return sIvokedMethod;}
       
   199     int classMethodR1L(int a)
       
   200         {sIvokedMethod = 82; sA = a;return sIvokedMethod;}
       
   201     int classMethodR2L(int a, int b)
       
   202         {sIvokedMethod = 83; sA = a; sB = b;return sIvokedMethod;}
       
   203     int classMethodR3L(int a, int b, int c)
       
   204         {sIvokedMethod = 84; sA = a; sB = b; sC = c;return sIvokedMethod;}
       
   205     int classMethodR4L(int a, int b, int c, int d)
       
   206         {sIvokedMethod = 85; sA = a; sB = b; sC = c; sD = d;return sIvokedMethod;}
       
   207     int classMethodR5L(int a, int b, int c, int d, int e)
       
   208         {sIvokedMethod = 86; sA = a; sB = b; sC = c; sD = d; sE = e;return sIvokedMethod;}
       
   209     int classMethodR6L(int a, int b, int c, int d, int e, int f)
       
   210         {sIvokedMethod = 87; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f;return sIvokedMethod;}
       
   211     int classMethodR7L(int a, int b, int c, int d, int e, int f, int g)
       
   212         {sIvokedMethod = 88; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g;return sIvokedMethod;}
       
   213 
       
   214     int classMethodWithLeaveRL()
       
   215         {sIvokedMethod = 91;User::Leave(-sIvokedMethod);return 0;}
       
   216     int classMethodWithLeaveR1L(int a)
       
   217         {sIvokedMethod = 92; sA = a;User::Leave(-sIvokedMethod);return 0;}
       
   218     int classMethodWithLeaveR2L(int a, int b)
       
   219         {sIvokedMethod = 93; sA = a; sB = b;User::Leave(-sIvokedMethod);return 0;}
       
   220     int classMethodWithLeaveR3L(int a, int b, int c)
       
   221         {sIvokedMethod = 94; sA = a; sB = b; sC = c;User::Leave(-sIvokedMethod);return 0;}
       
   222     int classMethodWithLeaveR4L(int a, int b, int c, int d)
       
   223         {sIvokedMethod = 95; sA = a; sB = b; sC = c; sD = d;User::Leave(-sIvokedMethod);return 0;}
       
   224     int classMethodWithLeaveR5L(int a, int b, int c, int d, int e)
       
   225         {sIvokedMethod = 96; sA = a; sB = b; sC = c; sD = d; sE = e;User::Leave(-sIvokedMethod);return 0;}
       
   226     int classMethodWithLeaveR6L(int a, int b, int c, int d, int e, int f)
       
   227         {sIvokedMethod = 97; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f;User::Leave(-sIvokedMethod);return 0;}
       
   228     int classMethodWithLeaveR7L(int a, int b, int c, int d, int e, int f, int g)
       
   229         {sIvokedMethod = 98; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g;User::Leave(-sIvokedMethod);return 0;}
       
   230 
       
   231 
       
   232 
       
   233     void classMethodC() const
       
   234         {sIvokedMethod = 101;}
       
   235     void classMethodC1(int a) const
       
   236         {sIvokedMethod = 102; sA = a;}
       
   237     void classMethodC2(int a, int b) const
       
   238         {sIvokedMethod = 103; sA = a; sB = b;}
       
   239     void classMethodC3(int a, int b, int c) const
       
   240         {sIvokedMethod = 104; sA = a; sB = b; sC = c;}
       
   241     void classMethodC4(int a, int b, int c, int d) const
       
   242         {sIvokedMethod = 105; sA = a; sB = b; sC = c; sD = d;}
       
   243     void classMethodC5(int a, int b, int c, int d, int e) const
       
   244         {sIvokedMethod = 106; sA = a; sB = b; sC = c; sD = d; sE = e;}
       
   245     void classMethodC6(int a, int b, int c, int d, int e, int f) const
       
   246         {sIvokedMethod = 107; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f;}
       
   247     void classMethodC7(int a, int b, int c, int d, int e, int f, int g) const
       
   248         {sIvokedMethod = 108; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g;}
       
   249 
       
   250     int classMethodRC() const
       
   251         {sIvokedMethod = 111;return sIvokedMethod;}
       
   252     int classMethodRC1(int a) const
       
   253         {sIvokedMethod = 112; sA = a;return sIvokedMethod;}
       
   254     int classMethodRC2(int a, int b) const
       
   255         {sIvokedMethod = 113; sA = a; sB = b;return sIvokedMethod;}
       
   256     int classMethodRC3(int a, int b, int c) const
       
   257         {sIvokedMethod = 114; sA = a; sB = b; sC = c;return sIvokedMethod;}
       
   258     int classMethodRC4(int a, int b, int c, int d) const
       
   259         {sIvokedMethod = 115; sA = a; sB = b; sC = c; sD = d;return sIvokedMethod;}
       
   260     int classMethodRC5(int a, int b, int c, int d, int e) const
       
   261         {sIvokedMethod = 116; sA = a; sB = b; sC = c; sD = d; sE = e;return sIvokedMethod;}
       
   262     int classMethodRC6(int a, int b, int c, int d, int e, int f) const
       
   263         {sIvokedMethod = 117; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f;return sIvokedMethod;}
       
   264     int classMethodRC7(int a, int b, int c, int d, int e, int f, int g) const
       
   265         {sIvokedMethod = 118; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g;return sIvokedMethod;}
       
   266 
       
   267     void classMethodCL() const
       
   268         {sIvokedMethod = 121;}
       
   269     void classMethodC1L(int a) const
       
   270         {sIvokedMethod = 122; sA = a;}
       
   271     void classMethodC2L(int a, int b) const
       
   272         {sIvokedMethod = 123; sA = a; sB = b;}
       
   273     void classMethodC3L(int a, int b, int c) const
       
   274         {sIvokedMethod = 124; sA = a; sB = b; sC = c;}
       
   275     void classMethodC4L(int a, int b, int c, int d) const
       
   276         {sIvokedMethod = 125; sA = a; sB = b; sC = c; sD = d;}
       
   277     void classMethodC5L(int a, int b, int c, int d, int e) const
       
   278         {sIvokedMethod = 126; sA = a; sB = b; sC = c; sD = d; sE = e;}
       
   279     void classMethodC6L(int a, int b, int c, int d, int e, int f) const
       
   280         {sIvokedMethod = 127; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f;}
       
   281     void classMethodC7L(int a, int b, int c, int d, int e, int f, int g) const
       
   282         {sIvokedMethod = 128; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g;}
       
   283 
       
   284     void classMethodWithLeaveCL() const
       
   285         {sIvokedMethod = 131;User::Leave(-sIvokedMethod);}
       
   286     void classMethodWithLeaveC1L(int a) const
       
   287         {sIvokedMethod = 132; sA = a;User::Leave(-sIvokedMethod);}
       
   288     void classMethodWithLeaveC2L(int a, int b) const
       
   289         {sIvokedMethod = 133; sA = a; sB = b;User::Leave(-sIvokedMethod);}
       
   290     void classMethodWithLeaveC3L(int a, int b, int c) const
       
   291         {sIvokedMethod = 134; sA = a; sB = b; sC = c;User::Leave(-sIvokedMethod);}
       
   292     void classMethodWithLeaveC4L(int a, int b, int c, int d) const
       
   293         {sIvokedMethod = 135; sA = a; sB = b; sC = c; sD = d;User::Leave(-sIvokedMethod);}
       
   294     void classMethodWithLeaveC5L(int a, int b, int c, int d, int e) const
       
   295         {sIvokedMethod = 136; sA = a; sB = b; sC = c; sD = d; sE = e;User::Leave(-sIvokedMethod);}
       
   296     void classMethodWithLeaveC6L(int a, int b, int c, int d, int e, int f) const
       
   297         {sIvokedMethod = 137; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f;User::Leave(-sIvokedMethod);}
       
   298     void classMethodWithLeaveC7L(int a, int b, int c, int d, int e, int f, int g) const
       
   299         {sIvokedMethod = 138; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g;User::Leave(-sIvokedMethod);}
       
   300 
       
   301     int classMethodRCL() const
       
   302         {sIvokedMethod = 141;return sIvokedMethod;}
       
   303     int classMethodRC1L(int a) const
       
   304         {sIvokedMethod = 142; sA = a;return sIvokedMethod;}
       
   305     int classMethodRC2L(int a, int b) const
       
   306         {sIvokedMethod = 143; sA = a; sB = b;return sIvokedMethod;}
       
   307     int classMethodRC3L(int a, int b, int c) const
       
   308         {sIvokedMethod = 144; sA = a; sB = b; sC = c;return sIvokedMethod;}
       
   309     int classMethodRC4L(int a, int b, int c, int d) const
       
   310         {sIvokedMethod = 145; sA = a; sB = b; sC = c; sD = d;return sIvokedMethod;}
       
   311     int classMethodRC5L(int a, int b, int c, int d, int e) const
       
   312         {sIvokedMethod = 146; sA = a; sB = b; sC = c; sD = d; sE = e;return sIvokedMethod;}
       
   313     int classMethodRC6L(int a, int b, int c, int d, int e, int f) const
       
   314         {sIvokedMethod = 147; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f;return sIvokedMethod;}
       
   315     int classMethodRC7L(int a, int b, int c, int d, int e, int f, int g) const
       
   316         {sIvokedMethod = 148; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g;return sIvokedMethod;}
       
   317 
       
   318     int classMethodWithLeaveRCL() const
       
   319         {sIvokedMethod = 151;User::Leave(-sIvokedMethod); return 0;}
       
   320     int classMethodWithLeaveRC1L(int a) const
       
   321         {sIvokedMethod = 152; sA = a;User::Leave(-sIvokedMethod);return 0;}
       
   322     int classMethodWithLeaveRC2L(int a, int b) const
       
   323         {sIvokedMethod = 153; sA = a; sB = b;User::Leave(-sIvokedMethod);return 0;}
       
   324     int classMethodWithLeaveRC3L(int a, int b, int c) const
       
   325         {sIvokedMethod = 154; sA = a; sB = b; sC = c;User::Leave(-sIvokedMethod);return 0;}
       
   326     int classMethodWithLeaveRC4L(int a, int b, int c, int d) const
       
   327         {sIvokedMethod = 155; sA = a; sB = b; sC = c; sD = d;User::Leave(-sIvokedMethod);return 0;}
       
   328     int classMethodWithLeaveRC5L(int a, int b, int c, int d, int e) const
       
   329         {sIvokedMethod = 156; sA = a; sB = b; sC = c; sD = d; sE = e;User::Leave(-sIvokedMethod);return 0;}
       
   330     int classMethodWithLeaveRC6L(int a, int b, int c, int d, int e, int f) const
       
   331         {sIvokedMethod = 157; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f;User::Leave(-sIvokedMethod);return 0;}
       
   332     int classMethodWithLeaveRC7L(int a, int b, int c, int d, int e, int f, int g) const
       
   333         {sIvokedMethod = 158; sA = a; sB = b; sC = c; sD = d; sE = e; sF = f; sG = g;User::Leave(-sIvokedMethod);return 0;}
       
   334 };
       
   335 
       
   336 
       
   337 class MyFunctionServer: public java::util::FunctionServer
       
   338 {
       
   339 public:
       
   340 
       
   341     MyFunctionServer() :
       
   342         java::util::FunctionServer("JavaTestFunctionServer")
       
   343     {
       
   344     }
       
   345 
       
   346     virtual void doServerSideInit()
       
   347     {
       
   348         java::util::FunctionServer::doServerSideInit();
       
   349         sServerSideInitCalled = ++sIndex;
       
   350     }
       
   351     virtual void doServerSideClean()
       
   352     {
       
   353         sServerSideCleanCalled = ++sIndex;
       
   354     }
       
   355     virtual void startServer()
       
   356     {
       
   357         sStartServerCalled = ++sIndex;
       
   358         java::util::FunctionServer::startServer();
       
   359     }
       
   360 };
       
   361 class MyFunctionServer2
       
   362 {
       
   363     int a;
       
   364 };
       
   365 
       
   366 TEST_GROUP(TestFuncServerInit)
       
   367 {
       
   368     TEST_SETUP()
       
   369     {
       
   370         sIvokedMethod = -1;
       
   371         sA = -1;
       
   372         sB = -1;
       
   373         sC = -1;
       
   374         sD = -1;
       
   375         sE = -1;
       
   376         sF = -1;
       
   377         sG = -1;
       
   378         sH = -1;
       
   379         sI = -1;
       
   380         sServerSideInitCalled = 0;
       
   381         sServerSideCleanCalled = 0;
       
   382         sStartServerCalled = 0;
       
   383         sIndex = 0;
       
   384     }
       
   385 
       
   386     TEST_TEARDOWN()
       
   387     {
       
   388     }
       
   389 };
       
   390 
       
   391 
       
   392 TEST(TestFuncServerInit, startAndStop)
       
   393 {
       
   394     MyFunctionServer* fserver = new MyFunctionServer();
       
   395     try
       
   396     {
       
   397         fserver->createServerToNewThread();
       
   398         fserver->stopServer();
       
   399         delete fserver;
       
   400         fserver = 0;
       
   401     }
       
   402     catch(...)
       
   403     {
       
   404         FAIL("Unexpected exp in startAndStop\n");
       
   405     }
       
   406 
       
   407     CHECK(sServerSideInitCalled == 1);
       
   408     CHECK(sStartServerCalled == 2);
       
   409     CHECK(sServerSideCleanCalled == 3);
       
   410 }
       
   411 
       
   412 
       
   413 
       
   414 
       
   415 
       
   416 
       
   417 
       
   418 TEST_GROUP(TestFuncServerNotOpened)
       
   419 {
       
   420     MyFunctionServer* fserver;
       
   421     TestClass* clazz;
       
   422     int a;
       
   423     int b;
       
   424     int c;
       
   425     int d;
       
   426     int e;
       
   427     int f;
       
   428     int g;
       
   429     int h;
       
   430     int i;
       
   431 
       
   432     TEST_SETUP()
       
   433     {
       
   434         fserver = new MyFunctionServer();
       
   435 
       
   436         sServerSideInitCalled = 0;
       
   437         sServerSideCleanCalled = 0;
       
   438         sStartServerCalled = 0;
       
   439         sIndex = 0;
       
   440         sIvokedMethod = -1;
       
   441         sA = -1;
       
   442         sB = -1;
       
   443         sC = -1;
       
   444         sD = -1;
       
   445         sE = -1;
       
   446         sF = -1;
       
   447         sG = -1;
       
   448         sH = -1;
       
   449         sI = -1;
       
   450         a = -1;
       
   451         b = -1;
       
   452         c = -1;
       
   453         d = -1;
       
   454         e = -1;
       
   455         f = -1;
       
   456         g = -1;
       
   457         h = -1;
       
   458         i = -1;
       
   459     }
       
   460 
       
   461     TEST_TEARDOWN()
       
   462     {
       
   463         CHECK(sA == a);
       
   464         CHECK(sB == b);
       
   465         CHECK(sC == c);
       
   466         CHECK(sD == d);
       
   467         CHECK(sE == e);
       
   468         CHECK(sF == f);
       
   469         CHECK(sG == g);
       
   470         CHECK(sH == h);
       
   471         CHECK(sI == i);
       
   472         delete fserver;
       
   473         fserver = 0;
       
   474     }
       
   475 };
       
   476 
       
   477 
       
   478 TEST(TestFuncServerNotOpened, closeWithoutOpen)
       
   479 {
       
   480     try
       
   481     {
       
   482         fserver->stopServer();
       
   483         
       
   484     }
       
   485     catch(...)
       
   486     {
       
   487         FAIL("UNexpected exp in closeWithoutOpen\n");
       
   488     }
       
   489     CHECK(sServerSideInitCalled == 0);
       
   490     CHECK(sStartServerCalled == 0);
       
   491     CHECK(sServerSideCleanCalled == 0);
       
   492 }
       
   493 
       
   494 
       
   495 TEST(TestFuncServerNotOpened, sendWithoutOpen)
       
   496 {
       
   497     try
       
   498     {
       
   499         CallMethod(localMethod, fserver);
       
   500     }
       
   501     catch (ExceptionBase& e)
       
   502     {
       
   503         CHECK(e.toString().find("Trying to execute code in non-existing FS: ") != std::string::npos)
       
   504         CHECK(e.toString().find(" server not created.") != std::string::npos)
       
   505     }
       
   506     catch(...)
       
   507     {
       
   508         FAIL("UNexpected exp in closeWithoutOpen\n");
       
   509     }
       
   510     CHECK(sIvokedMethod == -1);
       
   511     CHECK(sServerSideInitCalled == 0);
       
   512     CHECK(sStartServerCalled == 0);
       
   513     CHECK(sServerSideCleanCalled == 0);
       
   514 }
       
   515 
       
   516 
       
   517 TEST(TestFuncServerNotOpened, sendWithoutOpenL)
       
   518 {
       
   519     try
       
   520     {
       
   521         TRAPD(err, CallMethodL(localLeavingMethodTL, fserver));
       
   522         CHECK(err == KErrServerTerminated);
       
   523     }
       
   524     catch(...)
       
   525     {
       
   526         FAIL("UNexpected exp in closeWithoutOpen\n");
       
   527     }
       
   528     CHECK(sIvokedMethod == -1);
       
   529     CHECK(sServerSideInitCalled == 0);
       
   530     CHECK(sStartServerCalled == 0);
       
   531     CHECK(sServerSideCleanCalled == 0);
       
   532 }
       
   533 
       
   534 
       
   535 TEST(TestFuncServerNotOpened, sendAfterClose)
       
   536 {
       
   537     try
       
   538     {
       
   539         fserver->createServerToNewThread();
       
   540         fserver->stopServer();
       
   541         CallMethod(localMethod, fserver);
       
   542     }
       
   543     catch (ExceptionBase& e)
       
   544     {
       
   545         CHECK(e.toString().find("Trying to execute code in non-existing FS: ") != std::string::npos)
       
   546         CHECK(e.toString().find(" server closing.") != std::string::npos)
       
   547     }
       
   548     catch(...)
       
   549     {
       
   550         FAIL("UNexpected exp in closeWithoutOpen\n");
       
   551     }
       
   552     CHECK(sIvokedMethod == -1);
       
   553 }
       
   554 
       
   555 TEST(TestFuncServerNotOpened, sendAfterCloseL)
       
   556 {
       
   557     try
       
   558     {
       
   559         fserver->createServerToNewThread();
       
   560         fserver->stopServer();
       
   561         TRAPD(err, CallMethodL(localLeavingMethodTL, fserver));
       
   562         CHECK(err == KErrServerTerminated);
       
   563     }
       
   564     catch(...)
       
   565     {
       
   566         FAIL("UNexpected exp in closeWithoutOpen\n");
       
   567     }
       
   568     CHECK(sIvokedMethod == -1);
       
   569 }
       
   570 
       
   571 
       
   572 
       
   573 
       
   574 
       
   575 
       
   576 
       
   577 
       
   578 
       
   579 
       
   580 
       
   581 TEST_GROUP(TestFuncServer)
       
   582 {
       
   583     MyFunctionServer* fserver;
       
   584     TestClass* clazz;
       
   585     int a;
       
   586     int b;
       
   587     int c;
       
   588     int d;
       
   589     int e;
       
   590     int f;
       
   591     int g;
       
   592     int h;
       
   593     int i;
       
   594 
       
   595     TEST_SETUP()
       
   596     {
       
   597         fserver = new MyFunctionServer();
       
   598         clazz = new TestClass();
       
   599 
       
   600         sServerSideInitCalled = 0;
       
   601         sServerSideCleanCalled = 0;
       
   602         sStartServerCalled = 0;
       
   603         sIndex = 0;
       
   604         fserver->createServerToNewThread();
       
   605         sIvokedMethod = -1;
       
   606         sA = -1;
       
   607         sB = -1;
       
   608         sC = -1;
       
   609         sD = -1;
       
   610         sE = -1;
       
   611         sF = -1;
       
   612         sG = -1;
       
   613         sH = -1;
       
   614         sI = -1;
       
   615         a = -1;
       
   616         b = -1;
       
   617         c = -1;
       
   618         d = -1;
       
   619         e = -1;
       
   620         f = -1;
       
   621         g = -1;
       
   622         h = -1;
       
   623         i = -1;
       
   624     }
       
   625 
       
   626     TEST_TEARDOWN()
       
   627     {
       
   628         CHECK(sA == a);
       
   629         CHECK(sB == b);
       
   630         CHECK(sC == c);
       
   631         CHECK(sD == d);
       
   632         CHECK(sE == e);
       
   633         CHECK(sF == f);
       
   634         CHECK(sG == g);
       
   635         CHECK(sH == h);
       
   636         CHECK(sI == i);
       
   637         delete clazz;
       
   638         fserver->stopServer();
       
   639         delete fserver;
       
   640         fserver = 0;
       
   641         CHECK(sServerSideInitCalled == 1);
       
   642         CHECK(sStartServerCalled == 2);
       
   643         CHECK(sServerSideCleanCalled == 3);
       
   644     }
       
   645 };
       
   646 
       
   647 // Calling local void methods.
       
   648 TEST(TestFuncServer, localVoid0)
       
   649 {
       
   650     CallMethod(localMethod, fserver);
       
   651     CHECK(sIvokedMethod == 1);
       
   652 }
       
   653 
       
   654 TEST(TestFuncServer, localVoid1)
       
   655 {
       
   656     a = 1;
       
   657     CallMethod(localMethod1, a, fserver);
       
   658     CHECK(sIvokedMethod == a + 1);
       
   659 }
       
   660 
       
   661 TEST(TestFuncServer, localVoid2)
       
   662 {
       
   663     a = 2;
       
   664     b = a + 1;
       
   665     CallMethod(localMethod2, a, b, fserver);
       
   666     CHECK(sIvokedMethod == a + 1);
       
   667 }
       
   668 
       
   669 TEST(TestFuncServer, localVoid3)
       
   670 {
       
   671     a = 3;
       
   672     b = a + 1;
       
   673     c = b + 1;
       
   674     CallMethod(localMethod3, a, b, c, fserver);
       
   675     CHECK(sIvokedMethod == a + 1);
       
   676 }
       
   677 
       
   678 TEST(TestFuncServer, localVoid4)
       
   679 {
       
   680     a = 4;
       
   681     b = a + 1;
       
   682     c = b + 1;
       
   683     d = c + 1;
       
   684     CallMethod(localMethod4, a, b, c, d, fserver);
       
   685     CHECK(sIvokedMethod == a + 1);
       
   686 }
       
   687 
       
   688 TEST(TestFuncServer, localVoid5)
       
   689 {
       
   690     a = 5;
       
   691     b = a + 1;
       
   692     c = b + 1;
       
   693     d = c + 1;
       
   694     e = d + 1;
       
   695     CallMethod(localMethod5, a, b, c, d, e, fserver);
       
   696     CHECK(sIvokedMethod == a + 1);
       
   697 }
       
   698 
       
   699 TEST(TestFuncServer, localVoid6)
       
   700 {
       
   701     a = 6;
       
   702     b = a + 1;
       
   703     c = b + 1;
       
   704     d = c + 1;
       
   705     e = d + 1;
       
   706     f = e + 1;
       
   707     CallMethod(localMethod6, a, b, c, d, e, f, fserver);
       
   708     CHECK(sIvokedMethod == a + 1);
       
   709 }
       
   710 
       
   711 TEST(TestFuncServer, localVoid7)
       
   712 {
       
   713     a = 7;
       
   714     b = a + 1;
       
   715     c = b + 1;
       
   716     d = c + 1;
       
   717     e = d + 1;
       
   718     f = e + 1;
       
   719     g = f + 1;
       
   720     CallMethod(localMethod7, a, b, c, d, e, f, g, fserver);
       
   721     CHECK(sIvokedMethod == a + 1);
       
   722 }
       
   723 
       
   724 TEST(TestFuncServer, localVoid8)
       
   725 {
       
   726     a = 8;
       
   727     b = a + 1;
       
   728     c = b + 1;
       
   729     d = c + 1;
       
   730     e = d + 1;
       
   731     f = e + 1;
       
   732     g = f + 1;
       
   733     h = g + 1;
       
   734     CallMethod(localMethod8, a, b, c, d, e, f, g, h, fserver);
       
   735     CHECK(sIvokedMethod == a + 1);
       
   736 }
       
   737 
       
   738 TEST(TestFuncServer, localVoid9)
       
   739 {
       
   740     a = 9;
       
   741     b = a + 1;
       
   742     c = b + 1;
       
   743     d = c + 1;
       
   744     e = d + 1;
       
   745     f = e + 1;
       
   746     g = f + 1;
       
   747     h = g + 1;
       
   748     i = h + 1;
       
   749     CallMethod(localMethod9, a, b, c, d, e, f, g, h, i, fserver);
       
   750     CHECK(sIvokedMethod == a + 1);
       
   751 }
       
   752 
       
   753 
       
   754 // Calling methods that returns something.
       
   755 
       
   756 TEST(TestFuncServer, localReturn)
       
   757 {
       
   758     int res = CallMethod(localMethodR, fserver);
       
   759     CHECK(res == 11);
       
   760     CHECK(sIvokedMethod == 11);
       
   761 }
       
   762 
       
   763 TEST(TestFuncServer, localReturn1)
       
   764 {
       
   765     a = 11;
       
   766     int res = CallMethod(localMethodR1, a, fserver);
       
   767     CHECK(res == a + 1);
       
   768     CHECK(sIvokedMethod == a + 1);
       
   769 }
       
   770 
       
   771 TEST(TestFuncServer, localReturn2)
       
   772 {
       
   773     a = 12;
       
   774     b = a + 1;
       
   775     int res = CallMethod(localMethodR2, a, b, fserver);
       
   776     CHECK(res == a + 1);
       
   777     CHECK(sIvokedMethod == a + 1);
       
   778 }
       
   779 
       
   780 TEST(TestFuncServer, localReturn3)
       
   781 {
       
   782     a = 13;
       
   783     b = a + 1;
       
   784     c = b + 1;
       
   785     int res = CallMethod(localMethodR3, a, b, c, fserver);
       
   786     CHECK(res == a + 1);
       
   787     CHECK(sIvokedMethod == a + 1);
       
   788 }
       
   789 
       
   790 TEST(TestFuncServer, localReturn4)
       
   791 {
       
   792     a = 14;
       
   793     b = a + 1;
       
   794     c = b + 1;
       
   795     d = c + 1;
       
   796     int res = CallMethod(localMethodR4, a, b, c, d, fserver);
       
   797     CHECK(res == a + 1);
       
   798     CHECK(sIvokedMethod == a + 1);
       
   799 }
       
   800 
       
   801 TEST(TestFuncServer, localReturn5)
       
   802 {
       
   803     a = 15;
       
   804     b = a + 1;
       
   805     c = b + 1;
       
   806     d = c + 1;
       
   807     e = d + 1;
       
   808     int res = CallMethod(localMethodR5, a, b, c, d, e, fserver);
       
   809     CHECK(res == a + 1);
       
   810     CHECK(sIvokedMethod == a + 1);
       
   811 }
       
   812 
       
   813 TEST(TestFuncServer, localReturn6)
       
   814 {
       
   815     a = 16;
       
   816     b = a + 1;
       
   817     c = b + 1;
       
   818     d = c + 1;
       
   819     e = d + 1;
       
   820     f = e + 1;
       
   821     int res = CallMethod(localMethodR6, a, b, c, d, e, f, fserver);
       
   822     CHECK(res == a + 1);
       
   823     CHECK(sIvokedMethod == a + 1);
       
   824 }
       
   825 
       
   826 TEST(TestFuncServer, localReturn7)
       
   827 {
       
   828     a = 17;
       
   829     b = a + 1;
       
   830     c = b + 1;
       
   831     d = c + 1;
       
   832     e = d + 1;
       
   833     f = e + 1;
       
   834     g = f + 1;
       
   835     int res = CallMethod(localMethodR7, a, b, c, d, e, f, g, fserver);
       
   836     CHECK(res == a + 1);
       
   837     CHECK(sIvokedMethod == a + 1);
       
   838 }
       
   839 
       
   840 TEST(TestFuncServer, localReturn8)
       
   841 {
       
   842     a = 18;
       
   843     b = a + 1;
       
   844     c = b + 1;
       
   845     d = c + 1;
       
   846     e = d + 1;
       
   847     f = e + 1;
       
   848     g = f + 1;
       
   849     h = g + 1;
       
   850     int res = CallMethod(localMethodR8, a, b, c, d, e, f, g, h, fserver);
       
   851     CHECK(res == a + 1);
       
   852     CHECK(sIvokedMethod == a + 1);
       
   853 }
       
   854 
       
   855 TEST(TestFuncServer, localReturn9)
       
   856 {
       
   857     a = 19;
       
   858     b = a + 1;
       
   859     c = b + 1;
       
   860     d = c + 1;
       
   861     e = d + 1;
       
   862     f = e + 1;
       
   863     g = f + 1;
       
   864     h = g + 1;
       
   865     i = h + 1;
       
   866     int res = CallMethod(localMethodR9, a, b, c, d, e, f, g, h, i, fserver);
       
   867     CHECK(res == a + 1);
       
   868     CHECK(sIvokedMethod == a + 1);
       
   869 }
       
   870 
       
   871 
       
   872 // Calling methods through TRAP.
       
   873 
       
   874 TEST(TestFuncServer, localTrap0)
       
   875 {
       
   876     int res = CallMethodTrap(localMethodTL, fserver);
       
   877     CHECK(res == 0);
       
   878     CHECK(sIvokedMethod == 21);
       
   879 }
       
   880 
       
   881 TEST(TestFuncServer, localTrap1)
       
   882 {
       
   883     a = 21;
       
   884     int res = CallMethodTrap(localMethodT1L, a, fserver);
       
   885     CHECK(res == 0);
       
   886     CHECK(sIvokedMethod == a + 1);
       
   887 }
       
   888 
       
   889 TEST(TestFuncServer, localTrap2)
       
   890 {
       
   891     a = 22;
       
   892     b = a + 1;
       
   893     int res = CallMethodTrap(localMethodT2L, a, b, fserver);
       
   894     CHECK(res == 0);
       
   895     CHECK(sIvokedMethod == a + 1);
       
   896 }
       
   897 
       
   898 TEST(TestFuncServer, localTrap3)
       
   899 {
       
   900     a = 23;
       
   901     b = a + 1;
       
   902     c = b + 1;
       
   903     int res = CallMethodTrap(localMethodT3L, a, b, c, fserver);
       
   904     CHECK(res == 0);
       
   905     CHECK(sIvokedMethod == a + 1);
       
   906 }
       
   907 
       
   908 TEST(TestFuncServer, localTrap4)
       
   909 {
       
   910     a = 24;
       
   911     b = a + 1;
       
   912     c = b + 1;
       
   913     d = c + 1;
       
   914     int res = CallMethodTrap(localMethodT4L, a, b, c, d, fserver);
       
   915     CHECK(res == 0);
       
   916     CHECK(sIvokedMethod == a + 1);
       
   917 }
       
   918 
       
   919 TEST(TestFuncServer, localTrap5)
       
   920 {
       
   921     a = 25;
       
   922     b = a + 1;
       
   923     c = b + 1;
       
   924     d = c + 1;
       
   925     e = d + 1;
       
   926     int res = CallMethodTrap(localMethodT5L, a, b, c, d, e, fserver);
       
   927     CHECK(res == 0);
       
   928     CHECK(sIvokedMethod == a + 1);
       
   929 }
       
   930 
       
   931 TEST(TestFuncServer, localTrap6)
       
   932 {
       
   933     a = 26;
       
   934     b = a + 1;
       
   935     c = b + 1;
       
   936     d = c + 1;
       
   937     e = d + 1;
       
   938     f = e + 1;
       
   939     int res = CallMethodTrap(localMethodT6L, a, b, c, d, e, f, fserver);
       
   940     CHECK(res == 0);
       
   941     CHECK(sIvokedMethod == a + 1);
       
   942 }
       
   943 
       
   944 TEST(TestFuncServer, localTrap7)
       
   945 {
       
   946     a = 27;
       
   947     b = a + 1;
       
   948     c = b + 1;
       
   949     d = c + 1;
       
   950     e = d + 1;
       
   951     f = e + 1;
       
   952     g = f + 1;
       
   953     int res = CallMethodTrap(localMethodT7L, a, b, c, d, e, f, g, fserver);
       
   954     CHECK(res == 0);
       
   955     CHECK(sIvokedMethod == a + 1);
       
   956 }
       
   957 
       
   958 TEST(TestFuncServer, localTrap8)
       
   959 {
       
   960     a = 28;
       
   961     b = a + 1;
       
   962     c = b + 1;
       
   963     d = c + 1;
       
   964     e = d + 1;
       
   965     f = e + 1;
       
   966     g = f + 1;
       
   967     h = g + 1;
       
   968     int res = CallMethodTrap(localMethodT8L, a, b, c, d, e, f, g, h, fserver);
       
   969     CHECK(res == 0);
       
   970     CHECK(sIvokedMethod == a + 1);
       
   971 }
       
   972 
       
   973 TEST(TestFuncServer, localTrap9)
       
   974 {
       
   975     a = 29;
       
   976     b = a + 1;
       
   977     c = b + 1;
       
   978     d = c + 1;
       
   979     e = d + 1;
       
   980     f = e + 1;
       
   981     g = f + 1;
       
   982     h = g + 1;
       
   983     i = h + 1;
       
   984     int res = CallMethodTrap(localMethodT9L, a, b, c, d, e, f, g, h, i, fserver);
       
   985     CHECK(res == 0);
       
   986     CHECK(sIvokedMethod == a + 1);
       
   987 }
       
   988 
       
   989 // Calling methods through TRAP. The method will leave.
       
   990 TEST(TestFuncServer, localTrapWithLeave)
       
   991 {
       
   992     int res = CallMethodTrap(localLeavingMethodTL, fserver);
       
   993     CHECK(res == -31);
       
   994     CHECK(sIvokedMethod == 31);
       
   995 }
       
   996 
       
   997 TEST(TestFuncServer, localTrapWithLeave1)
       
   998 {
       
   999     a = 31;
       
  1000     int res = CallMethodTrap(localLeavingMethodT1L, a, fserver);
       
  1001     CHECK(res == -(a + 1));
       
  1002     CHECK(sIvokedMethod == a + 1);
       
  1003 }
       
  1004 
       
  1005 TEST(TestFuncServer, localTrapWithLeave2)
       
  1006 {
       
  1007     a = 32;
       
  1008     b = a + 1;
       
  1009     int res = CallMethodTrap(localLeavingMethodT2L, a, b, fserver);
       
  1010     CHECK(res == -(a + 1));
       
  1011     CHECK(sIvokedMethod == a + 1);
       
  1012 }
       
  1013 
       
  1014 TEST(TestFuncServer, localTrapWithLeave3)
       
  1015 {
       
  1016     a = 33;
       
  1017     b = a + 1;
       
  1018     c = b + 1;
       
  1019     int res = CallMethodTrap(localLeavingMethodT3L, a, b, c, fserver);
       
  1020     CHECK(res == -(a + 1));
       
  1021     CHECK(sIvokedMethod == a + 1);
       
  1022 }
       
  1023 
       
  1024 TEST(TestFuncServer, localTrapWithLeave4)
       
  1025 {
       
  1026     a = 34;
       
  1027     b = a + 1;
       
  1028     c = b + 1;
       
  1029     d = c + 1;
       
  1030     int res = CallMethodTrap(localLeavingMethodT4L, a, b, c, d, fserver);
       
  1031     CHECK(res == -(a + 1));
       
  1032     CHECK(sIvokedMethod == a + 1);
       
  1033 }
       
  1034 
       
  1035 TEST(TestFuncServer, localTrapWithLeave5)
       
  1036 {
       
  1037     a = 35;
       
  1038     b = a + 1;
       
  1039     c = b + 1;
       
  1040     d = c + 1;
       
  1041     e = d + 1;
       
  1042     int res = CallMethodTrap(localLeavingMethodT5L, a, b, c, d, e, fserver);
       
  1043     CHECK(res == -(a + 1));
       
  1044     CHECK(sIvokedMethod == a + 1);
       
  1045 }
       
  1046 
       
  1047 
       
  1048 TEST(TestFuncServer, localTrapWithLeave6)
       
  1049 {
       
  1050     a = 36;
       
  1051     b = a + 1;
       
  1052     c = b + 1;
       
  1053     d = c + 1;
       
  1054     e = d + 1;
       
  1055     f = e + 1;
       
  1056     int res = CallMethodTrap(localLeavingMethodT6L, a, b, c, d, e, f, fserver);
       
  1057     CHECK(res == -(a + 1));
       
  1058     CHECK(sIvokedMethod == a + 1);
       
  1059 }
       
  1060 
       
  1061 TEST(TestFuncServer, localTrapWithLeave7)
       
  1062 {
       
  1063     a = 37;
       
  1064     b = a + 1;
       
  1065     c = b + 1;
       
  1066     d = c + 1;
       
  1067     e = d + 1;
       
  1068     f = e + 1;
       
  1069     g = f + 1;
       
  1070     int res = CallMethodTrap(localLeavingMethodT7L, a, b, c, d, e, f, g, fserver);
       
  1071     CHECK(res == -(a + 1));
       
  1072     CHECK(sIvokedMethod == a + 1);
       
  1073 }
       
  1074 
       
  1075 TEST(TestFuncServer, localTrapWithLeave8)
       
  1076 {
       
  1077     a = 38;
       
  1078     b = a + 1;
       
  1079     c = b + 1;
       
  1080     d = c + 1;
       
  1081     e = d + 1;
       
  1082     f = e + 1;
       
  1083     g = f + 1;
       
  1084     h = g + 1;
       
  1085     int res = CallMethodTrap(localLeavingMethodT8L, a, b, c, d, e, f, g, h, fserver);
       
  1086     CHECK(res == -(a + 1));
       
  1087     CHECK(sIvokedMethod == a + 1);
       
  1088 }
       
  1089 
       
  1090 TEST(TestFuncServer, localTrapWithLeave9)
       
  1091 {
       
  1092     a = 39;
       
  1093     b = a + 1;
       
  1094     c = b + 1;
       
  1095     d = c + 1;
       
  1096     e = d + 1;
       
  1097     f = e + 1;
       
  1098     g = f + 1;
       
  1099     h = g + 1;
       
  1100     i = h + 1;
       
  1101     int res = CallMethodTrap(localLeavingMethodT9L, a, b, c, d, e, f, g, h, i, fserver);
       
  1102     CHECK(res == -(a + 1));
       
  1103     CHECK(sIvokedMethod == a + 1);
       
  1104 }
       
  1105 
       
  1106 
       
  1107 // Testing non-const void methods from a class.
       
  1108 
       
  1109 TEST(TestFuncServer, classVoid0)
       
  1110 {
       
  1111     CallMethod( clazz, TestClass::classMethod, fserver );
       
  1112     CHECK(sIvokedMethod == 41);
       
  1113 }
       
  1114 
       
  1115 TEST(TestFuncServer, classVoid1)
       
  1116 {
       
  1117     a = 41;
       
  1118     CallMethod( clazz, TestClass::classMethod1, a, fserver );
       
  1119     CHECK(sIvokedMethod == a + 1);
       
  1120 }
       
  1121 
       
  1122 TEST(TestFuncServer, classVoid2)
       
  1123 {
       
  1124     a = 42;
       
  1125     b = a + 1;
       
  1126     CallMethod( clazz, TestClass::classMethod2, a, b, fserver );
       
  1127     CHECK(sIvokedMethod == a + 1);
       
  1128 }
       
  1129 
       
  1130 TEST(TestFuncServer, classVoid3)
       
  1131 {
       
  1132     a = 43;
       
  1133     b = a + 1;
       
  1134     c = b + 1;
       
  1135     CallMethod( clazz, TestClass::classMethod3, a, b, c, fserver );
       
  1136     CHECK(sIvokedMethod == a + 1);
       
  1137 }
       
  1138 
       
  1139 TEST(TestFuncServer, classVoid4)
       
  1140 {
       
  1141     a = 44;
       
  1142     b = a + 1;
       
  1143     c = b + 1;
       
  1144     d = c + 1;
       
  1145     CallMethod( clazz, TestClass::classMethod4, a, b, c, d, fserver );
       
  1146     CHECK(sIvokedMethod == a + 1);
       
  1147 }
       
  1148 
       
  1149 TEST(TestFuncServer, classVoid5)
       
  1150 {
       
  1151     a = 45;
       
  1152     b = a + 1;
       
  1153     c = b + 1;
       
  1154     d = c + 1;
       
  1155     e = d + 1;
       
  1156     CallMethod( clazz, TestClass::classMethod5, a, b, c, d, e, fserver );
       
  1157     CHECK(sIvokedMethod == a + 1);
       
  1158 }
       
  1159 
       
  1160 TEST(TestFuncServer, classVoid6)
       
  1161 {
       
  1162     a = 46;
       
  1163     b = a + 1;
       
  1164     c = b + 1;
       
  1165     d = c + 1;
       
  1166     e = d + 1;
       
  1167     f = e + 1;
       
  1168     CallMethod( clazz, TestClass::classMethod6, a, b, c, d, e, f, fserver );
       
  1169     CHECK(sIvokedMethod == a + 1);
       
  1170 }
       
  1171 
       
  1172 TEST(TestFuncServer, classVoid7)
       
  1173 {
       
  1174     a = 47;
       
  1175     b = a + 1;
       
  1176     c = b + 1;
       
  1177     d = c + 1;
       
  1178     e = d + 1;
       
  1179     f = e + 1;
       
  1180     g = f + 1;
       
  1181     CallMethod( clazz, TestClass::classMethod7, a, b, c, d, e, f, g, fserver );
       
  1182     CHECK(sIvokedMethod == a + 1);
       
  1183 }
       
  1184 
       
  1185 // Testing non-const methods from a class that returns a value.
       
  1186 
       
  1187 TEST(TestFuncServer, classReturn0)
       
  1188 {
       
  1189     int res;
       
  1190     CallMethod(res, clazz, TestClass::classMethodR, fserver );
       
  1191     CHECK(sIvokedMethod == 51);
       
  1192     CHECK(res == 51);
       
  1193 
       
  1194 }
       
  1195 TEST(TestFuncServer, classReturn1)
       
  1196 {
       
  1197     a = 51;
       
  1198     int res;
       
  1199     CallMethod(res, clazz, TestClass::classMethodR1, a, fserver );
       
  1200     CHECK(sIvokedMethod == a + 1);
       
  1201     CHECK(res == a + 1);
       
  1202 
       
  1203 }
       
  1204 TEST(TestFuncServer, classReturn2)
       
  1205 {
       
  1206     a = 52;
       
  1207     b = a + 1;
       
  1208     int res;
       
  1209     CallMethod(res, clazz, TestClass::classMethodR2, a, b, fserver );
       
  1210     CHECK(sIvokedMethod == a + 1);
       
  1211     CHECK(res == a + 1);
       
  1212 
       
  1213 }
       
  1214 TEST(TestFuncServer, classReturn3)
       
  1215 {
       
  1216     a = 53;
       
  1217     b = a + 1;
       
  1218     c = b + 1;
       
  1219     int res;
       
  1220     CallMethod(res, clazz, TestClass::classMethodR3, a, b, c, fserver );
       
  1221     CHECK(sIvokedMethod == a + 1);
       
  1222     CHECK(res == a + 1);
       
  1223 
       
  1224 }
       
  1225 TEST(TestFuncServer, classReturn4)
       
  1226 {
       
  1227     a = 54;
       
  1228     b = a + 1;
       
  1229     c = b + 1;
       
  1230     d = c + 1;
       
  1231     int res;
       
  1232     CallMethod(res, clazz, TestClass::classMethodR4, a, b, c, d, fserver );
       
  1233     CHECK(sIvokedMethod == a + 1);
       
  1234     CHECK(res == a + 1);
       
  1235 
       
  1236 }
       
  1237 TEST(TestFuncServer, classReturn5)
       
  1238 {
       
  1239     a = 55;
       
  1240     b = a + 1;
       
  1241     c = b + 1;
       
  1242     d = c + 1;
       
  1243     e = d + 1;
       
  1244     int res;
       
  1245     CallMethod(res, clazz, TestClass::classMethodR5, a, b, c, d, e, fserver );
       
  1246     CHECK(sIvokedMethod == a + 1);
       
  1247     CHECK(res == a + 1);
       
  1248 
       
  1249 }
       
  1250 TEST(TestFuncServer, classReturn6)
       
  1251 {
       
  1252     a = 56;
       
  1253     b = a + 1;
       
  1254     c = b + 1;
       
  1255     d = c + 1;
       
  1256     e = d + 1;
       
  1257     f = e + 1;
       
  1258     int res;
       
  1259     CallMethod(res, clazz, TestClass::classMethodR6, a, b, c, d, e, f, fserver );
       
  1260     CHECK(sIvokedMethod == a + 1);
       
  1261     CHECK(res == a + 1);
       
  1262 
       
  1263 }
       
  1264 TEST(TestFuncServer, classReturn7)
       
  1265 {
       
  1266     a = 57;
       
  1267     b = a + 1;
       
  1268     c = b + 1;
       
  1269     d = c + 1;
       
  1270     e = d + 1;
       
  1271     f = e + 1;
       
  1272     g = f + 1;
       
  1273     int res;
       
  1274     CallMethod(res, clazz, TestClass::classMethodR7, a, b, c, d, e, f, g, fserver );
       
  1275     CHECK(sIvokedMethod == a + 1);
       
  1276     CHECK(res == a + 1);
       
  1277 
       
  1278 }
       
  1279 
       
  1280 // Testing non-const void leaving methods from a class. Leave is not happening.
       
  1281 
       
  1282 TEST(TestFuncServer, classVoidL0)
       
  1283 {
       
  1284     TRAPD(res, CallMethodL(clazz, TestClass::classMethodL, fserver ));
       
  1285     CHECK(sIvokedMethod == 61);
       
  1286     CHECK(res == 0);
       
  1287 
       
  1288 }
       
  1289 TEST(TestFuncServer, classVoidL1)
       
  1290 {
       
  1291     a = 61;
       
  1292     TRAPD(res, CallMethodL(clazz, TestClass::classMethodL1, a, fserver ));
       
  1293     CHECK(sIvokedMethod == a + 1);
       
  1294     CHECK(res == 0);
       
  1295 
       
  1296 }
       
  1297 TEST(TestFuncServer, classVoidL2)
       
  1298 {
       
  1299     a = 62;
       
  1300     b = a + 1;
       
  1301     TRAPD(res, CallMethodL(clazz, TestClass::classMethodL2, a, b, fserver ));
       
  1302     CHECK(sIvokedMethod == a + 1);
       
  1303     CHECK(res == 0);
       
  1304 
       
  1305 }
       
  1306 TEST(TestFuncServer, classVoidL3)
       
  1307 {
       
  1308     a = 63;
       
  1309     b = a + 1;
       
  1310     c = b + 1;
       
  1311     TRAPD(res, CallMethodL(clazz, TestClass::classMethodL3, a, b, c, fserver ));
       
  1312     CHECK(sIvokedMethod == a + 1);
       
  1313     CHECK(res == 0);
       
  1314 
       
  1315 }
       
  1316 TEST(TestFuncServer, classVoidL4)
       
  1317 {
       
  1318     a = 64;
       
  1319     b = a + 1;
       
  1320     c = b + 1;
       
  1321     d = c + 1;
       
  1322     TRAPD(res, CallMethodL(clazz, TestClass::classMethodL4, a, b, c, d, fserver ));
       
  1323     CHECK(sIvokedMethod == a + 1);
       
  1324     CHECK(res == 0);
       
  1325 
       
  1326 }
       
  1327 TEST(TestFuncServer, classVoidL5)
       
  1328 {
       
  1329     a = 65;
       
  1330     b = a + 1;
       
  1331     c = b + 1;
       
  1332     d = c + 1;
       
  1333     e = d + 1;
       
  1334     TRAPD(res, CallMethodL(clazz, TestClass::classMethodL5, a, b, c, d, e, fserver ));
       
  1335     CHECK(sIvokedMethod == a + 1);
       
  1336     CHECK(res == 0);
       
  1337 
       
  1338 }
       
  1339 TEST(TestFuncServer, classVoidL6)
       
  1340 {
       
  1341     a = 66;
       
  1342     b = a + 1;
       
  1343     c = b + 1;
       
  1344     d = c + 1;
       
  1345     e = d + 1;
       
  1346     f = e + 1;
       
  1347     TRAPD(res, CallMethodL(clazz, TestClass::classMethodL6, a, b, c, d, e, f, fserver ));
       
  1348     CHECK(sIvokedMethod == a + 1);
       
  1349     CHECK(res == 0);
       
  1350 
       
  1351 }
       
  1352 TEST(TestFuncServer, classVoidL7)
       
  1353 {
       
  1354     a = 67;
       
  1355     b = a + 1;
       
  1356     c = b + 1;
       
  1357     d = c + 1;
       
  1358     e = d + 1;
       
  1359     f = e + 1;
       
  1360     g = f + 1;
       
  1361     TRAPD(res, CallMethodL(clazz, TestClass::classMethodL7, a, b, c, d, e, f, g, fserver ));
       
  1362     CHECK(sIvokedMethod == a + 1);
       
  1363     CHECK(res == 0);
       
  1364 
       
  1365 }
       
  1366 
       
  1367 // Testing non-const void leaving methods from a class. Leave is happening.
       
  1368 TEST(TestFuncServer, classVoidLeavingL0)
       
  1369 {
       
  1370     TRAPD(res, CallMethodL(clazz, TestClass::classMethodWithLeaveL, fserver ));
       
  1371     CHECK(sIvokedMethod == 71);
       
  1372     CHECK(res == -71);
       
  1373 
       
  1374 }
       
  1375 TEST(TestFuncServer, classVoidLeavingL1)
       
  1376 {
       
  1377     a = 71;
       
  1378     TRAPD(res, CallMethodL(clazz, TestClass::classMethodWithLeave1L, a, fserver ));
       
  1379     CHECK(sIvokedMethod == a + 1);
       
  1380     CHECK(res == -(a + 1));
       
  1381 
       
  1382 }
       
  1383 TEST(TestFuncServer, classVoidLeavingL2)
       
  1384 {
       
  1385     a = 72;
       
  1386     b = a + 1;
       
  1387     TRAPD(res, CallMethodL(clazz, TestClass::classMethodWithLeave2L, a, b, fserver ));
       
  1388     CHECK(sIvokedMethod == a + 1);
       
  1389     CHECK(res == -(a + 1));
       
  1390 
       
  1391 }
       
  1392 TEST(TestFuncServer, classVoidLeavingL3)
       
  1393 {
       
  1394     a = 73;
       
  1395     b = a + 1;
       
  1396     c = b + 1;
       
  1397     TRAPD(res, CallMethodL(clazz, TestClass::classMethodWithLeave3L, a, b, c, fserver ));
       
  1398     CHECK(sIvokedMethod == a + 1);
       
  1399     CHECK(res == -(a + 1));
       
  1400 
       
  1401 }
       
  1402 TEST(TestFuncServer, classVoidLeavingL4)
       
  1403 {
       
  1404     a = 74;
       
  1405     b = a + 1;
       
  1406     c = b + 1;
       
  1407     d = c + 1;
       
  1408     TRAPD(res, CallMethodL(clazz, TestClass::classMethodWithLeave4L, a, b, c, d, fserver ));
       
  1409     CHECK(sIvokedMethod == a + 1);
       
  1410     CHECK(res == -(a + 1));
       
  1411 
       
  1412 }
       
  1413 TEST(TestFuncServer, classVoidLeavingL5)
       
  1414 {
       
  1415     a = 75;
       
  1416     b = a + 1;
       
  1417     c = b + 1;
       
  1418     d = c + 1;
       
  1419     e = d + 1;
       
  1420     TRAPD(res, CallMethodL(clazz, TestClass::classMethodWithLeave5L, a, b, c, d, e, fserver ));
       
  1421     CHECK(sIvokedMethod == a + 1);
       
  1422     CHECK(res == -(a + 1));
       
  1423 
       
  1424 }
       
  1425 TEST(TestFuncServer, classVoidLeavingL6)
       
  1426 {
       
  1427     a = 76;
       
  1428     b = a + 1;
       
  1429     c = b + 1;
       
  1430     d = c + 1;
       
  1431     e = d + 1;
       
  1432     f = e + 1;
       
  1433     TRAPD(res, CallMethodL(clazz, TestClass::classMethodWithLeave6L, a, b, c, d, e, f, fserver ));
       
  1434     CHECK(sIvokedMethod == a + 1);
       
  1435     CHECK(res == -(a + 1));
       
  1436 
       
  1437 }
       
  1438 TEST(TestFuncServer, classVoidLeavingL7)
       
  1439 {
       
  1440     a = 77;
       
  1441     b = a + 1;
       
  1442     c = b + 1;
       
  1443     d = c + 1;
       
  1444     e = d + 1;
       
  1445     f = e + 1;
       
  1446     g = f + 1;
       
  1447     TRAPD(res, CallMethodL(clazz, TestClass::classMethodWithLeave7L, a, b, c, d, e, f, g, fserver ));
       
  1448     CHECK(sIvokedMethod == a + 1);
       
  1449     CHECK(res == -(a + 1));
       
  1450 
       
  1451 }
       
  1452 
       
  1453 // Testing non-const value returning leaving methods from a class. Leave is not happening.
       
  1454 
       
  1455 TEST(TestFuncServer, classReturnL0)
       
  1456 {
       
  1457     int res;
       
  1458     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodRL, fserver ));
       
  1459     CHECK(sIvokedMethod == 81);
       
  1460     CHECK(res == 81);
       
  1461     CHECK(leaveRes == 0);
       
  1462 }
       
  1463 TEST(TestFuncServer, classReturnL1)
       
  1464 {
       
  1465     a = 81;
       
  1466     int res;
       
  1467     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodR1L, a, fserver ));
       
  1468     CHECK(sIvokedMethod == a + 1);
       
  1469     CHECK(res == a + 1);
       
  1470     CHECK(leaveRes == 0);
       
  1471 }
       
  1472 TEST(TestFuncServer, classReturnL2)
       
  1473 {
       
  1474     a = 82;
       
  1475     b = a + 1;
       
  1476     int res;
       
  1477     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodR2L, a, b, fserver ));
       
  1478     CHECK(sIvokedMethod == a + 1);
       
  1479     CHECK(res == a + 1);
       
  1480     CHECK(leaveRes == 0);
       
  1481 }
       
  1482 TEST(TestFuncServer, classReturnL3)
       
  1483 {
       
  1484     a = 83;
       
  1485     b = a + 1;
       
  1486     c = b + 1;
       
  1487     int res;
       
  1488     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodR3L, a, b, c, fserver ));
       
  1489     CHECK(sIvokedMethod == a + 1);
       
  1490     CHECK(res == a + 1);
       
  1491     CHECK(leaveRes == 0);
       
  1492 }
       
  1493 TEST(TestFuncServer, classReturnL4)
       
  1494 {
       
  1495     a = 84;
       
  1496     b = a + 1;
       
  1497     c = b + 1;
       
  1498     d = c + 1;
       
  1499     int res;
       
  1500     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodR4L, a, b, c, d, fserver ));
       
  1501     CHECK(sIvokedMethod == a + 1);
       
  1502     CHECK(res == a + 1);
       
  1503     CHECK(leaveRes == 0);
       
  1504 }
       
  1505 TEST(TestFuncServer, classReturnL5)
       
  1506 {
       
  1507     a = 85;
       
  1508     b = a + 1;
       
  1509     c = b + 1;
       
  1510     d = c + 1;
       
  1511     e = d + 1;
       
  1512     int res;
       
  1513     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodR5L, a, b, c, d, e, fserver ));
       
  1514     CHECK(sIvokedMethod == a + 1);
       
  1515     CHECK(res == a + 1);
       
  1516     CHECK(leaveRes == 0);
       
  1517 }
       
  1518 TEST(TestFuncServer, classReturnL6)
       
  1519 {
       
  1520     a = 86;
       
  1521     b = a + 1;
       
  1522     c = b + 1;
       
  1523     d = c + 1;
       
  1524     e = d + 1;
       
  1525     f = e + 1;
       
  1526     int res;
       
  1527     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodR6L, a, b, c, d, e, f, fserver ));
       
  1528     CHECK(sIvokedMethod == a + 1);
       
  1529     CHECK(res == a + 1);
       
  1530     CHECK(leaveRes == 0);
       
  1531 }
       
  1532 TEST(TestFuncServer, classReturnL7)
       
  1533 {
       
  1534     a = 87;
       
  1535     b = a + 1;
       
  1536     c = b + 1;
       
  1537     d = c + 1;
       
  1538     e = d + 1;
       
  1539     f = e + 1;
       
  1540     g = f + 1;
       
  1541     int res;
       
  1542     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodR7L, a, b, c, d, e, f, g, fserver ));
       
  1543     CHECK(sIvokedMethod == a + 1);
       
  1544     CHECK(res == a + 1);
       
  1545     CHECK(leaveRes == 0);
       
  1546 }
       
  1547 
       
  1548 // Testing non-const value returning leaving methods from a class. Leave is happening.
       
  1549 
       
  1550 
       
  1551 TEST(TestFuncServer, classReturnLeaveL0)
       
  1552 {
       
  1553     int res=123;
       
  1554     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodWithLeaveRL, fserver ));
       
  1555     CHECK(sIvokedMethod == 91);
       
  1556     CHECK(leaveRes == -91);
       
  1557     CHECK(res == 123);
       
  1558 }
       
  1559 TEST(TestFuncServer, classReturnLeaveL1)
       
  1560 {
       
  1561     a = 91;
       
  1562     int res=123;
       
  1563     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodWithLeaveR1L, a, fserver ));
       
  1564     CHECK(sIvokedMethod == a + 1);
       
  1565     CHECK(leaveRes == -(a + 1));
       
  1566     CHECK(res == 123);
       
  1567 }
       
  1568 TEST(TestFuncServer, classReturnLeaveL2)
       
  1569 {
       
  1570     a = 92;
       
  1571     b = a + 1;
       
  1572     int res=123;
       
  1573     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodWithLeaveR2L, a, b, fserver ));
       
  1574     CHECK(sIvokedMethod == a + 1);
       
  1575     CHECK(leaveRes == -(a + 1));
       
  1576     CHECK(res == 123);
       
  1577 }
       
  1578 TEST(TestFuncServer, classReturnLeaveL3)
       
  1579 {
       
  1580     a = 93;
       
  1581     b = a + 1;
       
  1582     c = b + 1;
       
  1583     int res=123;
       
  1584     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodWithLeaveR3L, a, b, c, fserver ));
       
  1585     CHECK(sIvokedMethod == a + 1);
       
  1586     CHECK(leaveRes == -(a + 1));
       
  1587     CHECK(res == 123);
       
  1588 }
       
  1589 TEST(TestFuncServer, classReturnLeaveL4)
       
  1590 {
       
  1591     a = 94;
       
  1592     b = a + 1;
       
  1593     c = b + 1;
       
  1594     d = c + 1;
       
  1595     int res=123;
       
  1596     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodWithLeaveR4L, a, b, c, d, fserver ));
       
  1597     CHECK(sIvokedMethod == a + 1);
       
  1598     CHECK(leaveRes == -(a + 1));
       
  1599     CHECK(res == 123);
       
  1600 }
       
  1601 TEST(TestFuncServer, classReturnLeaveL5)
       
  1602 {
       
  1603     a = 95;
       
  1604     b = a + 1;
       
  1605     c = b + 1;
       
  1606     d = c + 1;
       
  1607     e = d + 1;
       
  1608     int res=123;
       
  1609     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodWithLeaveR5L, a, b, c, d, e, fserver ));
       
  1610     CHECK(sIvokedMethod == a + 1);
       
  1611     CHECK(leaveRes == -(a + 1));
       
  1612     CHECK(res == 123);
       
  1613 }
       
  1614 TEST(TestFuncServer, classReturnLeaveL6)
       
  1615 {
       
  1616     a = 96;
       
  1617     b = a + 1;
       
  1618     c = b + 1;
       
  1619     d = c + 1;
       
  1620     e = d + 1;
       
  1621     f = e + 1;
       
  1622     int res=123;
       
  1623     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodWithLeaveR6L, a, b, c, d, e, f, fserver ));
       
  1624     CHECK(sIvokedMethod == a + 1);
       
  1625     CHECK(leaveRes == -(a + 1));
       
  1626     CHECK(res == 123);
       
  1627 }
       
  1628 TEST(TestFuncServer, classReturnLeaveL7)
       
  1629 {
       
  1630     a = 97;
       
  1631     b = a + 1;
       
  1632     c = b + 1;
       
  1633     d = c + 1;
       
  1634     e = d + 1;
       
  1635     f = e + 1;
       
  1636     g = f + 1;
       
  1637     int res=123;
       
  1638     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodWithLeaveR7L, a, b, c, d, e, f, g, fserver ));
       
  1639     CHECK(sIvokedMethod == a + 1);
       
  1640     CHECK(leaveRes == -(a + 1));
       
  1641     CHECK(res == 123);
       
  1642 }
       
  1643 
       
  1644 // Testing const void methods from a class.
       
  1645 
       
  1646 TEST(TestFuncServer, classVoidC0)
       
  1647 {
       
  1648     CallMethod( clazz, TestClass::classMethodC, fserver );
       
  1649     CHECK(sIvokedMethod == 101);
       
  1650 
       
  1651 }
       
  1652 TEST(TestFuncServer, classVoidC1)
       
  1653 {
       
  1654     a = 101;
       
  1655     CallMethod( clazz, TestClass::classMethodC1, a, fserver );
       
  1656     CHECK(sIvokedMethod == a + 1);
       
  1657 
       
  1658 }
       
  1659 TEST(TestFuncServer, classVoidC2)
       
  1660 {
       
  1661     a = 102;
       
  1662     b = a + 1;
       
  1663     CallMethod( clazz, TestClass::classMethodC2, a, b, fserver );
       
  1664     CHECK(sIvokedMethod == a + 1);
       
  1665 
       
  1666 }
       
  1667 TEST(TestFuncServer, classVoidC3)
       
  1668 {
       
  1669     a = 103;
       
  1670     b = a + 1;
       
  1671     c = b + 1;
       
  1672     CallMethod( clazz, TestClass::classMethodC3, a, b, c, fserver );
       
  1673     CHECK(sIvokedMethod == a + 1);
       
  1674 
       
  1675 }
       
  1676 TEST(TestFuncServer, classVoidC4)
       
  1677 {
       
  1678     a = 104;
       
  1679     b = a + 1;
       
  1680     c = b + 1;
       
  1681     d = c + 1;
       
  1682     CallMethod( clazz, TestClass::classMethodC4, a, b, c, d, fserver );
       
  1683     CHECK(sIvokedMethod == a + 1);
       
  1684 
       
  1685 }
       
  1686 TEST(TestFuncServer, classVoidC5)
       
  1687 {
       
  1688     a = 105;
       
  1689     b = a + 1;
       
  1690     c = b + 1;
       
  1691     d = c + 1;
       
  1692     e = d + 1;
       
  1693     CallMethod( clazz, TestClass::classMethodC5, a, b, c, d, e, fserver );
       
  1694     CHECK(sIvokedMethod == a + 1);
       
  1695 
       
  1696 }
       
  1697 TEST(TestFuncServer, classVoidC6)
       
  1698 {
       
  1699     a = 106;
       
  1700     b = a + 1;
       
  1701     c = b + 1;
       
  1702     d = c + 1;
       
  1703     e = d + 1;
       
  1704     f = e + 1;
       
  1705     CallMethod( clazz, TestClass::classMethodC6, a, b, c, d, e, f, fserver );
       
  1706     CHECK(sIvokedMethod == a + 1);
       
  1707 
       
  1708 }
       
  1709 TEST(TestFuncServer, classVoidC7)
       
  1710 {
       
  1711     a = 107;
       
  1712     b = a + 1;
       
  1713     c = b + 1;
       
  1714     d = c + 1;
       
  1715     e = d + 1;
       
  1716     f = e + 1;
       
  1717     g = f + 1;
       
  1718     CallMethod( clazz, TestClass::classMethodC7, a, b, c, d, e, f, g, fserver );
       
  1719     CHECK(sIvokedMethod == a + 1);
       
  1720 
       
  1721 }
       
  1722 
       
  1723 // Testing const methods from a class retruning a value.
       
  1724 
       
  1725 TEST(TestFuncServer, classReturnC0)
       
  1726 {
       
  1727     int res;
       
  1728     CallMethod(res, clazz, TestClass::classMethodRC, fserver );
       
  1729     CHECK(sIvokedMethod == 111);
       
  1730     CHECK(res == 111);
       
  1731 
       
  1732 }
       
  1733 TEST(TestFuncServer, classReturnC1)
       
  1734 {
       
  1735     a = 111;
       
  1736     int res;
       
  1737     CallMethod(res, clazz, TestClass::classMethodRC1, a, fserver );
       
  1738     CHECK(sIvokedMethod == a + 1);
       
  1739     CHECK(res == a + 1);
       
  1740 
       
  1741 }
       
  1742 TEST(TestFuncServer, classReturnC2)
       
  1743 {
       
  1744     a = 112;
       
  1745     b = a + 1;
       
  1746     int res;
       
  1747     CallMethod(res, clazz, TestClass::classMethodRC2, a, b, fserver );
       
  1748     CHECK(sIvokedMethod == a + 1);
       
  1749     CHECK(res == a + 1);
       
  1750 
       
  1751 }
       
  1752 TEST(TestFuncServer, classReturnC3)
       
  1753 {
       
  1754     a = 113;
       
  1755     b = a + 1;
       
  1756     c = b + 1;
       
  1757     int res;
       
  1758     CallMethod(res, clazz, TestClass::classMethodRC3, a, b, c, fserver );
       
  1759     CHECK(sIvokedMethod == a + 1);
       
  1760     CHECK(res == a + 1);
       
  1761 
       
  1762 }
       
  1763 TEST(TestFuncServer, classReturnC4)
       
  1764 {
       
  1765     a = 114;
       
  1766     b = a + 1;
       
  1767     c = b + 1;
       
  1768     d = c + 1;
       
  1769     int res;
       
  1770     CallMethod(res, clazz, TestClass::classMethodRC4, a, b, c, d, fserver );
       
  1771     CHECK(sIvokedMethod == a + 1);
       
  1772     CHECK(res == a + 1);
       
  1773 
       
  1774 }
       
  1775 TEST(TestFuncServer, classReturnC5)
       
  1776 {
       
  1777     a = 115;
       
  1778     b = a + 1;
       
  1779     c = b + 1;
       
  1780     d = c + 1;
       
  1781     e = d + 1;
       
  1782     int res;
       
  1783     CallMethod(res, clazz, TestClass::classMethodRC5, a, b, c, d, e, fserver );
       
  1784     CHECK(sIvokedMethod == a + 1);
       
  1785     CHECK(res == a + 1);
       
  1786 
       
  1787 }
       
  1788 TEST(TestFuncServer, classReturnC6)
       
  1789 {
       
  1790     a = 116;
       
  1791     b = a + 1;
       
  1792     c = b + 1;
       
  1793     d = c + 1;
       
  1794     e = d + 1;
       
  1795     f = e + 1;
       
  1796     int res;
       
  1797     CallMethod(res, clazz, TestClass::classMethodRC6, a, b, c, d, e, f, fserver );
       
  1798     CHECK(sIvokedMethod == a + 1);
       
  1799     CHECK(res == a + 1);
       
  1800 
       
  1801 }
       
  1802 TEST(TestFuncServer, classReturnC7)
       
  1803 {
       
  1804     a = 117;
       
  1805     b = a + 1;
       
  1806     c = b + 1;
       
  1807     d = c + 1;
       
  1808     e = d + 1;
       
  1809     f = e + 1;
       
  1810     g = f + 1;
       
  1811     int res;
       
  1812     CallMethod(res, clazz, TestClass::classMethodRC7, a, b, c, d, e, f, g, fserver );
       
  1813     CHECK(sIvokedMethod == a + 1);
       
  1814     CHECK(res == a + 1);
       
  1815 
       
  1816 }
       
  1817 
       
  1818 // Testing const leaving void methods from a class. No leave.
       
  1819 
       
  1820 
       
  1821 TEST(TestFuncServer, classVoidCL0)
       
  1822 {
       
  1823     TRAPD(res, CallMethodL(clazz, TestClass::classMethodCL, fserver ));
       
  1824     CHECK(sIvokedMethod == 121);
       
  1825     CHECK(res == 0);
       
  1826 
       
  1827 }
       
  1828 TEST(TestFuncServer, classVoidCL1)
       
  1829 {
       
  1830     a = 121;
       
  1831     TRAPD(res, CallMethodL(clazz, TestClass::classMethodC1L, a, fserver ));
       
  1832     CHECK(sIvokedMethod == a + 1);
       
  1833     CHECK(res == 0);
       
  1834 
       
  1835 }
       
  1836 TEST(TestFuncServer, classVoidCL2)
       
  1837 {
       
  1838     a = 122;
       
  1839     b = a + 1;
       
  1840     TRAPD(res, CallMethodL(clazz, TestClass::classMethodC2L, a, b, fserver ));
       
  1841     CHECK(sIvokedMethod == a + 1);
       
  1842     CHECK(res == 0);
       
  1843 
       
  1844 }
       
  1845 TEST(TestFuncServer, classVoidCL3)
       
  1846 {
       
  1847     a = 123;
       
  1848     b = a + 1;
       
  1849     c = b + 1;
       
  1850     TRAPD(res, CallMethodL(clazz, TestClass::classMethodC3L, a, b, c, fserver ));
       
  1851     CHECK(sIvokedMethod == a + 1);
       
  1852     CHECK(res == 0);
       
  1853 
       
  1854 }
       
  1855 TEST(TestFuncServer, classVoidCL4)
       
  1856 {
       
  1857     a = 124;
       
  1858     b = a + 1;
       
  1859     c = b + 1;
       
  1860     d = c + 1;
       
  1861     TRAPD(res, CallMethodL(clazz, TestClass::classMethodC4L, a, b, c, d, fserver ));
       
  1862     CHECK(sIvokedMethod == a + 1);
       
  1863     CHECK(res == 0);
       
  1864 
       
  1865 }
       
  1866 TEST(TestFuncServer, classVoidCL5)
       
  1867 {
       
  1868     a = 125;
       
  1869     b = a + 1;
       
  1870     c = b + 1;
       
  1871     d = c + 1;
       
  1872     e = d + 1;
       
  1873     TRAPD(res, CallMethodL(clazz, TestClass::classMethodC5L, a, b, c, d, e, fserver ));
       
  1874     CHECK(sIvokedMethod == a + 1);
       
  1875     CHECK(res == 0);
       
  1876 
       
  1877 }
       
  1878 TEST(TestFuncServer, classVoidCL6)
       
  1879 {
       
  1880     a = 126;
       
  1881     b = a + 1;
       
  1882     c = b + 1;
       
  1883     d = c + 1;
       
  1884     e = d + 1;
       
  1885     f = e + 1;
       
  1886     TRAPD(res, CallMethodL(clazz, TestClass::classMethodC6L, a, b, c, d, e, f, fserver ));
       
  1887     CHECK(sIvokedMethod == a + 1);
       
  1888     CHECK(res == 0);
       
  1889 
       
  1890 }
       
  1891 TEST(TestFuncServer, classVoidCL7)
       
  1892 {
       
  1893     a = 127;
       
  1894     b = a + 1;
       
  1895     c = b + 1;
       
  1896     d = c + 1;
       
  1897     e = d + 1;
       
  1898     f = e + 1;
       
  1899     g = f + 1;
       
  1900     TRAPD(res, CallMethodL(clazz, TestClass::classMethodC7L, a, b, c, d, e, f, g, fserver ));
       
  1901     CHECK(sIvokedMethod == a + 1);
       
  1902     CHECK(res == 0);
       
  1903 
       
  1904 }
       
  1905 
       
  1906 
       
  1907 
       
  1908 // Testing const leaving void methods from a class. Leaving.
       
  1909 
       
  1910 
       
  1911 TEST(TestFuncServer, classVoidLeavingCL0)
       
  1912 {
       
  1913     TRAPD(res, CallMethodL(clazz, TestClass::classMethodWithLeaveCL, fserver ));
       
  1914     CHECK(sIvokedMethod == 131);
       
  1915     CHECK(res == -131);
       
  1916 
       
  1917 }
       
  1918 TEST(TestFuncServer, classVoidLeavingCL1)
       
  1919 {
       
  1920     a = 131;
       
  1921     TRAPD(res, CallMethodL(clazz, TestClass::classMethodWithLeaveC1L, a, fserver ));
       
  1922     CHECK(sIvokedMethod == a + 1);
       
  1923     CHECK(res == -(a + 1));
       
  1924 
       
  1925 }
       
  1926 TEST(TestFuncServer, classVoidLeavingCL2)
       
  1927 {
       
  1928     a = 132;
       
  1929     b = a + 1;
       
  1930     TRAPD(res, CallMethodL(clazz, TestClass::classMethodWithLeaveC2L, a, b, fserver ));
       
  1931     CHECK(sIvokedMethod == a + 1);
       
  1932     CHECK(res == -(a + 1));
       
  1933 
       
  1934 }
       
  1935 TEST(TestFuncServer, classVoidLeavingCL3)
       
  1936 {
       
  1937     a = 133;
       
  1938     b = a + 1;
       
  1939     c = b + 1;
       
  1940     TRAPD(res, CallMethodL(clazz, TestClass::classMethodWithLeaveC3L, a, b, c, fserver ));
       
  1941     CHECK(sIvokedMethod == a + 1);
       
  1942     CHECK(res == -(a + 1));
       
  1943 
       
  1944 }
       
  1945 TEST(TestFuncServer, classVoidLeavingCL4)
       
  1946 {
       
  1947     a = 134;
       
  1948     b = a + 1;
       
  1949     c = b + 1;
       
  1950     d = c + 1;
       
  1951     TRAPD(res, CallMethodL(clazz, TestClass::classMethodWithLeaveC4L, a, b, c, d, fserver ));
       
  1952     CHECK(sIvokedMethod == a + 1);
       
  1953     CHECK(res == -(a + 1));
       
  1954 
       
  1955 }
       
  1956 TEST(TestFuncServer, classVoidLeavingCL5)
       
  1957 {
       
  1958     a = 135;
       
  1959     b = a + 1;
       
  1960     c = b + 1;
       
  1961     d = c + 1;
       
  1962     e = d + 1;
       
  1963     TRAPD(res, CallMethodL(clazz, TestClass::classMethodWithLeaveC5L, a, b, c, d, e, fserver ));
       
  1964     CHECK(sIvokedMethod == a + 1);
       
  1965     CHECK(res == -(a + 1));
       
  1966 
       
  1967 }
       
  1968 TEST(TestFuncServer, classVoidLeavingCL6)
       
  1969 {
       
  1970     a = 136;
       
  1971     b = a + 1;
       
  1972     c = b + 1;
       
  1973     d = c + 1;
       
  1974     e = d + 1;
       
  1975     f = e + 1;
       
  1976     TRAPD(res, CallMethodL(clazz, TestClass::classMethodWithLeaveC6L, a, b, c, d, e, f, fserver ));
       
  1977     CHECK(sIvokedMethod == a + 1);
       
  1978     CHECK(res == -(a + 1));
       
  1979 
       
  1980 }
       
  1981 TEST(TestFuncServer, classVoidLeavingCL7)
       
  1982 {
       
  1983     a = 137;
       
  1984     b = a + 1;
       
  1985     c = b + 1;
       
  1986     d = c + 1;
       
  1987     e = d + 1;
       
  1988     f = e + 1;
       
  1989     g = f + 1;
       
  1990     TRAPD(res, CallMethodL(clazz, TestClass::classMethodWithLeaveC7L, a, b, c, d, e, f, g, fserver ));
       
  1991     CHECK(sIvokedMethod == a + 1);
       
  1992     CHECK(res == -(a + 1));
       
  1993 
       
  1994 }
       
  1995 
       
  1996 
       
  1997 
       
  1998 // Testing const leaving value returning methods from a class. Not leaving.
       
  1999 TEST(TestFuncServer, classReturnLC0)
       
  2000 {
       
  2001     int res;
       
  2002     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodRCL, fserver ));
       
  2003     CHECK(sIvokedMethod == 141);
       
  2004     CHECK(res == 141);
       
  2005     CHECK(leaveRes == 0);
       
  2006 }
       
  2007 TEST(TestFuncServer, classReturnLC1)
       
  2008 {
       
  2009     a = 141;
       
  2010     int res;
       
  2011     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodRC1L, a, fserver ));
       
  2012     CHECK(sIvokedMethod == a + 1);
       
  2013     CHECK(res == a + 1);
       
  2014     CHECK(leaveRes == 0);
       
  2015 }
       
  2016 TEST(TestFuncServer, classReturnLC2)
       
  2017 {
       
  2018     a = 142;
       
  2019     b = a + 1;
       
  2020     int res;
       
  2021     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodRC2L, a, b, fserver ));
       
  2022     CHECK(sIvokedMethod == a + 1);
       
  2023     CHECK(res == a + 1);
       
  2024     CHECK(leaveRes == 0);
       
  2025 }
       
  2026 TEST(TestFuncServer, classReturnLC3)
       
  2027 {
       
  2028     a = 143;
       
  2029     b = a + 1;
       
  2030     c = b + 1;
       
  2031     int res;
       
  2032     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodRC3L, a, b, c, fserver ));
       
  2033     CHECK(sIvokedMethod == a + 1);
       
  2034     CHECK(res == a + 1);
       
  2035     CHECK(leaveRes == 0);
       
  2036 }
       
  2037 TEST(TestFuncServer, classReturnLC4)
       
  2038 {
       
  2039     a = 144;
       
  2040     b = a + 1;
       
  2041     c = b + 1;
       
  2042     d = c + 1;
       
  2043     int res;
       
  2044     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodRC4L, a, b, c, d, fserver ));
       
  2045     CHECK(sIvokedMethod == a + 1);
       
  2046     CHECK(res == a + 1);
       
  2047     CHECK(leaveRes == 0);
       
  2048 }
       
  2049 TEST(TestFuncServer, classReturnLC5)
       
  2050 {
       
  2051     a = 145;
       
  2052     b = a + 1;
       
  2053     c = b + 1;
       
  2054     d = c + 1;
       
  2055     e = d + 1;
       
  2056     int res;
       
  2057     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodRC5L, a, b, c, d, e, fserver ));
       
  2058     CHECK(sIvokedMethod == a + 1);
       
  2059     CHECK(res == a + 1);
       
  2060     CHECK(leaveRes == 0);
       
  2061 }
       
  2062 TEST(TestFuncServer, classReturnLC6)
       
  2063 {
       
  2064     a = 146;
       
  2065     b = a + 1;
       
  2066     c = b + 1;
       
  2067     d = c + 1;
       
  2068     e = d + 1;
       
  2069     f = e + 1;
       
  2070     int res;
       
  2071     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodRC6L, a, b, c, d, e, f, fserver ));
       
  2072     CHECK(sIvokedMethod == a + 1);
       
  2073     CHECK(res == a + 1);
       
  2074     CHECK(leaveRes == 0);
       
  2075 }
       
  2076 TEST(TestFuncServer, classReturnLC7)
       
  2077 {
       
  2078     a = 147;
       
  2079     b = a + 1;
       
  2080     c = b + 1;
       
  2081     d = c + 1;
       
  2082     e = d + 1;
       
  2083     f = e + 1;
       
  2084     g = f + 1;
       
  2085     int res;
       
  2086     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodRC7L, a, b, c, d, e, f, g, fserver ));
       
  2087     CHECK(sIvokedMethod == a + 1);
       
  2088     CHECK(res == a + 1);
       
  2089     CHECK(leaveRes == 0);
       
  2090 }
       
  2091 
       
  2092 // Testing const leaving value returning methods from a class. Leaving.
       
  2093 
       
  2094 TEST(TestFuncServer, classReturnLeaveCL0)
       
  2095 {
       
  2096     int res=456;
       
  2097     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodWithLeaveRCL, fserver ));
       
  2098     CHECK(sIvokedMethod == 151);
       
  2099     CHECK(leaveRes == -151);
       
  2100     CHECK(res == 456);
       
  2101 }
       
  2102 TEST(TestFuncServer, classReturnLeaveCL1)
       
  2103 {
       
  2104     a = 151;
       
  2105     int res=456;
       
  2106     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodWithLeaveRC1L, a, fserver ));
       
  2107     CHECK(sIvokedMethod == a + 1);
       
  2108     CHECK(leaveRes == -(a + 1));
       
  2109     CHECK(res == 456);
       
  2110 }
       
  2111 TEST(TestFuncServer, classReturnLeaveCL2)
       
  2112 {
       
  2113     a = 152;
       
  2114     b = a + 1;
       
  2115     int res=456;
       
  2116     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodWithLeaveRC2L, a, b, fserver ));
       
  2117     CHECK(sIvokedMethod == a + 1);
       
  2118     CHECK(leaveRes == -(a + 1));
       
  2119     CHECK(res == 456);
       
  2120 }
       
  2121 TEST(TestFuncServer, classReturnLeaveCL3)
       
  2122 {
       
  2123     a = 153;
       
  2124     b = a + 1;
       
  2125     c = b + 1;
       
  2126     int res=456;
       
  2127     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodWithLeaveRC3L, a, b, c, fserver ));
       
  2128     CHECK(sIvokedMethod == a + 1);
       
  2129     CHECK(leaveRes == -(a + 1));
       
  2130     CHECK(res == 456);
       
  2131 }
       
  2132 TEST(TestFuncServer, classReturnLeaveCL4)
       
  2133 {
       
  2134     a = 154;
       
  2135     b = a + 1;
       
  2136     c = b + 1;
       
  2137     d = c + 1;
       
  2138     int res=456;
       
  2139     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodWithLeaveRC4L, a, b, c, d, fserver ));
       
  2140     CHECK(sIvokedMethod == a + 1);
       
  2141     CHECK(leaveRes == -(a + 1));
       
  2142     CHECK(res == 456);
       
  2143 }
       
  2144 TEST(TestFuncServer, classReturnLeaveCL5)
       
  2145 {
       
  2146     a = 155;
       
  2147     b = a + 1;
       
  2148     c = b + 1;
       
  2149     d = c + 1;
       
  2150     e = d + 1;
       
  2151     int res=456;
       
  2152     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodWithLeaveRC5L, a, b, c, d, e, fserver ));
       
  2153     CHECK(sIvokedMethod == a + 1);
       
  2154     CHECK(leaveRes == -(a + 1));
       
  2155     CHECK(res == 456);
       
  2156 }
       
  2157 TEST(TestFuncServer, classReturnLeaveCL6)
       
  2158 {
       
  2159     a = 156;
       
  2160     b = a + 1;
       
  2161     c = b + 1;
       
  2162     d = c + 1;
       
  2163     e = d + 1;
       
  2164     f = e + 1;
       
  2165     int res=456;
       
  2166     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodWithLeaveRC6L, a, b, c, d, e, f, fserver ));
       
  2167     CHECK(sIvokedMethod == a + 1);
       
  2168     CHECK(leaveRes == -(a + 1));
       
  2169     CHECK(res == 456);
       
  2170 }
       
  2171 TEST(TestFuncServer, classReturnLeaveCL7)
       
  2172 {
       
  2173     a = 157;
       
  2174     b = a + 1;
       
  2175     c = b + 1;
       
  2176     d = c + 1;
       
  2177     e = d + 1;
       
  2178     f = e + 1;
       
  2179     g = f + 1;
       
  2180     int res=456;
       
  2181     TRAPD(leaveRes, CallMethodL(res, clazz, TestClass::classMethodWithLeaveRC7L, a, b, c, d, e, f, g, fserver ));
       
  2182     CHECK(sIvokedMethod == a + 1);
       
  2183     CHECK(leaveRes == -(a + 1));
       
  2184     CHECK(res == 456);
       
  2185 }
       
  2186