mirror of https://github.com/OpenMW/openmw.git
Merge branch 'fix_use_after_move' into 'master'
Fix use after move in InfoOrder::insertInfo See merge request OpenMW/openmw!3296macos_ci_fix
commit
23671ced33
@ -0,0 +1,27 @@
|
||||
#include <components/esm3/infoorder.hpp>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
namespace ESM
|
||||
{
|
||||
namespace
|
||||
{
|
||||
struct Value
|
||||
{
|
||||
RefId mId;
|
||||
RefId mPrev;
|
||||
|
||||
Value() = default;
|
||||
Value(const Value&) = delete;
|
||||
Value(Value&&) = default;
|
||||
Value& operator=(const Value&) = delete;
|
||||
Value& operator=(Value&&) = default;
|
||||
};
|
||||
|
||||
TEST(Esm3InfoOrderTest, insertInfoShouldNotCopyValue)
|
||||
{
|
||||
InfoOrder<Value> order;
|
||||
order.insertInfo(Value{}, false);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue