Files
textmate/Frameworks/io/tests/t_xattr.cc
Allan Odgaard 9894969e67 Initial commit
2012-08-09 16:25:56 +02:00

17 lines
764 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>
class XattrTests : public CxxTest::TestSuite
{
public:
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;
TS_ASSERT_EQUALS(statfs(path::home().c_str(), &buf), 0);
TS_ASSERT_EQUALS(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);
TS_ASSERT_EQUALS(attrBuf.length, sizeof(attrBuf));
TS_ASSERT_EQUALS(attrBuf.attr.capabilities[VOL_CAPABILITIES_INTERFACES] & VOL_CAP_INT_EXCHANGEDATA, VOL_CAP_INT_EXCHANGEDATA);
}
};