Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package cppcheck for openSUSE:Factory 
checked in at 2022-07-18 18:34:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/cppcheck (Old)
 and      /work/SRC/openSUSE:Factory/.cppcheck.new.1523 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "cppcheck"

Mon Jul 18 18:34:16 2022 rev:26 rq:989720 version:2.8.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/cppcheck/cppcheck.changes        2022-06-08 
14:25:19.700532658 +0200
+++ /work/SRC/openSUSE:Factory/.cppcheck.new.1523/cppcheck.changes      
2022-07-18 18:34:31.981808315 +0200
@@ -1,0 +2,8 @@
+Sun Jul 17 16:14:50 UTC 2022 - Dirk M??ller <dmuel...@suse.com>
+
+- update to 2.8.2:
+  * do not allocate std::string when column is -1
+  * catch internal error during whole program analysis
+  * fix whole program analysis 
+
+-------------------------------------------------------------------

Old:
----
  cppcheck-2.8.tar.gz

New:
----
  cppcheck-2.8.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ cppcheck.spec ++++++
--- /var/tmp/diff_new_pack.AVVRoP/_old  2022-07-18 18:34:32.577809163 +0200
+++ /var/tmp/diff_new_pack.AVVRoP/_new  2022-07-18 18:34:32.581809168 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           cppcheck
-Version:        2.8
+Version:        2.8.2
 Release:        0
 Summary:        A tool for static C/C++ code analysis
 License:        GPL-3.0-or-later

++++++ cppcheck-2.8.tar.gz -> cppcheck-2.8.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cppcheck-2.8/Makefile new/cppcheck-2.8.2/Makefile
--- old/cppcheck-2.8/Makefile   2022-05-21 12:54:19.000000000 +0200
+++ new/cppcheck-2.8.2/Makefile 2022-07-12 23:11:29.000000000 +0200
@@ -213,6 +213,7 @@
 
 TESTOBJ =     test/options.o \
               test/test64bit.o \
+              test/testanalyzerinformation.o \
               test/testassert.o \
               test/testastutils.o \
               test/testautovariables.o \
@@ -582,6 +583,9 @@
 test/test64bit.o: test/test64bit.cpp lib/check.h lib/check64bit.h lib/color.h 
lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h 
lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h 
lib/suppressions.h lib/templatesimplifier.h lib/timer.h lib/token.h 
lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h test/testsuite.h
        $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) 
$(UNDEF_STRICT_ANSI) -c -o test/test64bit.o test/test64bit.cpp
 
+test/testanalyzerinformation.o: test/testanalyzerinformation.cpp 
lib/analyzerinfo.h lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h 
lib/importproject.h lib/platform.h lib/suppressions.h lib/utils.h 
test/testsuite.h
+       $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) 
$(UNDEF_STRICT_ANSI) -c -o test/testanalyzerinformation.o 
test/testanalyzerinformation.cpp
+
 test/testassert.o: test/testassert.cpp lib/check.h lib/checkassert.h 
lib/color.h lib/config.h lib/errorlogger.h lib/errortypes.h lib/importproject.h 
lib/library.h lib/mathlib.h lib/platform.h lib/settings.h lib/standards.h 
lib/suppressions.h lib/templatesimplifier.h lib/timer.h lib/token.h 
lib/tokenize.h lib/tokenlist.h lib/utils.h lib/valueflow.h test/testsuite.h
        $(CXX) ${INCLUDE_FOR_TEST} $(CPPFLAGS) $(CPPFILESDIR) $(CXXFLAGS) 
$(UNDEF_STRICT_ANSI) -c -o test/testassert.o test/testassert.cpp
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cppcheck-2.8/addons/cppcheckdata.py 
new/cppcheck-2.8.2/addons/cppcheckdata.py
--- old/cppcheck-2.8/addons/cppcheckdata.py     2022-05-21 12:54:19.000000000 
+0200
+++ new/cppcheck-2.8.2/addons/cppcheckdata.py   2022-07-12 23:11:29.000000000 
+0200
@@ -1391,7 +1391,10 @@
 
 
 def cmd_output(cmd):
