Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5912: Start creating unit tests covering the GeometryStore implement…
…ation
- Loading branch information
1 parent
52e15d1
commit e8d8a4c
Showing
4 changed files
with
41 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include "gtest/gtest.h" | ||
|
||
#include "render/GeometryStore.h" | ||
|
||
namespace test | ||
{ | ||
|
||
class NullSyncObjectProvider final : | ||
public render::ISyncObjectProvider | ||
{ | ||
public: | ||
std::size_t invocationCount = 0; | ||
|
||
render::ISyncObject::Ptr createSyncObject() override | ||
{ | ||
++invocationCount; | ||
return {}; | ||
} | ||
|
||
static NullSyncObjectProvider& Instance() | ||
{ | ||
static NullSyncObjectProvider _instance; | ||
return _instance; | ||
} | ||
}; | ||
|
||
TEST(GeometryStore, SyncObjectAcquisition) | ||
{ | ||
render::GeometryStore store(NullSyncObjectProvider::Instance()); | ||
|
||
store.onFrameStart(); | ||
store.onFrameFinished(); | ||
|
||
EXPECT_EQ(NullSyncObjectProvider::Instance().invocationCount, 1) << | ||
"GeometryStore should have acquired one sync object"; | ||
} | ||
|
||
} |
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