General Purpose library for Freestanding C++ and POSIX systems
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

42 lines
1.0 KiB

#include "gp/utils/pointers.hpp"
#include "gp/utils/allocators/arena.hpp"
#include "test_scaffold.h"
#include "allocator.hpp"
#include <memory>
struct unique_ptr_test : public test_scaffold {
uint32_t seed;
unique_ptr_test() {
name = __FILE__ ":1";
}
virtual int run() {
std::unique_ptr<gp::array<char, 4096*4>> store = std::make_unique<gp::array<char, 4096*4>>();
gp::arena alloc{&*store->begin(), store->size()};
auto v = gp::unique_ptr<uint64_t>::make(alloc, 1024);
return !v;
}
};
append_test dummy_45sdf543(new unique_ptr_test{});
struct unique_ptr2_test : public test_scaffold {
uint32_t seed;
unique_ptr2_test() {
name = __FILE__ ":2";
}
virtual int run() {
std::unique_ptr<gp::array<char, 4096*4>> store = std::make_unique<gp::array<char, 4096*4>>();
gp::arena alloc{&*store->begin(), store->size()};
auto v = gp::unique_ptr<std::string>::make(alloc, "1024");
return !(*(v->begin()) == '1' && v);
}
};
append_test dummy_aguhdff543(new unique_ptr2_test{});