Commit Graph

84 Commits

Author SHA1 Message Date
Thomas Goyne 73217fd0e9 Move uuencoding logic to libaegisub and add tests 2013-02-07 16:02:44 -08:00
Thomas Goyne b885c2c19d Disable the signed/unsigned comparison warning for the tests 2013-02-06 13:38:34 -08:00
Thomas Goyne 523fcd72b0 Add agi::fs tests 2013-02-06 13:38:34 -08:00
Thomas Goyne 761bc80d8b Switch to a less terrible set of m4 macros for boost 2013-02-06 13:38:34 -08:00
Thomas Goyne 10a88dfb52 Use boost.locale for spellchecker word splitting
This is currently only correct if the UI language is the same as the
subtitles language as the global locale is used, but it should still
never be worse than the small hardcoded table of word splitters.

Closes #1206.
2013-02-06 13:38:33 -08:00
Thomas Goyne 47c36c9033 Use ICU/boost.locale for case-insensitive searching
Do proper unicode case-folding for case-insensitive searching rather
than converting only ascii characters to lowercase. The Turkish 'i' is
still not handled correctly (since it's the only place where
case-folding is locale-dependent), but that's probably not worth caring
about as long as we don't have a Turkish UI translation.

This affects both the find/replace dialog and the select lines dialog.

Closes #1342.
2013-02-06 13:38:33 -08:00
Thomas Goyne 1cc52611de Rearrange the tests files 2013-02-06 13:22:34 -08:00
Thomas Goyne af37047736 Build the tests on Windows 2013-02-06 13:22:33 -08:00
Thomas Goyne c6005be4a1 Write log files incrementally so that they actually exist for crashes 2013-02-06 13:22:16 -08:00
Thomas Goyne 69e1744fc7 Make agi::util::time_log less insane 2013-02-06 13:22:16 -08:00
Thomas Goyne 1e0f08c0ed Mostly purge wxWidgets from non-UI stuff
Use boost::filesystem::path for all paths, and std::string for all other
strings, converting to/from wxString as close to the actual uses of wx
as possible.

Where possible, replace the uses of non-UI wxWidgets functionality with
the additions to the standard library in C++11, or the equivalents in
boost.

Move the path token management logic to libaegisub (and rewrite it in
the process).

Add a basic thread pool based on asio and std::thread to libaegisub.

This touches nearly every file in the project and a nontrivial amount of
code had to be rewritten entirely, so there's probably a lot of broken
stuff.
2013-02-06 13:22:15 -08:00
Thomas Goyne e8344ab0c7 Add agi::util::Remove for deleting files 2013-01-03 17:36:50 -08:00
Thomas Goyne cec5f2256c Add agi::util::try_parse 2013-01-03 17:36:50 -08:00
Thomas Goyne 1f1cb36b6d Extract TEXT -> DRAWING conversion from SplitWords 2012-12-31 07:09:31 -08:00
Thomas Goyne 134fe60517 Fix tests compilation 2012-12-31 07:09:31 -08:00
Thomas Goyne cccd95941d Fix syntax highlighting for multiple karaoke templater expression blocks 2012-12-07 18:20:09 -08:00
Thomas Goyne 0483c1cfbe Fix string vs color logic in the option parsing 2012-11-24 16:24:00 -08:00
Thomas Goyne eeb28dbdb1 Fix SSA parsing test 2012-11-12 18:35:28 -08:00
Thomas Goyne 6212afb314 Add karaoke templater support to the syntax highlighter 2012-11-12 18:35:27 -08:00
Thomas Goyne b3c1af11b7 Fix handling of unclosed override blocks starting at position 0 2012-11-12 18:35:27 -08:00
Thomas Goyne 7ca7b1d934 Fix syntax highlighting for fonts with spaces 2012-11-12 18:35:27 -08:00
Thomas Goyne 6f05d4b466 Change the test for json parse errors to work with libc++
libc++ is of the opinion that "123eee" is a well-formed double equal to 0.
2012-11-12 18:35:26 -08:00
Thomas Goyne 9c37a50b4d Add support for gtest 1.6
1.6.0 removed support for 'make install' as the maintainers are
apparently unaware that their library is not actually a unique snowflake
and that having to use identical compilation settings for every library
is in fact a completely normal thing for C++ libraries that people
somehow manage to deal with.

Building the tests now requires passing the root directory of a copy of
the googletest source to make, via 'make GTEST_ROOT=~/path/to/gtest'.
2012-11-12 18:35:26 -08:00
Thomas Goyne 88fdee726b Extract word-splitting logic from the syntax highlighter 2012-11-12 18:35:25 -08:00
Thomas Goyne 0893ed3f0a Remove references to tr1 2012-11-10 18:05:57 -08:00
Thomas Goyne 47bafe4b9f Add a lexer for the body of dialogue lines to libaegisub 2012-11-10 18:05:56 -08:00
Thomas Goyne 08983adc96 Move agi::Color parsing to its own file
Keeping all uses of boost.spirit in a single translation unit helps
avoid having it murder compile times, which requires that it be off by
itself.
2012-11-10 18:05:56 -08:00
Thomas Goyne ea5428b65f Replace AssColor with agi::Color
Add agi::Color, and replace AssColor and all uses of wxColor that are
not immediately passed to/from wx with it.
2012-11-10 18:05:56 -08:00
Thomas Goyne ca4c29a9f4 Fix tests linking with static libaegisub 2012-08-26 19:15:42 -07:00
Thomas Goyne 028fd3b4ba Add line-wrapping logic to libaegisub
Originally committed to SVN as r6635.
2012-03-29 19:05:16 +00:00
Thomas Goyne f31d9a5a8b Add converter to ISO-6937-2
glibc's iconv implementation supports ISO-6937-2, but libiconv doesn't
due to that these days the only place it's used is in a few old subtitle
formats. As a result, on everything but linux we need our own converter.

