Clone in a terminal:
#include <cppunit/extensions/HelperMacros.h>
#include "HelloWorld.h"
#include <string>

using namespace std;

class HelloWorldTest : public CPPUNIT_NS::TestFixture
{
  private:
    CPPUNIT_TEST_SUITE( HelloWorldTest );
    CPPUNIT_TEST( test0 );
    CPPUNIT_TEST( test1 );
    CPPUNIT_TEST_SUITE_END();

  public:
    void test0();
    void test1();

};

// Registers the fixture into the 'registry'
CPPUNIT_TEST_SUITE_REGISTRATION( HelloWorldTest );

void HelloWorldTest::test0()
{
  HelloWorld hello;
  string expected("Hello World");
  CPPUNIT_ASSERT_EQUAL(expected, hello.message());
}

void HelloWorldTest::test1()
{
  string expected("Hola Mundo");
  HelloWorld hello(expected);
  CPPUNIT_ASSERT_EQUAL(expected, hello.message());
  expected = "Hello, world!";
  hello.setMessage(expected);
  CPPUNIT_ASSERT_EQUAL(expected, hello.message());

}

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112