Skip to content

Commit

Permalink
Updated sequence and sequence tests
Browse files Browse the repository at this point in the history
  • Loading branch information
axsaucedo committed Feb 27, 2021
1 parent f206c62 commit 9788c79
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 39 deletions.
6 changes: 3 additions & 3 deletions src/Sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ Sequence::destroy()
KP_LOG_DEBUG("Kompute Sequence destroy called");

if (!this->mDevice) {
KP_LOG_ERROR("Kompute Sequence destroy called "
KP_LOG_WARN("Kompute Sequence destroy called "
"with null Device pointer");
return;
}

if (this->mFreeCommandBuffer) {
KP_LOG_INFO("Freeing CommandBuffer");
if (!this->mCommandBuffer) {
KP_LOG_ERROR(
KP_LOG_WARN(
"Kompute Sequence destroy called with null "
"CommandPool pointer");
return;
Expand All @@ -199,7 +199,7 @@ Sequence::destroy()
if (this->mFreeCommandPool) {
KP_LOG_INFO("Destroying CommandPool");
if (this->mCommandPool == nullptr) {
KP_LOG_ERROR(
KP_LOG_WARN(
"Kompute Sequence destroy called with null "
"CommandPool pointer");
return;
Expand Down
50 changes: 14 additions & 36 deletions test/TestSequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,18 @@

#include "kompute/Kompute.hpp"

//TEST(TestSequence, CmdBufSequenceBeginEnd)
//{
// kp::Manager mgr;
//
// {
// std::shared_ptr<kp::Sequence> sq =
// mgr.sequence("newSequence");
//
// EXPECT_TRUE(sq->eval());
// EXPECT_TRUE(!sq->isRecording());
// EXPECT_TRUE(sq->begin());
// EXPECT_TRUE(sq->isRecording());
// EXPECT_TRUE(!sq->begin());
// EXPECT_TRUE(sq->isRecording());
// EXPECT_TRUE(sq->end());
// EXPECT_TRUE(!sq->isRecording());
// EXPECT_TRUE(!sq->end());
// EXPECT_TRUE(!sq->isRecording());
// EXPECT_TRUE(sq->eval());
// }
//}
//
//TEST(TestSequence, SequenceDestructorViaManager)
//{
// std::shared_ptr<kp::Sequence> sq = nullptr;
//
// {
// kp::Manager mgr;
//
// sq = mgr.sequence("newSequence");
//
// EXPECT_TRUE(sq->isInit());
// }
//
// EXPECT_FALSE(sq->isInit());
//}
TEST(TestSequence, SequenceDestructorViaManager)
{
std::shared_ptr<kp::Sequence> sq = nullptr;

{
kp::Manager mgr;

sq = mgr.sequence();

EXPECT_TRUE(sq->isInit());
}

EXPECT_FALSE(sq->isInit());
}

0 comments on commit 9788c79

Please sign in to comment.