Skip to content

Commit

Permalink
Adding installation test.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Jan 4, 2023
1 parent af6e596 commit 55f65d9
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/installation_tests/find/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
cmake_minimum_required(VERSION 3.15)

project(test_install VERSION 0.1.0 LANGUAGES C)

set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
find_package(xor_singleheader REQUIRED)



file(WRITE main.c "
#include <binaryfusefilter.h>
#include <xorfilter.h>
#include <stdlib.h>
int main() {
uint64_t big_set[3] = {1,2,3};
binary_fuse8_t filter;
bool is_ok = binary_fuse8_allocate(3, &filter);
if(! is_ok ) {
// do something (you have run out of memory)
}
is_ok = binary_fuse8_populate(big_set, 3, &filter);
if(! is_ok ) {
// do something (you have run out of memory)
}
binary_fuse8_contain(big_set[0], &filter); // will be true
binary_fuse8_contain(32132, &filter); // will be false with high probability
binary_fuse8_free(&filter);
return EXIT_SUCCESS;
}")



add_executable(repro main.c)
target_link_libraries(repro PUBLIC xor_singleheader::xor_singleheader)

0 comments on commit 55f65d9

Please sign in to comment.