summaryrefslogtreecommitdiffstats
path: root/tests/auto
Commit message (Collapse)AuthorAgeFilesLines
* Fix cmake unit test for Qt3DSean Harmer2015-06-102-3/+9
| | | | | | Task-number: QTBUG-46592 Change-Id: Ib28a8fcf2c0e692dd10227f9a9e3c6a10a7fcdbd Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Make QAspectJobManager and base class privateSean Harmer2015-06-101-2/+2
| | | | | | | | Prevents leaking of private headers and allows use of QT3DCORE_PRIVATE_EXPORT for use with the job manager unit test. Change-Id: I7f0c2b2e27e88eee6cb686f5ae55c78b73ea27d3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Unit tests for ThreadPoolerMika Salmela2015-05-203-1/+328
| | | | | | | | Few basic tests for threadpooler. Also adds QT3DCORE_PRIVATE_EXPORTT for QAspectJobManager. Change-Id: I6bf930b0013b301c6a8ce2193ad9b34fe4638eb3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Unit tests for RenderMeshPaul Lemire2015-05-143-1/+189
| | | | | | | Set enabled to true by default on a RenderMesh Change-Id: I269505ab74f05fa81dae5eceef4c0afe24f10031 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Unit tests for RenderMaterialPaul Lemire2015-05-133-1/+198
| | | | | | | | | Properly initialize the enabled flag in RenderMaterial and use Q_AUTOTEST_EXPORT to make it available to the unit tests Change-Id: Ie38169815f920f828effe03b52f6f32c85030523 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QRenderPass: add/remove ParametersPaul Lemire2015-05-091-0/+34
| | | | | Change-Id: Ibccaa97c9cd1d9e8229ea59228ef2535b23b64b7 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QRenderPass use QNodePtr to send clonesPaul Lemire2015-04-251-3/+2
| | | | | | | and updated tst_renderrenderpass Change-Id: I9fae01de6c1c343cdc327cfed5ffa0cf16b01988 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add QRay3DRĂ©mi Benoit2015-03-243-1/+556
| | | | | Change-Id: I5e45f6275c69ea38866086be61a1390bbb31cb9d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Updated licenses & license headersJani Heikkinen2015-03-232-20/+26
| | | | | | | | | | | | | | | | | | | | | Added missing LICENSE.LGPLv3 Removed unnesessary license files: LGPL_EXCEPTION.txt LICENSE.FDL LICENSE.LGPL LICENSE.PREVIEW.COMMERCIAL Changed LICENSE.GPL from GPLv3 to GPLv2 (as defined in license headers) Changed license headers from LGPLv21 to LGPLv3 in: tests/auto/shared/util.h tests/auto/shared/util.cpp Task-number: QTBUG-45014 Task-number: QTBUG-45012 Change-Id: Id632067ee359b4737d43be30ff5d5eb9fb44fa93 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Units test for RenderViewUtils and RenderViewPaul Lemire2015-03-095-1/+531
| | | | | | | | Mostly focused on ShaderData for now, RenderView unit tests will be completed over time. Change-Id: I279a49a294ff83d5ab5ec06c48e14796cf00b7b0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* ChangeArbiter/SceneChange: use id as change subjectPaul Lemire2015-02-283-26/+20
| | | | | | | | | | | | Instead of having a QNode* or QObservable as the subject of a change, we use it's unique NodeId instead. That will prevent the ChangeArbiter from trying to distribute changes by looking at a QNode/QObservable id when the QNode/QObservable might have been destroyed in the meantime. Change-Id: Ia419d5b841434fd65522c8c65de552089cfe97cf Task-number: QTBUG-44628 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Unit Tests for RenderShaderPaul Lemire2015-02-283-1/+139
| | | | | | | | Note: Only test proper initialization, cleanup and that it matches a frontend peer. Doesn't that shader loading as this requires a context, surface... Change-Id: I05f6ef059005b4781b82876a8d73e46d41d44387 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix: remove QByteArrayLiteral used when setting SceneChange property namesPaul Lemire2015-02-282-12/+12
| | | | | | | | This was probably forgotten when the property name was changed fron QByteArray to char *. Change-Id: Idd6a988703a241519b3aba7b1d127adae5e1375e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Added NodeInstantiatorSean Harmer2015-02-2814-2/+679
| | | | | | | | | Hopefully in the long term we can make the renderer smart enough that it can automatically use instancing to render such things. Change-Id: I9f5cfabeea11f5e6b925d5ad2466afa8e601e6f8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* unit tests for qchangearbiterPaul Lemire2015-02-181-97/+143
| | | | | Change-Id: I7f6e37cd010b530bd36e15d8461e6d50da7a42b9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Copyright header change.Mika Salmela2015-02-0920-380/+280
| | | | | | | | As for preparation for Qt5.5 release the copyright header is updated to correspond the current license requirements. Change-Id: I36632918b66f455539453b42c369689fb11298ec Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Complete unit tests for QNode and friendsKevin Ottens2015-02-082-12/+175
| | | | | | | | Thanks to QLockableObserverInterface I can finally unit tests the changes I did in f446248. Change-Id: Ica9c47417bd7036fa22dc0c5ddb38bb3754bec56 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Introduce QLockableObserverInterfaceKevin Ottens2015-02-081-8/+14
| | | | | | | | | We introduce QLockableObserverInterface as an intermediate interface before the QChangeArbiter and depend on that interface whenever possible. Change-Id: Ic92efec8d68c88344bb43f8fc7dc10b1212180af Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Don't store QRenderState* in RenderRenderPassKevin Ottens2015-02-031-52/+97
| | | | | | | | RenderRenderPass is now storing pointers to backend objects as soon as possible. Change-Id: I6f8c4b92d18bcfe726df5731b978df0606a6a81c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Don't keep pointers to QParameterMappingKevin Ottens2015-02-031-2/+8
| | | | | | | | | The backend is not supposed to keep pointers on frontend objects it doesn't own. Instead store the data in RenderParameterMapping instances as soon as possible. Change-Id: I5f0ff04f06c54c2ad0fbe483051db9974f4aedf8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add tests for RenderRenderPassKevin Ottens2015-02-023-0/+298
| | | | | Change-Id: Ifa1ee12959202093bea49d1e6c5b028d17eae01c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add QServiceLocator and skeleton system and OpenGL info servicesSean Harmer2015-01-283-0/+175
| | | | | Change-Id: I587d4d9f6065e377e7254ca916fdab2c0527ac30 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* On component removal only deal with the idKevin Ottens2015-01-281-4/+4
| | | | | | | | Would have been nice to unit test the other end of this event handling (namely QEntity) but it is tight coupled to ChangeArbiter. Change-Id: I78a63a237cfac7502a0b2e48118559f5b1bec85a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Unit tests for RenderEntity sceneChangeEventKevin Ottens2015-01-283-0/+200
| | | | | Change-Id: Icc554960901833834dfd00ce2505b160d125e86a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Cleanup entities component lists on destructionKevin Ottens2015-01-281-0/+23
| | | | | Change-Id: I1e5f006b612a69e6b5cc98aecb6c8fdc3d6281b0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add QAspectFactory class, creates aspects by nameKevin Ottens2015-01-233-0/+139
| | | | | Change-Id: I91480d9a61accf313d10f5ddb21100fdc13481c2 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* tst_cloning: Add unit test for cloningPaul Lemire2015-01-104-40/+159
| | | | | Change-Id: I008e81fa698195b732c535a2728bd117ddd1b325 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Change uuid -> id as it really isn't universally unique any longerSean Harmer2014-12-193-57/+57
| | | | | Change-Id: If25d1f71dfff62009db1cd4f72a1b0725b4c6d14 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Unit tests for QGraphicsUtilsPaul Lemire2014-12-123-1/+380
| | | | | | | | Helps make sure that the methods are working as expected before being used by the renderer. Change-Id: If335bf4c7f9cb95d5e7b1f9bd862d438e71a3fe1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Rename QNodeUuid to QNodeIdSean Harmer2014-11-191-3/+3
| | | | | Change-Id: I0450a4d4708af1ccd3d4c8f2ddc5c9a5c9deca27 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Make QCircularBuffer and QBoundedCircularBuffer privateSean Harmer2014-11-194-4/+4
| | | | | Change-Id: I298fbaf819a118a5da4453082ec7f1484835480a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Rename QResourcesManager -> QResourceManager and make privateSean Harmer2014-11-186-45/+45
| | | | | | | | Once we are happy with the API we can make this public for a future release. Change-Id: I914f087e10adddbadac1649a8b889b9f53f82fd2 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add skeleton unit tests for QEntity and QAspectEngineSean Harmer2014-11-175-0/+179
| | | | | | | | | | | | QAspectEngine is crashing upon shutdown so adding a test case to investigate. Without a root entity set we just get warnings about threads being killed whilst still running. With a root entity set, it crashes. Need to solve these before we can test any more work towards a clean shutdown. Next commit solves the crash so merge it together with this one. Change-Id: Ic90c0f130ed48b418bb376b38eb10f23ea90590e Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Enforce that we never try to allocate unexpectedly huge items.Milian Wolff2014-11-141-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also allows us to greatly simplify the code while at it. If future subclasses ever become larger than our maxObjectSize, we can either force them to overload operator new themselves or increase the maxObjectSize in the allocator. That never happens in practice and just increases the codesize and also slows down the code. The benchmark now shows the following numbers for perf's instr:k counter on my machine: ********* Start testing of tst_QFrameAllocator ********* Config: Using QtTest library 5.5.0, Qt 5.5.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 4.9.2) PASS : tst_QFrameAllocator::initTestCase() PASS : tst_QFrameAllocator::benchmarkAllocateSmall() RESULT : tst_QFrameAllocator::benchmarkAllocateSmall(): 880,438 instructions per iteration (total: 880,438, iterations: 1) PASS : tst_QFrameAllocator::benchmarkAllocateBig() RESULT : tst_QFrameAllocator::benchmarkAllocateBig(): 965,937 instructions per iteration (total: 965,937, iterations: 1) PASS : tst_QFrameAllocator::benchmarkDeallocateSmall() RESULT : tst_QFrameAllocator::benchmarkDeallocateSmall(): 701,573 instructions per iteration (total: 701,573, iterations: 1) PASS : tst_QFrameAllocator::benchmarkDeallocateBig() RESULT : tst_QFrameAllocator::benchmarkDeallocateBig(): 701,572 instructions per iteration (total: 701,572, iterations: 1) PASS : tst_QFrameAllocator::benchmarkAllocateRaw() RESULT : tst_QFrameAllocator::benchmarkAllocateRaw(): 867,893 instructions per iteration (total: 867,893, iterations: 1) PASS : tst_QFrameAllocator::benchmarkDeallocateRaw() RESULT : tst_QFrameAllocator::benchmarkDeallocateRaw(): 771,701 instructions per iteration (total: 771,701, iterations: 1) PASS : tst_QFrameAllocator::cleanupTestCase() Totals: 8 passed, 0 failed, 0 skipped, 0 blacklisted ********* Finished testing of tst_QFrameAllocator ********* Change-Id: I0500a206e8460e27b5157d6238a06bee355b7318 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Guard against unsafe usage of QFrameAllocator::(de)allocateRawMemory.Milian Wolff2014-11-141-19/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before one could potentially fall into a trap when one would call allocateRawMemory<BaseClass>(size); When size belongs to a child class inheriting from BaseClass and falls into a different (larger) bucket, the following deallocation via deallocateRawMemory<BaseClass>() would fail. Because there we just picked the size of the BaseClass to find the bucket. Now the whole API is restructured to guard against this wrong usage: - we only ever operator on void* in the *Raw* methods - we pass on the size explictily This also means we must use the safe operator deallocate overloads that also take the size as a parameter. The unit test was run first to check that this was indeed an issue. Then it is ported to the new API and cleanup up a bit as well to reduce duplicated code. Change-Id: I559af1c0ffc633962fac12d6e3cadf87c09ef92d Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Cleanup code and remove C-isms.Milian Wolff2014-11-141-12/+12
| | | | | Change-Id: I09aa2d0d7b95b809ba3da4841c05c04c47d377f8 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QNodeUuid: typedef for QUuidPaul Lemire2014-11-021-3/+3
| | | | | | | Should allow to easily replace QUuid by a custom quint64 based struct Change-Id: Ib4ba57efd2e070317aa3417b37ce091f2b4779a0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QObservableInterface refactoredPaul Lemire2014-11-021-8/+2
| | | | | | | | | | | | | Explicit registerArbiter/unregisterArbiter methods. QNode: removed QReadWriteLock for the QChangeArbiter, no need to protect as the QChangeArbiter is always set in the main thread. QBackendNode: similar for the QBackend, all locks removed as we are always locked when synching changes. QObservable was removed. Change-Id: I570afbf3e3230ac9d9613474fedd7849aba7412a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Optimize: Use a plain non-recursive QMutex in the QResourceManager.Milian Wolff2014-10-293-17/+12
| | | | | | | | | | | | | | | | | | | | | The overhead of a read/write lock should not be required for such small critical sections. It will also allow us to cleanup the code a bit more. Already, the code changes lead to a small improvement before: RESULT : tst_QResourcesManager::benchmarkAllocateSmallResources(): 46,552,767 instructions per iteration (total: 46,552,767, iterations: 1) RESULT : tst_QResourcesManager::benchmarkAllocateBigResources(): 48,338,703 instructions per iteration (total: 48,338,703, iterations: 1) after: RESULT : tst_QResourcesManager::benchmarkAllocateSmallResources(): 44,848,672 instructions per iteration (total: 44,848,672, iterations: 1) RESULT : tst_QResourcesManager::benchmarkAllocateBigResources(): 46,634,161 instructions per iteration (total: 46,634,161, iterations: 1) Change-Id: I8ef0aa52be3caf8b4c8691579677f693a054565c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QResourcesManager: Added dynamic ArrayAllocation policyPaul Lemire2014-10-255-22/+474
| | | | | | | | | | | | | Startup memory usage is now 10% of what it was before. Unit tests corrected and benchmarks added. Benchmarks: DynamicArrayPolicy QResourcesManager Change-Id: Idaeedba5156ac2d6a0a494e7399d9dcb141dc81c Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QChangeArbiter and Observers/Observables made privatePaul Lemire2014-10-173-7/+7
| | | | | | | | | Note: the Renderer aspect uses all those private headers, when we introduce the QBackendNode class that will be a wrapper around those, we will be able to remove those private includes. Change-Id: I6240f754e6da251da158cafcf76029ae59000e05 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Hide doClone implementations behind a macroKevin Ottens2014-10-152-22/+4
| | | | | | | | | This way we will avoid inconsistencies. It also means making some of the copy() implementations more clever. Change-Id: Ic79c9ec7c9c32f8951d5d9f5184592880bf8d5fd Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Silence warnings in QNode unit testSean Harmer2014-10-041-3/+3
| | | | | Change-Id: I903493cc3399b6680ac5947f1c81033a1f1c745c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QNode refactoringPaul Lemire2014-10-035-120/+94
| | | | | | | | | | | | | | | | Move almost everything to private classes. Assimp loading restored. All examples working. QNode hierachy is now handled through QObject::setParent, addChild, removeChild are part of the private api. Note: commented QChangeArbiter unit tests as they can no longer work with this patch and will restore them when QChangeArbiter will have been made private. Task-number: QTBUG-41470 Task-number: QTBUG-41523 Change-Id: I4430974b3aa7f3744c38714b451b122e0cb4d0c9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Improved/Refactored cloning and doClone off all subclassesPaul Lemire2014-09-303-13/+29
| | | | | | | | Note: As we are using QScene during cloning, it is important that node hierarchy be created and added in the proper order (parent then child). Change-Id: I8fd53f7ca696ec9aca19cc70dc116ccba4154911 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Unit Tests for QChangeArbiterPaul Lemire2014-09-303-1/+714
| | | | | Change-Id: I60e9fd42191c14428b38ee9c343477dd4fac3596 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Unit Tests for QScenePaul Lemire2014-09-302-0/+372
| | | | | Change-Id: If4fe9107b72b9efe9bec24e854f4f1b7e6b6553d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QFrameAllocator allocate based on size instead of typePaul Lemire2014-09-301-0/+65
| | | | | | | | Allows to handle allocation of subclasses using the overloaded new operator from the parent. Change-Id: Ie587c81fb3a5cb5aa6735377bfcc57bb4407b117 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Mark backend render classes as private and fix compilationSean Harmer2014-08-172-3/+3
| | | | | Change-Id: I1afb8408e03d4b5405e8ee82d1a3b6b4364d3f5d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Completed node unit testsPaul Lemire2014-08-141-5/+85
| | | | | Change-Id: Iba356b1266b820b50b86efcbd6590f120db80b79 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>