Commit Graph

192 Commits (b98edec8f8f07aedd28e363c61e616ef588bfb08)

Author SHA1 Message Date
krzys_h 6289ea91b1
Merge pull request #1140 from AbigailBuccaneer/Wsuggest-override
Compile with -Wsuggest-override under GCC
2018-04-24 14:12:31 +02:00
AbigailBuccaneer ea64edaa0b Compile with -Wmissing-declarations
-Wmissing-declarations enforces that every function (except for static
functions) must be declared separately before it's defined. This
essentially enforces that every function must be either static, or
declared in a header elsewhere.

This helps the optimizer, as it can do a better job of inlining if it
knows that a function won't be used outside of a given file. It also
helps -Wunused-function (which is enabled by -Wall) find more unused
functions.

Note that Clang spells this option -Wmissing-prototypes, which
confusingly is the name of a related but different warning option under
GCC.
2018-04-21 16:49:27 +01:00
AbigailBuccaneer 4119e669d1 Remove central tracking of SystemTimeStamp
SystemTimeStamp used to be an opaque class, as it was provided by
`system_{linux/other/windows}.h`. Because of this, code dealt in
SystemTimeStamp pointers, and getting the current timestamp required a
memory allocation. Now SystemTimeStamp is just a
`std::chrono::time_point`, we can make the code cleaner and faster by
just directly keeping SystemTimeStamp instead of pointers around.
2018-04-20 09:57:10 +01:00
krzys-h 1c2bdc9cab Update license headers 2018-04-20 02:08:50 +02:00
AbigailBuccaneer 6978c28ee0 Compile with -Wsuggest-override under GCC
Clang by default compiles with -Winconsistent-missing-override, which
warns when a class declares virtual functions that override those in the
base class, and some but not all of them are explicitly declared
`override`.

GCC doesn't support this option, but has a stronger version,
-Wsuggest-override. In combination with -Werror, this means that any
virtual function that overrides another *must* be explicitly declared as
`override`.

This commit enables -Wsuggest-override where available. This means that
GCC users can't break the Clang build with inconsistent overrides (see
 #1113 and #1114) and consequently that any build that passes the pull
