Files
textmate/Frameworks/io/tests/t_xattr.cc
2013-02-22 15:55:28 +01:00

13 lines
684 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#include <io/path.h>
void test_xattr ()
{
// This isnt a test per se, its more to keep the code around that tests volume capabilities (which is something we presently do anywhere in Avian).
struct statfs buf;
struct { u_int32_t length; vol_capabilities_attr_t attr; } attrBuf;
OAK_ASSERT_EQ(statfs(path::home().c_str(), &buf), 0);
OAK_ASSERT_EQ(getattrlist(buf.f_mntonname, &(attrlist){ ATTR_BIT_MAP_COUNT, 0, 0, ATTR_VOL_INFO|ATTR_VOL_CAPABILITIES, 0, 0, 0 }, &attrBuf, sizeof(attrBuf), 0), 0);
OAK_ASSERT_EQ(attrBuf.length, sizeof(attrBuf));
OAK_ASSERT_EQ(attrBuf.attr.capabilities[VOL_CAPABILITIES_INTERFACES] & VOL_CAP_INT_EXCHANGEDATA, VOL_CAP_INT_EXCHANGEDATA);
}