Add the following test to jsontests.cpp
class BinData80 : public Base {
virtual BSONObj bson() const
{
char z[ 3 ];
z[ 0 ] = 'a';
z[ 1 ] = 'b';
z[ 2 ] = 'c';
BSONObjBuilder b;
b.appendBinData( "a", 3, bdtCustom, z );
return b.obj();
}
virtual string json() const {
return "{ \"a\" :
{ \"$binary\" : \"YWJj\", \"$type\" : \"80\" }
}";
}
};
and you get the error
JsonTests::FromJsonTests::BinData80 std::exception: code FailedToParse: FailedToParse: Argument of $type in $bindata object must be a hex string representation of a single byte: offset:50 in test JsonTests::FromJsonTests::BinData80