-    try:
-        return subprocess.check_output(cmd).strip().decode('ascii')
-    except subprocess.CalledProcessError as e:
-        return e.output
+    with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
as p:
+        comm = p.communicate()
+        out = comm[0]
+        if p.returncode == 1 and len(comm[1]) > 2:
+            out = comm[1]
+        return out.decode(encoding='utf-8', errors='ignore')
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cppcheck-2.8/addons/misra.py 
new/cppcheck-2.8.2/addons/misra.py
--- old/cppcheck-2.8/addons/misra.py    2022-05-21 12:54:19.000000000 +0200
+++ new/cppcheck-2.8.2/addons/misra.py  2022-07-12 23:11:29.000000000 +0200
@@ -4062,8 +4062,9 @@
                 errmsg = 'misra violation (use --rule-texts=<file> to get 
proper output)'
                 if self.path_premium_addon:
                     for line in 
cppcheckdata.cmd_output([self.path_premium_addon, '--cli', '--get-rule-text=' + 
errorId]).split('\n'):
-                        if not line.startswith('{'):
-                            errmsg = line
+                        if len(line) > 1 and not line.startswith('{'):
+                            errmsg = line.strip()
+                            break
             else:
                 errmsg = 'misra violation %s with no text in the supplied 
rule-texts-file' % (ruleNum)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cppcheck-2.8/cli/cppcheckexecutor.cpp 
new/cppcheck-2.8.2/cli/cppcheckexecutor.cpp
--- old/cppcheck-2.8/cli/cppcheckexecutor.cpp   2022-05-21 12:54:19.000000000 
+0200
+++ new/cppcheck-2.8.2/cli/cppcheckexecutor.cpp 2022-07-12 23:11:29.000000000 
+0200
@@ -122,7 +122,7 @@
 
         if (parser.getShowErrorMessages()) {
             mShowAllErrors = true;
-            std::cout << ErrorMessage::getXMLHeader();
+            std::cout << 
ErrorMessage::getXMLHeader(settings.cppcheckCfgProductName);
             cppcheck->getErrorMessages();
             std::cout << ErrorMessage::getXMLFooter() << std::endl;
         }
