From: <Or...@us...> - 2008-08-18 12:27:07
|
Revision: 334 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=334&view=rev Author: Oracle_ Date: 2008-08-18 12:27:16 +0000 (Mon, 18 Aug 2008) Log Message: ----------- Fixed bugs. Modified Paths: -------------- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp 2008-08-17 23:12:52 UTC (rev 333) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp 2008-08-18 12:27:16 UTC (rev 334) @@ -249,7 +249,7 @@ HasDF=true; Details="Destricted Function. "; FreeLibrary(hmodCaller); - return false; + return true; } } } @@ -334,12 +334,15 @@ bool DoubleSecure::Init(LPWSTR lpApplicationName) { - return (syssec->Init(lpApplicationName)&&usersec->Init(lpApplicationName)); + bool res=(syssec->Init(lpApplicationName)&&usersec->Init(lpApplicationName)); + this->Details=syssec->Details+usersec->Details; + return res; } bool DoubleSecure::CreateProc(LPWSTR lpApplicationName,BOOL bInheritHandles,DWORD dwCreationFlags,LPSTARTUPINFOW lpStartupInfo) { bool res=usersec->CreateProc(lpApplicationName,bInheritHandles,dwCreationFlags,lpStartupInfo); + this->Details=usersec->Details; if (res) { this->process=usersec->process; Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-08-17 23:12:52 UTC (rev 333) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-08-18 12:27:16 UTC (rev 334) @@ -9,6 +9,7 @@ Runner::Runner(SecureType secure, String^ ProblemPath, String^ ExeFile, String^ TempPath, int WaitForFile) { + SetPriorityClass(GetCurrentProcess(),HIGH_PRIORITY_CLASS); //for better testing initlock(); data = gcnew DataLoader(ProblemPath + "ProblemData.txt"); data->Load(); @@ -50,8 +51,10 @@ sec=new SysCallSecure(); else if (SecType==SecureType::Double) sec=new DoubleSecure(); + lock(); String^ oupath=temp+"out"+index.ToString()+".txt"; String^ erpath=temp+"err"+index.ToString()+".txt"; + unlock(); String^ inpath=test->tests[index-1]->InPath; si.cb=sizeof(si); @@ -62,13 +65,23 @@ si.hStdError=CreateFile(bufW=(wchar_t*)Marshal::StringToHGlobalUni(erpath).ToPointer(),GENERIC_WRITE,FILE_SHARE_WRITE,&secdesc,CREATE_ALWAYS,0,NULL); Marshal::FreeHGlobal(IntPtr(bufW)); SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOALIGNMENTFAULTEXCEPT|SEM_NOGPFAULTERRORBOX|SEM_NOOPENFILEERRORBOX); - if (!sec->Init(bufW=(wchar_t*)Marshal::StringToHGlobalUni(exe).ToPointer())) + lock(); + bufW=(wchar_t*)Marshal::StringToHGlobalUni(exe).ToPointer(); + unlock(); + if (!sec->Init(bufW)) { result->res=TestResult::InternalError; result->Details=gcnew String(sec->Details.c_str())+" Can not init secure"; Marshal::FreeHGlobal(IntPtr(bufW)); return false; } + if (sec->CheckSecure()) + { + result->res=TestResult::DestrictedFunction; + result->Details=gcnew String(sec->Details.c_str())+" Destricted function."; + Marshal::FreeHGlobal(IntPtr(bufW)); + return false; + } if (!sec->CreateProc(bufW,TRUE,CREATE_SUSPENDED|CREATE_NO_WINDOW|ABOVE_NORMAL_PRIORITY_CLASS,&si)) { Marshal::FreeHGlobal(IntPtr(bufW)); @@ -263,7 +276,9 @@ return true; }finally { + lock(); results[index-1]=result; + unlock(); sec->Finalize(); if (sec!=NULL) delete sec; @@ -328,6 +343,7 @@ Runner::~Runner() { destroylock(); + SetPriorityClass(GetCurrentProcess(),NORMAL_PRIORITY_CLASS); } void Runner::initlock() Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h 2008-08-17 23:12:52 UTC (rev 333) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h 2008-08-18 12:27:16 UTC (rev 334) @@ -80,10 +80,11 @@ void lock(); //locks access to other theads void unlock(); //unlocks access to other threads TestLoader^ testfield; + DataLoader^ datafield; + PluginLoader^ plugfield; public: array<TestRes^>^ results; - DataLoader^ data; - PluginLoader^ plug; + bool TestAll; //set false if break testing after ExecuteTest return false (not AC) SecureType SecType; int CONST_SLEEP; @@ -115,6 +116,50 @@ unlock(); } } + + property DataLoader^ data + { + DataLoader^ get() + { + try + { + lock(); + return datafield; + } finally + { + unlock(); + } + } + + void set(DataLoader^ value) + { + lock(); + datafield=value; + unlock(); + } + } + + property PluginLoader^ plug + { + PluginLoader^ get() + { + try + { + lock(); + return plugfield; + } finally + { + unlock(); + } + } + + void set(PluginLoader^ value) + { + lock(); + plugfield=value; + unlock(); + } + } }; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Or...@us...> - 2008-09-20 10:03:33
|
Revision: 356 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=356&view=rev Author: Oracle_ Date: 2008-09-20 10:03:22 +0000 (Sat, 20 Sep 2008) Log Message: ----------- Deleted precompiled headers (for compiling on Vista). Modified Paths: -------------- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/AssemblyInfo.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.vcproj Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/AssemblyInfo.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/AssemblyInfo.cpp 2008-09-19 21:53:02 UTC (rev 355) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/AssemblyInfo.cpp 2008-09-20 10:03:22 UTC (rev 356) @@ -1,5 +1,3 @@ -#include "stdafx.h" - using namespace System; using namespace System::Reflection; using namespace System::Runtime::CompilerServices; Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp 2008-09-19 21:53:02 UTC (rev 355) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/CompileClass.cpp 2008-09-20 10:03:22 UTC (rev 356) @@ -1,4 +1,3 @@ -#include "stdafx.h" #include "CompileClass.h" using namespace Test; using namespace System::IO; Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp 2008-09-19 21:53:02 UTC (rev 355) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/SecureClass.cpp 2008-09-20 10:03:22 UTC (rev 356) @@ -1,4 +1,4 @@ -#include "stdafx.h" + #include "SecureClass.h" #include <Lm.h> #include <Userenv.h> Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-09-19 21:53:02 UTC (rev 355) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2008-09-20 10:03:22 UTC (rev 356) @@ -1,4 +1,3 @@ -#include "stdafx.h" //#define _WIN32_WINNT 0x0500 //need for easy compiling on different machine #include "Test.h" #include <windows.h> Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.vcproj =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.vcproj 2008-09-19 21:53:02 UTC (rev 355) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.vcproj 2008-09-20 10:03:22 UTC (rev 356) @@ -44,7 +44,7 @@ Optimization="0" PreprocessorDefinitions="WIN32;_DEBUG" RuntimeLibrary="3" - UsePrecompiledHeader="2" + UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="3" /> @@ -202,26 +202,6 @@ > </File> <File - RelativePath=".\Stdafx.cpp" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCLCompilerTool" - UsePrecompiledHeader="1" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCLCompilerTool" - UsePrecompiledHeader="1" - /> - </FileConfiguration> - </File> - <File RelativePath=".\Test.cpp" > </File> @@ -240,10 +220,6 @@ > </File> <File - RelativePath=".\Stdafx.h" - > - </File> - <File RelativePath=".\Test.h" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Or...@us...> - 2009-02-02 12:55:54
|
Revision: 476 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=476&view=rev Author: Oracle_ Date: 2009-02-02 12:55:50 +0000 (Mon, 02 Feb 2009) Log Message: ----------- Added UserOutput to results. Modified Paths: -------------- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2009-02-02 01:54:43 UTC (rev 475) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.cpp 2009-02-02 12:55:50 UTC (rev 476) @@ -278,9 +278,9 @@ result->Details=gcnew String(sec->Details.c_str())+" No output file"; return false; } + result->UserOutput=ReadAllFile(oupath); + Checker^ check=gcnew Tester::Checker(Path::GetFullPath(data->Checker),test->tests[index-1]->input,result->UserOutput,test->tests[index-1]->output); - Checker^ check=gcnew Tester::Checker(Path::GetFullPath(data->Checker),test->tests[index-1]->input,ReadAllFile(oupath),test->tests[index-1]->output); - switch (check->Check()) { case CheckResult::OE: Modified: ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h =================================================================== --- ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h 2009-02-02 01:54:43 UTC (rev 475) +++ ACMServer/trunk/sharp tester/SourceTest 2.0/Test/Test.h 2009-02-02 12:55:50 UTC (rev 476) @@ -36,6 +36,7 @@ public ref struct TestRes { String^ Details; + String^ UserOutput; TestResult res; int UsedTime; int UsedMemory; @@ -45,6 +46,7 @@ TestRes() { Details=""; + UserOutput=""; UsedTime=-1; UsedMemory=-1; UsedRealTime=-1; @@ -54,6 +56,7 @@ TestRes^ operator=(TestRes^ value) { this->Details=value->Details; + this->UserOutput=value->UserOutput; this->Points=value->Points; this->res=value->res; this->UsedMemory=value->UsedMemory; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |