Files
pip/tests/io/testpifile.cpp
andrey 69b22bf95a feat: complete PIP_HAS_* feature guards in code and auto-generate flag summary
Guard PIConnection, thread primitives, PICodeParser and other feature
code behind PIP_HAS_THREADS/PIP_HAS_FILESYSTEM. In CMake generate the
feature flags summary from the single PIP_HAS_FLAGS list (used by the
add_definitions loop as well), default ICU to OFF and make introspection
also require PIP_HAS_SOCKET. Build system/thread test suites only when
the corresponding feature flags are enabled.
2026-08-25 11:14:25 +03:00

16 lines
363 B
C++

#ifdef PIP_HAS_FILESYSTEM
# 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());
}
#endif // PIP_HAS_FILESYSTEM