[SERVER-1259] replace "assert" with "verify" Created: 19/Jun/10  Updated: 12/Jul/16  Resolved: 26/Mar/12

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 2.1.1

Type: Bug Priority: Major - P3
Reporter: Johannes Wienke Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Independent of linux or windows.


Operating System: ALL
Participants:

 Description   

Current nightly build redefines assert in assert_util.h:

#ifdef assert
#undef assert
#endif

#define MONGO_assert(Expression) (void)( (!!(_Expression)) || (mongo::asserted(#_Expression, __FILE, __LINE_), 0) )
#define assert MONGO_assert

This may break compilation because the redefinition doesn't always behave like e.g. the gcc linux implementation. asert_util.h is included thorugh dbclient.h etc., so the redefinition affects client applications. I had to change the include order to get back the normal assert behaviour.



 Comments   
Comment by auto [ 26/Mar/12 ]

Author:

{u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: fail to build if you use a bare assert SERVER-1259
Branch: master
https://github.com/mongodb/mongo/commit/87a4604930a9f4e2324bf5d5ccbec106d2a84e7f

Comment by auto [ 26/Mar/12 ]

Author:

{u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: fix --dd build after assert change SERVER-1259
Branch: master
https://github.com/mongodb/mongo/commit/72fb624f068b0f156d1ba95317ba8656f6a67988

Comment by auto [ 26/Mar/12 ]

Author:

{u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: replace assert with verify SERVER-1259
Branch: master
https://github.com/mongodb/mongo/commit/bd6d0c99195e324e14390205e2bc6ff88c01e365

Comment by auto [ 26/Mar/12 ]

Author:

{u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: SERVER-1259 removing some of the verify calls with error messages before replacing all assert with verify batch 3
Branch: master
https://github.com/mongodb/mongo/commit/a56eef7bd9a5d390182ea64118e11420b052a380

Comment by auto [ 26/Mar/12 ]

Author:

{u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: SERVER-1259 removing some of the verify calls with error messages before replacing all assert with verify batch 2
Branch: master
https://github.com/mongodb/mongo/commit/136c74632c10224b48c76d4861b0f56c7af2d851

Comment by auto [ 26/Mar/12 ]

Author:

{u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: SERVER-1259 removing some of the verify calls with error messages before replacing all assert with verify
Branch: master
https://github.com/mongodb/mongo/commit/8a4b1033064057929f8bf69b0220f1aa3a82ce88

Comment by auto [ 26/Mar/12 ]

Author:

{u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: SERVER-1259: Replace verify-with-code to assert.
Branch: master
https://github.com/mongodb/mongo/commit/a1c41fa4cc8b909bbcd703da0d0e65a3c7912fbb

Comment by auto [ 26/Mar/12 ]

Author:

{u'login': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@10gen.com'}

Message: SERVER-1259: Another batch of replacing "verify" with "assert" and getting rid of the error code.

To be followed with a bulk replace of "assert" with "verify" after the error codes are gone.
Branch: master
https://github.com/mongodb/mongo/commit/85f5e091eeac1a15a948dd510fcfb4c4c95660b1

Comment by Eliot Horowitz (Inactive) [ 30/May/11 ]

We are starting to use verify internally, but won't wholesale replace until 2.1

Comment by auto [ 30/May/11 ]

Author:

{u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: add verify( <code> , <test> ) SERVER-1259
Branch: master
https://github.com/mongodb/mongo/commit/510347df13244344ba4d4ea476cd4bbc4bac0239

Generated at Thu Feb 08 02:56:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.