Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-25991

WithNullCharacter* test cases in ExpressionSubstrCPTest should use StringData literal

    • Fully Compatible
    • ALL
    • Query 2016-10-31

      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")}});
      }
      

            Assignee:
            marko.vojvodic@mongodb.com Marko Vojvodic
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: