Vladimír Vondruš
2322267af4
Harden ResourceManager::setFallback() test.
...
Removing a fallback should trigger update of the falled-back resources
as well. Works as expected.
6 years ago
Vladimír Vondruš
2ba54b542c
Ensure std::string is not accidentally printed to Debug as ResourceKey.
6 years ago
Vladimír Vondruš
169378eb7d
Make Debug printer for ResourceKey more distinct.
...
Printing ResourceKey(0xabcd) instead of just abcd to make it clear what
it is.
6 years ago
Vladimír Vondruš
9c8a3b6c39
Adapt to Corrade changes.
6 years ago
Vladimír Vondruš
eda984c9c9
Made Resource nothrow-movable.
...
Otherwise it can't be used in growable Arrays (and std::vector copies it
instead of moving when reallocating).
6 years ago
Vladimír Vondruš
2eaa9f2ceb
Add explicit tests for Resource constructors.
6 years ago
Vladimír Vondruš
0f7e1e8fad
Deprecate ResourceManager::instance().
...
If I would have done this a year ago, I could have it removed by now.
Well. Gotta look forward to 2020, then.
7 years ago
Vladimír Vondruš
f89e935f7d
Ensure Resource operator== doesn't work with different types.
...
Otherwise it could in some circumstances compare the actual
resource values giving false positives.
7 years ago
Daniel Guzman
909b05b8fa
Added equal and not equal operators in Magnum::Resource
7 years ago
Vladimír Vondruš
eccebcbdd7
Accept nullptr in AbstractResourceLoader::set().
...
Also implement setNotFound() using set() and make the code more
flexible.
7 years ago
Vladimír Vondruš
2d04b22aba
Make it possible to pass Containers::Pointer to ResourceManager APIs.
...
Also cleaned up the test from naked new. This still needs to be reworked
to not do manual memory management inside (and then deprecate the raw
pointer versions), but for now this has to suffice.
7 years ago
Vladimír Vondruš
2149f7b869
Wrap all tests in unnamed namespaces.
...
This makes the compiler warn about test cases that aren't ever used,
which is a good thing.
7 years ago
Vladimír Vondruš
e6b7aa12fa
Updated copyright year.
7 years ago
Vladimír Vondruš
623fa97970
Updated copyright year.
8 years ago
Vladimír Vondruš
7a16273e5d
Updated copyright year.
9 years ago
Vladimír Vondruš
1eb26bd1a5
Test: workaround/suppress leaks when ResourceManager is asserting.
...
The code is bad (yes, I know), but these should be harmless as the leaks
are really only when asserting.
10 years ago
Vladimír Vondruš
7d8b2ce9a6
Print value of invalid enums in debug output, test those cases.
10 years ago
Vladimír Vondruš
26d0df06b7
Test ResourceState debug output.
10 years ago
Vladimír Vondruš
23646e6690
Hell, this project is big.
10 years ago
Vladimír Vondruš
30fc1411bb
Adapted to Corrade changes.
10 years ago
Vladimír Vondruš
869cb842a0
Make reference counted resources in ResourceManager actually sane.
...
Annoyance reported by @wivlaro like three months ago. Ugh, I'm so behind
on everything.
11 years ago
Vladimír Vondruš
697a6aa0df
Test cleanup.
11 years ago
Vladimír Vondruš
c71dc12503
Making test declarations more compact.
...
Yet again I experienced how insanely large this thing got over the
years.
11 years ago
Vladimír Vondruš
6488fe6e75
Oh, it's 2015 already.
11 years ago
Vladimír Vondruš
a9a5ead13d
Dropped GCC 4.6 support.
12 years ago
Vladimír Vondruš
8a9fa4d999
Test also ResourceManager::set() with default values.
12 years ago
Vladimír Vondruš
6f0ba96cb6
Happy new year too.
12 years ago
Vladimír Vondruš
0616f24f34
Making includes absolute, part 5: absolute includes everywhere.
...
The only places where they aren't absolute are:
- when header is included from corresponding source file
- when including headers which are not part of final installation (e.g.
test-specific configuration, headers from Implementation/)
12 years ago
Vladimír Vondruš
8c2291aa49
Making includes absolute, part 4: using absolute includes for Corrade.
...
Also adapted to some Corrade renames.
12 years ago
Vladimír Vondruš
45a10cefdf
Making includes absolute, part 1: moving files around.
...
Everything what was in src/ is now in src/Corrade, everything from
src/Plugins is now in src/MagnumPlugins, everything from external/ is in
src/MagnumExternal. Added new CMakeLists.txt file and updated the other
ones for the moves, no other change was made. If MAGNUM_BUILD_DEPRECATED
is set, everything compiles and installs like previously except for the
plugins, which are now in MagnumPlugins and not in Magnum/Plugins.
12 years ago
Vladimír Vondruš
3285b23ad9
Minor cleanup in tests.
13 years ago
Vladimír Vondruš
68638969f3
Don't forbid setting resources by copy/move.
...
It adds much more convenience. Only some resources can't be moved around
(i.e. those with someone pointing at them), which isn't excuse for
forbidding copy/move altogether.
Finally it is possible to do convenient things like this again:
DebugTools::ResourceManager::instance()->set("red",
DebugTools::ShapeRendererOptions().setColor({1.0f, 0.0f, 0.0f}));
13 years ago
Vladimír Vondruš
e19154be5e
Reducing pointer chasings, part 3a: less pointer passing in root namespace.
...
Passing pointer as function parameter will now mean that it is possible
to pass `nullptr`. Some code examples now look like the parameter is
copied instead of referenced, which is misleading. Updated the
documentation to reflect that more clearly.
13 years ago
Vladimír Vondruš
c1c4788e88
Ability to force cleanup of ResourceManager.
...
Assumes that no resources of given type are referenced. The test case
for this is awful, as I can't think of a way to test which would work
without trying to decrement reference counter on already deleted
resource. Added just-to-be-sure assertion to make it fail early and not
somewhere deep in STL.
13 years ago
Vladimír Vondruš
a31badc570
Minor cleanup in ResourceManagerTest.
13 years ago
Vladimír Vondruš
8bce5114da
Deleting all resource loaders before unloading any resource data.
...
Previously was done per type (i.e. for each type delete loader and then
the data), wasn't usable when the loader stored different resource type
(which is the only case where it is useful).
13 years ago
Vladimír Vondruš
26504480b2
Test whole AbstractResourceLoader API.
13 years ago
Vladimír Vondruš
77dca430c3
Make virtual AbstractResourceLoader functions private.
...
Removes the need to call AbstractResourceLoader::load() from
reimplementation.
13 years ago
Vladimír Vondruš
f7aa2c05a6
Deinlined heavy functions and removed redundant `inline` everywhere else.
13 years ago
Vladimír Vondruš
db71a23e3c
Bring whole Corrade namespace into Magnum namespace.
...
These projects are tightly interconnected anyway, this means a lot less
typing (yay!).
13 years ago
Vladimír Vondruš
dd788285dc
Various code cleanup.
13 years ago
Vladimír Vondruš
c5ab86794b
Relicensing to MIT/Expat license, part 3: source files.
...
Added license header also to shader sources. Hopefully it won't harm
compilation times too much.
13 years ago
Vladimír Vondruš
231f3277ab
Adapted to Corrade changes.
...
Allowing to instantiate Trade::AbstractImporter subclasses directly
without plugin manager.
13 years ago
Vladimír Vondruš
2d2d1c07f4
Using new type aliases in whole root Magnum namespace.
13 years ago
Vladimír Vondruš
9464e805e1
Use {} instead of "".
...
Calls default std::string constructor instead of converting from const
char*, might possibly save unneeded allocation.
13 years ago
Vladimír Vondruš
e58962dc43
Don't use fully qualified Corrade::Utility::Debug when not needed.
13 years ago
Vladimír Vondruš
5707a138d1
Print also resource key when attempting to overwrite final resource.
13 years ago
Vladimír Vondruš
fcb8a7b768
Got rid of header files in tests.
...
They have no practical use and they only bloat codebase size and add
maintenance burden.
14 years ago
Vladimír Vondruš
0f889369f4
No `using namespace std` anywhere.
...
Also added missing std:: prefix to remaining cases of std::size_t,
std::[u]int[0-9]+_t, std::sin() etc., std::exit().
14 years ago
Vladimír Vondruš
67f2e0fc7f
GCC 4.6 compatibility is now handled by Corrade.
14 years ago