Initial commit: PrivateBin API C++ DLL implementation
This commit is contained in:
25
tests/CMakeLists.txt
Normal file
25
tests/CMakeLists.txt
Normal file
@ -0,0 +1,25 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(PrivateBinAPITests)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
# Find the privatebinapi library
|
||||
find_library(PRIVATEBINAPI_LIB privatebinapi
|
||||
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/../build)
|
||||
|
||||
# If not found, build it as part of the project
|
||||
if(NOT PRIVATEBINAPI_LIB)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR}/privatebinapi)
|
||||
set(PRIVATEBINAPI_LIB privatebinapi)
|
||||
endif()
|
||||
|
||||
# Create test executable
|
||||
add_executable(test_basic test_basic.cpp)
|
||||
|
||||
# Link with the privatebinapi library
|
||||
target_link_libraries(test_basic ${PRIVATEBINAPI_LIB})
|
||||
|
||||
# Include directories
|
||||
target_include_directories(test_basic PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../include
|
||||
)
|
||||
15
tests/test_basic.cpp
Normal file
15
tests/test_basic.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
#include "privatebinapi.h"
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
|
||||
int main() {
|
||||
// Test Base58 encoding/decoding
|
||||
std::cout << "Testing Base58 encoding/decoding..." << std::endl;
|
||||
|
||||
// This is just a basic test to verify the API compiles and links
|
||||
// In a real test, we would test actual functionality
|
||||
|
||||
std::cout << "API test completed successfully!" << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user