コード例 #1
0
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;
}
コード例 #2
0
ファイル: event_list.cpp プロジェクト: cojuer/vis4
/** 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);
    }
}
コード例 #3
0
ファイル: Wheeshtv1mr3fr3t256.cpp プロジェクト: Vieteg/EACirc
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;
    }
}
コード例 #4
0
ファイル: Norx3241v1.cpp プロジェクト: Vieteg/EACirc
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;
    }
}
コード例 #5
0
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;
    }
}
コード例 #6
0
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;
    }
}
コード例 #7
0
ファイル: Juliusv1draft.cpp プロジェクト: Vieteg/EACirc
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;
    }
}
コード例 #8
0
ファイル: Aes128poetv1aes128.cpp プロジェクト: Vieteg/EACirc
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;
    }
}
コード例 #9
0
ファイル: Scream10v2.cpp プロジェクト: Vieteg/EACirc
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;
    }
}
コード例 #10
0
ファイル: Shellaes128v1d7n80.cpp プロジェクト: Vieteg/EACirc
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;
    }
}
コード例 #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);
}