Cleaned up repo

This commit is contained in:
2023-09-14 14:20:21 -05:00
parent 629d1e657a
commit 1f39fc8366
5 changed files with 51 additions and 2 deletions
+7
View File
@@ -0,0 +1,7 @@
add_subdirectory(Unity)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
add_executable(testing
./test.cpp
)
set_target_properties(testing PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(testing unity)
+2 -2
View File
@@ -28,7 +28,7 @@
//= History: KJC (12/29/00) - Genesis (from server.c) =
//= HF (01/25/01) - Ported to multi-platform environment =
//=============================================================================
#define WIN // WIN for Windows environment, UNIX for BSD or LINUX env.
#define UNIX // WIN for Windows environment, UNIX for BSD or LINUX env.
//----- Include files ---------------------------------------------------------
#include <stdio.h> // Needed for printf()
@@ -301,4 +301,4 @@ void child_proc(int server_s, int client_s)
close(client_s);
}
#endif
/* ----------------------------------------------------------------------- */
/* ----------------------------------------------------------------------- */
+28
View File
@@ -0,0 +1,28 @@
#include <cassert>
#include <iostream>
int math();
void test_math();
void IsEqual(bool lhs, bool rhs);
int main() {
test_math();
return 0;
}
int math() {
return 2+2;
}
void test_math() {
IsEqual(math(), 4);
IsEqual(math(), 6);
}
void IsEqual(bool lhs, bool rhs) {
if (lhs == rhs) {
std::cout << "Test Success" << std::endl;
} else {
std::cout << "Test Failure" << std::endl;
}
}