Uncommented a few tests that our Storage Kit implementation passes now.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8696 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -52,9 +52,6 @@ NodeTest::Suite() {
|
|||||||
suite->addTest( new CppUnit::TestCaller<NodeTest>("BNode::Equality Test", &NodeTest::EqualityTest) );
|
suite->addTest( new CppUnit::TestCaller<NodeTest>("BNode::Equality Test", &NodeTest::EqualityTest) );
|
||||||
suite->addTest( new CppUnit::TestCaller<NodeTest>("BNode::Assignment Test", &NodeTest::AssignmentTest) );
|
suite->addTest( new CppUnit::TestCaller<NodeTest>("BNode::Assignment Test", &NodeTest::AssignmentTest) );
|
||||||
suite->addTest( new CppUnit::TestCaller<NodeTest>("BNode::Lock Test"
|
suite->addTest( new CppUnit::TestCaller<NodeTest>("BNode::Lock Test"
|
||||||
#if TEST_OBOS /* !!!POSIX ONLY!!! */
|
|
||||||
" (NOTE: test not actually performed with OpenBeOS Posix libraries)"
|
|
||||||
#endif
|
|
||||||
, &NodeTest::LockTest) );
|
, &NodeTest::LockTest) );
|
||||||
|
|
||||||
return suite;
|
return suite;
|
||||||
@@ -795,7 +792,7 @@ NodeTest::AttrRenameTest(BNode &node)
|
|||||||
const int dataLen = 1024;
|
const int dataLen = 1024;
|
||||||
char data[dataLen];
|
char data[dataLen];
|
||||||
|
|
||||||
node.SetTo("./");
|
CPPUNIT_ASSERT( node.SetTo("./") == B_OK );
|
||||||
|
|
||||||
// Test the case of the first attribute not existing
|
// Test the case of the first attribute not existing
|
||||||
node.RemoveAttr(attr1);
|
node.RemoveAttr(attr1);
|
||||||
@@ -1172,7 +1169,6 @@ NodeTest::LockTest(BNode &node, const char *entryName)
|
|||||||
void
|
void
|
||||||
NodeTest::LockTest()
|
NodeTest::LockTest()
|
||||||
{
|
{
|
||||||
#if !TEST_OBOS /* !!!POSIX ONLY!!! */
|
|
||||||
// uninitialized objects
|
// uninitialized objects
|
||||||
NextSubTest();
|
NextSubTest();
|
||||||
TestNodes testEntries;
|
TestNodes testEntries;
|
||||||
@@ -1190,7 +1186,6 @@ NodeTest::LockTest()
|
|||||||
LockTest(*node, nodeName.c_str());
|
LockTest(*node, nodeName.c_str());
|
||||||
}
|
}
|
||||||
testEntries.delete_all();
|
testEntries.delete_all();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// entry names used in tests
|
// entry names used in tests
|
||||||
|
|||||||
@@ -136,10 +136,7 @@ StatableTest::GetXYZTest()
|
|||||||
#if !TEST_R5 && !TEST_OBOS /* !!!POSIX ONLY!!! */
|
#if !TEST_R5 && !TEST_OBOS /* !!!POSIX ONLY!!! */
|
||||||
CPPUNIT_ASSERT( atime == st.st_atime );
|
CPPUNIT_ASSERT( atime == st.st_atime );
|
||||||
#endif
|
#endif
|
||||||
// OBOS: BVolume::==() is not implemented yet
|
|
||||||
#if !TEST_OBOS /* !!!POSIX ONLY!!! */
|
|
||||||
CPPUNIT_ASSERT( volume == BVolume(st.st_dev) );
|
CPPUNIT_ASSERT( volume == BVolume(st.st_dev) );
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
testEntries.delete_all();
|
testEntries.delete_all();
|
||||||
// test with uninitialized objects
|
// test with uninitialized objects
|
||||||
@@ -200,35 +197,27 @@ StatableTest::SetXYZTest()
|
|||||||
struct stat st;
|
struct stat st;
|
||||||
uid_t owner = 0xdad;
|
uid_t owner = 0xdad;
|
||||||
gid_t group = 0xdee;
|
gid_t group = 0xdee;
|
||||||
// OBOS: no fchmod(), no FD time setters
|
|
||||||
#if !TEST_OBOS /* !!!POSIX ONLY!!! */
|
|
||||||
mode_t perms = 0x0ab; // -w- r-x -wx -- unusual enough? ;-)
|
mode_t perms = 0x0ab; // -w- r-x -wx -- unusual enough? ;-)
|
||||||
time_t mtime = 1234567;
|
time_t mtime = 1234567;
|
||||||
time_t ctime = 654321;
|
time_t ctime = 654321;
|
||||||
#endif
|
|
||||||
// R5: access time unused
|
// R5: access time unused
|
||||||
#if !TEST_R5 && !TEST_OBOS /* !!!POSIX ONLY!!! */
|
#if !TEST_R5 && !TEST_OBOS /* !!!POSIX ONLY!!! */
|
||||||
time_t atime = 2345678;
|
time_t atime = 2345678;
|
||||||
#endif
|
#endif
|
||||||
// OBOS: no fchmod(), no FD time setters
|
|
||||||
CPPUNIT_ASSERT( statable->SetOwner(owner) == B_OK );
|
CPPUNIT_ASSERT( statable->SetOwner(owner) == B_OK );
|
||||||
CPPUNIT_ASSERT( statable->SetGroup(group) == B_OK );
|
CPPUNIT_ASSERT( statable->SetGroup(group) == B_OK );
|
||||||
#if !TEST_OBOS /* !!!POSIX ONLY!!! */
|
|
||||||
CPPUNIT_ASSERT( statable->SetPermissions(perms) == B_OK );
|
CPPUNIT_ASSERT( statable->SetPermissions(perms) == B_OK );
|
||||||
CPPUNIT_ASSERT( statable->SetModificationTime(mtime) == B_OK );
|
CPPUNIT_ASSERT( statable->SetModificationTime(mtime) == B_OK );
|
||||||
CPPUNIT_ASSERT( statable->SetCreationTime(ctime) == B_OK );
|
CPPUNIT_ASSERT( statable->SetCreationTime(ctime) == B_OK );
|
||||||
#endif
|
|
||||||
#if !TEST_R5 && !TEST_OBOS /* !!!POSIX ONLY!!! */
|
#if !TEST_R5 && !TEST_OBOS /* !!!POSIX ONLY!!! */
|
||||||
CPPUNIT_ASSERT( statable->SetAccessTime(atime) == B_OK );
|
CPPUNIT_ASSERT( statable->SetAccessTime(atime) == B_OK );
|
||||||
#endif
|
#endif
|
||||||
CPPUNIT_ASSERT( lstat(entryName.c_str(), &st) == 0 );
|
CPPUNIT_ASSERT( lstat(entryName.c_str(), &st) == 0 );
|
||||||
CPPUNIT_ASSERT( owner == st.st_uid );
|
CPPUNIT_ASSERT( owner == st.st_uid );
|
||||||
CPPUNIT_ASSERT( group == st.st_gid );
|
CPPUNIT_ASSERT( group == st.st_gid );
|
||||||
#if !TEST_OBOS /* !!!POSIX ONLY!!! */
|
|
||||||
CPPUNIT_ASSERT( perms == (st.st_mode & S_IUMSK) );
|
CPPUNIT_ASSERT( perms == (st.st_mode & S_IUMSK) );
|
||||||
CPPUNIT_ASSERT( mtime == st.st_mtime );
|
CPPUNIT_ASSERT( mtime == st.st_mtime );
|
||||||
CPPUNIT_ASSERT( ctime == st.st_crtime );
|
CPPUNIT_ASSERT( ctime == st.st_crtime );
|
||||||
#endif
|
|
||||||
#if !TEST_R5 && !TEST_OBOS /* !!!POSIX ONLY!!! */
|
#if !TEST_R5 && !TEST_OBOS /* !!!POSIX ONLY!!! */
|
||||||
CPPUNIT_ASSERT( atime == st.st_atime );
|
CPPUNIT_ASSERT( atime == st.st_atime );
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -191,6 +191,17 @@ CheckVolume(BVolume &volume, dev_t device, status_t error)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AssertNotBootVolume
|
||||||
|
static
|
||||||
|
void
|
||||||
|
AssertNotBootVolume(const BVolume &volume)
|
||||||
|
{
|
||||||
|
CHK(volume.InitCheck() == B_OK);
|
||||||
|
dev_t bootDevice = dev_for_path("/boot");
|
||||||
|
CHK(bootDevice >= 0);
|
||||||
|
CHK(volume.Device() != bootDevice);
|
||||||
|
}
|
||||||
|
|
||||||
// InitTest1
|
// InitTest1
|
||||||
void
|
void
|
||||||
VolumeTest::InitTest1()
|
VolumeTest::InitTest1()
|
||||||
@@ -361,6 +372,7 @@ VolumeTest::SetNameTest()
|
|||||||
dev_t device = dev_for_path(testMountPoint);
|
dev_t device = dev_for_path(testMountPoint);
|
||||||
BVolume volume(device);
|
BVolume volume(device);
|
||||||
CheckVolume(volume, device, B_OK);
|
CheckVolume(volume, device, B_OK);
|
||||||
|
AssertNotBootVolume(volume);
|
||||||
// set a new name
|
// set a new name
|
||||||
NextSubTest();
|
NextSubTest();
|
||||||
const char *newName = "a new name";
|
const char *newName = "a new name";
|
||||||
|
|||||||
Reference in New Issue
Block a user