summaryrefslogtreecommitdiff
path: root/unittests/tier1test/tier1test.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /unittests/tier1test/tier1test.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'unittests/tier1test/tier1test.cpp')
-rw-r--r--unittests/tier1test/tier1test.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/unittests/tier1test/tier1test.cpp b/unittests/tier1test/tier1test.cpp
new file mode 100644
index 0000000..2dc85d7
--- /dev/null
+++ b/unittests/tier1test/tier1test.cpp
@@ -0,0 +1,47 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Unit test program for testing of tier1 libraries
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#include "unitlib/unitlib.h"
+#include "tier1/tier1.h"
+#include "mathlib/mathlib.h"
+#include "tier1/convar.h"
+#include "vstdlib/iprocessutils.h"
+
+
+//-----------------------------------------------------------------------------
+// Used to connect/disconnect the DLL
+//-----------------------------------------------------------------------------
+class CTier1TestAppSystem : public CTier1AppSystem< IAppSystem >
+{
+ typedef CTier1AppSystem< IAppSystem > BaseClass;
+
+public:
+ virtual bool Connect( CreateInterfaceFn factory )
+ {
+ if ( !BaseClass::Connect( factory ) )
+ 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;
+ }
+
+ virtual void Shutdown()
+ {
+ BaseClass::Shutdown();
+ }
+};
+
+USE_UNITTEST_APPSYSTEM( CTier1TestAppSystem )