*not part of the build*

fix for 80938
a = avm@sparc.spb.su
    ovk@sparc.spb.su
    sva@sparc.spb.su

Tests for blackConnect


git-svn-id: svn://10.0.0.236/trunk@95860 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
idk%eng.sun.com
2001-05-24 05:22:13 +00:00
parent d74ff774aa
commit 6e4a0fdecc
214 changed files with 17250 additions and 0 deletions

View File

@@ -0,0 +1,270 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
The contents of this file are subject to the Mozilla Public
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.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is mozilla.org code.
The Initial Developer of the Original Code is Sun Microsystems,
Inc. Portions created by Sun are
Copyright (C) 1999 Sun Microsystems, Inc. All
Rights Reserved.
Contributor(s):
Client QA Team, St. Petersburg, Russia
*/
#include "plstr.h"
#include "stdio.h"
#include "nsMemory.h"
#include "BCTest.h"
#include <sys/stat.h>
#include <stdlib.h>
#include "J2XINOUTServerTestComponent.h"
#include "prmem.h"
#include "prenv.h"
#include "nsString.h"
#include "nsStringUtil.h"
char* testLocation=NULL;
char* logLocation=NULL;
char* fBuffer=NULL;
PRUint8 end_of_data = 112;
int all=0;
J2XINOUTServerTestComponentImpl::J2XINOUTServerTestComponentImpl()
{
NS_INIT_REFCNT();
testLocation=PR_GetEnv(BC_TEST_LOCATION_VAR_NAME);
logLocation=PR_GetEnv(BC_LOG_LOCATION_VAR_NAME);
if((testLocation == NULL)||(logLocation == NULL)) {
fprintf(stderr,"ERROR: %s or %s isn't set !", BC_TEST_LOCATION_VAR_NAME, BC_LOG_LOCATION_VAR_NAME);
}
InitStackVars();
printf("DEbug:avm:J2XINOUTServerTestComponentImpl::J2XINOUTServerTestComponentImp\n");
}
J2XINOUTServerTestComponentImpl::~J2XINOUTServerTestComponentImpl()
{
}
NS_IMPL_ISUPPORTS1(J2XINOUTServerTestComponentImpl, iJ2XINOUTServerTestComponent);
IMPL_PROCEED_RESULTS(J2XINOUTServerTestComponentImpl)
IMPL_VAR_STACKS(J2XINOUTServerTestComponentImpl)
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::GetTestLocation(char **tLocation, char **lLocation) {
*tLocation = testLocation;
*lLocation = logLocation;
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::Flush(const char *type) {
char* fileName = NULL;
fileName = PR_sprintf_append(fileName,"j2x.inout.server.%s",type);
if(fBuffer) {
PrintResult(fileName,fBuffer);
PR_smprintf_free(fBuffer);
fBuffer = NULL;
} else {
}
PR_smprintf_free(fileName);
if(fBuffer != NULL ) {
}else {
}
all=0;
return NS_OK;
}
//Test methods
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestShort(PRInt16 *i) {
if (*i!=112) fBuffer = PR_sprintf_append(fBuffer,"%d\n",*i);
else Flush("short");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestLong(PRInt32 *i) {
if (*i!=112) fBuffer = PR_sprintf_append(fBuffer,"%d\n",*i);
else Flush("long");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestLonglong(PRInt64 *i) {
if (*i!=112) fBuffer = PR_sprintf_append(fBuffer,"%lld\n",*i);
else Flush("longlong");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestByte(PRUint8 *i) {
// Strange bug here
/* if (*i!=112)*/ fBuffer = PR_sprintf_append(fBuffer,"%d\n",*i);
all++;
if (all==4) Flush("octet");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestUShort(PRUint16 *i) {
if (*i!=112) fBuffer = PR_sprintf_append(fBuffer,"%d\n",*i);
else Flush("ushort");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestULong(PRUint32 *i) {
if (*i!=112) fBuffer = PR_sprintf_append(fBuffer,"%d\n",*i);
else Flush("ulong");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestULonglong(PRUint64 *i) {
if (*i!=112) fBuffer = PR_sprintf_append(fBuffer,"%lld\n",*i);
else Flush("ulonglong");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestFloat(float *i) {
if (*i!=112) fBuffer = PR_sprintf_append(fBuffer,"%.3e\n",*i);
else Flush("float");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestDouble(double *i) {
if (*i!=112) fBuffer = PR_sprintf_append(fBuffer,"%.3e\n",*i);
else Flush("double");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestBoolean(PRBool *i) {
if (*i==PR_TRUE) fBuffer = PR_sprintf_append(fBuffer,"%s\n","true");
else if (*i==PR_FALSE) fBuffer = PR_sprintf_append(fBuffer,"%s\n","false");
else fBuffer = PR_sprintf_append(fBuffer,"%s\n","strange value");
all++;
if (all==2) Flush("boolean");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestChar(char *i) {
// Strange bug here
/* if (*i!='x')*/ fBuffer = PR_sprintf_append(fBuffer,"%c\n",i);
all++;
if (all==2) Flush("char");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestWChar(PRUnichar *i) {
// Strange bug here
/* if (*i!='x')*/ fBuffer = PR_sprintf_append(fBuffer,"%c\n",i);
all++;
if (all==2) Flush("wchar");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestString(char **i) {
fBuffer = PR_sprintf_append(fBuffer,"%s\n",*i);
all++;
if (all==3) Flush("string");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestWString(PRUnichar **i) {
nsString str = *(new nsString(*i));
{
NS_ALLOC_STR_BUF(aBuf,str,100)
fBuffer = PR_sprintf_append(fBuffer,"%s\n",aBuf);
NS_FREE_STR_BUF(aBuf)
}
all++;
if (all==3) Flush("wstring");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestStringArray(PRUint32 count, char ***valueArray) {
for(int i=0;i<count;i++)
fBuffer = PR_sprintf_append(fBuffer,"%s\n",valueArray[0][i]);
Flush("stringArray");
return NS_OK;//PrintResultArray("j2x.in.server.stringArray",count,valueArray);
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestLongArray(PRUint32 count, PRInt32 **longArray) {
for(int i=0;i<count;i++)
fBuffer = PR_sprintf_append(fBuffer,"%d\n",longArray[i]);
Flush("longArray");
return NS_OK;//PrintResultArray("j2x.in.server.longArray",count,longArray);
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestCharArray(PRUint32 count, char **valueArray) {
for(int i=0;i<count;i++)
fBuffer = PR_sprintf_append(fBuffer,"%c\n",valueArray[i]);
Flush("charArray");
return NS_OK;//PrintResultArray("j2x.in.server.charArray",count,valueArray);;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestMixed(PRBool *bBool, char *cChar, PRUint8 *nByte, PRInt16 *nShort, PRUint16 *nUShort, PRInt32 *nLong, PRUint32 *nULong, PRInt64 *nHyper, PRUint64 *nUHyper, float *fFloat, double *fDouble, char **aString, PRUint32 count, PRInt32 **longArray) {
fBuffer = PR_sprintf_append(fBuffer,"%d\n%d\n%d",nByte, nShort, nUShort);
Flush("mixed");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestObject(iJ2XINOUTServerTestComponent **obj) {
obj[0]->TestObj();
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestObj() {
fBuffer = PR_sprintf_append(fBuffer,"!!!Right string!!!");
Flush("object");
return NS_OK;
}
NS_IMETHODIMP J2XINOUTServerTestComponentImpl::TestObj2() {
fBuffer = PR_sprintf_append(fBuffer,"!!!Right string!!!");
char* fileName = NULL;
fileName = PR_sprintf_append(fileName,"j2x.inout.xclient.object");
if(fBuffer) {
PrintResult(fileName,fBuffer);
PR_smprintf_free(fBuffer);
fBuffer = NULL;
} else {
}
PR_smprintf_free(fileName);
return NS_OK;
}

View File

@@ -0,0 +1,61 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
The contents of this file are subject to the Mozilla Public
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.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is mozilla.org code.
The Initial Developer of the Original Code is Sun Microsystems,
Inc. Portions created by Sun are
Copyright (C) 1999 Sun Microsystems, Inc. All
Rights Reserved.
Contributor(s):
Client QA Team, St. Petersburg, Russia
*/
#include "iJ2XINOUTServerTestComponent.h"
#include "ProceedResults.h"
#include "VarContainer.h"
class J2XINOUTServerTestComponentImpl : public iJ2XINOUTServerTestComponent
{
public:
NS_DECL_ISUPPORTS
NS_DECL_IJ2XINOUTSERVERTESTCOMPONENT
DECL_PROCEED_RESULTS
DECL_VAR_STACKS
J2XINOUTServerTestComponentImpl();
virtual ~J2XINOUTServerTestComponentImpl();
};
class _MYCLASS_ : public iJ2XINOUTServerTestComponent
{
public:
NS_DECL_ISUPPORTS
NS_DECL_IJ2XINOUTSERVERTESTCOMPONENT
_MYCLASS_();
virtual ~_MYCLASS_();
/* additional members */
};

View File

@@ -0,0 +1,40 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
The contents of this file are subject to the Mozilla Public
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.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is mozilla.org code.
The Initial Developer of the Original Code is Sun Microsystems,
Inc. Portions created by Sun are
Copyright (C) 1999 Sun Microsystems, Inc. All
Rights Reserved.
Contributor(s):
Client QA Team, St. Petersburg, Russia
*/
#include "nsIGenericFactory.h"
#include "J2XINOUTServerTestComponent.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(J2XINOUTServerTestComponentImpl)
static nsModuleComponentInfo components[] =
{
{ "J2XINOUT Server Test Component", J2XINOUTSERVERTESTCOMPONENT_CID, J2XINOUTSERVERTESTCOMPONENT_PROGID, J2XINOUTServerTestComponentImplConstructor,
NULL /* NULL if you dont need one */,
NULL /* NULL if you dont need one */
}
};
NS_IMPL_NSGETMODULE("J2XINOUTServerTestComponentFactory", components)

View File

@@ -0,0 +1,61 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public
# 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.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Client QA Team, St. Petersburg, Russia
#
DEPTH=../../../../../../..
topsrcdir = $(DEPTH)
srcdir = .
VPATH = .
include $(DEPTH)/config/autoconf.mk
include $(DEPTH)/config/config.mk
MODULE = J2XINOUTServerTestComponent
LIBRARY_NAME = $(MODULE)
XPIDL_MODULE = $(MODULE)
IS_COMPONENT = 1
#It is not right !
#DSO_LDOPTS += -L$(DIST)/lib \
# -lnspr4 \
# $(NULL)
DSO_LDOPTS += \
$(XPCOM_LIBS) \
$(NSPR_LIBS) \
$(NULL)
CPPSRCS = \
J2XINOUTServerTestComponent.cpp \
J2XINOUTServerTestComponentFactory.cpp \
$(NULL)
XPIDLSRCS = iJ2XINOUTServerTestComponent.idl
JAVAI = iJ2XINOUTServerTestComponent.java
include $(topsrcdir)/config/rules.mk
JAVAC=$(JDKHOME)/bin/javac -classpath $(DIST)/classes -d $(DIST)/classes
export::
$(JAVAC) $(JAVAI)

View File

@@ -0,0 +1,72 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
The contents of this file are subject to the Mozilla Public
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.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is mozilla.org code.
The Initial Developer of the Original Code is Sun Microsystems,
Inc. Portions created by Sun are
Copyright (C) 1999 Sun Microsystems, Inc. All
Rights Reserved.
Contributor(s):
Client QA Team, St. Petersburg, Russia
*/
#include "nsISupports.idl"
[scriptable, uuid(c534e01c-9567-44ac-aaa6-f908fabefc2b)]
interface iJ2XINOUTServerTestComponent : nsISupports
{
void GetTestLocation(out string tLocation, out string lLocation);
void Flush(in string s);
void TestShort(inout short i);
void TestLong(inout long i);
void TestLonglong(inout long long i);
void TestByte(inout octet i);
void TestUShort(inout unsigned short i);
void TestULong(inout unsigned long i);
void TestULonglong(inout unsigned long long i);
void TestFloat(inout float i);
void TestDouble(inout double i);
void TestBoolean(inout boolean i);
void TestChar(inout char i);
void TestWChar(inout wchar i);
void TestString(inout string i);
void TestWString(inout wstring i);
void TestStringArray(in unsigned long count,[array, size_is(count)] inout string valueArray);
void TestLongArray(in unsigned long count, [array, size_is(count)] inout long longArray);
void TestCharArray(in unsigned long count,[array, size_is(count)] inout char valueArray);
void TestMixed(inout boolean bBool, inout char cChar, inout octet nByte,
inout short nShort, inout unsigned short nUShort,
inout long nLong, inout unsigned long nULong,
inout long long nHyper, inout unsigned long long nUHyper,
inout float fFloat, inout double fDouble,
inout string aString,
in unsigned long count, [array, size_is(count)] inout long longArray);
void TestObject(inout iJ2XINOUTServerTestComponent obj);
void TestObj();
void TestObj2();
};
%{ C++
#define J2XINOUTSERVERTESTCOMPONENT_CID \
{ /*4aa238d4-d655-40b7-9743-62a5b2e21a5c*/ \
0x4aa238d4, \
0xd655, \
0x40b7, \
{0x97, 0x43, 0x62, 0xa5, 0xb2, 0xe2, 0x1a, 0x5c} \
}
#define J2XINOUTSERVERTESTCOMPONENT_PROGID "@mozilla/blackwood/blackconnect/test/params/J2XINOUTServer;1"
%}

View File

@@ -0,0 +1,96 @@
/*
* ************* DO NOT EDIT THIS FILE ***********
*
* This file was automatically generated from iJ2XINOUTServerTestComponent.idl.
*/
package org.mozilla.xpcom;
/**
* Interface iJ2XINOUTServerTestComponent
*
* IID: 0xc534e01c-9567-44ac-aaa6-f908fabefc2b
*/
public interface iJ2XINOUTServerTestComponent extends nsISupports
{
public static final IID IID =
new IID("c534e01c-9567-44ac-aaa6-f908fabefc2b");
/* void GetTestLocation (out string tLocation, out string lLocation); */
public void getTestLocation(String[] tLocation, String[] lLocation);
/* void Flush (in string s); */
public void flush(String s);
/* void TestShort (inout short i); */
public void testShort(short[] i);
/* void TestLong (inout long i); */
public void testLong(int[] i);
/* void TestLonglong (inout long long i); */
public void testLonglong(long[] i);
/* void TestByte (inout octet i); */
public void testByte(byte[] i);
/* void TestUShort (inout unsigned short i); */
public void testUShort(short[] i);
/* void TestULong (inout unsigned long i); */
public void testULong(int[] i);
/* void TestULonglong (inout unsigned long long i); */
public void testULonglong(long[] i);
/* void TestFloat (inout float i); */
public void testFloat(float[] i);
/* void TestDouble (inout double i); */
public void testDouble(double[] i);
/* void TestBoolean (inout boolean i); */
public void testBoolean(boolean[] i);
/* void TestChar (inout char i); */
public void testChar(char[] i);
/* void TestWChar (inout wchar i); */
public void testWChar(char[] i);
/* void TestString (inout string i); */
public void testString(String[] i);
/* void TestWString (inout wstring i); */
public void testWString(String[] i);
/* void TestStringArray (in unsigned long count, [array, size_is (count)] inout string valueArray); */
public void testStringArray(int count, String[][] valueArray);
/* void TestLongArray (in unsigned long count, [array, size_is (count)] inout long longArray); */
public void testLongArray(int count, int[][] longArray);
/* void TestCharArray (in unsigned long count, [array, size_is (count)] inout char valueArray); */
public void testCharArray(int count, char[][] valueArray);
/* void TestMixed (inout boolean bBool, inout char cChar, inout octet nByte, inout short nShort, inout unsigned short nUShort, inout long nLong, inout unsigned long nULong, inout long long nHyper, inout unsigned long long nUHyper, inout float fFloat, inout double fDouble, inout string aString, in unsigned long count, [array, size_is (count)] inout long longArray); */
public void testMixed(boolean[] bBool, char[] cChar, byte[] nByte, short[] nShort, short[] nUShort, int[] nLong, int[] nULong, long[] nHyper, long[] nUHyper, float[] fFloat, double[] fDouble, String[] aString, int count, int[][] longArray);
/* void TestObject (inout iJ2XINOUTServerTestComponent obj); */
public void testObject(iJ2XINOUTServerTestComponent[] obj);
/* void TestObj (); */
public void testObj();
/* void TestObj2 (); */
public void testObj2();
}
/*
* end
*/

View File

@@ -0,0 +1,58 @@
#!nmake
#
# The contents of this file are subject to the Mozilla Public
# 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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Sun Microsystems,
# Inc. Portions created by Sun are
# Copyright (C) 1999 Sun Microsystems, Inc. All
# Rights Reserved.
#
# Contributor(s):
# Client QA Team, St. Petersburg, Russia
#
DEPTH=..\..\..\..\..\..\..
MAKE_OBJ_TYPE = DLL
DLLNAME = J2XINOUTServerTestComponent
DLL=.\$(OBJDIR)\$(DLLNAME).dll
MODULE = J2XINOUTServerTestComponent
COMPONENT = 1
CPP_OBJS= \
.\$(OBJDIR)\J2XINOUTServerTestComponent.obj \
.\$(OBJDIR)\J2XINOUTServerTestComponentFactory.obj \
$(NULL)
XPIDLSRCS = .\iJ2XINOUTServerTestComponent.idl
JAVAI= iJ2XINOUTServerTestComponent.java
LLIBS= $(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib
include <$(DEPTH)\config\rules.mak>
JAVAC=$(JDKHOME)\bin\javac -classpath $(DEPTH)\dist\classes -d $(DEPTH)\dist\classes
install:: $(DLL)
$(MAKE_INSTALL) $(DLL) $(DIST)\bin\components
clobber::
del /f $(DIST)\bin\components\$(DLLNAME).dll
del /f $(DIST)\bin\components\J2XINOUT*.xpt
export::
$(JAVAC) $(JAVAI)