@@ -908,7 +908,7 @@
     }
 
     if (settings.xml) {
-        reportErr(ErrorMessage::getXMLHeader());
+        reportErr(ErrorMessage::getXMLHeader(settings.cppcheckCfgProductName));
     }
 
     if (!settings.buildDir.empty()) {
@@ -979,7 +979,12 @@
 
     cppcheck.analyseWholeProgram(mSettings->buildDir, mFiles);
 
-    if (settings.severity.isEnabled(Severity::information) || 
settings.checkConfiguration) {
+    bool suppressUnmatchedSuppressions = false;
+    for (const Suppressions::Suppression& suppression: 
settings.nomsg.getSuppressions()) {
+        if (suppression.errorId == "unmatchedSuppression" && 
suppression.fileName.empty() && suppression.lineNumber == 
Suppressions::Suppression::NO_LINE)
+            suppressUnmatchedSuppressions = true;
+    }
+    if (!suppressUnmatchedSuppressions && 
(settings.severity.isEnabled(Severity::information) || 
settings.checkConfiguration)) {
         const bool enableUnusedFunctionCheck = 
cppcheck.isUnusedFunctionCheckEnabled();
 
         if (settings.jointSuppressionReport) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cppcheck-2.8/cmake/versions.cmake 
new/cppcheck-2.8.2/cmake/versions.cmake
--- old/cppcheck-2.8/cmake/versions.cmake       2022-05-21 12:54:19.000000000 
+0200
+++ new/cppcheck-2.8.2/cmake/versions.cmake     2022-07-12 23:11:29.000000000 
+0200
@@ -1,9 +1,10 @@
 # Version for libraries CPP
-SET(VERSION "2.8")
+SET(VERSION "2.8.2")
 STRING(REGEX MATCHALL "[0-9]" VERSION_PARTS "${VERSION}")
 LIST(GET VERSION_PARTS 0 VERSION_MAJOR)
 LIST(GET VERSION_PARTS 1 VERSION_MINOR)
-SET(SOVERSION "${VERSION_MAJOR}.${VERSION_MINOR}")
+LIST(GET VERSION_PARTS 2 VERSION_BUILD)
+SET(SOVERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}")
 
 # Postfix of so's:
 SET(DLLVERSION "")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cppcheck-2.8/lib/analyzerinfo.cpp 
new/cppcheck-2.8.2/lib/analyzerinfo.cpp
--- old/cppcheck-2.8/lib/analyzerinfo.cpp       2022-05-21 12:54:19.000000000 
+0200
+++ new/cppcheck-2.8.2/lib/analyzerinfo.cpp     2022-07-12 23:11:29.000000000 
+0200
@@ -95,34 +95,36 @@
     return true;
 }
 
+std::string AnalyzerInformation::getAnalyzerInfoFileFromFilesTxt(std::istream& 
filesTxt, const std::string &sourcefile, const std::string &cfg)
+{
+    std::string line;
+    const std::string end(':' + cfg + ':' + Path::simplifyPath(sourcefile));
+    while (std::getline(filesTxt,line)) {
+        if (line.size() <= end.size() + 2U)
+            continue;
+        if (!endsWith(line, end.c_str(), end.size()))
+            continue;
+        return line.substr(0,line.find(':'));
+    }
+    return "";
+}
+
 std::string AnalyzerInformation::getAnalyzerInfoFile(const std::string 
&buildDir, const std::string &sourcefile, const std::string &cfg)
 {
-    const std::string files(buildDir + "/files.txt");
-    std::ifstream fin(files);
+    std::ifstream fin(Path::join(buildDir, "files.txt"));
     if (fin.is_open()) {
-        std::string line;
-        const std::string end(':' + cfg + ':' + sourcefile);
-        while (std::getline(fin,line)) {
-            if (line.size() <= end.size() + 2U)
-                continue;
-            if (!endsWith(line, end.c_str(), end.size()))
-                continue;
-            std::ostringstream ostr;
-            ostr << buildDir << '/' << line.substr(0,line.find(':'));
-            return ostr.str();
-        }
+        const std::string& ret = getAnalyzerInfoFileFromFilesTxt(fin, 
sourcefile, cfg);
+        if (!ret.empty())
+            return Path::join(buildDir, ret);
     }
 
-    std::string filename = Path::fromNativeSeparators(buildDir);
-    if (!endsWith(filename, '/'))
-        filename += '/';
     const std::string::size_type pos = sourcefile.rfind('/');
-    if (pos == std::string::npos)
-        filename += sourcefile;
+    std::string filename;
+    if (pos != std::string::npos)
+        filename = sourcefile;
     else
-        filename += sourcefile.substr(pos+1);
-    filename += ".analyzerinfo";
-    return filename;
+        filename = sourcefile.substr(pos + 1);
+    return Path::join(buildDir, filename) + ".analyzerinfo";
 }
 
 bool AnalyzerInformation::analyzeFile(const std::string &buildDir, const 
std::string &sourcefile, const std::string &cfg, unsigned long long checksum, 
std::list<ErrorMessage> *errors)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cppcheck-2.8/lib/analyzerinfo.h 
new/cppcheck-2.8.2/lib/analyzerinfo.h
--- old/cppcheck-2.8/lib/analyzerinfo.h 2022-05-21 12:54:19.000000000 +0200
+++ new/cppcheck-2.8.2/lib/analyzerinfo.h       2022-07-12 23:11:29.000000000 
+0200
@@ -58,6 +58,8 @@
     void reportErr(const ErrorMessage &msg, bool verbose);
     void setFileInfo(const std::string &check, const std::string &fileInfo);
     static std::string getAnalyzerInfoFile(const std::string &buildDir, const 
std::string &sourcefile, const std::string &cfg);
+protected:
+    static std::string getAnalyzerInfoFileFromFilesTxt(std::istream& filesTxt, 
const std::string &sourcefile, const std::string &cfg);
 private:
     std::ofstream mOutputStream;
     std::string mAnalyzerInfoFile;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cppcheck-2.8/lib/cppcheck.cpp 
new/cppcheck-2.8.2/lib/cppcheck.cpp
--- old/cppcheck-2.8/lib/cppcheck.cpp   2022-05-21 12:54:19.000000000 +0200
+++ new/cppcheck-2.8.2/lib/cppcheck.cpp 2022-07-12 23:11:29.000000000 +0200
@@ -1435,7 +1435,12 @@
         ctuInfoFiles.push_back(getCtuInfoFileName(dumpFileName));
     }
 
-    executeAddons(ctuInfoFiles);
+    try {
+        executeAddons(ctuInfoFiles);
+    } catch (const InternalError& e) {
+        internalError("", "Internal error during whole program analysis: " + 
e.errorMessage);
+        mExitCode = 1;
+    }
 
     for (const std::string &f: ctuInfoFiles) {
         std::remove(f.c_str());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cppcheck-2.8/lib/errorlogger.cpp 
new/cppcheck-2.8.2/lib/errorlogger.cpp
--- old/cppcheck-2.8/lib/errorlogger.cpp        2022-05-21 12:54:19.000000000 
+0200
+++ new/cppcheck-2.8.2/lib/errorlogger.cpp      2022-07-12 23:11:29.000000000 
+0200
@@ -368,7 +368,7 @@
     return true;
 }
 
-std::string ErrorMessage::getXMLHeader()
+std::string ErrorMessage::getXMLHeader(const std::string& productName)
 {
     tinyxml2::XMLPrinter printer;
 
@@ -380,6 +380,8 @@
 
     printer.PushAttribute("version", 2);
     printer.OpenElement("cppcheck", false);
+    if (!productName.empty())
+        printer.PushAttribute("product-name", productName.c_str());
     printer.PushAttribute("version", CppCheck::version());
     printer.CloseElement(false);
     printer.OpenElement("errors", false);
@@ -489,7 +491,7 @@
     std::string::size_type pos = 0;
     while ((pos = line.find('\t', pos)) != std::string::npos)
         line[pos] = ' ';
-    return line + endl + std::string((column>0 ? column-1 : column), ' ') + 
'^';
+    return line + endl + std::string((column>0 ? column-1 : 0), ' ') + '^';
 }
 
 static void replaceColors(std::string& source)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cppcheck-2.8/lib/errorlogger.h 
new/cppcheck-2.8.2/lib/errorlogger.h
--- old/cppcheck-2.8/lib/errorlogger.h  2022-05-21 12:54:19.000000000 +0200
+++ new/cppcheck-2.8.2/lib/errorlogger.h        2022-07-12 23:11:29.000000000 
+0200
@@ -160,7 +160,7 @@
      */
     std::string toXML() const;
 
-    static std::string getXMLHeader();
+    static std::string getXMLHeader(const std::string& productName);
     static std::string getXMLFooter();
 
     /**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cppcheck-2.8/lib/path.cpp 
new/cppcheck-2.8.2/lib/path.cpp
--- old/cppcheck-2.8/lib/path.cpp       2022-05-21 12:54:19.000000000 +0200
+++ new/cppcheck-2.8.2/lib/path.cpp     2022-07-12 23:11:29.000000000 +0200
@@ -242,3 +242,11 @@
     std::ifstream f(file.c_str());
     return f.is_open();
 }
+
+std::string Path::join(std::string path1, std::string path2) {
+    if (path1.empty() || path2.empty())
+        return path1 + path2;
+    if (path2.front() == '/')
+        return path2;
+    return ((path1.back() == '/') ? path1 : (path1 + "/")) + path2;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cppcheck-2.8/lib/path.h new/cppcheck-2.8.2/lib/path.h
--- old/cppcheck-2.8/lib/path.h 2022-05-21 12:54:19.000000000 +0200
+++ new/cppcheck-2.8.2/lib/path.h       2022-07-12 23:11:29.000000000 +0200
@@ -179,6 +179,11 @@
      * @return true if given path is a File
      */
     static bool fileExists(const std::string &file);
+
+    /**
+     * join 2 paths with '/' separators
+     */
+    static std::string join(std::string path1, std::string path2);
 };
 
 /// @}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cppcheck-2.8/lib/version.h 
