summaryrefslogtreecommitdiff
path: root/unittests/tier2test
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/tier2test')
-rw-r--r--unittests/tier2test/tier2test.cpp44
-rw-r--r--unittests/tier2test/tier2test.vpc38
2 files changed, 82 insertions, 0 deletions
diff --git a/unittests/tier2test/tier2test.cpp b/unittests/tier2test/tier2test.cpp
new file mode 100644
index 0000000..24e072b
--- /dev/null
+++ b/unittests/tier2test/tier2test.cpp
@@ -0,0 +1,44 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Unit test program for testing of tier2 libraries
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#include "unitlib/unitlib.h"
+#include "filesystem.h"
+#include "tier2/tier2.h"
+#include "mathlib/mathlib.h"
+
+
+//-----------------------------------------------------------------------------
+// Used to connect/disconnect the DLL
+//-----------------------------------------------------------------------------
+class CTier2TestAppSystem : public CTier2AppSystem< IAppSystem >
+{
+ typedef CTier2AppSystem< IAppSystem > BaseClass;
+
+public:
+ virtual bool Connect( CreateInterfaceFn factory )
+ {
+ if ( !BaseClass::Connect( factory ) )
+ return false;
+
+ if ( !g_pFullFileSystem )
+ return false;
+ return true;
+ }
+
+ virtual InitReturnVal_t Init()
+ {
+ MathLib_Init( 2.2f, 2.2f, 0.0f, 2.0f );
+
+ InitReturnVal_t nRetVal = BaseClass::Init();
+ if ( nRetVal != INIT_OK )
+ return nRetVal;
+
+ return INIT_OK;
+ }
+};
+
+USE_UNITTEST_APPSYSTEM( CTier2TestAppSystem )
diff --git a/unittests/tier2test/tier2test.vpc b/unittests/tier2test/tier2test.vpc
new file mode 100644
index 0000000..4560e44
--- /dev/null
+++ b/unittests/tier2test/tier2test.vpc
@@ -0,0 +1,38 @@
+//-----------------------------------------------------------------------------
+// TIER2TEST.VPC
+//
+// Project Script
+//-----------------------------------------------------------------------------
+
+$Macro SRCDIR "..\.."
+$Macro OUTBINDIR "$SRCDIR\..\game\bin\unittests"
+
+$Include "$SRCDIR\vpc_scripts\source_dll_base.vpc"
+
+$Configuration
+{
+ $Compiler
+ {
+ $PreprocessorDefinitions "$BASE;TIER2TEST_EXPORTS"
+ }
+}
+
+$Project "tier2test"
+{
+ $Folder "Source Files"
+ {
+ $File "tier2test.cpp"
+ }
+
+ $Folder "Header Files"
+ {
+ }
+
+ $Folder "Link Libraries"
+ {
+ $Lib mathlib
+ $Lib unitlib
+ $Lib bitmap
+ $Lib tier2
+ }
+}