summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Add a new class for handling a process's environment variables.Thiago Macieira2009-08-211-6/+31
| | | | | | | | | | | | | | | | | First of all, make it a lot easier to access individual variables by having them in an associative container (a QHash). This fixes task 232427, albeit one release later than I had originally planned. On Windows, the variable names in the environment are case-insensitive, so a direct QHash isn't a good solution. Implement code that does the uppercasing on Windows and leaves untransformed on other platforms. Since we're doing this anyways, use QByteArray on Unix systems, since, in theory, the environment could contain any random binary data, which is not representable in QString. Task-number: 232427
* Fix memory leakOlivier Goffart2009-08-211-1/+1
| | | | | | | | | When the variant is invalid the shared is not destroyed. We even can avoid the creation of the PrivateShared if we know the variant is invalid Reviewed-by: Thierry
* Optimize contrcuction of variant of type pointer.Olivier Goffart2009-08-211-0/+1
| | | | | | | | | | | | | Constructing a variant of a pointer type was previously quite slow: QVariant had no information it was a pointer. It had to create a QVariant::PrivateShared, ask the QMetaType for a constructor (slow as it involve locking mutextes) and allocate a pointer. By detecting a pointer in qVariantFromValue, we can store the pointer value dirrectly in the Variant union. We then avoid 2 allocations, and the expensive locking in QMetaType::construct Reviewed-by: Thierry
* rename QEventTransition::eventObject to eventSourceKent Hansen2009-08-211-8/+8
| | | | | | eventObject was a horrible name. The documentation already used the term "event source", so let's call it that. Agreed with Eskil.
* Autotest QEXPECTED_FAIL removedJedrzej Nowacki2009-08-211-3/+1
| | | | Reviewed-by: Kent Hansen
* Merge branch 'anchorlayout' of ↵Jan-Arve Sæther2009-08-214-0/+874
|\ | | | | | | | | | | | | git@gitorious.org:+openbossa-developers/qt/openbossa-clone Conflicts: src/gui/graphicsview/graphicsview.pri
| * Add the autotest to auto.proJan-Arve Sæther2009-08-201-1/+2
| |
| * update API to what was agreed on the API review meeting yesterday:Jan-Arve Sæther2009-08-191-134/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changes are: * Move enums in QGraphicsAnchorLayout::Edge to Qt::AnchorPoint. Prefix them with Anchor since they are not edges in general. * Rename anchor() to addAnchor() * Rename anchorCorner() -> addCornerAnchors() * Rename anchorWidth() -> addLeftAndRightAnchors() * Rename anchorHeight() -> addTopAndBottomAnchors() * Rename anchorGeometry() -> addAllAnchors() * remove the overloads that take a spacing argument, and add setAnchorSpacing() to accommodate for that. * Added anchorSpacing() (implementation missing) * Added unsetAnchorSpacing(). (implementation missing) * made sizeHint() protected. Updated all examples and autotest to reflect this API change.
| * Fix one "failure" on the mac.Jan-Arve Sæther2009-08-191-0/+3
| | | | | | | | This failed on Alexis' Mac Mini (Leopard)
| * QGraphicsAnchorLayout: fix calculation of sizeAt* values for SequentialCaio Marcelo de Oliveira Filho2009-08-181-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit implements what's described in the previous commit QGraphicsAnchorLayout: fix expected values for parallel test When filling the sizeAt* values (the three points used for interpolation when setting geometry), now sequential anchors distribute the sizes to the children in a fair way, i.e. proportionally in relation to the existing min/pref/max hints. Each value is defined in relation of the pref (either as a shrinkage in pref or a grow in pref). In both cases the shrinking/growing factor is the same for all children. When we implement support for QSizePolicies, this distribution might be changed by setting size policies for a certain item or anchor. This makes two tests work -- so no more expected fail. Also fixed a typo in one test's expected results.
| * QGraphicsAnchorLayout: add names to items in examplesCaio Marcelo de Oliveira Filho2009-08-171-33/+33
| | | | | | | | | | Having the items named helps when using debugging functions to identify the anchors. Cause no harm to add them to the tests.
| * QGraphicsAnchorLayout: calculate vertex positions with simplified graphCaio Marcelo de Oliveira Filho2009-08-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When traversing the graph looking for calculating the distances, also enter inside the complex edges to find (and calculate) the distances for the vertices that were simplified. This require a little tweak in the traversal, now we can't always skip an edge when both vertices are already visited, because complex anchors can hide vertices inside (a sequential anchor in practice remove vertices from the full graph). As a bonus we now pass on the 'example' test (as expected) and the example now works fine. Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
| * More tests for setSpacingJan-Arve Sæther2009-08-171-0/+15
| |
| * Add autotest for setSpacing()Jan-Arve Sæther2009-08-171-0/+42
| |
| * Added QEXPECT_FAIL, for tests that we must fix, but we know they fail.Jan-Arve Sæther2009-08-141-0/+3
| |
| * QGraphicsAnchorLayout: fix expected values for parallel testCaio Marcelo de Oliveira Filho2009-08-131-40/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We changed the parallel example because the expected values for preferred size are wrong. Before we had a parallel anchor ("d|e") that should have the maximum preferred of the both children, so this end up being 170. This parallel is in a sequence with another item ("b") with a preferred of 150 ending up with 320. This group is in parallel with "c" that has a maximum of 300. So in the preferred size of the layout, the group was constraint to 300, which would be proportionally distributed between "b" and "d|e", and 50%/50% as the test expected. The proportional distribution is a feature and we changed the test to illustrate that more. We gave a bump in "c" maximum to 350 and "b" maximum to 300, so the preferred is 100% for both "b" and "d|e", and the proportional feature shows up in the maximum allocation, which is not 100% for the group (b and d|e). In the group, the maximum possible is 500 but the layout only allows 350, so the sizes need to be proportionally, but in relation not to zero, but to the preferred which is 320 (this is the same logic used for setGeometry()). So the growth is 30 / (500 - 320) = 30 / 180 = 1/6. This 1/6 should be the factor given to the children (b and d|e), taking their preferred sizes as starting points. Note that the test still fails, but serve as a milestone to see when the feature is correct implemented. Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> Reviewed-by: Artur Duque de Souza <artur.souza@openbossa.org>
| * QGraphicsAnchorLayout: test for proportional distributionCaio Marcelo de Oliveira Filho2009-08-131-0/+62
| | | | | | | | | | | | | | | | | | | | This test (which fails right now) check whether a sequential anchor is distributing proportionally the size between its parts. This should pass when we make calculateVertexPositions() work together with the simplified graph. Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> Reviewed-by: Artur Duque de Souza <artur.souza@openbossa.org>
| * QGraphicsAnchorLayout: add a few more testsCaio Marcelo de Oliveira Filho2009-08-131-0/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding tests that were helpful during debugging simplification - example: a replica of the anchorlayout example, which has a few interesting cases. - parallel2: a small pararell test case, subset of example. - snakeOppositeDirections: snake but with connections in the opposite directions (this will end up with anchors with opposite directions). - fairDistributionOppositeDirections: same as before, but in the end, this should be taken care by our API which makes internally the same as fairDistribution. Some work on adding QCOMPARE() statements may still be needed for this examples. Note that is interesting to notice (maybe we can make this available for the test checking automatically) whether the simplex is being used or not when simplification is active. Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
| * Add QGraphicsLayout::anchor() overloads and query the default spacing.Jan-Arve Sæther2009-07-221-54/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes several related issues: 1. QGAL::anchor() had a spacing argument that defaulted to 0. That made it impossible to know if the user meant that the spacing should be 0 or if the spacing should be picked from the style. Instead we have to overload anchor, so now we have one function that does not take spacing as an argument. That one will create an anchor where the spacing is queried from the style. The other overload allows the user to explicitly set the spacing, thus the default spacing is ignored. 2. Make sure we pick up the spacing correctly from the style if needed. setAnchorSizeHintsFromDefaults() will set the correct spacing on anchors that was created without specifying a spacing value. 3. Add QGAL::anchor(Qt::Corner, ...) convenience function with an overload (for the same reason as explained in 1.) 4. Added QGraphicsAnchorLayoutPrivate::anchor() as a helper function that is called from all the 4 public API anchor() functions so that we don't need to have duplicate code for argument checking etc. 5. Fix autotests. They assumed that anchor() without a spacing argument created a spacing of 0.
| * QGraphicsAnchorLayout: Adding auto-testsJesus Sanchez-Palencia2009-07-223-0/+356
| | | | | | | | | | | | | | Signed-off-by: Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org> Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Signed-off-by: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
* | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into ↵Kent Hansen2009-08-212-32/+520
|\ \ | | | | | | | | | qtscript-jsc-backend
| * \ Merge branch 'kinetic-transform' of git@scm.dev.nokia.troll.no:qt/kineticRhys Weatherley2009-08-202-32/+520
| |\ \
| | * | Benchmarks comparing QMatrix4x4 with QTransformRhys Weatherley2009-08-201-0/+411
| | | | | | | | | | | | | | | | Reviewed-by: trustme
| | * | Remove QGraphicsTransform::project()Rhys Weatherley2009-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | QMatrix4x4::toTransform() now does what project() used to do. Reviewed-by: trustme
| | * | Re-implement QGraphicsTransform to use QMatrix4x4Rhys Weatherley2009-08-191-32/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTransform-based transformations create problems when performing X and Y axis rotations because they aren't using true 3D. This change modifies QGraphicsTransform and its sub-classes to use QMatrix4x4 as the standard transformation matrix, with a project() function to project back to 2D when required. Reviewed-by: trustme
* | | | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into ↵Kent Hansen2009-08-2023-63/+244
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | qtscript-jsc-backend Conflicts: src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
| * | | Extend testUndoBlock() with a single command block insertmae2009-08-201-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | Test a newly discovered bug when a beginEditBlock()/endEditoBlock() contains only one single insertion command. It should still be treated as an undo block of its own.
| * | | split the qstringbuilder autotest into fourhjk2009-08-2015-43/+38
| | | | | | | | | | | | | | | | | | | | Some S60 and WinCE test scripts prefer to have only one executable per directory.
| * | | Autotest: this test is not passing: so show that.Thiago Macieira2009-08-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that this the test is running into a false positive. It thinks it's ok, but it isn't. So show the problem.
| * | | Autotest: remove unreliable test.Thiago Macieira2009-08-201-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test required Qt to be built in debug mode. But there's no way of checking that from the autotest: some of our test machines build Qt in release mode but the tests in debug mode. So we don't test the Q_ASSERT.
| * | | Autotest: add one more check for operator==Thiago Macieira2009-08-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm running out of ideas as to why MSVC.NET 2003 cannot do this test: baseptr == aData If I do baseptr.data() == aData, it works. And the operator== that it should be calling does exactly that. So my only clue so far is that it's calling some other operator== -- which doesn't make sense, since there is no other.
| * | | Fix literal IPv6 hostname resolution in QHostInfo.Thiago Macieira2009-08-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the series of commits ending in ff1280178, I made QUrl::toAce fail if the parameter is not a well-formed hostname (i.e., if it violates STD3). IPv6 hostnames do, so we can't preemptively run ToACE. Instead, delay running ToACE until we've tried literal matching. Reviewed-by: TrustMe
| * | | Performance issue in QGraphicsItem::addParentItem while building theGabriel de Dietrich2009-08-201-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scene bottom-up. When adding n items, the depth was computed n² times. Adding lazy computation fixes this performance issue. Reviewed-by: Andreas
| * | | Fix QVariant::toFloat() and QVariant::toRealOlivier Goffart2009-08-201-1/+37
| | | | | | | | | | | | | | | | Reviewed-by: Thierry
| * | | QNAM HTTP PipeliningMarkus Goetz2009-08-202-3/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HTTP Pipelining should improve the performance of HTTP requests for high latency network links. Since some servers/proxies could have problems with it, it is disabled by default. Set the HttpPipeliningAllowed attribute of a QNetworkRequest to enable it for that request. Reviewed-by: Thiago
* | | | use a list to keep track of registered script valuesKent Hansen2009-08-201-2/+0
| | | | | | | | | | | | | | | | Get rid of the hash.
* | | | QEXPECT_FAIL was removed.Jedrzej Nowacki2009-08-201-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Autotest's correction after 3062cd6395ba13746aea452eb53447d915184e2d Column numbers are calculated corectly Reviewed-by: Kent Hansen
* | | | make QScriptEngine::objectById() workKent Hansen2009-08-201-1/+3
| | | | | | | | | | | | | | | | | | | | It needs to work even when there is no public QScriptValue that holds a reference to the object.
* | | | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into ↵Kent Hansen2009-08-2031-5/+1154
|\ \ \ \ | |/ / / | | | | | | | | qtscript-jsc-backend
| * | | Add some more tests for QQuaternion multiplicationRhys Weatherley2009-08-201-0/+9
| | | | | | | | | | | | | | | | Reviewed-by: trustme
| * | | Make the license test pass.Frans Englich2009-08-1930-5/+1145
| |/ / | | | | | | | | | | | | | | | | | | This is partly done to address a review comment for S60. Reviewed-by: Marius SO Reviewed-by: Paul
* | | invalidate wrapped JSC::JSValue when script engine is deletedKent Hansen2009-08-191-3/+1
| | | | | | | | | | | | Otherwise we will crash if someone tries to do something with the value.
* | | Fix QScriptValue::objectId().Jedrzej Nowacki2009-08-191-1/+0
| | | | | | | | | | | | | | | | | | | | | QScriptValue id were made persistent. It depands on JSC:JSValue JSCell pointer not on QScriptValuePrivate attr. Reviewed-by: Kent Hansen
* | | add more detailed tests for QRegExp <--> JS RegExp conversionKent Hansen2009-08-191-1/+19
| | |
* | | remove expected failureKent Hansen2009-08-191-1/+0
| | | | | | | | | | | | Works as of commit 5bca43cca3ac90429e3f9263d0d7ea8c9eb164d4.
* | | add test to make sure a JavaScript object's ID persistsKent Hansen2009-08-191-0/+10
| | | | | | | | | | | | | | | | | | Even if the QScriptValue is destroyed, the underlying ID should not change; e.g. if a new QScriptValue is created and wraps the same object, the ID should be the same as before.
* | | update expected output to match that of JSC-based qtscript back-endKent Hansen2009-08-191-2/+2
| | | | | | | | | | | | Output of backtrace has changed slightly (e.g. "at" instead of "@").
* | | make QScriptEngine::isEvaluating() work for top-level evaluationKent Hansen2009-08-191-0/+24
| | | | | | | | | | | | | | | | | | Since QScriptEngine::evaluate() doesn't create a new stack frame anymore, we need to use a dedicated variable to keep track of whether the engine is currently evaluating or not.
* | | move the builtinFunctionNames test to qscriptengine autotestsKent Hansen2009-08-192-198/+175
| | | | | | | | | | | | | | | | | | | | | With the JSC-based back-end, stack frames aren't created when calling any of the built-in ECMA functions, so we can't base the test on that. Instead, just look up the "name" property of each function and check that it has the expected value.
* | | only add qtscript autotests if qt is configured appropriatelyKent Hansen2009-08-191-13/+15
| | |