|
From: <Or...@us...> - 2008-07-11 11:35:06
|
Revision: 296
http://acmcontester.svn.sourceforge.net/acmcontester/?rev=296&view=rev
Author: Oracle_
Date: 2008-07-11 04:35:15 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
Fixed bug with counting points.
Modified Paths:
--------------
ACMServer/trunk/sharp tester/SourceTest/SourceTest.cpp
Modified: ACMServer/trunk/sharp tester/SourceTest/SourceTest.cpp
===================================================================
--- ACMServer/trunk/sharp tester/SourceTest/SourceTest.cpp 2008-07-09 09:53:53 UTC (rev 295)
+++ ACMServer/trunk/sharp tester/SourceTest/SourceTest.cpp 2008-07-11 11:35:15 UTC (rev 296)
@@ -150,7 +150,7 @@
sec.lpSecurityDescriptor=NULL;
sec.nLength=sizeof(sec);
char* bufA;
- wchar_t* bufW;
+ wchar_t* bufW,*bufW2;
try
{
String^ srcpath=gcnew String(FTempPath+"source.txt");
@@ -180,14 +180,17 @@
DWORD start=GetTickCount();
bufW=StrToArrW("\""+FCompPath+"\" \""+srcpath+"\" \""+FTempPath);
- if (!CreateProcess(NULL,bufW,&sec,&sec,true,CREATE_NEW_CONSOLE|CREATE_NO_WINDOW,NULL,NULL,&si,&pi))
+ bufW2=StrToArrW(Path::GetDirectoryName(FCompPath));
+ if (!CreateProcess(NULL,bufW,&sec,&sec,true,CREATE_NEW_CONSOLE|CREATE_NO_WINDOW,NULL,bufW2,&si,&pi))
{
FreeArr(bufW);
+ FreeArr(bufW2);
FCompResult->res=TCompRes::crIE;
FCompResult->Details+="Can not run the compiler\n";
return;
}
FreeArr(bufW);
+ FreeArr(bufW2);
if (WaitForSingleObject(pi.hProcess,FLim->CompilationTimeLimit)==WAIT_TIMEOUT)
{
TerminateProcess(pi.hProcess,0);
@@ -242,10 +245,12 @@
if (n<TestCnt())
{
RunTest(n);
+ lock();
Summary->res->points+=Results[n-1]->points;
Summary->res->UsedMemory=max(Results[n-1]->UsedMemory,Summary->res->UsedMemory);
Summary->res->UsedTime=max(Results[n-1]->UsedTime,Summary->res->UsedTime);
Summary->res->UsedRealTime=max(Results[n-1]->UsedRealTime,Summary->res->UsedRealTime);
+ unlock();
if (Results[n-1]->res!=TRes::trAC)
{
Summary->res->res=Results[n-1]->res;
@@ -479,7 +484,7 @@
Results[index-1]->Details+="Real time limit";
break;
}
- if (CheckTL((int)(acc.ThisPeriodTotalKernelTime.QuadPart+acc.ThisPeriodTotalUserTime.QuadPart),Lim->TimeLimit*10000))
+ if (CheckTL((int)(acc.TotalKernelTime.QuadPart+acc.TotalUserTime.QuadPart),Lim->TimeLimit*10000))
{
TerminateJobObject(job,0);
Results[index-1]->res=TRes::trTL;
@@ -542,7 +547,7 @@
QueryInformationJobObject(job,JobObjectExtendedLimitInformation,&mem,sizeof(mem),NULL);
QueryInformationJobObject(job,JobObjectBasicAccountingInformation,&acc,sizeof(acc),NULL);
Results[index-1]->UsedMemory=mem.PeakJobMemoryUsed;
- Results[index-1]->UsedTime=(int)((acc.ThisPeriodTotalKernelTime.QuadPart+acc.ThisPeriodTotalUserTime.QuadPart)/10000);
+ Results[index-1]->UsedTime=(int)((acc.TotalKernelTime.QuadPart+acc.TotalUserTime.QuadPart)/10000);
if (Results[index-1]->res!=TRes::trAC) return;
if ((int)GetFileSize(si.hStdOutput,NULL)>Lim->OutputLimit)
@@ -585,7 +590,7 @@
if (r==carAC)
{
if (File::Exists(pointpath))
- Results[index-1]->points.Parse(ReadFullFile(pointpath)); else
+ Results[index-1]->points=int::Parse(ReadFullFile(pointpath)); else
Results[index-1]->points=1;
return ;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|