summaryrefslogtreecommitdiff
path: root/util/text.cpp
diff options
context:
space:
mode:
authordwight <dwight@10gen.com>2010-06-26 13:32:19 -0400
committerdwight <dwight@10gen.com>2010-06-26 13:32:19 -0400
commit1e9b37b577efc3498880e7def529ea8ec213a082 (patch)
treecd39adf6295e6d1527d3580cbf4ffdd94cddfa84 /util/text.cpp
parent67ca6192833fab75e3e14a219dd47a40ee3b9621 (diff)
downloadmongo-1e9b37b577efc3498880e7def529ea8ec213a082.tar.gz
unit test added
Diffstat (limited to 'util/text.cpp')
-rw-r--r--util/text.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/util/text.cpp b/util/text.cpp
index f64c3e33bf2..f381e01c12d 100644
--- a/util/text.cpp
+++ b/util/text.cpp
@@ -17,8 +17,10 @@
#include "pch.h"
#include "text.h"
+#include "unittest.h"
namespace mongo{
+
inline int leadingOnes(unsigned char c){
if (c < 0x80) return 0;
static const char _leadingOnes[128] = {
@@ -103,4 +105,13 @@ namespace mongo{
#endif
#endif
+
+ struct TextUnitTest : public UnitTest {
+ void run() {
+ assert( parseLL("123") == 123 );
+ assert( parseLL("-123000000000") == -123000000000LL );
+ }
+ } textUnitTest;
+
}
+