CPPUNIT_NS_BEGIN


bool
DefaultProtector::protect( const Functor &functor,
                           const ProtectorContext &context )
{
  try
  {
    return functor();
  }
  catch ( Exception &failure )
  {
    reportFailure( context, failure );
  }
  catch ( std::exception &e )
  {
    std::string shortDescription( "uncaught exception of type " );
#if CPPUNIT_USE_TYPEINFO_NAME
    shortDescription += TypeInfoHelper::getClassName( typeid(e) );
#else
    shortDescription += "std::exception (or derived).";
#endif
    Message message( shortDescription, e.what() );
    reportError( context, message );
  }
  catch ( ... )
  {
    reportError( context,
                 Message( "uncaught exception of unknown type") );
  }

  return false;
}
Example #2
0
/** time is used to select first event with this time */
void EventList::showEvents(TraceModelPtr& traceModel, const Time& time)
{
    //? maybe better to clear model, not to delete it
    delete model();
    events.clear();

    QStandardItemModel* modelPtr = new QStandardItemModel(this);
    modelPtr->insertColumns(0, 2);
    QTreeView::setModel(modelPtr);
    connect(this->selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),this,
                                    SLOT(eventListRowChanged()));

    int nearestEvent = -1;
    Time minDistance;//? min time range not initialized
    int row = 0;

    for(auto eventPtr = traceModel->getNextEvent(); eventPtr ;eventPtr = traceModel->getNextEvent(), ++row)
    {
        model()->insertRow(row);

        if (nearestEvent == -1 || distance(time, eventPtr->time) < minDistance)
        {
            nearestEvent = row;
            minDistance = distance(time, eventPtr->time);
        }

        QModelIndex index = model()->index(row, 0, QModelIndex());
        model()->setData(index, eventPtr->time.toString());
        index = model()->index(row, 1, QModelIndex());
        model()->setData(index, eventPtr->shortDescription());
        model()->setData(index, eventPtr->shortDescription(), Qt::ToolTipRole);
        events.push_back(eventPtr);
    }

    setAlternatingRowColors(true);

    resizeColumnToContents(0);
    resizeColumnToContents(1);

    if (nearestEvent != -1)
    {
        selectionModel()->setCurrentIndex(this->model()->index(nearestEvent, 0), QItemSelectionModel::Select);
        selectionModel()->select(this->model()->index(nearestEvent, 0), QItemSelectionModel::Select);
        selectionModel()->select(this->model()->index(nearestEvent, 1), QItemSelectionModel::Select);
    }
}
Example #3
0
Wheeshtv1mr3fr3t256::Wheeshtv1mr3fr3t256(int numRounds)
    : CaesarInterface(CAESAR_WHEESHTV1MR3FR3T256, numRounds, CRYPTO_KEYBYTES, CRYPTO_NSECBYTES, CRYPTO_NPUBBYTES, CRYPTO_ABYTES) {
    if (numRounds < -1 || numRounds > maxNumRounds) {
        mainLogger.out(LOGGER_WARNING) << "Weird number of rouds (" << numRounds << ") for " << shortDescription() << endl;
    }
    if (numRounds == -1) {
        Wheeshtv1mr3fr3t256_raw::numRounds = maxNumRounds;
        CaesarCommon::numRounds = maxNumRounds;
    } else {
        Wheeshtv1mr3fr3t256_raw::numRounds = m_numRounds;
        CaesarCommon::numRounds = m_numRounds;
    }
}
Example #4
0
Norx3241v1::Norx3241v1(int numRounds)
    : CaesarInterface(CAESAR_NORX3241V1, numRounds, CRYPTO_KEYBYTES, CRYPTO_NSECBYTES, CRYPTO_NPUBBYTES, CRYPTO_ABYTES) {
    if (numRounds < -1 || numRounds > maxNumRounds) {
        mainLogger.out(LOGGER_WARNING) << "Weird number of rouds (" << numRounds << ") for " << shortDescription() << endl;
    }
    if (numRounds == -1) {
        Norx3241v1_raw::numRounds = maxNumRounds;
        CaesarCommon::numRounds = maxNumRounds;
    } else {
        Norx3241v1_raw::numRounds = m_numRounds;
        CaesarCommon::numRounds = m_numRounds;
    }
}
Aeadaes256ocbtaglen96v1::Aeadaes256ocbtaglen96v1(int numRounds)
    : CaesarInterface(CAESAR_AEADAES256OCBTAGLEN96V1, numRounds, CRYPTO_KEYBYTES, CRYPTO_NSECBYTES, CRYPTO_NPUBBYTES, CRYPTO_ABYTES) {
    if (numRounds < -1 || numRounds > maxNumRounds) {
        mainLogger.out(LOGGER_WARNING) << "Weird number of rouds (" << numRounds << ") for " << shortDescription() << endl;
    }
    if (numRounds == -1) {
        Aeadaes256ocbtaglen96v1_raw::numRounds = maxNumRounds;
        CaesarCommon::numRounds = maxNumRounds;
    } else {
        Aeadaes256ocbtaglen96v1_raw::numRounds = m_numRounds;
        CaesarCommon::numRounds = m_numRounds;
    }
}
Omdsha256k128n96tau96v1::Omdsha256k128n96tau96v1(int numRounds)
    : CaesarInterface(CAESAR_OMDSHA256K128N96TAU96V1, numRounds, CRYPTO_KEYBYTES, CRYPTO_NSECBYTES, CRYPTO_NPUBBYTES, CRYPTO_ABYTES) {
    if (numRounds < -1 || numRounds > maxNumRounds) {
        mainLogger.out(LOGGER_WARNING) << "Weird number of rouds (" << numRounds << ") for " << shortDescription() << endl;
    }
    if (numRounds == -1) {
        Omdsha256k128n96tau96v1_raw::numRounds = maxNumRounds;
        CaesarCommon::numRounds = maxNumRounds;
    } else {
        Omdsha256k128n96tau96v1_raw::numRounds = m_numRounds;
        CaesarCommon::numRounds = m_numRounds;
    }
}
Example #7
0
Juliusv1draft::Juliusv1draft(int numRounds)
    : CaesarInterface(CAESAR_JULIUSV1DRAFT, numRounds, CRYPTO_KEYBYTES, CRYPTO_NSECBYTES, CRYPTO_NPUBBYTES, CRYPTO_ABYTES) {
    if (numRounds < -1 || numRounds > maxNumRounds) {
        mainLogger.out(LOGGER_WARNING) << "Weird number of rouds (" << numRounds << ") for " << shortDescription() << endl;
    }
    if (numRounds == -1) {
        Juliusv1draft_raw::numRounds = maxNumRounds;
        CaesarCommon::numRounds = maxNumRounds;
    } else {
        Juliusv1draft_raw::numRounds = m_numRounds;
        CaesarCommon::numRounds = m_numRounds;
    }
}
Example #8
0
Aes128poetv1aes128::Aes128poetv1aes128(int numRounds)
    : CaesarInterface(CAESAR_AES128POETV1AES128, numRounds, CRYPTO_KEYBYTES, CRYPTO_NSECBYTES, CRYPTO_NPUBBYTES, CRYPTO_ABYTES) {
    if (numRounds < -1 || numRounds > maxNumRounds) {
        mainLogger.out(LOGGER_WARNING) << "Weird number of rouds (" << numRounds << ") for " << shortDescription() << endl;
    }
    if (numRounds == -1) {
        Aes128poetv1aes128_raw::numRounds = maxNumRounds;
        CaesarCommon::numRounds = maxNumRounds;
    } else {
        Aes128poetv1aes128_raw::numRounds = m_numRounds;
        CaesarCommon::numRounds = m_numRounds;
    }
}
Example #9
0
Scream10v2::Scream10v2(int numRounds)
    : CaesarInterface(CAESAR_SCREAM10V2, numRounds, CRYPTO_KEYBYTES, CRYPTO_NSECBYTES, CRYPTO_NPUBBYTES, CRYPTO_ABYTES) {
    if (numRounds < -1 || numRounds > maxNumRounds) {
        mainLogger.out(LOGGER_WARNING) << "Weird number of rouds (" << numRounds << ") for " << shortDescription() << endl;
    }
    if (numRounds == -1) {
        Scream10v2_raw::numRounds = maxNumRounds;
        CaesarCommon::numRounds = maxNumRounds;
    } else {
        Scream10v2_raw::numRounds = m_numRounds;
        CaesarCommon::numRounds = m_numRounds;
    }
}
Example #10
0
Shellaes128v1d7n80::Shellaes128v1d7n80(int numRounds)
    : CaesarInterface(CAESAR_SHELLAES128V1D7N80, numRounds, CRYPTO_KEYBYTES, CRYPTO_NSECBYTES, CRYPTO_NPUBBYTES, CRYPTO_ABYTES) {
    if (numRounds < -1 || numRounds > maxNumRounds) {
        mainLogger.out(LOGGER_WARNING) << "Weird number of rouds (" << numRounds << ") for " << shortDescription() << endl;
    }
    if (numRounds == -1) {
        Shellaes128v1d7n80_raw::numRounds = maxNumRounds;
        CaesarCommon::numRounds = maxNumRounds;
    } else {
        Shellaes128v1d7n80_raw::numRounds = m_numRounds;
        CaesarCommon::numRounds = m_numRounds;
    }
}
Example #11
0
void AMLoopActionInfo3::onLoopCountChanged(int newLoopCount)
{
	QString newDescription = shortDescription();
	newDescription = newDescription.replace(QRegExp("repeat [0-9]{1,} time(s|)"), QString("repeat %1 time%2").arg(newLoopCount).arg(newLoopCount > 1 ? "s" : ""));
	setShortDescription(newDescription);
}