Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-4926

Aggregate class deadlocks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Not Evaluated Not Evaluated
    • Qt Creator 2.3.0
    • Qt Creator 2.2.0
    • All Other Issues
    • None
    • f3e22da48cb4ae1c8be48072c852a1a24e54f953

      Adding the following test code results in a deadlock of the code.

      void tst_Aggregate::parentAggregate()
       {
           Aggregation::Aggregate aggregation;
      +    Aggregation::Aggregate aggregation2;
           Interface1 *component1 = new Interface1;
           Interface11 *component11 = new Interface11;
           QObject *component2 = new QObject;
           aggregation.add(component1);
           aggregation.add(component11);
           QCOMPARE(Aggregation::Aggregate::parentAggregate(&aggregation), &aggregation);
           QCOMPARE(Aggregation::Aggregate::parentAggregate(component1), &aggregation);
           QCOMPARE(Aggregation::Aggregate::parentAggregate(component11), &aggregation);
           QCOMPARE(Aggregation::Aggregate::parentAggregate(component2), (Aggregation::Aggregate *)0);
      +    // test reparenting a component to another aggregate.
      +    aggregation2.add(component11);
      +    QCOMPARE(Aggregation::Aggregate::parentAggregate(component11), &aggregation2);
      +    // test adding an aggregate to an aggregate
      +    aggregation.add(&aggregation2);
      +    QCOMPARE(Aggregation::Aggregate::parentAggregate(&aggregation2), &aggregation);
      +    // test reparenting an aggregate to an aggregate
      +    aggregation2.add(&aggregation);
      +    QCOMPARE(Aggregation::Aggregate::parentAggregate(&aggregation2), &aggregation);
      +    // test removing an object from an aggregation.
      +    aggregation2.remove(component11);
      +    QCOMPARE(Aggregation::Aggregate::parentAggregate(component11), (Aggregation::Aggregate *)0);
       }
      

        For Gerrit Dashboard: QTCREATORBUG-4926
        # Subject Branch Project Status CR V

            con Eike Ziller
            bilking Bill King
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes