Ejemplo n.º 1
0
int
main (int argc, char **argv)
{
  int debug = 0;
  int i;

  if (argc > 1 && !strcmp (argv[1], "--verbose"))
    verbose = 1;
  else if (argc > 1 && !strcmp (argv[1], "--debug"))
    {
      verbose = 2;
      debug = 1;
    }

  gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
  if (!gcry_check_version (GCRYPT_VERSION))
    die ("version mismatch\n");
  gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
  if (debug)
    gcry_control (GCRYCTL_SET_DEBUG_FLAGS, 1u , 0);
  /* No valuable keys are create, so we can speed up our RNG. */
  gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);

  for (i=0; i < 2; i++)
    check_run ();

  for (i=0; i < 4; i++)
    check_x931_derived_key (i);

  check_ecc_sample_key ();
  check_ed25519ecdsa_sample_key ();

  return !!error_count;
}
Ejemplo n.º 2
0
TEST print_check_runs_and_pass(unsigned int id) {
    if (print_flag) {
        printf("running test %u\n", id);
    }
    if (check_run(id)) {
        fprintf(stderr, "Error: Shuffling made test run multiple times!\n");
        assert(0);
    } else {
        set_run(id);
    }
    PASS();
}
Ejemplo n.º 3
0
void
Main_GUI::create_connections()
{
  connect(input_button, SIGNAL(clicked()), this,
          SLOT(browse_input()));
  connect(output_button, SIGNAL(clicked()), this,
          SLOT(browse_output()));

  connect(input_line, SIGNAL(textChanged(QString)), this,
          SLOT(check_run()));
  connect(output_line, SIGNAL(textChanged(QString)), this,
          SLOT(check_run()));

  connect(input_line, SIGNAL(editingFinished()), this,
          SLOT(absolute_input()));
  connect(output_line, SIGNAL(editingFinished()), this,
          SLOT(absolute_output()));

  connect(min_box, SIGNAL(valueChanged(int)), this,
          SLOT(check_min()));
  connect(max_box, SIGNAL(valueChanged(int)), this,
          SLOT(check_max()));

  connect(limit_box, SIGNAL(valueChanged(int)), this,
          SLOT(check_limit()));
  connect(no_limit_box, SIGNAL(clicked()), this,
          SLOT(check_no_limit()));

  connect(no_increase_box, SIGNAL(clicked()), this,
          SLOT(check_no_increase()));

  connect(snapping_line, SIGNAL(editingFinished()), this,
          SLOT(check_number_set()));
  connect(snapping_line, SIGNAL(textEdited(QString)), this,
          SLOT(clear_status_bar()));

  connect(run_button, SIGNAL(clicked()), this,
          SLOT(run()));
}
Ejemplo n.º 4
0
int
main (int argc, char *argv[])
{
  int ret;

  GNUNET_log_setup ("test-os-start-process",
                    "WARNING",
                    NULL);
  ret = 0;
  ret |= check_run ();
  ret |= check_kill ();
  ret |= check_instant_kill ();
  return ret;
}
int
main (int argc, char *argv[])
{
  int ret;

  GNUNET_log_setup ("test-os-start-process",
#if VERBOSE
                    "DEBUG",
#else
                    "WARNING",
#endif
                    NULL);
  ret = 0;
  ret |= check_run ();
  ret |= check_kill ();
  ret |= check_instant_kill ();

  return ret;
}
Ejemplo n.º 6
0
JBoolean
JTEStyler::SetStyle
	(
	const JIndexRange&	range,
	const JFontStyle&	style
	)
{
	assert( !range.IsEmpty() );

	if (itsCheckRange.last < range.first)
		{
		// we are beyond the range where anything could have changed
		return kJFalse;
		}

	assert( range.first == itsTokenStart );

	if (itsRedoAllFlag)
		{
		JFontID fid = itsDefFontID;
		if (!OnlyColorChanged(style, itsDefFontStyle))
			{
			fid = itsFontMgr->GetFontID(itsFontName, itsFontSize, style);
			}
		itsStyles->AppendElements(JTextEditor::Font(fid, itsFontSize, style, itsDefFontAlign),
								  range.GetLength());
		}
	else if (range.last >= itsCheckRange.first)
		{
		JIndexRange fontRange;
		fontRange.SetFirstAndLength(itsTokenFirstInRun, itsStyles->GetRunLength(itsTokenRunIndex));
		const JBoolean beyondCurrentRun = JNegate( fontRange.Contains(range) );

		JTextEditor::Font f = itsStyles->GetRunData(itsTokenRunIndex);
		if (beyondCurrentRun || style != f.style)
			{
			// extend the check range if we slop over into another style run
			// (HTML: type '<' after 'x' in "x<!--<br><h3>text</h3>-->")

			// extend past end of run to insure that we keep going until we
			// find a correctly styled token

			if (beyondCurrentRun)
				{
				JIndex runIndex   = itsTokenRunIndex;
				JIndex firstInRun = itsTokenFirstInRun;
				const JBoolean ok = itsStyles->FindRun(itsTokenStart, range.last,
													   &runIndex, &firstInRun);
				ExtendCheckRange(firstInRun + itsStyles->GetRunLength(runIndex));
				}

			// extend check range to next token since this token was not
			// correctly styled -- should only stop when find correctly
			// styled tokens

			else	// style != f.style
				{
				ExtendCheckRange(range.last+1);
				}

			// update the styles

			if (!beyondCurrentRun && OnlyColorChanged(style, f.style))
				{
				*itsRedrawRange += range;
				}
			else
				{
				*itsRecalcRange += range;
				}

			f.size  = itsFontSize;
			f.style = style;
			if (OnlyColorChanged(style, itsDefFontStyle))
				{
				f.id = itsDefFontID;
				}
			else
				{
				f.id = itsFontMgr->GetFontID(itsFontName, itsFontSize, style);
				}
			f.align  = itsDefFontAlign;

			itsStyles->RemoveNextElements(range.first, range.GetLength(),
										  &itsTokenRunIndex, &itsTokenFirstInRun);

			run_assert(itsStyles, range.first, itsTokenRunIndex, itsTokenFirstInRun);

			itsStyles->InsertElementsAtIndex(range.first, f, range.GetLength(),
											 &itsTokenRunIndex, &itsTokenFirstInRun);

			run_assert(itsStyles, range.first, itsTokenRunIndex, itsTokenFirstInRun);
			}
		}

	itsTokenStart = range.last+1;
	if (!itsRedoAllFlag)
		{
		const JBoolean ok = itsStyles->FindRun(range.first, itsTokenStart,
											   &itsTokenRunIndex, &itsTokenFirstInRun);
		assert( ok || range.last == itsText->GetLength() );
		assert( range.last == itsText->GetLength() ||
				check_run(itsStyles, itsTokenStart, itsTokenRunIndex, itsTokenFirstInRun) );
		}

	return JConvertToBoolean( range.last < itsCheckRange.last );
}