Skip to content

Commit

Permalink
Update test_parfor.cpp: fix output
Browse files Browse the repository at this point in the history
  • Loading branch information
vlkale authored Apr 11, 2024
1 parent 877d863 commit 9fa94c5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/sampler/test_parfor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ static const std::vector<std::string> matchers{
/**
* @test This test checks that the tool effectively samples.
*
*/

TEST(SamplerTest, ktoEnvVarDefault) {
//! Initialize @c Kokkos.
Kokkos::initialize();
Expand Down Expand Up @@ -84,9 +84,10 @@ 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();
}
Expand Down

0 comments on commit 9fa94c5

Please sign in to comment.