ddnet/src/test
bors[bot] cf6e89c319
Merge #6035
6035: Fix various issues reported by cppcheck static analyser r=def- a=Robyt3

After generating `compile_commands.json` with cmake, I ran [cppcheck](https://cppcheck.sourceforge.io/) like this:

```
cppcheck --project=compile_commands.json -DWIN64 --suppressions-list=cppcheck.supp --enable=all 2>cppcheck.log
```

With these suppressions in `cppcheck.supp`:

```
cstyleCast
useStlAlgorithm
unusedFunction
variableScope
noExplicitConstructor
useInitializationList
noConstructor
uninitMemberVar
uninitMemberVarPrivate
uninitDerivedMemberVar
uninitStructMember
uninitvar
shadowFunction
memleakOnRealloc
internalAstError
virtualCallInConstructor
unknownMacro
noOperatorEq
noCopyConstructor
```

Many of these occur too often or are false positives. 

Here is a list of all remaining non-suppressed issues reported by cppcheck: [cppcheck.log](https://github.com/ddnet/ddnet/files/9997663/cppcheck.log)

And here is a list of all remaining issues including the suppressed ones: [cppcheck_all.log](https://github.com/ddnet/ddnet/files/9997662/cppcheck_all.log)

I couldn't get cppcheck's command line argument to ignore the external folders to work correctly, so I manually removed those entries from the files.

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2022-12-05 20:00:07 +00:00
..
aio.cpp Add override in code behind CONF_DISCORD, disable clang-tidy check 2022-05-18 01:19:35 +02:00
bezier.cpp Move src/game/bezier.cpp/h to src/base/bezier.cpp/h 2022-09-24 20:53:59 +02:00
blocklist_driver.cpp make tests work 2021-05-06 13:10:39 +02:00
bytes_be.cpp Fix modernize-loop-convert in tests 2022-07-10 21:42:57 +02:00
color.cpp Remove unused include from test 2022-05-29 13:10:49 +02:00
compression.cpp Use traditional casts instead of functional-style casts 2022-11-06 11:52:21 +01:00
csv.cpp Run clang-format 2020-09-26 21:50:15 +02:00
datafile.cpp Renamed all shadowing/shadowed variables 2022-03-24 17:59:49 +01:00
fs.cpp Make use of IO_MAX_PATH_LENGTH 2021-09-13 12:14:50 +02:00
git_revision.cpp Use EXPECT_* rather than ASSERT_* in tests 2019-03-12 02:06:54 +01:00
hash.cpp Add tests for overloaded hash operators, use operator instead 2022-11-12 20:36:38 +01:00
huffman.cpp Add tests for Huffman compression 2022-10-25 14:04:50 +02:00
io.cpp Don't flush all files, some improvements to io_sync 2022-02-01 02:33:18 +01:00
jobs.cpp Allow the test suite to run offline 2022-11-01 14:23:53 +01:00
json.cpp Remove /modhelp (fixes #1401) 2018-12-12 10:05:44 +01:00
mapbugs.cpp Remove code for CRC in most places, except where needed for net compat 2020-10-14 17:08:58 +02:00
name_ban.cpp Use std::vector<CNameBan> instead of array 2022-05-27 16:31:18 +02:00
net.cpp Fix receiving IPv6 packets after IPv4 ones on Linux 2022-09-20 01:06:56 +02:00
netaddr.cpp Only announce servers using Steam/Discord integration which are registered 2022-10-09 16:16:54 +02:00
os.cpp Add function to get the OS version 2022-01-31 03:15:19 +01:00
packer.cpp Add tests for int packer 2022-11-06 14:49:40 +01:00
prng.cpp Fix modernize-loop-convert in tests 2022-07-10 21:42:57 +02:00
score.cpp Store ranks in sqlite first to not loose them if server shuts down during stuck mysql transaction 2022-12-05 16:50:25 +01:00
secure_random.cpp Declare variables as const when possible 2022-11-29 23:32:32 +01:00
serverbrowser.cpp Add support for Rust code in DDNet 2022-10-19 23:46:06 +02:00
serverinfo.cpp Remove unused parts of the new serverinfo 2021-05-27 21:48:10 +02:00
str.cpp Add tests for str_utf8_to_skeleton 2022-11-12 20:36:39 +01:00
strip_path_and_extension.cpp Add testing infrastructure for teehistorian 2017-09-28 02:03:30 +02:00
teehistorian.cpp Fix modernize-use-bool-literals 2022-07-10 21:00:40 +02:00
test.cpp More vector naming format 2022-06-15 19:37:37 +02:00
test.h Fix Serverbrowser.PingCache test on Windows 2022-01-31 03:15:19 +01:00
thread.cpp Add test for the CSemaphore wrapper 2022-11-12 20:36:38 +01:00
unix.cpp Add very basic test for Unix sockets 2017-12-20 16:56:44 +01:00
uuid.cpp Allow ParseUuid to report errors and add tests 2021-01-23 01:21:20 +01:00