From e1ac7a13a287379054dc7652b0e068215511f40c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Mart=C3=ADn=20Sotuyo=20Dodero?= Date: Thu, 18 Apr 2024 00:54:29 -0300 Subject: [PATCH] Remove multiple occurrence test from cpp - This is superceded by a generic test in pmd-core --- .../pmd/lang/cpp/cpd/CppCpdTest.java | 17 ----------------- .../cpp/cpd/testdata/multipleExactMatches.c | 12 ------------ 2 files changed, 29 deletions(-) delete mode 100644 pmd-cpp/src/test/resources/net/sourceforge/pmd/lang/cpp/cpd/testdata/multipleExactMatches.c diff --git a/pmd-cpp/src/test/java/net/sourceforge/pmd/lang/cpp/cpd/CppCpdTest.java b/pmd-cpp/src/test/java/net/sourceforge/pmd/lang/cpp/cpd/CppCpdTest.java index 7285c35e2d..635613908e 100644 --- a/pmd-cpp/src/test/java/net/sourceforge/pmd/lang/cpp/cpd/CppCpdTest.java +++ b/pmd-cpp/src/test/java/net/sourceforge/pmd/lang/cpp/cpd/CppCpdTest.java @@ -39,21 +39,4 @@ public class CppCpdTest { }); } } - - @Test - void testMultipleExactMatches() throws Exception { - CPDConfiguration configuration = new CPDConfiguration(); - configuration.setMinimumTileSize(40); - configuration.setOnlyRecognizeLanguage(CppLanguageModule.getInstance()); - try (CpdAnalysis cpd = CpdAnalysis.create(configuration)) { - cpd.files().addFile(testdir.resolve("multipleExactMatches.c")); - - cpd.performAnalysis(matches -> { - // There should only be 1 duplication, and it should be maximal - assertEquals(1, matches.getMatches().size()); - assertEquals(3, matches.getMatches().get(0).getMarkCount()); - assertEquals(41, matches.getMatches().get(0).getTokenCount()); - }); - } - } } diff --git a/pmd-cpp/src/test/resources/net/sourceforge/pmd/lang/cpp/cpd/testdata/multipleExactMatches.c b/pmd-cpp/src/test/resources/net/sourceforge/pmd/lang/cpp/cpd/testdata/multipleExactMatches.c deleted file mode 100644 index 853655957e..0000000000 --- a/pmd-cpp/src/test/resources/net/sourceforge/pmd/lang/cpp/cpd/testdata/multipleExactMatches.c +++ /dev/null @@ -1,12 +0,0 @@ - -unsigned char _ctype[] = { 3, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4 -}; \ No newline at end of file