fix warning tmpnam

This commit is contained in:
2025-08-13 11:17:31 +03:00
parent be2d3c197c
commit 64e142b8c6
4 changed files with 24 additions and 5 deletions

View File

@@ -35,3 +35,4 @@ pip_test(math)
pip_test(core)
pip_test(piobject)
pip_test(client_server pip_client_server)
pip_test(io)

14
tests/io/testpifile.cpp Normal file
View File

@@ -0,0 +1,14 @@
#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());
}