From cc868bc230be2ea503399f24feaa46ab6aa1d690 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 28 Aug 2004 20:20:55 +0000 Subject: [PATCH] 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 --- src/tests/kits/storage/NodeTest.cpp | 7 +------ src/tests/kits/storage/StatableTest.cpp | 11 ----------- src/tests/kits/storage/VolumeTest.cpp | 12 ++++++++++++ 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/tests/kits/storage/NodeTest.cpp b/src/tests/kits/storage/NodeTest.cpp index d93013bb75..36241e9926 100644 --- a/src/tests/kits/storage/NodeTest.cpp +++ b/src/tests/kits/storage/NodeTest.cpp @@ -52,9 +52,6 @@ NodeTest::Suite() { suite->addTest( new CppUnit::TestCaller("BNode::Equality Test", &NodeTest::EqualityTest) ); suite->addTest( new CppUnit::TestCaller("BNode::Assignment Test", &NodeTest::AssignmentTest) ); suite->addTest( new CppUnit::TestCaller("BNode::Lock Test" -#if TEST_OBOS /* !!!POSIX ONLY!!! */ - " (NOTE: test not actually performed with OpenBeOS Posix libraries)" -#endif , &NodeTest::LockTest) ); return suite; @@ -795,7 +792,7 @@ NodeTest::AttrRenameTest(BNode &node) const int dataLen = 1024; char data[dataLen]; - node.SetTo("./"); + CPPUNIT_ASSERT( node.SetTo("./") == B_OK ); // Test the case of the first attribute not existing node.RemoveAttr(attr1); @@ -1172,7 +1169,6 @@ NodeTest::LockTest(BNode &node, const char *entryName) void NodeTest::LockTest() { -#if !TEST_OBOS /* !!!POSIX ONLY!!! */ // uninitialized objects NextSubTest(); TestNodes testEntries; @@ -1190,7 +1186,6 @@ NodeTest::LockTest() LockTest(*node, nodeName.c_str()); } testEntries.delete_all(); -#endif } // entry names used in tests diff --git a/src/tests/kits/storage/StatableTest.cpp b/src/tests/kits/storage/StatableTest.cpp index 74fb32463d..4d4d72d0a3 100644 --- a/src/tests/kits/storage/StatableTest.cpp +++ b/src/tests/kits/storage/StatableTest.cpp @@ -136,10 +136,7 @@ StatableTest::GetXYZTest() #if !TEST_R5 && !TEST_OBOS /* !!!POSIX ONLY!!! */ CPPUNIT_ASSERT( atime == st.st_atime ); #endif -// OBOS: BVolume::==() is not implemented yet -#if !TEST_OBOS /* !!!POSIX ONLY!!! */ CPPUNIT_ASSERT( volume == BVolume(st.st_dev) ); -#endif } testEntries.delete_all(); // test with uninitialized objects @@ -200,35 +197,27 @@ StatableTest::SetXYZTest() struct stat st; uid_t owner = 0xdad; 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? ;-) time_t mtime = 1234567; time_t ctime = 654321; -#endif // R5: access time unused #if !TEST_R5 && !TEST_OBOS /* !!!POSIX ONLY!!! */ time_t atime = 2345678; #endif -// OBOS: no fchmod(), no FD time setters CPPUNIT_ASSERT( statable->SetOwner(owner) == B_OK ); CPPUNIT_ASSERT( statable->SetGroup(group) == B_OK ); -#if !TEST_OBOS /* !!!POSIX ONLY!!! */ CPPUNIT_ASSERT( statable->SetPermissions(perms) == B_OK ); CPPUNIT_ASSERT( statable->SetModificationTime(mtime) == B_OK ); CPPUNIT_ASSERT( statable->SetCreationTime(ctime) == B_OK ); -#endif #if !TEST_R5 && !TEST_OBOS /* !!!POSIX ONLY!!! */ CPPUNIT_ASSERT( statable->SetAccessTime(atime) == B_OK ); #endif CPPUNIT_ASSERT( lstat(entryName.c_str(), &st) == 0 ); CPPUNIT_ASSERT( owner == st.st_uid ); CPPUNIT_ASSERT( group == st.st_gid ); -#if !TEST_OBOS /* !!!POSIX ONLY!!! */ CPPUNIT_ASSERT( perms == (st.st_mode & S_IUMSK) ); CPPUNIT_ASSERT( mtime == st.st_mtime ); CPPUNIT_ASSERT( ctime == st.st_crtime ); -#endif #if !TEST_R5 && !TEST_OBOS /* !!!POSIX ONLY!!! */ CPPUNIT_ASSERT( atime == st.st_atime ); #endif diff --git a/src/tests/kits/storage/VolumeTest.cpp b/src/tests/kits/storage/VolumeTest.cpp index 0bd90bf9bd..db08665df3 100644 --- a/src/tests/kits/storage/VolumeTest.cpp +++ b/src/tests/kits/storage/VolumeTest.cpp @@ -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 void VolumeTest::InitTest1() @@ -361,6 +372,7 @@ VolumeTest::SetNameTest() dev_t device = dev_for_path(testMountPoint); BVolume volume(device); CheckVolume(volume, device, B_OK); + AssertNotBootVolume(volume); // set a new name NextSubTest(); const char *newName = "a new name";