Skip to content

Commit

Permalink
updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
merakulix committed Aug 29, 2024
1 parent 1684a1a commit 838fa82
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions tests/unittests/testCTiglPatchShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "BRep_Builder.hxx"

#include "CTiglLogging.h"
#include "testUtils.h"

TEST(CTiglPatchShell, Success)
{
Expand Down Expand Up @@ -122,17 +123,17 @@ TEST(CTiglPatchShell, noSideCaps)
loft.addProfiles(wire1.Shape());
loft.addProfiles(wire2.Shape());

auto temp = tigl::CTiglLogging::Instance().GetConsoleVerbosity();
tigl::CTiglLogging::Instance().SetConsoleVerbosity(TILOG_WARNING);
tigl::CTiglLogging::Instance().LogToConsole();
testing::internal::CaptureStderr();
// Check for warning
{ // Scope to destroy object of type CaptureTiGLLog and therefore reset console verbosity
CaptureTiGLLog t{TILOG_WARNING};

loft.Shape();

tigl::CTiglLogging::Instance().SetConsoleVerbosity(temp);
std::string value = testing::internal::GetCapturedStderr();
//TODO pullrequest Sven-> Klasse nutzen
//call function that returns warning
loft.Shape();

auto logOutput = t.log();

std::string comparisonString = "WARNING: Side caps invalid.";
ASSERT_TRUE((logOutput.find(comparisonString)) != std::string::npos);
} // scope
//#endif
}

0 comments on commit 838fa82

Please sign in to comment.