зеркало из https://github.com/mozilla/pjs.git
Making the jar cache test more flexable.
Adding all-tests:: rule to makefile.win
This commit is contained in:
Родитель
f1d01b5a9b
Коммит
6665f05899
|
@ -53,18 +53,9 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static char* filenames[] = {
|
||||
"c:\\temp\\test1.zip",
|
||||
"c:\\temp\\test2.zip",
|
||||
"c:\\temp\\test3.zip",
|
||||
"c:\\temp\\test4.zip",
|
||||
"c:\\temp\\test5.zip",
|
||||
"c:\\temp\\test6.zip",
|
||||
"c:\\temp\\test7.zip",
|
||||
"c:\\temp\\test8.zip",
|
||||
};
|
||||
static char** filenames;
|
||||
|
||||
#define ZIP_COUNT (sizeof(filenames)/sizeof(filenames[0]))
|
||||
#define ZIP_COUNT 8
|
||||
#define CACHE_SIZE 4
|
||||
#define THREAD_COUNT 6
|
||||
#define THREAD_LOOP_COUNT 1000
|
||||
|
@ -129,6 +120,7 @@ TestThread::Run()
|
|||
printf("thread %d started\n", mID);
|
||||
|
||||
nsCOMPtr<nsIZipReader> reader;
|
||||
int failure = 0;
|
||||
|
||||
for(int i = 0; i < THREAD_LOOP_COUNT; i++)
|
||||
{
|
||||
|
@ -137,6 +129,7 @@ TestThread::Run()
|
|||
if(!reader)
|
||||
{
|
||||
printf("thread %d failed to get reader for %s\n", mID, filenames[k]);
|
||||
failure = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -148,16 +141,28 @@ TestThread::Run()
|
|||
reader = nsnull;
|
||||
|
||||
printf("thread %d finished\n", mID);
|
||||
|
||||
if ( failure ) return NS_ERROR_FAILURE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
int main()
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
nsresult rv;
|
||||
int i;
|
||||
|
||||
if (ZIP_COUNT != (argc - 1))
|
||||
{
|
||||
printf("usage: TestJarCache ");
|
||||
for ( i = 0; i < ZIP_COUNT; i++)
|
||||
printf("file%1d ",i + 1);
|
||||
printf("\n");
|
||||
return 1;
|
||||
}
|
||||
filenames = argv + 1;
|
||||
|
||||
rv = NS_InitXPCOM(nsnull, nsnull);
|
||||
if(NS_FAILED(rv))
|
||||
{
|
||||
|
@ -222,4 +227,6 @@ int main()
|
|||
printf("done\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -48,4 +48,15 @@ clobber::
|
|||
|
||||
$(PROG1): $(OBJDIR) TestJarCache.cpp
|
||||
|
||||
ZIPS= $(MOZ_SRC)\$(MOZ_TOP)mozilla\dist\$(OBJDIR)\bin\chrome\blue.jar \
|
||||
$(MOZ_SRC)\$(MOZ_TOP)mozilla\dist\$(OBJDIR)\bin\chrome\chatzilla.jar \
|
||||
$(MOZ_SRC)\$(MOZ_TOP)mozilla\dist\$(OBJDIR)\bin\chrome\classic.jar \
|
||||
$(MOZ_SRC)\$(MOZ_TOP)mozilla\dist\$(OBJDIR)\bin\chrome\comm.jar \
|
||||
$(MOZ_SRC)\$(MOZ_TOP)mozilla\dist\$(OBJDIR)\bin\chrome\en-US.jar \
|
||||
$(MOZ_SRC)\$(MOZ_TOP)mozilla\dist\$(OBJDIR)\bin\chrome\messenger.jar \
|
||||
$(MOZ_SRC)\$(MOZ_TOP)mozilla\dist\$(OBJDIR)\bin\chrome\modern.jar \
|
||||
$(MOZ_SRC)\$(MOZ_TOP)mozilla\dist\$(OBJDIR)\bin\chrome\toolkit.jar \
|
||||
$(NULL)
|
||||
|
||||
all-tests::
|
||||
$(DIST)\bin\TestJarCache.exe $(ZIPS)
|
||||
|
|
Загрузка…
Ссылка в новой задаче