Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a46f515
commit 9f30f5e
Showing
17 changed files
with
82 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,45 @@ | ||
#include "stdafx.h" | ||
#include "CppUnitTest.h" | ||
|
||
#include "../Light Vox Engine/JobSystem/ConcurrentQueue.h" | ||
|
||
using namespace Microsoft::VisualStudio::CppUnitTestFramework; | ||
|
||
namespace LightVox_UnitTests | ||
{ | ||
TEST_CLASS(UnitTest1) | ||
TEST_CLASS( ConcurrentQueueTests ) | ||
{ | ||
public: | ||
|
||
TEST_METHOD(TestMethod1) | ||
{ | ||
// TODO: Your test code here | ||
Assert::AreEqual( 1, 1 ); | ||
} | ||
|
||
TEST_METHOD( EmplaceTest ) | ||
{ | ||
ConcurrentQueue<int> TestQueue; | ||
size_t addedVals = 2; | ||
int val1 = 10; | ||
int val2 = 15; | ||
//int val3 = 10; | ||
|
||
TestQueue.emplace_front( val1 ); | ||
TestQueue.emplace_front( val2 ); | ||
|
||
int outVal; | ||
TestQueue.pop_front( outVal ); | ||
|
||
// TODO: Your test code here | ||
Assert::AreEqual( outVal, val2 ); | ||
} | ||
|
||
TEST_METHOD( SizeTest ) | ||
{ | ||
ConcurrentQueue<int> TestQueue; | ||
size_t addedVals = 2; | ||
|
||
TestQueue.emplace_front( 10 ); | ||
TestQueue.emplace_front( 15 ); | ||
|
||
Assert::AreEqual( TestQueue.size(), addedVals ); | ||
|
||
} | ||
|
||
}; | ||
} |
Binary file added
BIN
+1.89 KB
LightVox_UnitTests/x64/Debug/LightVox.7F443EDB.tlog/CL.command.1.tlog
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
LightVox_UnitTests/x64/Debug/LightVox.7F443EDB.tlog/LightVox_UnitTests.lastbuildstate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17134.0 | ||
Debug|x64|C:\Git_Fast\light-vox-engine\| |
Binary file added
BIN
+1.98 KB
LightVox_UnitTests/x64/Debug/LightVox.7F443EDB.tlog/LightVox_UnitTests.write.1u.tlog
Binary file not shown.
Binary file added
BIN
+950 Bytes
LightVox_UnitTests/x64/Debug/LightVox.7F443EDB.tlog/link.13628.delete.1.tlog
Binary file not shown.
Binary file added
BIN
+950 Bytes
LightVox_UnitTests/x64/Debug/LightVox.7F443EDB.tlog/link.14092.delete.1.tlog
Binary file not shown.
Binary file added
BIN
+1.59 KB
LightVox_UnitTests/x64/Debug/LightVox.7F443EDB.tlog/link.command.1.tlog
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+666 Bytes
LightVox_UnitTests/x64/Debug/LightVox.7F443EDB.tlog/link.write.1.tlog
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## Unit Testing Guide in Visual C++ | ||
|
||
Here are some steps for doing some basic Unit Testing using Visual C++'s | ||
native framework. | ||
|
||
You will notice that there are not two `vcprocj` files in the solution, the | ||
`Light Vox Engine` and the `LightVox_UnitTests` | ||
|
||
In order to write Unit Tests for your code, there are a few steps simple steps | ||
to take. | ||
|
||
1. Add the existing header and source files to the Unit Testing project if you | ||
need to test a new file. | ||
- Right click on the `Header Files` folder in the Unit Testing project, click | ||
"Add Existing" and add the necessary `.h` file. This is necessary for proper | ||
linking of the test project. | ||
- Right click on the `Source` folder underneath the `Source Files` folder in | ||
the Unit Testing project, and add the necessary `.cpp` file. | ||
2. Create a new `TEST_CLASS` if you are testing a new class that doesn't have any existing unit tests. | ||
3. Write you `TEST_METHOD`s inside that test class! | ||
- There a lot of ways to write your unit tests, but the simplest way is with | ||
the `Assert` functionality. |
Binary file not shown.