Fixed a bug that caused the testname to not be printed.

This commit is contained in:
2024-06-24 18:23:49 -07:00
parent 6954f51793
commit e04b742954

View File

@@ -1,6 +1,8 @@
/// Josh Unit Test Library
#pragma once
#include <functional>
#include <string>
#include <vector>
@@ -15,7 +17,7 @@ namespace jtest {
// -maxine
struct testdef
{
const std::string& testname;
std::string testname;
const std::function<void()>& callback;
const std::string file; // <- & is not needed here -maxine
int line;
@@ -105,4 +107,5 @@ namespace jtest {
//#define TEST(a, b) jtest::test(a, b, __FILE__, __LINE__);
// Same definition as before essentially, but points to a different function which adds the test to the global vector.
// -maxine
#define TEST(a, b) jtest::definetest(a, b, __FILE__, __LINE__);