Skip to content

Commit

Permalink
test and fix for jeromelebel/MongoHub-Mac#102
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérôme Lebel committed Nov 13, 2013
1 parent 22ee7ea commit 7a94a84
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/MODServer_utils.m
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ + (id)objectFromBsonIterator:(bson_iterator *)iterator
result = [NSNumber numberWithBool:bson_iterator_bool(iterator) == true];
break;
case BSON_DATE:
result = [NSDate dateWithTimeIntervalSince1970:bson_iterator_date(iterator) / 1000];
result = [NSDate dateWithTimeIntervalSince1970:bson_iterator_date(iterator) / 1000.0];
break;
case BSON_NULL:
result = [NSNull null];
Expand Down
1 change: 1 addition & 0 deletions mongo-test/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ static void testJson()
NSError *error;
id value;

testObjects(@"{\"someDate\":{\"$date\":1384297199999.000000}}", nil, [MODSortedMutableDictionary sortedDictionaryWithObjectsAndKeys:[NSDate dateWithTimeIntervalSince1970:1384297199.999], @"someDate", nil]);
testObjects(@"{\"minkey\":{\"$minKey\":1}}", nil, [MODSortedMutableDictionary sortedDictionaryWithObjectsAndKeys:[[[MODMinKey alloc] init] autorelease], @"minkey", nil]);
testObjects(@"{\"maxkey\":{\"$maxKey\":1}}", nil, [MODSortedMutableDictionary sortedDictionaryWithObjectsAndKeys:[[[MODMaxKey alloc] init] autorelease], @"maxkey", nil]);
testObjects(@"{\"number\":16.039199999999993906}", nil, [MODSortedMutableDictionary sortedDictionaryWithObjectsAndKeys:[NSNumber numberWithDouble:16.039199999999994], @"number", nil]);
Expand Down

0 comments on commit 7a94a84

Please sign in to comment.