[SERVER-25991] WithNullCharacter* test cases in ExpressionSubstrCPTest should use StringData literal Created: 07/Sep/16  Updated: 19/Nov/16  Resolved: 18/Oct/16

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 3.4.0-rc1

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Marko Vojvodic
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-25992 Remove Value(const char* value) const... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 2016-10-31
Participants:

 Description   

The test cases are using the Value(const char*) constructor and truncating the string early at the embedded null byte.

TEST(ExpressionSubstrCPTest, WithNullCharacter) {
    assertExpectedResults("$substrCP", {{{Value("abc\0d"), Value(2), Value(3)}, Value("c\0d")}});
}
 
TEST(ExpressionSubstrCPTest, WithNullCharacterAtEnd) {
    assertExpectedResults("$substrCP", {{{Value("abc\0"), Value(2), Value(2)}, Value("c\0")}});
}



 Comments   
Comment by Githook User [ 18/Oct/16 ]

Author:

{u'username': u'm-vojvodic', u'name': u'Marko Vojvodic', u'email': u'marko.vojvodic@mongodb.com'}

Message: SERVER-25991 Use StringData literal in WithNullCharacter* test cases
Branch: master
https://github.com/mongodb/mongo/commit/60de7a9a84905b0a7f195162715c702658f42346

Generated at Thu Feb 08 04:10:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.