summaryrefslogtreecommitdiff
path: root/auto_tests/messenger_test.c
AgeCommit message (Collapse)Author
2016-09-16Ensure that all TODOs have an owner.iphydf
In the future, all TODOs added either need a bug number (TODO(#NN)) or a person's github user name. By default, I made irungentoo the owner of all toxcore TODOs, mannol the owner of toxav TODOs, and myself the owner of API TODOs.
2016-09-09Minor cleanups: header reordering, adding {}.iphydf
I hadn't done this for the "fun" code, yet. Also, we should include system headers after our own headers. "In general, a module should be implemented by one or more .cpp files. Each of these .cpp files should include the header that defines their interface first. This ensures that all of the dependences of the module header have been properly added to the module header itself, and are not implicit. System headers should be included after user headers for a translation unit." -- http://llvm.org/docs/CodingStandards.html#a-public-header-file-is-a-module
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-01Sort #includes in all source files.iphydf
2016-08-31Add braces to all if statements.iphydf
2016-08-27Move logging to a callback.iphydf
This removes the global logger (which by the way was deleted when the first tox was killed, so other toxes would then stop logging). Various bits of the code now carry a logger or pass it around. It's a bit less transparent now, but now there is no need to have a global logger, and clients can decide what to log and where.
2015-10-12Changed gramatically incorrect comment in messenger_testSoumitra
2015-10-09Added ommited words in commentSoumitra
2015-03-18Merged normal message function and send action function into oneirungentoo
messaging function. This removes code duplication and allows us to easily add new message types to the api without having to add new functions.
2015-03-12tox_new now sets error to TOX_ERR_NEW_PORT_ALLOC when binding to port fails.irungentoo
2015-02-25Ported some tests to the new api.irungentoo
2014-08-14UDP can now be disabled.irungentoo
new_messenger() now takes an options struct as an argument.
2014-08-09Remove DEFTESTCASE and DEFTESTCASE_SLOW redefinitionspyruvate
2014-05-02Fixed one test.irungentoo
2014-04-21Fixed a test.irungentoo
Removed function from Messenger.h
2014-02-22fixed build.irungentoo
2014-02-09Fixed memory leaks and removed repeated codeMaxim Biro
2013-12-21Added function to save an encrypted version of the messenger.irungentoo
Also added some tests.
2013-11-10Fixed test.irungentoo
2013-10-23Code cleanups.irungentoo
Fixed some tests.
2013-10-05Broken *_wait() into *_wait_prepare() and *_wait_execute()Coren[m]
To allow the actual waiting to run without any locking, split it into preparing the data it uses and the execution of the wait. The caller must provide with the buffer to store whatever data it requires to wait. Completely eliminates any reliance on the existence of anything but that data in the actual wait routine. Also fixed a few argument type warnings inside LOGGING.
2013-09-27Permit -Wshadow as useful warning.Coren[m]
2013-09-17astyled everything.irungentoo
2013-09-17Tests of state loading/saving lead to two fixes for DHT.c and util.cCoren[m]
util.c: - fix in empty section at the end of the state, showed as bug when having an empty name DHT.c: - fix in saving less data than originally announced, showed as bug when not having reached any clients ever (no clients or only with timestamp of zero)
2013-09-11tox.h, DHT.h:Coren[m]
- tox_bootstrap_ex(), DHT_bootstrap_ex() renamed to tox_bootstrap_from_address(), DHT_bootstrap_from_address() - (handle_)sendnodes_ex() renamed to (handle_)sendnodes_ipv6() - only sending sendnodes_ipv6() if we're actually IPv6 enabled - changed comments to conform better nTox.c, Messenger_text.c, DHT_test.c, DHT_bootstrap.c: - fallout from *_ex() to *_from_address() DHT_bootstrap.c: - corrected a potentially wrong info message util.c: - fixed logfile name: now (funcptr) => now() (number) network.c: - addead comment about the necessity of bind() to succeed auto_test/messenger_test.c: - defaulting ipv6enabled to TOX_ENABLE_IPV6_DEFAULT LAN_discovery.c: - slight cleanup and comments for clarity
2013-09-11Merge remote-tracking branch 'upstream/master' into IntegrationCoren[m]
2013-09-10Fixed building with NaCl.irungentoo
2013-09-09tox.*, Messenger.*:Coren[m]
- initialisation: argument added to enable/disable ipv6 as socket Messenger_test.c: - initialisation: ipv4 hardcoded for now - delegating IP resolution to DHT_bootstrap_ex()
2013-09-07Modified testMaxim Biro
2013-09-06Fixed autotest, increased MAX_STATUSMESSAGE_LENGTH.irungentoo
2013-08-31Properly fixed test.irungentoo
2013-08-31Fixed test.irungentoo
2013-08-24Rename core directory because of autoconf name clashjin-eld
While doing the checks configure might generate "core" files and will then try to remove them. Having a "core" directory generates an error while runing the configure script. There's no workaround but to rename the core directory.
2013-08-18Ran it through astyleSean Qureshi
2013-08-17Add test for getnameFlorian Hahn
2013-08-17Use ck_assert_msgFlorian Hahn
2013-08-16Passed everything through astyle.irungentoo
2013-08-13...irungentoo
2013-08-13...irungentoo
2013-08-13Fuck.irungentoo
2013-08-13Commented out old tests that are broken with current master.irungentoo
2013-08-13Hackish fix for the tests.irungentoo
2013-08-13Attempt to quickly fix a test.irungentoo
2013-08-13core: Fix a possible buffer overflow using getself_name().Andreas Schneider
If the passed buffer is smaller than MAX_NAME_LENGTH then, you will probably overflow it.
2013-08-12Messenger refactor - redid work from pull request 79Chris Hall
Moves static state out of Messenger.c and into a Messenger struct Purely stylistic, no functional changes were made. This commit also changed all the callers of Messenger as they now have to pass an instance of the Messenger struct to messenger functions. Also removed some uses of the 'static' keyword at the beginning of function definitions when the function was already declared static, as these caused gcc to whine.
2013-08-09Fix a recurring typo in code and comments.Christian Brueffer
2013-08-08Disable failing test assertionFlorian Hahn
2013-08-07Fixed auto testsMaxim Biro
2013-08-07Cleanup test and work on .travis filecharmlesscoin
2013-08-07added files for unit testscharmlesscoin