This commit is contained in:
nephacks
2025-06-04 03:22:50 +02:00
parent f234f23848
commit f12416cffd
14243 changed files with 6446499 additions and 26 deletions

View File

@@ -0,0 +1,22 @@
// ----------------------------------------- //
// File generated by VPC //
// ----------------------------------------- //
Source file: F:\csgo_64\cstrike15_src\common\debug_dll_check.cpp
Debug output file: F:\csgo_64\cstrike15_src\common\debug_dll_check.cpp
Release output file: F:\csgo_64\cstrike15_src\common\debug_dll_check.cpp
Containing unity file:
PCH file:
Source file: F:\csgo_64\cstrike15_src\public\tier0\memoverride.cpp
Debug output file: F:\csgo_64\cstrike15_src\public\tier0\memoverride.cpp
Release output file: F:\csgo_64\cstrike15_src\public\tier0\memoverride.cpp
Containing unity file:
PCH file:
Source file: F:\csgo_64\cstrike15_src\unitlib\unitlib.cpp
Debug output file: F:\csgo_64\cstrike15_src\unitlib\unitlib.cpp
Release output file: F:\csgo_64\cstrike15_src\unitlib\unitlib.cpp
Containing unity file:
PCH file:

156
unitlib/unitlib.cpp Normal file
View File

@@ -0,0 +1,156 @@
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
#include "unitlib/unitlib.h"
#include "tier0/dbg.h"
#include <string.h>
#include "memdbgon.h"
//-----------------------------------------------------------------------------
//
// Base class for test cases
//
//-----------------------------------------------------------------------------
CTestCase::CTestCase( char const* pName, ITestSuite* pParent )
{
Assert( pName );
m_pName = new char[strlen(pName) + 1];
strcpy( m_pName, pName );
// Only install the test case if it has no parent
if (pParent)
{
pParent->AddTest( this );
}
else
{
UnitTestInstallTestCase( this );
}
}
CTestCase::~CTestCase()
{
if (m_pName)
delete[] m_pName;
}
char const* CTestCase::GetName()
{
return m_pName;
}
//-----------------------------------------------------------------------------
//
// Test suite class
//
//-----------------------------------------------------------------------------
CTestSuite::CTestSuite( char const* pName, ITestSuite* pParent )
{
m_TestCount = 0;
m_ppTestCases = 0;
m_pName = new char[strlen(pName) + 1];
strcpy( m_pName, pName );
// Only install the test case if it has no parent
if (pParent)
{
pParent->AddTest( this );
}
else
{
UnitTestInstallTestCase( this );
}
}
CTestSuite::~CTestSuite()
{
if (m_ppTestCases)
free(m_ppTestCases);
if (m_pName)
delete[] m_pName;
}
char const* CTestSuite::GetName()
{
return m_pName;
}
void CTestSuite::AddTest( ITestCase* pTest )
{
Assert( pTest );
if (!m_ppTestCases)
{
m_ppTestCases = (ITestCase**)malloc( sizeof(ITestCase**) );
}
else
{
m_ppTestCases = (ITestCase**)realloc( m_ppTestCases, (m_TestCount+1) * sizeof(ITestCase**) );
}
m_ppTestCases[m_TestCount++] = pTest;
}
void CTestSuite::RunTest()
{
for ( int i = 0; i < m_TestCount; ++i )
{
m_ppTestCases[i]->RunTest();
}
}
//-----------------------------------------------------------------------------
// This is the main function exported by the unit test library used by
// unit test DLLs to install their test cases into a list to be run
//-----------------------------------------------------------------------------
static int s_TestCount = 0;
static int s_TestAllocated = 0;
static ITestCase** s_ppTestCases = 0;
void UnitTestInstallTestCase( ITestCase* pTest )
{
Assert( pTest );
if (s_TestCount == s_TestAllocated)
{
if (!s_ppTestCases)
{
s_ppTestCases = (ITestCase**)malloc( 16 * sizeof(ITestCase**) );
s_TestAllocated = 16;
}
else
{
s_ppTestCases = (ITestCase**)realloc( s_ppTestCases, s_TestAllocated * 2 * sizeof(ITestCase**) );
s_TestAllocated *= 2;
}
}
s_ppTestCases[s_TestCount++] = pTest;
}
//-----------------------------------------------------------------------------
// These are the methods used by the unit test running program to run all tests
//-----------------------------------------------------------------------------
int UnitTestCount()
{
return s_TestCount;
}
ITestCase* GetUnitTest( int i )
{
Assert( i < s_TestCount );
return s_ppTestCases[i];
}

45
unitlib/unitlib.vpc Normal file
View File

@@ -0,0 +1,45 @@
//-----------------------------------------------------------------------------
// UNITLIB.VPC
//
// Project Script
//-----------------------------------------------------------------------------
$Macro SRCDIR ".."
$Macro OUTBINDIR "$SRCDIR\..\game\bin"
$Include "$SRCDIR\vpc_scripts\source_dll_base.vpc"
$Configuration
{
$Compiler
{
$PreprocessorDefinitions "$BASE;UNITLIB_DLL_EXPORT"
}
$PreLinkEvent [!$POSIX]
{
$CommandLine "call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $SRCDIR\lib\public\$(TargetName).lib $SRCDIR" "\n" \
"call $SRCDIR\vpc_scripts\valve_p4_edit.cmd $SRCDIR\lib\public\$(TargetName).exp $SRCDIR" "\n" \
"$BASE"
}
$Linker [!$POSIX]
{
$AdditionalDependencies "odbc32.lib odbccp32.lib"
$ImportLibrary "$SRCDIR\lib\public\$(TargetName).lib"
}
}
$Project "Unitlib"
{
$Folder "Source Files"
{
$File "unitlib.cpp"
}
$Folder "Header Files"
{
$File "$SRCDIR\public\unitlib\unitlib.h"
}
}

View File

@@ -0,0 +1,13 @@
"vpc_cache"
{
"CacheVersion" "1"
"win32"
{
"CRCFile" "unitlib.vcxproj.vpc_crc"
"OutputFiles"
{
"0" "unitlib.vcxproj"
"1" "unitlib.vcxproj.filters"
}
}
}