BIND 10 trac1144, updated. 956e210239d46bebe4574c5ca38b3b51b1bb7c65 [1144] more comparison tests in tests/rdata_ds_like_unittest.cc
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Oct 4 11:43:02 UTC 2011
The branch, trac1144 has been updated
via 956e210239d46bebe4574c5ca38b3b51b1bb7c65 (commit)
via fe76209cd8ad96144f0e2fc9522f5fda1d52d9c3 (commit)
from 0b46c391a973bb8d3f0a1681eb0a79e8a196f0f0 (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 956e210239d46bebe4574c5ca38b3b51b1bb7c65
Author: Dima Volodin <dvv at isc.org>
Date: Tue Oct 4 07:33:55 2011 -0400
[1144] more comparison tests in tests/rdata_ds_like_unittest.cc
commit fe76209cd8ad96144f0e2fc9522f5fda1d52d9c3
Author: Dima Volodin <dvv at isc.org>
Date: Tue Oct 4 07:33:05 2011 -0400
[1144] read instead of peek in rdata/generic/detail/ds_like.h
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/rdata/generic/detail/ds_like.h | 2 +-
src/lib/dns/tests/rdata_ds_like_unittest.cc | 34 ++++++++++++++++++++++++++-
2 files changed, 34 insertions(+), 2 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/rdata/generic/detail/ds_like.h b/src/lib/dns/rdata/generic/detail/ds_like.h
index 1061ece..b5a35cd 100644
--- a/src/lib/dns/rdata/generic/detail/ds_like.h
+++ b/src/lib/dns/rdata/generic/detail/ds_like.h
@@ -87,7 +87,7 @@ public:
RRType(typeCode) << " digest type out of range");
}
- peekc = iss.peek();
+ iss.read(&peekc, 1);
if (!iss.good() || !isspace(peekc, iss.getloc())) {
isc_throw(InvalidRdataText,
RRType(typeCode) << " presentation format error");
diff --git a/src/lib/dns/tests/rdata_ds_like_unittest.cc b/src/lib/dns/tests/rdata_ds_like_unittest.cc
index 95610e1..db25aea 100644
--- a/src/lib/dns/tests/rdata_ds_like_unittest.cc
+++ b/src/lib/dns/tests/rdata_ds_like_unittest.cc
@@ -125,11 +125,43 @@ TYPED_TEST(Rdata_DS_LIKE_Test, toWireBuffer) {
rdata_ds_like.toWire(this->obuffer);
}
+string ds_like_txt1("12892 5 2 F1E184C0E1D615D20EB3C223ACED3B03C773DD952D"
+ "5F0EB5C777586DE18DA6B5");
+// different tag
+string ds_like_txt2("12893 5 2 F1E184C0E1D615D20EB3C223ACED3B03C773DD952D"
+ "5F0EB5C777586DE18DA6B5");
+// different algorithm
+string ds_like_txt3("12892 6 2 F1E184C0E1D615D20EB3C223ACED3B03C773DD952D"
+ "5F0EB5C777586DE18DA6B5");
+// different digest type
+string ds_like_txt4("12892 5 3 F1E184C0E1D615D20EB3C223ACED3B03C773DD952D"
+ "5F0EB5C777586DE18DA6B5");
+// different digest
+string ds_like_txt5("12892 5 2 F2E184C0E1D615D20EB3C223ACED3B03C773DD952D"
+ "5F0EB5C777586DE18DA6B5");
+// different digest length
+string ds_like_txt6("12892 5 2 F2E184C0E1D615D20EB3C223ACED3B03C773DD952D"
+ "5F0EB5C777586DE18DA6B555");
+
TYPED_TEST(Rdata_DS_LIKE_Test, compare) {
// trivial case: self equivalence
EXPECT_EQ(0, TypeParam(ds_like_txt).compare(TypeParam(ds_like_txt)));
- // TODO: need more tests
+ // non-equivalence tests
+ EXPECT_LT(TypeParam(ds_like_txt1).compare(TypeParam(ds_like_txt2)), 0);
+ EXPECT_GT(TypeParam(ds_like_txt2).compare(TypeParam(ds_like_txt1)), 0);
+
+ EXPECT_LT(TypeParam(ds_like_txt1).compare(TypeParam(ds_like_txt3)), 0);
+ EXPECT_GT(TypeParam(ds_like_txt3).compare(TypeParam(ds_like_txt1)), 0);
+
+ EXPECT_LT(TypeParam(ds_like_txt1).compare(TypeParam(ds_like_txt4)), 0);
+ EXPECT_GT(TypeParam(ds_like_txt4).compare(TypeParam(ds_like_txt1)), 0);
+
+ EXPECT_LT(TypeParam(ds_like_txt1).compare(TypeParam(ds_like_txt5)), 0);
+ EXPECT_GT(TypeParam(ds_like_txt5).compare(TypeParam(ds_like_txt1)), 0);
+
+ EXPECT_LT(TypeParam(ds_like_txt1).compare(TypeParam(ds_like_txt6)), 0);
+ EXPECT_GT(TypeParam(ds_like_txt6).compare(TypeParam(ds_like_txt1)), 0);
}
}
More information about the bind10-changes
mailing list