Hello,
I am trying to make a very basic dice game to try out the functionality of CppUTesting in Eclipse. I have tried to get it to work for about 3 days now and I´m completely stuck.
In this very simple testing program which I copied of off a tutorial. There are 4 Files. One name "Die.cpp", one "DieTest.cpp", one "Die.h" and one named "RunAllTests.cpp". Whenever I try to build the project it doesnt find the "Die.h" header file in the directory, yet they are in the same directory.
I hope that someone can help me out.
Best regards
Bastian Grewe
For more information there is the code I wrote and pictures of the windows explorer with the directory and the error message. If there is any more information I can give for you to properly assess my problem, please just ask :).
Here is the code I wrote:
RunAllTest.cpp
#include <CppUTest/CommandLineTestRunner.h>
int main(int argc, char **argv)
{
return CommandLineTestRunner::RunAllTests(argc, argv);
}
DieTest.cpp
#include <CppUTest/TestHarness.h>
#include "Die.h"
TEST_GROUP(Die)
{
};
TEST(Die, InitialValueAfterCreationIsValid)
{
Die d;
CHECK(d.faceValue()>=1);
CHECK(d.faceValue()<=6);
}
Die.cpp
#include "Die.h"
Die::Die() {
}
Die::~Die() {
}
int Die::faceValue() const
{
return 1; //return one since the value given has to be between 1 and 6 including them in the Test file
}
Die.h
#ifndef DIE_H_
#define DIE_H_
#pragma once
class Die {
public:
Die();
virtual ~Die();
int faceValue() const;
};
#endif
<Screenshot 2023-02-03 142019.png><Screenshot 2023-02-03 142104.png>
--
You received this message because you are subscribed to the Google Groups "cpputest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
cpputest+u...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/cpputest/b60b0094-6580-4147-9f54-7e7cef471d3fn%40googlegroups.com.
<Screenshot 2023-02-03 142104.png><Screenshot 2023-02-03 142019.png>