7#include <gtest/gtest.h>
9#define LFOS_API __attribute__((visibility("default")))
13 #include "../allocator.h"
21 (
reinterpret_cast<size_t*
>(data))[0] =
size;
22 return data+
sizeof(
size_t);
25 size_t* data =
reinterpret_cast<size_t*
>(
reinterpret_cast<uint8_t*
>(ptr) -
sizeof(
size_t));
32 fprintf(stderr,
"Panic() called: %s\n",
message);
43 int count = vsnprintf(buffer, buffer_size,
format, args);
50int main(
int argc,
char* argv[]) {
51 dlopen(NULL, RTLD_NOW | RTLD_NOLOAD | RTLD_GLOBAL);
53 testing::InitGoogleTest(&argc, argv);
55 for(
int i = 1; i < argc; ++i) {
56 if(!dlopen(argv[i], RTLD_NOW)) {
57 char*
error = dlerror();
60 error = (
char*)
"Unknown error";
63 std::cerr <<
"Could not load testlib \"" << argv[i] <<
"\": " <<
error << std::endl;
68 return RUN_ALL_TESTS();
uint16_t size
Size of the loaded file.
int main(int argc, char *argv[])
LFOS_API void panic_message(const char *message)
LFOS_API allocator_t kernel_alloc
LFOS_API uint64_t scheduler_current_process
LFOS_API int ksnprintf(char *buffer, int buffer_size, const char *format,...)
__builtin_va_list va_list
void *(* alloc)(struct allocator *alloc, size_t size)
static bool struct Message * message
static uint16_t bool uint64_t * error