BIND 10 #1072: Element::fromJSON accepts "{" (a single opening curly brace)

BIND 10 Development do-not-reply at isc.org
Thu Jun 30 16:35:49 UTC 2011


#1072: Element::fromJSON accepts "{" (a single opening curly brace)
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  jelte
  jinmei                             |                Status:  reviewing
                       Type:         |             Milestone:
  defect                             |  Sprint-20110712
                   Priority:  major  |            Resolution:
                  Component:         |             Sensitive:  0
  configuration                      |           Sub-Project:  Core
                   Keywords:         |  Estimated Difficulty:  0.0
            Defect Severity:  N/A    |           Total Hours:  0
Feature Depending on Ticket:         |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
Changes (by stephen):

 * owner:  stephen => jelte


Comment:

 A couple of minor points:

 '''src/lib/cc/data.cc'''
 {{{
     if (c == EOF) {
         throwJSONError(std::string("Unterminated map, <string> or }
 expected"), file, line, pos);
     }
     if (c == '}') {
         // empty map, skip closing curly
         c = in.get();
     } else {
 }}}
 As the both the "if" tests check "c" (which isn't altered by the first
 one), the second "if" might look better stylistically as an "else if".

 '''src/lib/cc/tests/data_unittests.cc'''
 The description says that the first EXPECT_THROW fails with a "{" but
 works with a "[", which indicates that both those cases should be tested.
 (We should also test that interchanging braces and square brackets is
 invalid, e.g. that {{{ {"a", "b"} }}} and {{{ [ "a": 1, "b": 2 ] }}} are
 invalid.)

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


More information about the bind10-tickets mailing list