Skip to content

Valgrind issue in gtest-printers.cc #1610

@m-chaturvedi

Description

@m-chaturvedi

To reproduce:

#include "gtest/gtest.h"
#include <iostream>
#include <cmath>
#include <functional>
using std::function;

class FooTest : public ::testing::TestWithParam<function<double(double)>> {
        protected:
                virtual void SetUp() {
                }
                virtual void TearDown() {
                }
                double a_;
};


TEST_P(FooTest, Check) {
        a_ = GetParam()(547.0);
}

INSTANTIATE_TEST_CASE_P(
                TestWithParametersC1, FooTest, testing::Values(
                        [](double x) { return std::abs(x); },
                        [](double x) { return std::log(x); }
                        ));

int main(int argc, char **argv) {
        ::testing::InitGoogleTest(&argc, argv);
        return RUN_ALL_TESTS();
}

Output gist

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions