summaryrefslogtreecommitdiff
path: root/testing/misc_tools.c
AgeCommit message (Collapse)Author
2020-03-14Use spdx license identifier instead of GPL blurb.iphydf
2018-10-16Use `bool` for IPv6 flag in test programs and `DHT_bootstrap`.iphydf
2018-10-09Consistently use camel case enum names.iphydf
Including in tests and implementation files.
2018-09-19Fix typosyangfl
2018-08-26Update copyright to 2018.iphydf
2018-08-20handle libsodium dependency of misc_tools correctly for autotoolszugz (tox)
2018-08-19Add save file generator, save compatibility test, and generate a save fileendoffile78
2018-08-17Set `_POSIX_C_SOURCE` to 200112L. We need it for C99 compat.iphydf
It is invalid to compile an XPG3, XPG4, XPG4v2, or XPG5 application using c99. The same is true for POSIX.1-1990, POSIX.2-1992, POSIX.1b, and POSIX.1c applications. Likewise, it is invalid to compile an XPG6 or a POSIX.1-2001 application with anything other than a c99 or later compiler. Therefore, Solaris libc forces an error in both cases.
2018-08-12Add simple deterministic random number generator for testszugz (tox)
2018-07-21Avoid implementations in .h files or #including .c files.iphydf
Also, avoid the need for putting `_XOPEN_SOURCE` in every test file.
2018-03-16Remove the use of the 'hh' format specifier.iphydf
It's not supported in mingw. See https://github.com/TokTok/c-toxcore/issues/786.
2018-02-24Fix a bunch of compiler warnings and remove suppressions.iphydf
2018-01-30Use nullptr as NULL pointer constant instead of NULL or 0.iphydf
This changes only code, no string literals or comments.
2017-06-05Build tests on appveyor, the MSVC build.iphydf
Tests are not actually ran on appveyor for now, since they all fault for some reason. For now, we just build them. Also, some tests are disabled on msvc entirely, because they don't even compile. We'll need to look into those, later. They are disabled using `MSVC_DONT_BUILD`.
2017-03-25Move c_sleep to helpers.h and misc_tools.hDiadlo
Also fix a mistake with forgotten braces around parameter
2017-03-01Remove dependency on strings.hMaxim Biro
2017-01-19Update license headers and remove redundant file name comment.iphydf
"All rights reserved" was incorrect. The project was licensed under GPL3, which means a lot of rights are licensed to everybody in the world, i.e. not reserved to the "Tox Project".
2017-01-11Remove `TOX_DEBUG` and have asserts always enabled.iphydf
These are cheap asserts. I've also replaced the fprintf's with `LOGGER_ERROR` calls.
2017-01-06Revert "Revert "Portability fixes""David Zero
This reverts commit 59e2a844f04a8725e8079f854158aa86ef5988b2, and defines _DARWIN_C_SOURCE in toxcore/network.c
2017-01-05Revert "Portability fixes"endoffile78
This reverts commit f3469070fe899e8e4fd88665386a55bad9f77cd8.
2017-01-04Portability fixesDavid Zero
- CFLAG gnu99 was changed to c99. - CXXFLAG c++98 was changed to c++11. - CFLAG -pedantic-errors was added so that non-ISO C now throws errors. - _XOPEN_SOURCE feature test macro added and set to 600 to expose SUSv3 and c99 definitions in modules that required them. - Fixed tests (and bootstrap daemon logging) that were failing due to the altered build flags. - Avoid string suffix misinterpretation; explicit narrowing conversion. - Misc. additions to .gitignore to make sure build artifacts don't wind up in version control.
2016-09-24Make toxcore code C++ compatible.iphydf
It is still C code, so still compatible with C compilers as well. This change lets us see more clearly where implicit conversions occur by making them explicit.
2016-09-06Improve static and const correctness.iphydf
- Any non-externally-visible declarations should be `static`. - Casting away the `const` qualifier from pointers-to-const is dangerous. All but one instance of this are now correct. The one instance where we can't keep `const` is one where toxav code actually writes to a chunk of memory marked as `const`. This code also assumes 4 byte alignment of data packets. I don't know whether that is a valid assumption, but it's likely unportable, and *not* obviously correct. - Replaced empty parameter lists with `(void)` to avoid passing parameters to it. Empty parameter lists are old style declarations for unknown number and type of arguments. - Commented out (as `#if DHT_HARDENING` block) the hardening code that was never executed. - Minor style fix: don't use `default` in enum-switches unless the number of enumerators in the default case is very large. In this case, it was 2, so we want to list them both explicitly to be warned about missing one if we add one in the future. - Removed the only two function declarations from nTox.h and put them into nTox.c. They are not used outside and nTox is not a library.
2016-09-06Improve C standard compliance.iphydf
- Don't cast between object and function pointers. - Use standard compliant `__VA_ARGS__` in macros. - Add explicit `__extension__` on unnamed union in struct (it's a GNU extension). - Remove ; after function definitions. - Replace `const T foo = 3;` for integral types `T` with `enum { foo = 3 };`. Folding integral constants like that as compile time constants is a GNU extension. Arrays allocated with `foo` as dimension are VLAs on strictly compliant C99 compilers. - Replace empty initialiser list `{}` with zero-initialiser-list `{0}`. The former is a GNU extension meaning the latter. - Cast `T*` (where `T != void`) to `void *` in format arguments. While any object pointer can be implicitly converted to and from `void *`, this conversion does not happen in variadic function calls. - Replace arithmetic on `void *` with arithmetic on `char *`. The former is non-compliant. - Replace non-`int`-derived types (like `uint16_t`, which is `short`-derived) in bit fields with `int`-derived types. Using any type other than `int` or `unsigned int` (or any of their aliases) in bit fields is a GNU extension.
2016-09-01Sort #includes in all source files.iphydf
2016-08-31Add braces to all if statements.iphydf
2016-08-17Add missing DHT_bootstrap to CMakeLists.txt.iphydf
- This PR also adds a DEBUG cmake option that enables -DTOX_DEBUG. - We also remove `-Wall`, because there are too many warnings, and nobody really looks at them at the moment. We'll see about fixing them soon. We'll also want to enable `-Werror` at some point. - Finally, this PR enables `-O3` to make sure toxcore still works correctly under heavy compiler optimisations.
2014-02-09Astyled and removed some useless files.irungentoo
2014-02-09Fixed buildMaxim Biro
2014-02-09Modified hex_string_to_binMaxim Biro
2013-10-13tox A/V: integration of A/V code into toxmannol
Also-by: Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
2013-09-16Fix warnings of -Wall -WextraCoren[m]
2013-09-14astyled everything.irungentoo
2013-09-11toxcore/util.h:Coren[m]
- moved cmdline_parsefor_ipv46() to testing/misc_tools.c
2013-09-06Allow to build vs nacl instead of libsodiumJin^eLD
By default libsodium is used. Only if --enable-nacl is specified, then nacl will be used instead of libsodium. Pass locations of nacl headers and libraries by using the following options: --with-nacl-headers=/home/me/somewhere/nacl-20110221/build/469/include/amd64/ --with-nacl-libs=/home/me/somewhere/nacl-20110221/build/469/lib/amd64/
2013-08-30Fixed warnings and moved hex_string_to_bin to testing/irungentoo
2013-08-29Moved misc_tools from testing to toxcore.Anony Moose
2013-08-16Passed everything through astyle.irungentoo
2013-08-09Kill EOF whitespace.Christian Brueffer
2013-08-06Added a linked list implementation.Konstantin Kowalski
2013-08-04whoops, returning a free'd variable is really not what I meant...charmlesscoin
2013-08-04Removed memory leak, thanks to diath for spotting it.charmlesscoin
2013-07-27stylingnfkd
2013-07-27[fixed]created new files misc_tools.(c|h) and moved hex_string_to_bin() there.Konstantin Kowalski