Commit graph

8 commits

Author SHA1 Message Date
rfm
0fb9739f21 Fix leaks and a possible buffer overrun 2024-11-17 12:55:55 +00:00
Hugo Melder
6681a3da47
Initial port of WinObjC's KVO implementation to GNUstep (#420)
* GSAtomic: Add prefix to macro definitions

* NSKVOSupport: Import

* NSKVOSupport: Add test cases

* NSKVOSwizzling: Ugly C Rewrite

* NSKeyValueObserving: Use old implementation as fallback

* NSKeyValueObserving: Rename TypeEncodingCases header

* NSKVOSupport: Fix new objects not being added to NSKeyValueChangeNew set on set mutation

* NSKeyValueMutableSet: Fix will and didChange notifications for set operations

* NSKeyValueMutableSet: Document Accessor Search Patterns

* NSKVOSupport: Add toMany test

* NSKeyValueCoding: Change notifications when changing value via setValue:forKey:

* NSKVOSupport: Add more tests

* NSKVOSupport: Do not wrap block in try/finally to avoid crash in windows

* NSKVOSwizzling: use _alloca on Windows

* NSKVOSupport: Do not autorelease newWithObservee:

* NSKVOSupport: Do not leak Observee and TestFacade objects

* Improve runtime detection in makefile

* Add file extension of source file in GNUMakefile

* NSKVOSupport: Remove @status comments

* NSKVOSupport: Implement private notify method

* NSUserDefaults: KVO Support and fix macOS incompatibilities

* NSKeyValueObserving: Set old to null if nil

* NSKeyValueObserving: Remove cached new value

* NSMethodSignature: Add signature cache

* NSKVOSupport: Remove ObjC2 features and mark tests failing on GCC as hopeful

* Call class method instead of private _keyPathsForValuesAffectingValueForKey

* Move _keyPathsForValuesAffectingValueForKey body into class method and statically construct empty NSSet

* NSUserDefaults: Change notification should contain old value from other domains aswell

* NSUserDefaults: Fetch new value from all domains

* NSKVOInternal: Fixup filename in header

* NSUserDefaults: Go through search list instead of only one domain in KVO change

* Making indentation a bit less worse

* Add NSUserDefaults KVO tests

* NSKVOSupport: NSUserDefaults test small fixes

* Add autoreleasepool

* NSUserDefaults: Only emit change notifications if value changed

* Avoid compiler warnings and tidy some of the whitespace/formatting

---------

Co-authored-by: Frederik Seiffert <frederik@algoriddim.com>
Co-authored-by: rfm <richardfrithmacdonald@gmail.com>
Co-authored-by: rfm <rfm@gnu.org>
2024-11-10 17:05:23 +01:00
Frederik Seiffert
cd251a531a Extended general tests for NSUserDefaults. 2020-05-26 13:16:19 +02:00
Richard Frith-MacDonald
b9695fe9f5 add tests for removal of a default directly and via -setObject:forKey:
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34138 72102866-910b-0410-8b05-ffd578937521
2011-11-09 13:51:55 +00:00
Richard Frith-MacDonald
cbf54ac301 Add a few OSX compatibility methods
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33929 72102866-910b-0410-8b05-ffd578937521
2011-10-02 11:17:49 +00:00
Richard Frith-MacDonald
a0cea8389d remove obsolete tests
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32490 72102866-910b-0410-8b05-ffd578937521
2011-03-07 17:49:41 +00:00
Richard Frith-MacDonald
9f593f6b8e Add TestInfo markers
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32335 72102866-910b-0410-8b05-ffd578937521
2011-02-23 18:34:39 +00:00
Richard Frith-MacDonald
0e02133729 import testsuite
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32187 72102866-910b-0410-8b05-ffd578937521
2011-02-16 08:21:17 +00:00