From: <Or...@us...> - 2008-06-03 15:58:06
|
Revision: 205 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=205&view=rev Author: Oracle_ Date: 2008-06-03 08:58:14 -0700 (Tue, 03 Jun 2008) Log Message: ----------- Added TestLibrary. Added Paths: ----------- ACMServer/branches/sharp tester/SourceTest/AdvAPI32.Lib here.txt ACMServer/branches/sharp tester/TestLibrary/ ACMServer/branches/sharp tester/TestLibrary/TestLibrary.cpp ACMServer/branches/sharp tester/TestLibrary/TestLibrary.def ACMServer/branches/sharp tester/TestLibrary/TestLibrary.h ACMServer/branches/sharp tester/TestLibrary/TestLibrary.vcproj ACMServer/branches/sharp tester/TestLibrary/dllmain.cpp ACMServer/branches/sharp tester/TestLibrary/stdafx.cpp ACMServer/branches/sharp tester/TestLibrary/stdafx.h ACMServer/branches/sharp tester/TestLibrary/targetver.h Added: ACMServer/branches/sharp tester/SourceTest/AdvAPI32.Lib here.txt =================================================================== Added: ACMServer/branches/sharp tester/TestLibrary/TestLibrary.cpp =================================================================== --- ACMServer/branches/sharp tester/TestLibrary/TestLibrary.cpp (rev 0) +++ ACMServer/branches/sharp tester/TestLibrary/TestLibrary.cpp 2008-06-03 15:58:14 UTC (rev 205) @@ -0,0 +1,58 @@ +// TestLibrary.cpp : Defines the exported functions for the DLL application. +// + +#include "stdafx.h" +#include "TestLibrary.h" +#include <new.h> +#include <stdio.h> + +TESTLIBRARY_API bool CheckCL(char* src, int cl, char*& details) +{ + details=new char[20]; + strcpy_s(details,20,"CheckCL from DLL\n"); + return ((int)strlen(src)>cl); +} + +TESTLIBRARY_API bool CheckDF(char* src, int lang, char*& details) +{ + details=new char[20]; + strcpy_s(details,20,"CheckDF from DLL"); + return false; +} + +TESTLIBRARY_API void FreeChar(char* buf) +{ + delete[] buf; +} + +TESTLIBRARY_API bool CheckRTL(int usedrealtime, int realtimelimit) +{ + return (usedrealtime>realtimelimit); +} + +TESTLIBRARY_API bool CheckTL(int usedtime, int timelimit) +{ + return (usedtime>timelimit); +} + +TESTLIBRARY_API int CheckAnswer(char* input, char* output, char* rightoutput) +{ + if (strcmp(output,rightoutput)==0) + return 0; + int curo=0; + for (int i=0;;i++,curo++) + { + if (output[curo]=='\0'&&rightoutput[i]!='\0') + return 1; + if (output[curo]!='\0'&&rightoutput[i]=='\0') + return 1; + if (output[curo]=='\0'&&rightoutput[i]=='\0') + return 3; + while ((output[curo]==' ')&&(output[curo]=='\n')&&(output[curo]=='\r')) + ++curo; + while ((rightoutput[i]==' ')&&(rightoutput[i]=='\n')&&(rightoutput[i]=='\r')) + ++i; + if (output[curo]!=rightoutput[i]) + return 1; + } +} Added: ACMServer/branches/sharp tester/TestLibrary/TestLibrary.def =================================================================== --- ACMServer/branches/sharp tester/TestLibrary/TestLibrary.def (rev 0) +++ ACMServer/branches/sharp tester/TestLibrary/TestLibrary.def 2008-06-03 15:58:14 UTC (rev 205) @@ -0,0 +1,8 @@ +LIBRARY "TestLibrary" +EXPORTS +CheckCL +CheckDF +FreeChar +CheckRTL +CheckTL +CheckAnswer \ No newline at end of file Added: ACMServer/branches/sharp tester/TestLibrary/TestLibrary.h =================================================================== --- ACMServer/branches/sharp tester/TestLibrary/TestLibrary.h (rev 0) +++ ACMServer/branches/sharp tester/TestLibrary/TestLibrary.h 2008-06-03 15:58:14 UTC (rev 205) @@ -0,0 +1,14 @@ + +#ifdef TESTLIBRARY_EXPORTS +#define TESTLIBRARY_API __declspec(dllexport) +#else +#define TESTLIBRARY_API __declspec(dllimport) +#endif + +TESTLIBRARY_API bool CheckCL(char* src, int cl, char*& details); +TESTLIBRARY_API bool CheckDF(char* src, int lang, char*& details); +TESTLIBRARY_API void FreeChar(char* buf); +TESTLIBRARY_API bool CheckRTL(int usedrealtime, int realtimelimit); +TESTLIBRARY_API bool CheckTL(int usedtime, int timelimit); +TESTLIBRARY_API int CheckAnswer(char* input, char* output, char* rightoutput); + Added: ACMServer/branches/sharp tester/TestLibrary/TestLibrary.vcproj =================================================================== --- ACMServer/branches/sharp tester/TestLibrary/TestLibrary.vcproj (rev 0) +++ ACMServer/branches/sharp tester/TestLibrary/TestLibrary.vcproj 2008-06-03 15:58:14 UTC (rev 205) @@ -0,0 +1,253 @@ +<?xml version="1.0" encoding="windows-1251"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9,00" + Name="TestLibrary" + ProjectGUID="{2009FCA0-9B13-4D3D-8C89-DDCD3C40E4B4}" + RootNamespace="TestLibrary" + Keyword="Win32Proj" + TargetFrameworkVersion="196613" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="2" + CharacterSet="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TESTLIBRARY_EXPORTS" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + UsePrecompiledHeader="2" + WarningLevel="3" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + LinkIncremental="2" + ModuleDefinitionFile="TestLibrary.def" + GenerateDebugInformation="true" + SubSystem="2" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="2" + CharacterSet="1" + WholeProgramOptimization="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + EnableIntrinsicFunctions="true" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TESTLIBRARY_EXPORTS" + RuntimeLibrary="2" + EnableFunctionLevelLinking="true" + UsePrecompiledHeader="2" + WarningLevel="3" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + LinkIncremental="1" + ModuleDefinitionFile="TestLibrary.def" + GenerateDebugInformation="true" + SubSystem="2" + OptimizeReferences="2" + EnableCOMDATFolding="2" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" + UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" + > + <File + RelativePath=".\dllmain.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + CompileAsManaged="0" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + UsePrecompiledHeader="0" + CompileAsManaged="0" + /> + </FileConfiguration> + </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=".\TestLibrary.cpp" + > + </File> + <File + RelativePath=".\TestLibrary.def" + > + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl;inc;xsd" + UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" + > + <File + RelativePath=".\stdafx.h" + > + </File> + <File + RelativePath=".\targetver.h" + > + </File> + <File + RelativePath=".\TestLibrary.h" + > + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" + UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" + > + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> Added: ACMServer/branches/sharp tester/TestLibrary/dllmain.cpp =================================================================== --- ACMServer/branches/sharp tester/TestLibrary/dllmain.cpp (rev 0) +++ ACMServer/branches/sharp tester/TestLibrary/dllmain.cpp 2008-06-03 15:58:14 UTC (rev 205) @@ -0,0 +1,19 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#include "stdafx.h" + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + Added: ACMServer/branches/sharp tester/TestLibrary/stdafx.cpp =================================================================== --- ACMServer/branches/sharp tester/TestLibrary/stdafx.cpp (rev 0) +++ ACMServer/branches/sharp tester/TestLibrary/stdafx.cpp 2008-06-03 15:58:14 UTC (rev 205) @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// TestLibrary.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file Added: ACMServer/branches/sharp tester/TestLibrary/stdafx.h =================================================================== --- ACMServer/branches/sharp tester/TestLibrary/stdafx.h (rev 0) +++ ACMServer/branches/sharp tester/TestLibrary/stdafx.h 2008-06-03 15:58:14 UTC (rev 205) @@ -0,0 +1,16 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include <windows.h> + + + +// TODO: reference additional headers your program requires here Added: ACMServer/branches/sharp tester/TestLibrary/targetver.h =================================================================== --- ACMServer/branches/sharp tester/TestLibrary/targetver.h (rev 0) +++ ACMServer/branches/sharp tester/TestLibrary/targetver.h 2008-06-03 15:58:14 UTC (rev 205) @@ -0,0 +1,24 @@ +#pragma once + +// The following macros define the minimum required platform. The minimum required platform +// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run +// your application. The macros work by enabling all features available on platform versions up to and +// including the version specified. + +// Modify the following defines if you have to target a platform prior to the ones specified below. +// Refer to MSDN for the latest info on corresponding values for different platforms. +#ifndef WINVER // Specifies that the minimum required platform is Windows Vista. +#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista. +#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98. +#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. +#endif + +#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 7.0. +#define _WIN32_IE 0x0700 // Change this to the appropriate value to target other versions of IE. +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |