lix/tests/unit/libutil
jade 0cc285f87b
treewide: fix a bunch of lints
Fixes:
- Identifiers starting with _ are prohibited
- Some driveby header dependency cleaning which wound up with doing some
  extra fixups.
- Fucking C style casts, man. C++ made these 1000% worse by letting you
  also do memory corruption with them with references.
  - Remove casts to Expr * where ExprBlackHole is an incomplete type by
    introducing an explicitly-cast eBlackHoleAddr as Expr *.
  - An incredibly illegal cast of the text bytes of the StorePath hash
    into a size_t directly. You can't DO THAT.

    Replaced with actually parsing the hash so we get 100% of the bits
    being entropy, then memcpying the start of the hash. If this shows
    up in a profile we should just make the hash parser faster with a
    lookup table or something sensible like that.
  - This horrendous bit of UB which I thankfully slapped a deprecation
    warning on, built, and it didn't trigger anywhere so it was dead
    code and I just deleted it. But holy crap you *cannot* do that.

    inline void mkString(const Symbol & s)
    {
        mkString(((const std::string &) s).c_str());
    }
- Some wrong lints. Lots of wrong macro lints, one wrong
  suspicious-sizeof lint triggered by the template being instantiated
  with only pointers, but the calculation being correct for both
  pointers and not-pointers.
- Exceptions in destructors strike again. I tried to catch the
  exceptions that might actually happen rather than all the exceptions
  imaginable. We can let the runtime hard-kill it on other exceptions
  imo.

Change-Id: I71761620846cba64d66ee7ca231b20c061e69710
2024-08-26 16:13:03 -07:00
..
canon-path.cc Move tests to separate directories, and document 2023-12-01 13:05:03 -05:00
checked-arithmetic.cc libutil: add checked arithmetic tools 2024-07-13 00:56:37 +02:00
chunked-vector.cc Add pre-commit checks 2024-03-29 22:57:40 -07:00
closure.cc tree-wide: fix a pile of lints 2024-08-08 14:53:17 -07:00
compression.cc BrotliDecompressionSource: don't bail out too early 2024-06-20 09:21:13 +03:00
config.cc Move tests to separate directories, and document 2023-12-01 13:05:03 -05:00
escape-string.cc Add EscapeStringOptions and escapeString tests 2024-04-03 16:25:54 +00:00
fmt.cc abort with a descriptive message on bad HintFmt usage 2024-04-15 23:09:16 +00:00
generator.cc tree-wide: fix a pile of lints 2024-08-08 14:53:17 -07:00
git.cc Add pre-commit checks 2024-03-29 22:57:40 -07:00
hash.cc refactor: make HashType and Base enum classes for type safety 2024-08-08 14:53:17 -07:00
hilite.cc Move tests to separate directories, and document 2023-12-01 13:05:03 -05:00
json-utils.cc fix: nlohmann::adl_serializer for std::optional (#9147) 2024-03-04 07:11:25 +01:00
logging.cc util.hh: Delete remaining file and clean up headers 2024-05-29 12:38:51 +02:00
lru-cache.cc Move tests to separate directories, and document 2023-12-01 13:05:03 -05:00
paths-setting.cc libutil/config: unify path setting types 2024-08-21 17:57:23 +02:00
pool.cc Revert "libutil: drop Pool resources on exceptional free" 2024-04-05 20:13:02 +00:00
references.cc libutil: rewrite RewritingSink as source 2024-07-11 11:39:18 +00:00
serialise.cc libutil: allow construction of sources from generators 2024-07-05 22:28:16 +00:00
shlex.cc Move shell_words into its own file 2024-03-26 16:44:04 -07:00
suggestions.cc Move tests to separate directories, and document 2023-12-01 13:05:03 -05:00
tests.cc tree-wide: fix a pile of lints 2024-08-08 14:53:17 -07:00
url-name.cc getNameFromURL(): Support uppercase characters in attribute names 2024-05-02 12:02:28 -06:00
url.cc treewide: fix a bunch of lints 2024-08-26 16:13:03 -07:00
xml-writer.cc Move tests to separate directories, and document 2023-12-01 13:05:03 -05:00