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

Make NamespaceString override the stringifyForAssert for assert

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • Server Serverless 2023-06-12
    • 1

      When we make NamespaceString::toString() private, the unitest code `ASSERT_EQ(nss1, nss2)` get compile error like this:

      C:\data\mci\5b1328debd0837979a36f1bb84db036f\src\src\mongo/unittest/stringify.h(147,1): error C2248: 'mongo::NamespaceString::toString': cannot access private member declared in class 'mongo::NamespaceString'
      [2023/06/02 01:35:12.657]         return x.toString();
      [2023/06/02 01:35:12.657] ^
      [2023/06/02 01:35:12.657] C:\data\mci\5b1328debd0837979a36f1bb84db036f\src\src\mongo/db/namespace_string.h(861): note: see declaration of 'mongo::NamespaceString::toString'
      [2023/06/02 01:35:12.657]     std::string toString() const { 

      To resolve this issue, we are going to make the NamespaceString override the stringifyForAssert. 

            Assignee:
            sophia.tan@mongodb.com Sophia Tan
            Reporter:
            sophia.tan@mongodb.com Sophia Tan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: