diff options
Diffstat (limited to 'idlc/test')
-rw-r--r-- | idlc/test/const.idl | 48 | ||||
-rw-r--r-- | idlc/test/enum.idl | 24 | ||||
-rw-r--r-- | idlc/test/exception.idl | 20 | ||||
-rw-r--r-- | idlc/test/interface.idl | 51 | ||||
-rw-r--r-- | idlc/test/service.idl | 44 | ||||
-rw-r--r-- | idlc/test/struct.idl | 197 | ||||
-rw-r--r-- | idlc/test/typelookup.idl | 63 | ||||
-rw-r--r-- | idlc/test/union.idl | 35 |
8 files changed, 482 insertions, 0 deletions
diff --git a/idlc/test/const.idl b/idlc/test/const.idl new file mode 100644 index 000000000000..2366383baa89 --- /dev/null +++ b/idlc/test/const.idl @@ -0,0 +1,48 @@ +module test +{ + const long l = 1; + const long add = 1 + 2; + const long sub = 3 - 2; + const hyper h = 123456789; + const string str = "hallo"; + const float f7 = 3.4123; + const float f2 = 3.4123 + 10e-12; + const boolean bt = True; + const boolean bf = False; + const boolean and = bt & bf; + + /// SHORT_MAX + 1; + const short shortMax = -0x8000; + /// LONG_MAX + 1; + const unsigned long longMax = 0x80000000; + + +constants USER +{ + /// = 1 + const long FLAG1 = 0x00000001; + /// = 2 + const long FLAG2 = 0x00000002; + /// = 4 + const long FLAG3 = 0x00000004; + /// = 8 + const long FLAG4 = 0x00000008; + /// = 16 + const long FLAG5 = 0x00000010; + /// = 0 + const long FLAG6 = FLAG1 & FLAG2; + /// = 3 + const long FLAG7 = FLAG1 | FLAG2; + /// = 2 + const long FLAG8 = (FLAG1 | FLAG2) & FLAG2; + /// = 4 + const long FLAG9 = FLAG1 << 2; + /// = 32 + const long FLAG10 = (FLAG5 >> 1) << 2; + /// = 1 + const long FLAG11 = 33 % 4; + /// = 4 + const long FLAG12 = FLAG10 / 8; +}; + +}; diff --git a/idlc/test/enum.idl b/idlc/test/enum.idl new file mode 100644 index 000000000000..2920d7fe6a0f --- /dev/null +++ b/idlc/test/enum.idl @@ -0,0 +1,24 @@ +module idlc +{ +module test +{ + +enum Error +{ + NONE, + FATAL, + SYSTEM, + RUNTIME +}; + +enum Warning +{ + NO, + USER = 2, + WRONGPASSWORD = 4, + IDFAILURE +}; + + +}; +}; diff --git a/idlc/test/exception.idl b/idlc/test/exception.idl new file mode 100644 index 000000000000..b53d1dbe74fd --- /dev/null +++ b/idlc/test/exception.idl @@ -0,0 +1,20 @@ +module idlc +{ +module test +{ + +exception BaseException +{ + string Description; +}; + +exception RuntimeException : BaseException +{ + long Id; + type Context; +}; + + +}; +}; + diff --git a/idlc/test/interface.idl b/idlc/test/interface.idl new file mode 100644 index 000000000000..18116bf963db --- /dev/null +++ b/idlc/test/interface.idl @@ -0,0 +1,51 @@ +#include <enum.idl> +#include <struct.idl> + +module idlc +{ + +module test +{ + +interface XBase +{ + [readonly, attribute] string description; + + string getDescription(); +}; + +interface XTestBaseTypes : XBase +{ + void voidFunc(); + [oneway] void onewayFunc(); + + short shortFunc( [in] short inparam, [out] short outparam, [inout] short inoutparam); + unsigned short uShortFunc( [in] unsigned short inparam, [out] unsigned short outparam, [inout] unsigned short inoutparam); + + long longFunc( [in] long inparam, [out] long outparam, [inout] long inoutparam); + unsigned long ulongFunc( [in] unsigned long inparam, [out] unsigned long outparam, [inout] unsigned long inoutparam); + + hyper hyperFunc( [in] hyper inparam, [out] hyper outparam, [inout] hyper inoutparam); + unsigned hyper uHyperFunc( [in] unsigned hyper inparam, [out] unsigned hyper outparam, [inout] unsigned hyper inoutparam); + + float floatFunc( [in] float inparam, [out] float outparam, [inout] float inoutparam); + double doubleFunc( [in] double inparam, [out] double outparam, [inout] double inoutparam); + char charFunc( [in] char inparam, [out] char outparam, [inout] char inoutparam); + string stringFunc( [in] string inparam, [out] string outparam, [inout] string inoutparam); + byte byteFunc( [in] byte inparam, [out] byte outparam, [inout] byte inoutparam); + + type typeFunc( [in] type inparam, [out] type outparam, [inout] type inoutparam); + any anyFunc( [in] any inparam, [out] any outparam, [inout] any inoutparam); +}; + + +interface XTestComplexTypes : XBase +{ + Error enumFunc( [in] Error inparam, [out] Error outparam, [inout] Error inoutparam); + + BaseStruct structFunc( [in] ::idlc::test::BaseStruct inparam, [out] idlc::test::BaseStruct outparam, [inout] BaseStruct inoutparam); +}; + +}; + +}; diff --git a/idlc/test/service.idl b/idlc/test/service.idl new file mode 100644 index 000000000000..5a962d8fe948 --- /dev/null +++ b/idlc/test/service.idl @@ -0,0 +1,44 @@ +#include <interface.idl> + +module idlc +{ +module test +{ + +exception bla +{ +}; + +service IdlTest +{ +// [property] bla p0; + [property] short p1; + [optional, property] unsigned short p2; + + [maybevoid, property] long p3; + [bound, property] unsigned long p4; + + [constrained, property] hyper p5; + [transient, property] unsigned hyper p6; + + [maybeambiguous, property] string p7; + [maybedefault, property] type p8; + [removable, property] any p9; + + [readonly, optional, removable, property] ::idlc::test::BaseStruct p10; + + interface XTestBaseTypes; + [optional] interface ::idlc::test::XTestComplexTypes; +}; + +service BetterIdlTest +{ + service IdlTest; + + interface XTestBaseTypes; + [optional] interface ::idlc::test::XTestComplexTypes; +}; + +}; +}; + diff --git a/idlc/test/struct.idl b/idlc/test/struct.idl new file mode 100644 index 000000000000..1b76891a4867 --- /dev/null +++ b/idlc/test/struct.idl @@ -0,0 +1,197 @@ +/************************************************************************* + * + * $RCSfile: struct.idl,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: jsc $ $Date: 2001-03-15 12:25:06 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _STRUCT_IDL_ +#define _STRUCT_IDL_ + +/* In this file the idl struct will be tested. + bla + */ + +/// idlc defines a test module +module idlc +{ + +/// test defines a test module +module test +{ + +typedef sequence< long > Id; +//struct Bla +//{ +// long bla; +//}; + +/** bla + BaseStruct defines an * intial struct + */ +struct BaseStruct +{ + Id Id; + + /// a short member + short m1; + + /// a unsigned short member + unsigned short m2; + + /// a long member + long m3; + + /// a unsigned long member + unsigned long m4; + + /// a hyper member + hyper m5; + + /// a unsigned hyper member + unsigned hyper m6; + + /// a string member + string m7; + + /// a byte member + byte m8; + + /// a type member + type m9; + + /// a float member + float m10; + + /// a double member + double m11; + + /// a char member + char m12; + + /// a boolean member + boolean m13; + + /// a any member + any m14; +}; + +interface XTestBaseTypes; + +typedef sequence< long > LongSeq; + +typedef sequence< LongSeq > LongSeqSeq; + +/** TestStruct deinfes a struct which inherits + from the base strcut type BaseStruct. +*/ +struct TestStruct : BaseStruct +{ + /// a sequence< long > member + sequence< long > ms1; + + /// a sequence< sequence< long > > member + sequence< sequence< long > > ms2; + + /// a long array member with dimesion 5,10 +// long ms3[5][10]; + + /// a string array member with dimension 4,8 +// long[5][10] ms4; + + /// an interface member + XTestBaseTypes ms5; + + /// a typedef member + LongSeq ms6; + + /// a further typedef member + LongSeqSeq ms7; + + /// a sequence typedef member + sequence<LongSeq> ms8; + +}; + +//============================================================================= + +}; }; + +/*============================================================================= + + $Log: not supported by cvs2svn $ + Revision 1.4 2000/11/08 12:29:00 mi + moved from api + + Revision 1.1.1.1 2000/09/18 23:36:18 hjs + initial import + + Revision 1.5 2000/09/11 11:53:04 mi + documentation merged from XML + + Revision 1.3 2000/03/14 12:36:35 mi + #70728# missing documentation + + Revision 1.2 2000/02/07 11:25:05 mi + zu #70728# missing documentation marked + + Revision 1.1.1.1 1999/11/11 09:48:46 jsc + new + + +=============================================================================*/ +#endif + diff --git a/idlc/test/typelookup.idl b/idlc/test/typelookup.idl new file mode 100644 index 000000000000..ba1b6f29e8f3 --- /dev/null +++ b/idlc/test/typelookup.idl @@ -0,0 +1,63 @@ +/* In this file the idl struct will be tested. + bla + */ + +#include <enum.idl> + +typedef short Error; + +/// idlc defines a test module +module idlc +{ + +typedef long Error; + +/// test defines a test module +module test +{ + +/** bla + BaseStruct defines an * intial struct + */ +struct BaseStruct +{ + /// a long member + long m1; + /// a string member + string m2; + /// a byte member + byte m3; + /// a type member + type m4; + /// a enum member, Error in moudle idlc::test + Error m5; + /// a typedef member, global Error (typedef short) + ::Error m6; + /// a typedef member, Error in moudle idlc (typedef long) + ::idlc::Error m7; + /// a typedef member, Error in moudle idlc (typedef long) + idlc::Error m8; + /// a enum member, Error in moudle idlc::test + test::Error m9; +}; + +/** TestStruct deinfes a struct which inherits + from the base strcut type BaseStruct. +*/ +struct TestStruct : BaseStruct +{ + /// a short member + short ms1; + /// a hyper member + hyper ms2; + /// a sequence<long> member + sequence< long > ms3; + /// a long array member with dimesion 5,10 + long ms4[5][10]; + /// a string array member with dimension 4,8 + long[5][10] ms5; +}; + +}; // test + +}; // idlc diff --git a/idlc/test/union.idl b/idlc/test/union.idl new file mode 100644 index 000000000000..1401ac06c4ba --- /dev/null +++ b/idlc/test/union.idl @@ -0,0 +1,35 @@ +module idlc +{ +module test +{ + +union UnionTest switch (long) { + case 1: long x; + case 2: byte y; + case 3: string z; + case 4: + case 5: short w; + case 6: long array[ 10 ][ 20 ]; + case 7: sequence<long> seq; + default: any a; +}; + +typedef enum E { + A, + B +} E_Alias; + +// Union with no default label +union U2 switch(E_Alias) { + case E::A : long x; + case E::B : short y; +}; + +union U3 switch(char) { + case 2 : long x; + case 4 : short y; +}; + +}; +}; + |