request CI build on Jenkins won't break because of inconsistent
overrides.
2018-04-19 19:58:44 +01:00
melex750 c03dfc1284 Add escape codes for string literals 2017-07-22 14:29:05 -04:00
krzys-h 28081bfd3e Fix clang builds
see #955
2017-05-24 14:00:34 +02:00
melex750 f80db9e8fb Fix using negative numbers in default arguments
Issue #919
2017-03-03 02:11:10 -05:00
melex750 92a8c48953 Add syntax for parameters with default values
Also fixes #642
2017-01-24 15:19:03 -05:00
melex750 baba6081b3 Add checking for return statements in functions
issue #30
2017-01-24 14:41:22 -05:00
melex750 2ff8251a81 Fix game crashing with syntax errors 2017-01-24 13:47:00 -05:00
melex750 64bc1f1afb Fix constructor/destructor and field syntax 2017-01-16 21:16:59 +01:00
melex750 8fc0151444 Fix increment and decrement syntax 2017-01-16 21:16:59 +01:00
piotrwalkusz1 d7fae300b9 Fix crash on class redefinition, closes #703 (#890) 2017-01-15 20:28:52 +01:00
krzys-h 191151eb7b Refactor CBotClass and CBotFunction list to std::list 2016-11-11 19:37:19 +01:00
melex750 9ab7f7d140 Fix access to protected and private variables 2016-09-17 08:00:34 -04:00
melex750 3debfb9182 Fix finding in-class methods when searching by ID 2016-09-17 07:59:34 -04:00
melex750 4a14a44f3f Add implicit cast and null for passing arguments 2016-09-17 07:58:39 -04:00
melex750 3146d4ef35 Add method chaining for class constructor calls 2016-08-14 16:56:17 -04:00
krzys-h d411c5ebc0 Allow circular references from different classes (#814)
Conflicts:
	test/unit/CBot/CBot_test.cpp
2016-08-09 21:10:07 +02:00
melex750 71aa7e468b Add unit tests for circular reference 2016-08-09 14:55:56 -04:00
krzys-h b9d4d57e33 Syntax sugar: Accessing members of returned objects (#808)
Conflicts:
	src/CBot/CBotInstr/CBotInstrMethode.h
2016-08-09 20:28:37 +02:00
melex750 8b3c4302d2 Add more unit tests for inheritance 2016-08-07 10:01:10 -04:00
melex750 f3bf56d9e3 Add unit tests for returned object member access 2016-08-06 05:22:40 -04:00
melex750 c89e6f4c28 Begin adding unit tests for inheritance 2016-08-04 01:19:56 -04:00
krzys-h 81b7bcc5bc Moved system modules from app/ to common/system/ 2016-07-24 14:38:49 +02:00
krzys-h 11d40197ee Added some more CBot tests after #793 2016-07-04 12:23:48 +02:00
krzys-h c304ecd0ca Changed arrays to use {} when converted to string; added tests 2016-06-21 12:58:43 +02:00
krzys-h 543df84db6 Enabled more tests
See https://github.com/colobot/colobot/pull/783#issuecomment-226963085
2016-06-18 22:31:32 +02:00
krzys-h f0ed20fd67 Enabled working tests after bf2e3cdfae 2016-06-17 22:49:15 +02:00
krzys-h 7b32f6388f Enabled fixed test 2016-05-28 23:33:49 +02:00
krzys-h 620620fa61 Reenabled working tests after fc7e621471 2016-05-27 11:45:02 +02:00
krzys-h 7c551dc39d Added unit tests for #768 2016-04-19 21:09:41 +02:00
krzys-h efc5431da2 Enabled ArraysInClasses test after 1941020993 2016-04-07 21:28:16 +02:00
krzys-h 059a546689 Reenabled unit tests that started working after 14721001e5 2016-04-03 21:09:41 +02:00
krzys-h 33f411371c Added string arrays unit test 2016-03-20 15:19:08 +01:00
krzys-h 4479a196f9 Fix colobot-lint warnings 2016-03-15 17:39:00 +01:00
krzys-h 967aa22330 Allow assigning to array in initialization from function (#624, #728) 2016-03-13 20:27:10 +01:00
krzys-h 977607a934 Updated license headers 2016-02-13 14:11:30 +01:00
krzys-h b96305060b Fix colobot-lint warnings 2016-01-23 21:59:02 +01:00
krzys-h 9ff978155c Fix crash with CBot string functions out of range (closes #704) 2016-01-23 21:07:19 +01:00
krzys-h 048534e89d Fixed some errors reported by colobot-lint 2016-01-23 20:58:03 +01:00
krzys-h e3c53f9912 CBot compiled instruction graphs; some code cleanup 2015-12-27 16:51:57 +01:00
krzys-h d00720a2f2 Fixed commandline CBot interpreter not initializing the library properly 2015-12-26 19:57:12 +01:00
krzys-h ef91fb8e9d Fixed commandline interpreter 2015-12-26 14:37:36 +01:00
krzys-h 07a4d6a16b CBot namespace 2015-12-26 14:29:10 +01:00
krzys-h d041a16a50 Can't stop testing 2015-12-25 18:31:07 +01:00
krzys-h 30b5f86ebc You can never have too many tests 2015-12-25 18:10:22 +01:00
krzys-h 09e4919509 More things that should work but don't 2015-12-25 15:23:00 +01:00
krzys-h 5b7638d9f4 More CBot tests 2015-12-25 14:46:39 +01:00
krzys-h 3eb2a2d5ca Even more tests 2015-12-23 22:10:37 +01:00
krzys-h b1c4096ccf Needs MOAR tests! 2015-12-23 21:54:10 +01:00
krzys-h a18c2c39d9 Added ASSERT() to CBot unit tests 2015-12-23 21:08:36 +01:00
krzys-h b102f767d0 Compile error testing in CBot 2015-12-23 20:54:35 +01:00
krzys-h 8437a9bdd2 CBot testing framework; fixed a few bugs 2015-12-23 20:39:56 +01:00
krzys-h d577e7f41b Tests for CBotToken 2015-12-23 18:44:14 +01:00
krzys-h eedf8dacea Documentation for CBotProgram; some CBotError refactoring 2015-12-21 21:35:20 +01:00
krzys-h 9ec61d93e5 Refactored CBotString and const char* to std::string in CBot engine
A lot of changes, so it needs lots of testing
2015-12-20 16:19:10 +01:00
krzys-h 3eeab0f9b7 Removed CBotStringArray 2015-12-20 14:49:30 +01:00
krzys-h 5e23426b53 Refactored CBotString to use std::string and CBotStringArray to use std::vector 2015-12-20 14:24:49 +01:00
Grunaka 1a6b5ded64 Delete CBotDll.h 2015-12-01 23:25:36 +01:00
Grunaka 942d7195e4 Moving CBotString class in its own header and source files. 2015-12-01 23:25:36 +01:00
krzys-h 6590652d9e Added commandline CBot interpreter (for testing purposes) 2015-11-21 16:31:22 +01:00
Piotr Dziwinski 13f0159705 Fix ambiguous overload resolution
One operator+ for CBotString is enough
2015-11-02 22:17:53 +00:00
Piotr Dziwinski eeea31408b Fix operator+ semantics in CBotString 2015-11-02 22:11:02 +00:00
Grunaka 6a396e1522 Add unit tests for class CBotString.
Add comments in class CBotString.
Change existing comments in class CBotString to be compliant with doxygen.
Add function "const char* CBotString::CStr() const".
Add null pointer check in function "const CBotString& CBotString::operator+=(const CBotString& str)"
Remove functions "CBotString CBotString::Mid(int nFirst, int nCount) const" and "CBotString CBotString::Mid(int nFirst) const" because they were doublons of function "CBotString CBotString::Mid(int nFirst, int lg) const"
2015-11-01 17:03:30 +01:00
Piotr Dziwinski d11ebc891c Bring to zero some types of issues reported by colobot-lint 2015-10-04 00:09:10 +02:00
Piotr Dziwinski c3d4d46583 Fix missing empty line after license header 2015-08-22 17:52:07 +02:00
Piotr Dziwinski b93f610930 Fix license header in all files 2015-08-22 16:40:02 +02:00
Piotr Dziwinski efedb44cce Add proper initializations and remove manual memory management in remaining classes
Except CBot-related stuff of course
2015-08-14 23:44:00 +02:00
Piotr Dziwinski bd8ab7e645 Remove old CModelFile test 2015-08-14 20:24:58 +02:00
Piotr Dziwinski a0f0a53d59 Fix for gtest build with Clang libc++ 2015-08-14 14:24:55 +02:00
Piotr Dziwinski 5879de82ac Remove old CBot console
Not sure why we kept it; it probably doesn't even compile anymore
2015-08-11 23:15:04 +02:00
Piotr Dziwinski 36254080bf Remove obsolete test environments 2015-08-07 10:16:46 +02:00
Piotr Dziwinski e9e1c8d4dd Add proper initializations and remove manual memory management in app classes 2015-08-07 10:16:46 +02:00
Piotr Dziwinski 806ffdaf36 Fix segfault in unit tests 2015-08-05 10:27:39 +02:00
Piotr Dziwinski 73536290b2 Fix for incorrect compile flags in colobot-lint 2015-07-19 18:11:12 +02:00
krzys-h 02c24fbf27 CProfile -> CConfigFile 2015-07-19 16:05:09 +02:00
krzys-h 9e19d8433c Removed old CBot-related files 2015-07-16 22:17:54 +02:00
Piotr Dziwinski 88ec9aaae3 Drop GCC 4.6 support 2015-06-26 00:24:32 +02:00
Piotr Dziwinski 8806d1708d Proper CAuto, CBrain, CMotion, CPhysics, CPyro lifetime management
* change manual memory manament to std::unique_ptr
 * create CPyroManager
 * finally get rid of CInstanceManager
2015-06-22 21:58:58 +02:00
Piotr Dziwinski fd182e5515 Aligned unit tests to compile under MSVC 2015-05-13 21:05:39 +02:00
Piotr Dziwinski ccaac2c544 Rewrite unit tests to use HippoMocks 2015-05-13 00:52:18 +02:00
Piotr Dziwinski 81096fd2ae Fix Clang and GCC 4.6 compilation 2015-04-28 19:29:32 +02:00
Piotr Dziwinski d003247120 Provide usleep() in CSystemUtils interface 2015-04-27 20:02:22 +02:00
krzys-h f65b00089a Merge branch 'dev' into dev-physfs
Conflicts:
	data
2014-10-14 15:42:19 +02:00
krzys-h 9fd6cf5449 Changed all occurences of PPC in the code to TerranovaTeam 2014-10-14 15:26:18 +02:00
Piotr Dziwinski 12feb49098 Fixes in unit tests 2014-10-07 22:22:59 +02:00
Piotr Dziwinski e4d52d9afb CProfile refactoring 2014-08-12 21:24:33 +02:00
Piotr Dziwinski 74312b0405 Better CMake organization and unit test cleanups
* created a static library containing most source modules
  to avoid compiling source modules twice in code and unit tests
* moved profile_test to main unit tests executable
* removed image_test and edit_test as not really useful
2014-08-12 20:58:55 +02:00
Piotr Dziwinski 4bdfa0aa4e Remove unused accessors from CDevice 2014-08-12 18:18:30 +02:00
Piotr Dziwinski 0fbc05b96c Fix test compilation 2014-06-26 22:36:57 +02:00
krzys-h 092e7cc68d Fixed tests 2014-06-26 22:14:30 +02:00
Piotr Dziwinski 76d01b44f7 Fix test compilation 2014-06-24 19:51:48 +02:00
Piotr Dziwinski 52cf9e2815 Fix test compilation 2014-06-24 17:38:28 +02:00
Piotr Dziwinski 604d4a614e Fixed tests compilation 2014-01-18 20:16:31 +01:00
Piotr Dziwinski d9283e2afa Fix problem with gtest and pthread on some systems 2013-12-20 20:19:21 +01:00
Piotr Dziwinski 95661918ce Some further refactoring and test corrections 2013-12-20 20:18:30 +01:00
Didier Raboud 343fa8f0cb Add a PLATFORM_GNU global variable matching all GNU systems such as Debian's Linux, kFreeBSD and Hurd 2013-11-27 18:53:28 +01:00
Piotr Dziwiński 8ed542a881 Merge pull request #250 from OdyX/dev-platform-enhancements-and-installers
MacOSX and Windows platform enhancements and installers
2013-11-22 15:16:12 -08:00