Cleaned up repo
This commit is contained in:
parent
629d1e657a
commit
1f39fc8366
2
.gitignore
vendored
2
.gitignore
vendored
@ -32,3 +32,5 @@
|
|||||||
*.out
|
*.out
|
||||||
*.app
|
*.app
|
||||||
|
|
||||||
|
# Extras
|
||||||
|
build
|
||||||
|
12
README.md
12
README.md
@ -16,3 +16,15 @@ The program should now be compiled at ./build/bin/proxy-network
|
|||||||
Simply run the program using:
|
Simply run the program using:
|
||||||
|
|
||||||
build/bin/proxy-network
|
build/bin/proxy-network
|
||||||
|
|
||||||
|
## Testing the Project
|
||||||
|
The Unity framework is used for testing
|
||||||
|
|
||||||
|
Build the tests using:
|
||||||
|
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Debug -B build -S .
|
||||||
|
cmake --build build
|
||||||
|
|
||||||
|
Then run the tests using:
|
||||||
|
|
||||||
|
build/bin/testing
|
||||||
|
@ -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)
|
@ -28,7 +28,7 @@
|
|||||||
//= History: KJC (12/29/00) - Genesis (from server.c) =
|
//= History: KJC (12/29/00) - Genesis (from server.c) =
|
||||||
//= HF (01/25/01) - Ported to multi-platform environment =
|
//= 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 files ---------------------------------------------------------
|
||||||
#include <stdio.h> // Needed for printf()
|
#include <stdio.h> // Needed for printf()
|
||||||
@ -301,4 +301,4 @@ void child_proc(int server_s, int client_s)
|
|||||||
close(client_s);
|
close(client_s);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* ----------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------- */
|
||||||
|
28
test/test.cpp
Normal file
28
test/test.cpp
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user