aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Don't allow surrugate code points in UTF-8Pierre Ossman2023-06-301-0/+5
| | | | | | These are not valid outside of UTF-16 so seeing them in a UTF-8 sequence means that something is wrong with that sequence. Best to filter them out rather than letting them propagate and have unknown effects.
* Clean up string encoding handlingPierre Ossman2023-06-301-0/+49
| | | | | | We should handle this in the low-level protocol code as much as possible to avoid mistakes. This way the rest of the code can assume that strings are always UTF-8 with \n line endings.
* Remove custom CharArray typePierre Ossman2023-02-041-0/+1
| | | | | It has now been replaced, mostly by std::string, so remove the actual type definition.
* Return std::string instead of dynamic allocationsPierre Ossman2023-02-044-31/+18
| | | | | | We mostly use classical C strings, but the memory management around them can get confusing and error prone. Let's use std::string for the cases where we need to return a newly allocated string.
* Use stdint typesPierre Ossman2023-02-015-36/+36
| | | | | Avoid having our own custom stuff and instead use the modern, standard types, for familiarity.
* Explicitly mark unused parametersPierre Ossman2023-01-0411-17/+20
| | | | | This allows us to separate accidentally unused, from explicitly unused parameters, which allows us to turn on such checks in the compiler.
* Mark system include paths correctlyPierre Ossman2023-01-042-3/+3
| | | | | This makes sure the compiler doesn't complain about problems in those files.
* Ignore whitespace around components of host-and-port specificationCatherine Tower2022-09-011-0/+12
| | | | This is to make the code more tolerant of typos when entering a hostname
* Move include_directories() to proper placesPierre Ossman2022-08-252-3/+3
| | | | We should scope these as narrowely as possible to avoid side effects.
* Add missing FLTK include statementsAlbrecht Schlosser2022-07-071-0/+1
| | | | Add also missing <stdlib.h> where required.
* Fix up ffmpeg header and library handlingPierre Ossman2022-06-071-1/+0
| | | | | FFMPEG is needed by the RFB library, so all the details about it should only be applied there and not for other components.
* Avoid temporary cmake variablesPierre Ossman2022-06-071-8/+7
| | | | | Modern cmake has better support for adding source files and libraries incrementally, so let's use that to clean things up.
* H264 DecoderVladimir Sukhonosov2022-01-211-0/+1
| | | | Linux implementation using ffmpeg
* Be consistent in including config.hPierre Ossman2021-12-3012-0/+48
| | | | | | The generally recommended way is to include it from source files, not headers. We had a mix of both. Let's try to be consistent and follow the recommended way.
* Allow building with -DBUILD_VIEWER=OFFAlex Richardson2021-07-151-23/+25
| | | | | Without this change I get CMake errors due to use of ${FLTK_INCLUDE_DIR} and references to the non-existent vncviewer target.
* Support the VMware Cursor Position extension on vncviewerlhchavez2021-03-112-0/+10
| | | | | | | | This change makes it possible for re-synchronizing the remote cursor on the vncviewer when in fullscreen mode. This is done by locally moving the cursor position to what the server thinks it should be. Now SDL games should work!
* Merge branch 'noblock' of https://github.com/CendioOssman/tigervncPierre Ossman2021-01-192-13/+14
|\
| * Change streams to be asynchronousPierre Ossman2020-05-212-3/+10
| | | | | | | | | | | | | | | | | | | | Major restructuring of how streams work. Neither input nor output streams are now blocking. This avoids stalling the rest of the client or server when a peer is slow or unresponsive. Note that this puts an extra burden on users of streams to make sure they are allowed to do their work once the underlying transports are ready (e.g. monitoring fds).
| * Simplify stream availability handlingPierre Ossman2020-05-212-10/+4
| | | | | | | | | | Just have a simply number of bytes argument to avoid a lot of complexity.
| * Add stream avail() methodsPierre Ossman2020-05-212-4/+4
| | | | | | | | | | Makes it more readable to write code that needs to know how much data/space is available in a stream.
* | Correctly handle invalid UTF-16 code pointsPierre Ossman2020-10-051-0/+2
| | | | | | | | | | Some code points are reserved for the UTF-16 coding itself and must not appear as input data to the algorithm.
* | Fix conversion of latin-1 to UTF-8Pierre Ossman2020-10-051-0/+34
| | | | | | | | Signed bug prevented anything not ASCII from being coded correctly.
* | Fix UTF-16 encoding/decoding of high code pointsPierre Ossman2020-10-051-0/+4
| | | | | | | | | | Everything outside of BMP was handled incorrectly and was coded as completely different code points.
* | Return the correct number of consumed UTF-8 bytesPierre Ossman2020-10-052-0/+168
| | | | | | | | | | | | | | | | This would mess up most conversions from UTF-8 as the caller wouldn't know how far to step to get to the next valid character, resulting in markers for invalid data to be injected here and there. Also add some unit tests to avoid this reoccurring.
* | Update gesture unit test to cover angle cornercaseSamuel Mannehed2020-06-151-3/+3
| | | | | | | | | | | | If the difference in angle is larger than 180 degrees we hit a corner case. This commit modifies the coordinates of an existing test to cover this.
* | Improve names of many gesturehandler unit testsSamuel Mannehed2020-06-051-24/+24
| | | | | | | | Makes it easier to understand what the tests do.
* | Remove unnecessary touchEnd from unit testsSamuel Mannehed2020-06-051-1/+0
| |
* | Use mingw's stdio routines where neededPierre Ossman2020-05-311-7/+4
| | | | | | | | It allows us to use the more standard format specifiers.
* | Implement touch gesture handling on UnixAaron Sowry2020-05-292-0/+1248
| | | | | | | | | | Allows the user to perform certain important mouse operations using touch gestures instead.
* | Fix position for click and drag with EmulateMBAlex Tanskanen2020-05-261-2/+60
| | | | | | | | | | | | | | If you have the setting "Emulate middle mouse button" turned on, a click and drag can fail if it is done very quickly. The position of the initial click will be incorrect in such a case because the timeout will delay events.
* | Add unit tests for EmulateMBAlex Tanskanen2020-05-262-0/+433
|/
* Fix framebuffer setup in encperfPierre Ossman2020-02-271-2/+3
| | | | We adapted to the wrong new callback in a previous commit.
* Provide dummy output for dummy client connectionsPierre Ossman2020-02-272-2/+54
| | | | | The CConnection base class wants to be able to write things these days, so we need to provide it a place to do so.
* Handle pixel formats with odd shift valuesPierre Ossman2019-11-151-0/+6
| | | | | | | | | Our fast paths assume that each channel fits in to a separate byte. That means the shift needs to be a multiple of 8. Start actually checking this so that a client cannot trip us up and possibly cause incorrect code exection. Issue found by Pavel Cheremushkin from Kaspersky Lab.
* Add unit tests for PixelFormat.is888() detectionPierre Ossman2019-11-151-1/+59
|
* Use size_t for lengths in stream objectsPierre Ossman2019-11-151-5/+5
| | | | | | | | Provides safety against them accidentally becoming negative because of bugs in the calculations. Also does the same to CharArray and friends as they were strongly connection to the stream objects.
* Add sanity checks for PixelFormat shift valuesPierre Ossman2019-11-151-0/+6
| | | | | | | | | | | | Otherwise we might be tricked in to reading and writing things at incorrect offsets for pixels which ultimately could result in an attacker writing things to the stack or heap and executing things they shouldn't. This only affects the server as the client never uses the pixel format suggested by th server. Issue found by Pavel Cheremushkin from Kaspersky Lab.
* Fix depth sanity test in PixelFormatPierre Ossman2019-11-151-0/+4
|
* Add unit test for PixelFormat sanity checksPierre Ossman2019-11-152-0/+117
|
* Add unit tests for convertLF() and convertCRLF()Pierre Ossman2019-09-252-0/+127
|
* Split test programs to benchmarking and unit testsPierre Ossman2019-09-2517-45/+51
| | | | | They have very different purpose, so make things easier to work with by having multiple directories.
* Clean up internal clipboard handlingPierre Ossman2019-07-012-4/+4
| | | | | | We now filter incoming data, which means we can start assuming the clipboard data is always null terminated. This allows us to clean up a lot of the internal handling.
* Merge branch 'connparams' of https://github.com/CendioOssman/tigervncPierre Ossman2018-12-102-13/+11
|\
| * Let CMsgHandler::serverInit() handle initial set upPierre Ossman2018-11-012-8/+4
| | | | | | | | | | | | | | Avoid using the callbacks used for runtime changes for the initial setup. They weren't really useful anyway as you could not allocate a framebuffer without also knowing the pixel format. So make things more clear by letting serverInit() get the initial settings.
| * Rename ConnParams to ClientParamsPierre Ossman2018-11-011-2/+2
| | | | | | | | | | | | Now that we've split out server state to ServerParams, ConnParams only contains state for a client. Rename the class and variables to reflect this.
| * Split out ServerParams from ConnParamsPierre Ossman2018-11-012-3/+5
| | | | | | | | | | | | We need to track different things in the server and client, so separate things to two independent structures to keep things more clear.
| * Encapsulate screen layout storage in ConnParamsPierre Ossman2018-11-012-2/+2
| | | | | | | | | | | | | | Avoid direct access to the screen dimensions and layout so that we can make sure it stays sane. This also makes sure the layout is properly updated when we only get the screen dimensions from the server.
* | Remove variable length arraysPierre Ossman2018-11-071-2/+3
|/ | | | | These are not allowed in C++, and have been made optional in C11. So let's just get rid of them and any issues they may cause.
* Fix .gitignore for vncviewer/ and tests/Pierre Ossman2018-07-111-0/+6
| | | | | We had partial coverage for vncviewer/ already, but fix up the last pieces.
* Catch exceptions by referencePierre Ossman2018-05-292-6/+6
| | | | | We use polymorphic exception objects, so catching by value invokes the copy constructor and stuff that we don't really want.