Skip to content

Commit

Permalink
test_parscan.cpp: fix occurrences variable
Browse files Browse the repository at this point in the history
  • Loading branch information
vlkale authored Apr 11, 2024
1 parent 88040dc commit 030734b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/sampler/test_parscan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,14 @@ TEST(SamplerTest, ktoEnvVarDefault) {
EXPECT_THAT(output.str(), Not(HasSubstr("KokkosP: sample 15 calling")));

int occurrences = 0;
while (std::string::size_type pos = 0;
(pos = s.find("calling child-begin function", pos)) !=
std::string::npos) {
std::string::size_type pos = 0;
std::string samplerTestOutput(output.str());
std::string target("calling child-begin function");
while ((pos = samplerTestOutput.find(target, pos)) != std::string::npos) {
++occurrences;
pos += target.length();
}

EXPECT_EQ(occurrences, 2);

EXPECT_THAT(output.str(), Not(HasSubstr("KokkosP: FATAL: No child library of "
Expand Down

0 comments on commit 030734b

Please sign in to comment.