BIND 10 trac2575, updated. c9d46273b40b9be9902deaa081be0f1216d287c6 [2575] clarified/corrected some comments for tests.
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Jan 10 17:06:19 UTC 2013
The branch, trac2575 has been updated
via c9d46273b40b9be9902deaa081be0f1216d287c6 (commit)
from 84bc0b71b8c31013d702c206a3fb1b4d1b93e514 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c9d46273b40b9be9902deaa081be0f1216d287c6
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Thu Jan 10 09:05:20 2013 -0800
[2575] clarified/corrected some comments for tests.
also enabled DatabaseClientTest::createZoneRollbackOnExists with the mock
accessor, too (it should have been done but was overlooked).
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/tests/database_unittest.cc | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/tests/database_unittest.cc b/src/lib/datasrc/tests/database_unittest.cc
index a81d4d8..06b3874 100644
--- a/src/lib/datasrc/tests/database_unittest.cc
+++ b/src/lib/datasrc/tests/database_unittest.cc
@@ -4164,15 +4164,14 @@ TYPED_TEST(DatabaseClientTest, createZoneRollbackOnLocked) {
}
TYPED_TEST(DatabaseClientTest, createZoneRollbackOnExists) {
- // skip test for mock (it requires multiple transactions)
- if (this->is_mock_) {
- return;
- }
-
const Name new_name("example.com");
ASSERT_FALSE(this->client_->createZone(this->zname_));
- // createZone started a transaction, but since it failed,
- // it should have been rolled back, and the next attempt should succeed
+
+ // deleteZone started a transaction, but since the zone didn't even exist
+ // the transaction was not committed but should have been rolled back.
+ // The first transaction shouldn't leave any state, lock, etc, that
+ // would hinder the second attempt.
+ this->allowMoreTransaction(true);
ASSERT_TRUE(this->client_->createZone(new_name));
}
@@ -4180,14 +4179,14 @@ TYPED_TEST(DatabaseClientTest, deleteZone) {
// Check the zone currently exists.
EXPECT_EQ(result::SUCCESS, this->client_->findZone(this->zname_).code);
- // Deleting an existing zone; it should work and return false (not
- // previously existent)
+ // Deleting an existing zone; it should work and return true (previously
+ // existed and is now deleted)
EXPECT_TRUE(this->client_->deleteZone(this->zname_));
// Now it's not found by findZone
EXPECT_EQ(result::NOTFOUND, this->client_->findZone(this->zname_).code);
- // And the second call should return false since it now exists
+ // And the second call should return false since it doesn't exist any more
this->allowMoreTransaction(true);
EXPECT_FALSE(this->client_->deleteZone(this->zname_));
}
@@ -4213,8 +4212,10 @@ TYPED_TEST(DatabaseClientTest, deleteZoneRollbackOnNotFind) {
const Name new_name("example.com");
EXPECT_FALSE(this->client_->deleteZone(new_name));
- // deleteZone started a transaction, but since it failed,
- // it should have been rolled back, and the next attempt should succeed
+ // deleteZone started a transaction, but since the zone didn't even exist
+ // the transaction was not committed but should have been rolled back.
+ // The first transaction shouldn't leave any state, lock, etc, that
+ // would hinder the second attempt.
this->allowMoreTransaction(true);
EXPECT_TRUE(this->client_->deleteZone(this->zname_));
}
More information about the bind10-changes
mailing list