Conversion from ISO-6937-2 is currently not supported.

Originally committed to SVN as r6632.
2012-03-29 19:04:49 +00:00
Thomas Goyne 71776940f6 Rewrite SMPTE timecode handling
Move SMPTE handling to agi::vfr::Framerate to get all of the interesting
logic dealing with timcodes in one place, and to make it testable.

Completely rewrite the SMPTE time conversions as testing them reveals
that they were incorrect in some cases.

Originally committed to SVN as r6631.
2012-03-29 19:04:36 +00:00
Thomas Goyne 77e755d109 Allow duplicated timestamps as real files do have them; simply skip all but the last frame with the same timestamp
Originally committed to SVN as r6566.
2012-03-11 23:05:08 +00:00
Thomas Goyne 284eac1c93 Fix check for Darwin in the tests makefile
Originally committed to SVN as r6562.
2012-03-11 23:04:42 +00:00
Thomas Goyne 7dd6cfe37d Derive agi::acs exceptions from agi::FileSystemError and friends rather than having two sets of errors for the same thing
Originally committed to SVN as r6278.
2012-01-12 22:31:54 +00:00
Thomas Goyne 3c62a38c7a Replace MyThes thesaurus implementation with a custom one
Fixes a pile of unicode-related issues, such as dictionaries in a path
which does not fit into the system's local charset, and significantly
cuts down on the amount of code.

Originally committed to SVN as r6250.
2012-01-08 01:36:50 +00:00
Thomas Goyne e2d31b708e Split the json log writing into a seperate class from LogSink
Originally committed to SVN as r6248.
2012-01-08 01:36:23 +00:00
Thomas Goyne d2d28401bd Change how local config mode works
Rather than loading both the local and user config files and saving to
the local directory if an option is set, simply try to load the local
config file, and if it exists switch to local mode and never even touch
the user file.

Originally committed to SVN as r6244.
2012-01-08 01:35:56 +00:00
Thomas Goyne 0113b33d66 Always build with -g and optionally strip the debugging symbols on install so that crash backtraces aren't completely meaningless
Originally committed to SVN as r6201.
2012-01-08 01:04:05 +00:00
Thomas Goyne 84d1315736 Write the config and MRU files to ?data in portable mode rather than ?user
Originally committed to SVN as r6187.
2011-12-30 01:21:03 +00:00
Thomas Goyne 4c9ebe1a4d Add debug flags to tests's CXXFLAGS
Originally committed to SVN as r6140.
2011-12-22 21:31:39 +00:00
Thomas Goyne 93ce90cbf9 Store a numerator and denominator in agi::vfr::Framerate rather than a fps. Fixes minor rounding issues with 24000/1001 and 30000/1001 frame rates.
Originally committed to SVN as r6115.
2011-12-22 21:27:35 +00:00
Thomas Goyne 7a9bc1dcc9 Add tests for hotkeys
Originally committed to SVN as r6114.
2011-12-22 21:27:26 +00:00
Thomas Goyne eb8a73d836 Use EXPECT_TRUE and EXPECT_FALSE rather than EXPECT_EQ([true,false])
Originally committed to SVN as r6110.
2011-12-22 21:26:48 +00:00
Thomas Goyne 71109a87e1 Replace most inappropriate uses of LDFLAGS with LIBS
Originally committed to SVN as r6097.
2011-12-22 21:24:40 +00:00
Thomas Goyne c27ee9fcb8 Disable gcc's unused value warning for tests as a very large number of tests generate it
Originally committed to SVN as r6027.
2011-12-22 21:13:48 +00:00
Thomas Goyne ebde064cb4 Set rpath for tests correctly
Originally committed to SVN as r6025.
2011-12-22 21:13:30 +00:00
Thomas Goyne 61b1741376 Remove all the json::Reader::Read overloads, as we never actually use them
Originally committed to SVN as r6021.
2011-12-22 21:12:55 +00:00
Thomas Goyne 07da6f6f1b Split json::Number into json::Double and json::Integer
Trying to decide whether an option should be an int or double after
discarding the differences between "1.0" and "1" simply isn't possible,
and even if an option was initialized correctly, if it was changed to a
round number it could get written as an int and break later.

Also convert cajun to tabs because three spaces to indent is terrible.

Originally committed to SVN as r6018.
2011-12-22 21:12:25 +00:00
Thomas Goyne 70a291d4d4 Add some tests for agi::Options
Originally committed to SVN as r6010.
2011-12-22 21:11:10 +00:00