I try to compile the following code:
#include <cppunit/extensions/HelperMacros.h>
#include "tested.h"
class TestTested : public CppUnit::TestFixture
{
        CPPUNIT_TEST_SUITE(TestTested);
        CPPUNIT_TEST(check_value);
        CPPUNIT_TEST_SUITE_END();
        public:
                void check_value();
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestTested);
void TestTested::check_value() {
        tested t(3);
        int expected_val = t.getValue(); // <----- Line 18.
        CPPUNIT_ASSERT_EQUAL(7, expected_val);
}
As a result I get:
testing.cpp:18:32: Error: void-value is not ignored where it should be
EDDIT
To make the example complete I post the code of the tested.h and tested.cpp:
tested.h
#include <iostream>
using namespace std;
class tested {
    private:
        int x;
    public:
        tested(int int_x);
        void getValue();
};
tested.cpp
#include <iostream>
using namespace std;
tested::tested(int x_inp) {
    x = x_inp;
}
int tested::getValue() {
    return x;
}
 
     
     
     
    