Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leaks, datatype, logging facility, documentation, ... #41

Merged
merged 27 commits into from
Mar 6, 2022

Conversation

lcsmuller
Copy link
Collaborator

@lcsmuller lcsmuller commented Mar 6, 2022

What?

  1. Use greatest.h for writing unit tests.
  2. Convert bitmask enumerators to macros and replace enum type with u64bitmask.
  3. Client logging can now be configured without a config.json file.

Why?

  1. Unit tests will greatly benefit spotting regressions before its too late. In the future, a Discord mockup server such as Fosscord or Litecord can be used to make testing more flexible (eg. testing a scenario that requires scaleability).
  2. Per the standard, enums are only guaranteed to be as large as a int - going well over some of Discord's bitwise values (such as Permissions)
  3. See Cant set default prefix at config.json #25

How?

  1. Rewrite rest.c test with greatest.h tools.
  2. Rewrite enumerators as macros and introduce a new FIELD_BITMASK() gencodecs macro.
  3. Concord's logging facility is modular, meaning there is a root logging module that can have N sub-modules linked to it (each module responsible for logging something unique). Client logging couldn't be configured manually because each module had its own copies of configuration values, instead of those being shared among them - this is now fixed.

lcsmuller added 26 commits March 3, 2022 21:10
…enum discord_voice_speaking_flags with u64bitmask
… use lock callback instead of global mutex, use stack counter instead of a global one
@lcsmuller lcsmuller added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Mar 6, 2022
@lcsmuller lcsmuller self-assigned this Mar 6, 2022
@lcsmuller lcsmuller linked an issue Mar 6, 2022 that may be closed by this pull request
@lcsmuller lcsmuller merged commit f12bbb7 into master Mar 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trying to enable logging via functions doesn't work.
1 participant