Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 420d47b

Browse files
geoffw0hubwriter
andauthored
Apply suggestions from code review
Co-authored-by: hubwriter <[email protected]>
1 parent 390e61b commit 420d47b

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

cpp/ql/test/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The tests can be run through Visual Studio Code. Advanced users may also use th
88

99
We are keen to have unit tests for all of our QL code.
1010

11-
Every query in `cpp/ql/src` (outside of `cpp/ql/src/experimental`) should have a test in the corresponding subdirectory of `cpp/ql/test/query-tests`. At a minimum, each query test shall contain one case that should be detected by the query, and one related case that should not.
11+
Every query in `cpp/ql/src` (outside of `cpp/ql/src/experimental`) should have a test in the corresponding subdirectory of `cpp/ql/test/query-tests`. At a minimum, each query test should contain one case that should be detected by the query, and one related case that should not.
1212

1313
For example a simple test for the "Memory is never freed" (`cpp/memory-never-freed`) query might contain the following cases:
1414
```
@@ -24,14 +24,14 @@ Features of the QL libraries in `cpp/ql/src` should also have test coverage, in
2424

2525
## Copying code
2626

27-
The contents of `cpp/ql/test` should be original - nothing should be copied from other sources. In particular do not copy-paste C/C++ code from third party projects, your own projects, or the standard C/C++ library implementation of your compiler (regardless of the associated license). As an exception, required declarations may be taken from the following sources where necessary:
27+
The contents of `cpp/ql/test` should be original - nothing should be copied from other sources. In particular do not copy-paste C/C++ code from third-party projects, your own projects, or the standard C/C++ library implementation of your compiler (regardless of the associated license). As an exception, required declarations may be taken from the following sources where necessary:
2828
- ISO/IEC Programming languages - C (all versions)
2929
- ISO/IEC Programming languages - C++ (all versions)
30-
- code from existing queries and tests in this repository
31-
- this includes 'translating QL to C++', that is, writing C/C++ declarations from the information such as parameter names and positions specified in QL classes (when there is enough information to do so).
32-
- code in the public domain
30+
- Code from existing queries and tests in this repository
31+
This includes 'translating QL to C++', that is, writing C/C++ declarations from the information such as parameter names and positions specified in QL classes (when there is enough information to do so).
32+
- Code in the public domain
3333

34-
For example the test above for the "Memory is never freed" (`cpp/memory-never-freed`) query requires the following declarations, taken from Programming languages — C (November 2018):
34+
For example the test above for the "Memory is never freed" (`cpp/memory-never-freed`) query requires the following declarations, taken from [ISO/IEC 9899:2018 - Programming languages - C](https://www.iso.org/standard/74528.html):
3535
```
3636
void *malloc(size_t size);
3737
void free(void *ptr);
@@ -43,7 +43,7 @@ typedef unsigned int size_t;
4343

4444
## Including files
4545

46-
Standard and third party library header files should not be included in tests by means of `#include` or similar mechanisms. This is because the tests should be independent of platform and library versions installed on the running machine. Standard library declarations may be inserted directly where necessary (see the rules in the section above), but it is generally better to avoid using the standard library at all when possible.
46+
Standard and third-party library header files should not be included in tests by means of `#include` or similar mechanisms. This is because the tests should be independent of platform and library versions installed on the running machine. Standard library declarations may be inserted directly where necessary (see the rules in the section above), but it is generally better to avoid using the standard library at all when possible.
4747

4848
`#include` may be used to include files from the same directory within `cpp/ql/test`. For example the test for "Include header files only" (`cpp/include-non-header`) includes other files in the test directory:
4949
```

0 commit comments

Comments
 (0)