Skip to content

Commit

Permalink
STYLE: Change variable name to meet ITK style.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjmjohnson committed May 31, 2024
1 parent 916e064 commit a7d31ec
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions Modules/Video/Core/test/itkTemporalProcessObjectTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ class CallRecord
* Static list of CallRecord items representing the stack trace of
* calls to GenerateData and TemporalStreamingGenerateData
*/
static std::vector<CallRecord> m_CallStack;
static std::vector<CallRecord> processCallStackTraceList;

/**
* \class DummyTemporalDataObject
* Create TemporaDataObject subclass that does nothing, but overrides some
* Create TemporalDataObject subclass that does nothing, but overrides some
* methods to provide debug output
*/
class DummyTemporalDataObject : public TemporalDataObject
Expand Down Expand Up @@ -327,7 +327,7 @@ class DummyTemporalProcessObject : public TemporalProcessObject
TemporalStreamingGenerateData() override
{
// Create a START entry in the stack trace
m_CallStack.emplace_back(
processCallStackTraceList.emplace_back(
m_IdNumber, CallRecord::RecordTypeEnum::START_CALL, CallRecord::MethodTypeEnum::STREAMING_GENERATE_DATA);

// Report
Expand Down Expand Up @@ -369,7 +369,7 @@ class DummyTemporalProcessObject : public TemporalProcessObject
// this->GetOutput()->SetBufferedTemporalRegion(this->GetOutput()->GetRequestedTemporalRegion());

// Create an END entry in the stack trace
m_CallStack.emplace_back(
processCallStackTraceList.emplace_back(
m_IdNumber, CallRecord::RecordTypeEnum::END_CALL, CallRecord::MethodTypeEnum::STREAMING_GENERATE_DATA);
}

Expand Down Expand Up @@ -477,14 +477,14 @@ class DummyTemporalProcessObject : public TemporalProcessObject
GenerateData() override
{
// Create a START entry in the stack trace
m_CallStack.emplace_back(
processCallStackTraceList.emplace_back(
m_IdNumber, CallRecord::RecordTypeEnum::START_CALL, CallRecord::MethodTypeEnum::GENERATE_DATA);

std::cout << "*(ID = " << m_IdNumber << ") - GenerateData" << std::endl;
Superclass::GenerateData();

// Create an END entry in the stack trace
m_CallStack.emplace_back(
processCallStackTraceList.emplace_back(
m_IdNumber, CallRecord::RecordTypeEnum::END_CALL, CallRecord::MethodTypeEnum::GENERATE_DATA);
}

Expand Down Expand Up @@ -633,7 +633,7 @@ itkTemporalProcessObjectTest(int, char *[])
// Test Generation of data

// Call update to execute the entire pipeline and track the call stack
itk::TemporalProcessObjectTest::m_CallStack.clear();
itk::TemporalProcessObjectTest::processCallStackTraceList.clear();
tpo3->Update();

// Print out duration of buffered output region
Expand Down Expand Up @@ -706,21 +706,21 @@ itkTemporalProcessObjectTest(int, char *[])
correctCallStack.emplace_back(3, RecordType::RecordTypeEnum::END_CALL, RecordType::MethodTypeEnum::GENERATE_DATA);

// Check that correct number of calls made
ITK_TEST_EXPECT_EQUAL(itk::TemporalProcessObjectTest::m_CallStack.size(), correctCallStack.size());
ITK_TEST_EXPECT_EQUAL(itk::TemporalProcessObjectTest::processCallStackTraceList.size(), correctCallStack.size());

// Check that call lists match
std::cout << std::endl;
for (SizeValueType i = 0; i < itk::TemporalProcessObjectTest::m_CallStack.size(); ++i)
for (SizeValueType i = 0; i < itk::TemporalProcessObjectTest::processCallStackTraceList.size(); ++i)
{
if (itk::TemporalProcessObjectTest::m_CallStack[i] != correctCallStack[i])
if (itk::TemporalProcessObjectTest::processCallStackTraceList[i] != correctCallStack[i])
{
std::cerr << "Test failed!" << std::endl;
std::cerr << "Error in call stack at index [" << i << "]" << std::endl;
std::cerr << "Expected value ";
correctCallStack[i].Print();
std::cerr << std::endl;
std::cerr << " differs from ";
itk::TemporalProcessObjectTest::m_CallStack[i].Print();
itk::TemporalProcessObjectTest::processCallStackTraceList[i].Print();
return EXIT_FAILURE;
}
}
Expand All @@ -736,33 +736,33 @@ itkTemporalProcessObjectTest(int, char *[])
finalOutput->SetRequestedTemporalRegion(finalRequest);

// Call update to execute the entire pipeline and track the call stack
itk::TemporalProcessObjectTest::m_CallStack.clear();
itk::TemporalProcessObjectTest::processCallStackTraceList.clear();
tpo3->Update();

// Check that correct number of calls made
ITK_TEST_EXPECT_EQUAL(itk::TemporalProcessObjectTest::m_CallStack.size(), correctCallStack.size());
ITK_TEST_EXPECT_EQUAL(itk::TemporalProcessObjectTest::processCallStackTraceList.size(), correctCallStack.size());

// Check that call lists match
std::cout << std::endl;
for (SizeValueType i = 0; i < itk::TemporalProcessObjectTest::m_CallStack.size(); ++i)
for (SizeValueType i = 0; i < itk::TemporalProcessObjectTest::processCallStackTraceList.size(); ++i)
{
if (itk::TemporalProcessObjectTest::m_CallStack[i] != correctCallStack[i])
if (itk::TemporalProcessObjectTest::processCallStackTraceList[i] != correctCallStack[i])
{
std::cerr << "Test failed!" << std::endl;
std::cerr << "Error in call stack at index [" << i << "]" << std::endl;
std::cerr << "Expected value ";
correctCallStack[i].Print();
std::cerr << std::endl;
std::cerr << " differs from ";
itk::TemporalProcessObjectTest::m_CallStack[i].Print();
itk::TemporalProcessObjectTest::processCallStackTraceList[i].Print();
return EXIT_FAILURE;
}
}

// Call Update again and make sure that nothing happens except one call to
// GenerateData at the bottom which doesn't end up needing to do anything

itk::TemporalProcessObjectTest::m_CallStack.clear();
itk::TemporalProcessObjectTest::processCallStackTraceList.clear();
tpo3->Update();

correctCallStack.clear();
Expand All @@ -774,21 +774,21 @@ itkTemporalProcessObjectTest(int, char *[])
correctCallStack.emplace_back(3, RecordType::RecordTypeEnum::END_CALL, RecordType::MethodTypeEnum::GENERATE_DATA);

// Check that correct number of calls made
ITK_TEST_EXPECT_EQUAL(itk::TemporalProcessObjectTest::m_CallStack.size(), correctCallStack.size());
ITK_TEST_EXPECT_EQUAL(itk::TemporalProcessObjectTest::processCallStackTraceList.size(), correctCallStack.size());

// Check that call lists match
std::cout << std::endl;
for (SizeValueType i = 0; i < itk::TemporalProcessObjectTest::m_CallStack.size(); ++i)
for (SizeValueType i = 0; i < itk::TemporalProcessObjectTest::processCallStackTraceList.size(); ++i)
{
if (itk::TemporalProcessObjectTest::m_CallStack[i] != correctCallStack[i])
if (itk::TemporalProcessObjectTest::processCallStackTraceList[i] != correctCallStack[i])
{
std::cerr << "Test failed!" << std::endl;
std::cerr << "Error in call stack at index [" << i << "]" << std::endl;
std::cerr << "Expected value ";
correctCallStack[i].Print();
std::cerr << std::endl;
std::cerr << " differs from ";
itk::TemporalProcessObjectTest::m_CallStack[i].Print();
itk::TemporalProcessObjectTest::processCallStackTraceList[i].Print();
return EXIT_FAILURE;
}
}
Expand Down

0 comments on commit a7d31ec

Please sign in to comment.