Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12476

assert() calls that can't fail because of constant-value arguments

    • Fully Compatible
    • ALL
    • Sharding A (10/09/15), Sharding B (10/30/15), Sharding C (11/20/15)

      There are some assert() calls in jstests/ that will never fail because the first argument is a constant value:

      $ egrep -nirI "assert\s*\(\s*[1-9]\s*," * 
      core/batch_api_ordered.js:117:    assert(1, result.getWriteErrorCount());
      core/batch_api_unordered.js:43:    assert(1, result.getWriteErrorCount());
      core/batch_api_unordered.js:81:    assert(1, result.getWriteErrorCount());
      core/batch_api_unordered.js:115:    assert(3, result.getWriteErrorCount());
      sharding/diffservers1.js:13:assert( 3 , test1.count() );
      sharding/movePrimary1.js:11:    assert( 3 , c.count() );
      sharding/sync7.js:19:	assert( 3, c.count() );
      

      Version: 56e6f5ac4bbff54b95ce956823e4b80fc6769bc9

            Assignee:
            kevin.pulo@mongodb.com Kevin Pulo
            Reporter:
            kamran.khan Kamran K.
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: