Test changes
This commit is contained in:
parent
044b1cb2e1
commit
6ff7c5b43f
@ -1,7 +1,7 @@
|
|||||||
|
add_subdirectory(Unity)
|
||||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
|
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
add_executable(testing
|
add_executable(testing
|
||||||
./test-main.cpp
|
./test.cpp
|
||||||
./test-algorithm.cpp
|
|
||||||
../src/algorithm.cpp
|
|
||||||
)
|
)
|
||||||
set_target_properties(testing PROPERTIES LINKER_LANGUAGE CXX)
|
set_target_properties(testing PROPERTIES LINKER_LANGUAGE CXX)
|
||||||
|
target_link_libraries(testing unity)
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
#include <catch2/catch.hpp>
|
|
||||||
#include "algorithm.hpp"
|
|
||||||
|
|
||||||
TEST_CASE("Adding Graph") {
|
|
||||||
Graph testGraph = ReadInGraph("test/input/graphPosLittle");
|
|
||||||
INFO("Edge is ");
|
|
||||||
for (Edge i : testGraph.vertices.at(1).edges) {
|
|
||||||
INFO(i.destination->nodeNumber << ' ');
|
|
||||||
}
|
|
||||||
//REQUIRE( testGraph.nodeCount > 0 );
|
|
||||||
SECTION( "Vertices" ) {
|
|
||||||
//REQUIRE( testGraph.vertices.at(1).nodeNumber == 1 );
|
|
||||||
//REQUIRE( testGraph.vertices.at(2).nodeNumber == 2 );
|
|
||||||
//REQUIRE( testGraph.vertices.at(3).nodeNumber == 3 );
|
|
||||||
//REQUIRE( testGraph.vertices.at(4).nodeNumber == 4 );
|
|
||||||
//REQUIRE( testGraph.vertices.at(5).nodeNumber == 5 );
|
|
||||||
//REQUIRE( testGraph.vertices.at(6).nodeNumber == 6 );
|
|
||||||
//REQUIRE( testGraph.vertices.at(7).nodeNumber == 7 );
|
|
||||||
//REQUIRE( testGraph.vertices.at(8).nodeNumber == 8 );
|
|
||||||
//REQUIRE( testGraph.vertices.at(9).nodeNumber == 9 );
|
|
||||||
//REQUIRE( testGraph.vertices.at(10).nodeNumber == 10 );
|
|
||||||
}
|
|
||||||
SECTION( "Edges" ) {
|
|
||||||
//std::cout << std::endl;
|
|
||||||
//REQUIRE( testGraph.vertices.at(1).edges.at(1).destination->nodeNumber == 7 );
|
|
||||||
//REQUIRE( testGraph.vertices.at(1).edges.at(2).destination->nodeNumber == 2 );
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,2 +0,0 @@
|
|||||||
#define CATCH_CONFIG_MAIN
|
|
||||||
#include <catch2/catch.hpp>
|
|
24
test/test.cpp
Normal file
24
test/test.cpp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#include "unity.h"
|
||||||
|
#include "unity_internals.h"
|
||||||
|
|
||||||
|
void setUp() { }
|
||||||
|
void tearDown() { }
|
||||||
|
|
||||||
|
void test_SUCCESS(void)
|
||||||
|
{
|
||||||
|
TEST_ASSERT_EQUAL_INT(4, 2+2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_FAILURE(void)
|
||||||
|
{
|
||||||
|
TEST_ASSERT_EQUAL_INT(4, 2+3);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
UNITY_BEGIN();
|
||||||
|
RUN_TEST(test_SUCCESS);
|
||||||
|
RUN_TEST(test_FAILURE);
|
||||||
|
return UNITY_END();
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user