BIND 10 #2679: use value-param tests for database tests, not type-param tests

BIND 10 Development do-not-reply at isc.org
Tue Feb 12 21:29:14 UTC 2013


#2679: use value-param tests for database tests, not type-param tests
-------------------------------------+-------------------------------------
            Reporter:  jinmei        |                        Owner:
                Type:  defect        |  jinmei
            Priority:  medium        |                       Status:
           Component:  data source   |  reviewing
            Keywords:                |                    Milestone:
           Sensitive:  0             |  Sprint-20130219
         Sub-Project:  DNS           |                   Resolution:
Estimated Difficulty:  5             |                 CVSS Scoring:
         Total Hours:  0             |              Defect Severity:  N/A
                                     |  Feature Depending on Ticket:
                                     |          Add Hours to Ticket:  0
                                     |                    Internal?:  0
-------------------------------------+-------------------------------------

Comment (by jinmei):

 Thanks for reviewing the big diff!

 Replying to [comment:7 vorner]:

 > I found some minor things in the branch. I hope I didn't miss anything
 important in the large amount of diff, but it probably couldn't have been
 made shorter.
 >
 > Do the commits `79f65e1240e0104f6d425ce63821e1297b78a3ce` and
 `4792e513f5dc087a6dc5e51f72acf0efd0cc4f37` contain anything but
 reindentation and removal of the `#if 0` lines?

 To be very accurate, there are some other things, but all are
 editorial/style matters anyway:
 - constify
 - position of `++`

 > Is this really true?
 > {{{#!c++
 > /// This is similar to TEST_RECORDS, but the first entry is base32-hex
 encoded
 > /// hash value (which is expected to appear as the first label of NSEC3
 > /// owner names), not an FQDN.
 > }}}

 It's true, but to be specific in case it was misunderstood:

 {{{#!cpp
 TEST_RECORDS[][0] = "www.example.org." // and so on
 TEST_NSEC3_RECORDS[][0] = "0P9MHAVEQVM6T7VBL5LOP2U3T2RP3TOM" // and so on
 }}}

 ...but, I don't understand the rest of the comment.  What's the load
 function?

 > If so, what is the purpose of the split in the load function? That split
 seems to expect a name and takes the first label, but if it's only the
 hash, it should be passed as it is, shouldn't it?

 > Also, I was surprised it is possible to instantiate the tests multiple
 times with different values each time and have only one set of the test
 bodies. Is that really supported by GTEST, or does it work by accident?

 Are you asking about that we have this in database_unittest.cc
 {{{#!cpp
 INSTANTIATE_TEST_CASE_P(, DatabaseClientTest,
 ::testing::Values(&mock_param));
 }}}
 and this in database_sqlite3_unittest.cc?
 {{{#!cpp
 INSTANTIATE_TEST_CASE_P(SQLite3, DatabaseClientTest,
                         ::testing::Values(&sqlite3_param));
 }}}

 If so, I believe this clarifies it:
 http://code.google.com/p/googletest/wiki/V1_5_AdvancedGuide
 #Creating_Value-Parameterized_Abstract_Tests

 > It really seems #1272 can be closed.

 Okay, thanks.

-- 
Ticket URL: <http://bind10.isc.org/ticket/2679#comment:8>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list