new/cppcheck-2.8.2/lib/version.h
--- old/cppcheck-2.8/lib/version.h      2022-05-21 12:54:19.000000000 +0200
+++ new/cppcheck-2.8.2/lib/version.h    2022-07-12 23:11:29.000000000 +0200
@@ -8,8 +8,8 @@
 #define STRINGIFY(x) STRING(x)
 #define STRING(VER) #VER
 #if CPPCHECK_MINOR == CPPCHECK_DEVMINOR
-#define CPPCHECK_VERSION_STRING STRINGIFY(CPPCHECK_MAJOR) "." 
STRINGIFY(CPPCHECK_DEVMINOR)
-#define CPPCHECK_VERSION CPPCHECK_MAJOR,CPPCHECK_MINOR,0,0
+#define CPPCHECK_VERSION_STRING STRINGIFY(CPPCHECK_MAJOR) "." 
STRINGIFY(CPPCHECK_DEVMINOR) ".2"
+#define CPPCHECK_VERSION CPPCHECK_MAJOR,CPPCHECK_MINOR,1,0
 #else
 #define CPPCHECK_VERSION_STRING STRINGIFY(CPPCHECK_MAJOR) "." 
STRINGIFY(CPPCHECK_DEVMINOR) " dev"
 #define CPPCHECK_VERSION CPPCHECK_MAJOR,CPPCHECK_MINOR,99,0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cppcheck-2.8/test/testanalyzerinformation.cpp 
