CARVIEW |
mongodb / mongo
- Source
- Commits
- Network (68)
- Downloads (68)
- Graphs
-
Branch:
master
click here to add a description
click here to add a homepage
- Switch Branches (8)
-
Switch Tags (68)
- r1.5.4
- r1.5.3
- r1.5.2
- r1.5.1
- r1.5.0
- r1.4.4
- r1.4.3
- r1.4.2
- r1.4.1
- r1.4.0
- r1.3.5
- r1.3.4
- r1.3.3
- r1.3.2
- r1.3.1
- r1.3.0
- r1.2.5
- r1.2.4
- r1.2.3
- r1.2.2
- r1.2.1
- r1.2.0
- r1.1.4
- r1.1.3
- r1.1.2
- r1.1.1
- r1.1.0
- r1.0.1
- r1.0.0
- r0.9.10
- r0.9.9
- r0.9.8
- r0.9.7
- r0.9.6
- r0.9.5
- r0.9.4
- r0.9.3
- r0.9.2
- r0.9.1
- r0.9.0
- r0.8.0
- r0.2.1
- r0.2.0
- r0.1.7_rc1
- r0.1.6_rc1
- r0.1.5_rc1
- r0.1.4_rc1
- r0.1.3_rc1
- r0.1.2_rc1
- r0.1.1_rc1
- r0.1.0_rc4
- r0.1.0_rc3
- r0.1.0_rc2
- r0.1.0_rc1
- r0.0.9_rc1
- r0.0.8_rc1
- r0.0.7_rc4
- r0.0.7_rc3
- r0.0.7_rc2
- r0.0.7_rc1
- r0.0.6_rc1
- r0.0.5_rc2
- r0.0.5_rc1
- r0.0.4_rc3
- r0.0.4_rc2
- r0.0.4_rc1
- r0.0.3
- 0.9.1
- Comments
- Contributors
Comments for mongo


Was the near/far thing a 64 bit thing? I though the near/far dated back to win16 programming?
Regardless, it compiles.

The UTF-8 BOM, signifying nothing, and annoying the hell out of developers and users.

sure.
UnitTest is something that runs at every server startup. so they must very light and fast.
"real" tests should go in dbtests / test binary (or jstests if applicable)
running tests v good idea. see "smoke" page on wiki

Dwight,
Shouldn't we also check the error cases?
I'll confess I'm not running the unit tests on my machine. I'll start doing that.

Test code I used for this.:
#include #include #include namespace mongo { inline void uasserted(int msgid , char* msg) { printf("Msg: %s", msg); exit(4); } /* "user assert". if asserts, user did something wrong, not our code */ #define MONGO_uassert(msgid, msg, expr) (void)( (!!(expr)) || (mongo::uasserted(msgid, msg), 0) ) #define uassert MONGO_uassert inline long long parseLL( const char *n ); // expect that n contains a base ten number and nothing else after it // NOTE win version hasn't been tested directly inline long long parseLL( const char *n ) { long long ret; uassert( 13307, "cannot convert empty string to long long", *n != 0 ); #if !defined(_WIN32) char *endPtr = 0; errno = 0; ret = strtoll( n, &endPtr;, 10 ); uassert( 13305, "could not convert string to long long", *endPtr == 0 && errno == 0 ); #else #if _MSC_VER>=1600 size_t endLen = 0; try { ret = std::stoll( n, &endLen;, 10 ); } catch ( ... ) { endLen = 0; } uassert( 13306, "could not convert string to long long", endLen != 0 && n[ endLen ] == 0 ); #else // stoll() wasn't introduced into VS 2010. char* endPtr = (char *)&n;[strlen(n) - 1]; try { ret = _strtoi64( n, &endPtr;, 10 ); } catch ( ... ) { endPtr = 0; } uassert( 13310, "could not convert string to long long", *endPtr == 0 ); #endif // _MSC_VER >= 16 #endif // !defined(_WIN32) return ret; } } void main () { //printf("_MSC_VER: %d\n", _MSC_VER); char szNumber[] = "999999999"; printf("number '%s': %d\n\n", szNumber, mongo::parseLL(szNumber)); char szNumberWhitespace[] = " 999999999 999"; printf("number '%s': %d\n\n", szNumberWhitespace, mongo::parseLL(szNumberWhitespace)); char szNumberBad[] = "99r9dd999999"; printf("number '%s': %d\n\n", szNumberBad, mongo::parseLL(szNumberBad)); }

The older, more conservative function is _strtoi64()
Fix in https://github.com/zippy1981/mongo/commit/f7b7c07e2a72011b8dbd72d10dcbaa22d8e5fb54
Stackoverflow discussion is in https://stackoverflow.com/questions/3106026/is-there-a-stoll-stroll-string-to-long-long-alternative-in-visual-studio-20/3106060#3106060

stoll() doesn't exist in Visual Studio 2008. I'm installing the windows 7 SDK to see if that will rectify it, but perhaps even being dirty and calling atol() would be better than causing build problems.

Shouldn't the constant MaxBSONObjectSize be used instead? In case one wants to customize the size.

Confirmed that actually worked.

that's an accident. will remove.

Is it necessarily a good idea to have class diagrams in the visual studio projects? These projects will always be an afterthought (and rightly so) to the scons project.

Good to see I'm not the only one improving error messages!

Bravo :)

Looks like a typo here:
https://github.com/mongodb/mongo/commit/2b7eb102159a36129222afa1883ea3b15145e08b#L0R40
See &7 instead of &&


this was just a test.