#NO LOG MESSAGE BEING PRINTED

1 messages · Page 1 of 1 (latest)

scarlet rapids
sturdy axleBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

#

@scarlet rapids

Screenshots!

Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!

scarlet rapids
#
#define BOOST_TEST_MODULE mostEquatorialTestSuite
#include <boost/test/unit_test.hpp>

#include "gpx-parser.h"
#include "track.h"

using namespace GPS;

using std::cout;
using std::endl;

// Set default log level to 'success'
struct InitUnitTests {
    InitUnitTests() {
        boost::unit_test::unit_test_log.set_threshold_level(boost::unit_test::log_successful_tests);
    }
    ~InitUnitTests() {
        // Optionally, you can reset the log level here if needed.
    }
};

// Instantiate the struct to set log level at program startup
static InitUnitTests init;

BOOST_AUTO_TEST_SUITE( MostEquatorialWaypoint )


// Edge Case: fewest possible number of waypoints
BOOST_AUTO_TEST_CASE (ZeroWaypoints)
{
    BOOST_TEST_MESSAGE("Running ZeroWaypoints test case");


    // Arrange
    // need vector of trackpoitns to construct track object
    std::vector<Trackpoint> theTrackPoints = {};
    Track theTrack = Track(theTrackPoints); // need object of track class to test track class, use empty vector to test
    unsigned int expectedNumberOfPoints=0; // number of waypoints function returns unsigned int

    unsigned int actualNumberOfPoints = theTrack.numberOfWaypoints();     //Act

    BOOST_CHECK_EQUAL(expectedNumberOfPoints, actualNumberOfPoints);     //Assert


}


BOOST_AUTO_TEST_SUITE_END()
#

nothing is printed to the qt creator application console how come?

scarlet rapids
#

how do i ensure that my test cases are functioning the way i want it to and passing the function correctly? i need to use meessages or logging right? cus it building correctly is not enough...

warm tartan
#

You can step through the code with a debugger(IIRC QTCreator has a Debug button)

warm tartan
#

Also, you can add --log_level=message to the cli to output them, by default BoostTest only outputs warnings and above, not messages