#include "pifile.h"

#include "gtest/gtest.h"

TEST(PIFile_Test, openTemporary) {
	const auto ba = PIByteArray::fromHex("AABBCC");
	PIFile f;
	ASSERT_TRUE(f.openTemporary());
	ASSERT_TRUE(f.path().isNotEmpty());
	ASSERT_EQ(ba.size(), f.write(ba));
	ASSERT_EQ(ba, f.readAll());
	ASSERT_TRUE(f.close());
}

