Merge remote-tracking branch 'origin/master'

master
wuhaoyang 10 months ago
commit 9e2e3d1f0e
  1. 2
      sonar-keyware-plugins-cxx/src/test/java/com/keyware/sonar/cxx/rules/checkers/NumericalCopyTest.java
  2. 8
      sonar-keyware-plugins-cxx/src/test/resources/com/keyware/sonar/cxx/rules/checkers/NumericalCopyChecker.cc

@ -23,7 +23,7 @@ public class NumericalCopyTest {
SourceFile file = CxxAstScanner.scanSingleInputFile(tester.asInputFile(), checker); SourceFile file = CxxAstScanner.scanSingleInputFile(tester.asInputFile(), checker);
CheckMessagesVerifier.verify(file.getCheckMessages()) CheckMessagesVerifier.verify(file.getCheckMessages())
.next().atLine(15).withMessage("应返回该私有数值的副本") .next().atLine(15).withMessage("应返回该私有数值的副本")
.next().atLine(25).withMessage("应返回该私有数值的副本") .next().atLine(20).withMessage("应返回该私有数值的副本")
.noMore(); .noMore();
} }

@ -15,14 +15,8 @@ public:
return privateArray; // error return privateArray; // error
} }
// 返回的是私有数组的副本
// int getPrivateArrayPtr() {
// return privateArray.data();
// }
// 返回的是私有数组的指针 // 返回的是私有数组的指针
int* getPrivateArrayPtr() { int* getPrivateArrayPtr() {
return privateArray.data(); // error return privateArray.data(); // error
} }
}; }
Loading…
Cancel
Save