1 parent
8583a479dd
commit
3851aeb703
42 files changed
+6948
-759
No files matched your search
@@ -0,0 +1,10 @@
|
||||
cmake_minimum_required(VERSION 4.0)
|
||||
project(VoidBinaryConsumer LANGUAGES CXX)
|
||||
|
||||
find_package(Void CONFIG REQUIRED COMPONENTS Binary)
|
||||
|
||||
add_executable(void_binary_consumer main.cpp)
|
||||
target_link_libraries(void_binary_consumer PRIVATE Void::Binary)
|
||||
|
||||
enable_testing()
|
||||
add_test(NAME VoidBinaryConsumer COMMAND void_binary_consumer)
|
||||
@@ -0,0 +1,14 @@
|
||||
#include <Void/Binary/Reader.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <bit>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
int main()
|
||||
{
|
||||
const std::array bytes{std::byte{0x01}, std::byte{0x02}};
|
||||
Void::Binary::Reader reader{bytes};
|
||||
const auto value = reader.read<std::uint16_t>(std::endian::big);
|
||||
return value && *value == 0x0102 ? 0 : 1;
|
||||
}
|
||||
Reference in new issue
Block a user