General Purpose library for Freestanding C++ and POSIX systems
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

42 行
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{});