new/cppcheck-2.8.2/test/testanalyzerinformation.cpp
--- old/cppcheck-2.8/test/testanalyzerinformation.cpp   1970-01-01 
01:00:00.000000000 +0100
+++ new/cppcheck-2.8.2/test/testanalyzerinformation.cpp 2022-07-12 
23:11:29.000000000 +0200
@@ -0,0 +1,43 @@
+/*
+ * Cppcheck - A tool for static C/C++ code analysis
+ * Copyright (C) 2007-2022 Cppcheck team.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include "analyzerinfo.h"
+#include "testsuite.h"
+#include <sstream>
+
+class TestAnalyzerInformation : public TestFixture, private 
AnalyzerInformation {
+public:
+    TestAnalyzerInformation() : TestFixture("TestAnalyzerInformation") {}
+
+private:
+
+    void run() override {
+        TEST_CASE(getAnalyzerInfoFile);
+    }
+
+    void getAnalyzerInfoFile() const {
+        const char filesTxt[] = "file1.a4::file1.c\n";
+        std::istringstream f1(filesTxt);
+        ASSERT_EQUALS("file1.a4", getAnalyzerInfoFileFromFilesTxt(f1, 
"file1.c", ""));
+        std::istringstream f2(filesTxt);
+        ASSERT_EQUALS("file1.a4", getAnalyzerInfoFileFromFilesTxt(f2, 
"./file1.c", ""));
+    }
+};
+
+REGISTER_TEST(TestAnalyzerInformation)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cppcheck-2.8/test/testerrorlogger.cpp 
new/cppcheck-2.8.2/test/testerrorlogger.cpp
--- old/cppcheck-2.8/test/testerrorlogger.cpp   2022-05-21 12:54:19.000000000 
+0200
+++ new/cppcheck-2.8.2/test/testerrorlogger.cpp 2022-07-12 23:11:29.000000000 
+0200
@@ -192,7 +192,7 @@
         header += "    <cppcheck version=\"";
         header += CppCheck::version();
         header += "\"/>\n    <errors>";
-        ASSERT_EQUALS(header, ErrorMessage::getXMLHeader());
+        ASSERT_EQUALS(header, ErrorMessage::getXMLHeader(""));
         ASSERT_EQUALS("    </errors>\n</results>", 
ErrorMessage::getXMLFooter());
         std::string message("        <error id=\"errorId\" 
severity=\"error\"");
         message += " msg=\"Programming error.\" verbose=\"Verbose error\">\n";
@@ -208,7 +208,7 @@
         header += "    <cppcheck version=\"";
         header += CppCheck::version();
         header += "\"/>\n    <errors>";
-        ASSERT_EQUALS(header, ErrorMessage::getXMLHeader());
+        ASSERT_EQUALS(header, ErrorMessage::getXMLHeader(""));
         ASSERT_EQUALS("    </errors>\n</results>", 
ErrorMessage::getXMLFooter());
         std::string message("        <error id=\"errorId\" 
severity=\"error\"");
         message += " msg=\"Programming error.\" verbose=\"Verbose error\">\n";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cppcheck-2.8/test/testpath.cpp 
new/cppcheck-2.8.2/test/testpath.cpp
--- old/cppcheck-2.8/test/testpath.cpp  2022-05-21 12:54:19.000000000 +0200
+++ new/cppcheck-2.8.2/test/testpath.cpp        2022-07-12 23:11:29.000000000 
+0200
@@ -37,6 +37,7 @@
         TEST_CASE(is_c);
         TEST_CASE(is_cpp);
         TEST_CASE(get_path_from_filename);
+        TEST_CASE(join);
     }
 
     void removeQuotationMarks() const {
@@ -141,6 +142,14 @@
         ASSERT_EQUALS("a/b/c/", Path::getPathFromFilename("a/b/c/index.h"));
         ASSERT_EQUALS("a/b/c/", Path::getPathFromFilename("a/b/c/"));
     }
+
+    void join() const {
+        ASSERT_EQUALS("a", Path::join("a", ""));
+        ASSERT_EQUALS("a", Path::join("", "a"));
+        ASSERT_EQUALS("a/b", Path::join("a", "b"));
+        ASSERT_EQUALS("a/b", Path::join("a/", "b"));
+        ASSERT_EQUALS("/b", Path::join("a", "/b"));
+    }
 };
 
 REGISTER_TEST(TestPath)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cppcheck-2.8/test/testrunner.vcxproj 
new/cppcheck-2.8.2/test/testrunner.vcxproj
--- old/cppcheck-2.8/test/testrunner.vcxproj    2022-05-21 12:54:19.000000000 
+0200
+++ new/cppcheck-2.8.2/test/testrunner.vcxproj  2022-07-12 23:11:29.000000000 
+0200
@@ -31,6 +31,7 @@
     <ClCompile Include="..\lib\astutils.cpp" />
     <ClCompile Include="options.cpp" />
     <ClCompile Include="test64bit.cpp" />
+    <ClCompile Include="testanalyzerinformation.cpp" />
     <ClCompile Include="testassert.cpp" />
     <ClCompile Include="testastutils.cpp" />
     <ClCompile Include="testautovariables.cpp" />
@@ -313,4 +314,4 @@
   </ItemDefinitionGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets" />
-</Project>
\ No newline at end of file
+</Project>

Reply via email to