Initial commit: PrivateBin API C++ DLL implementation

This commit is contained in:
2025-08-28 09:15:47 +02:00
commit 90d9a23dd2
21 changed files with 2053 additions and 0 deletions

25
tests/CMakeLists.txt Normal file
View 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
View 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;
}