END_TEST

START_TEST (does_not_convert_numbers)
{
	test_conversion("1234567890", "1234567890");		
	test_conversion("1a2b3c4d5e6f7g8h9i0", "1A2B3C4D5E6F7G8H9I0");		
}
Example #2
0
static int control(struct af_instance *af, int cmd, void *arg)
{
    switch (cmd) {
    case AF_CONTROL_REINIT: {
        struct mp_audio *in = arg;
        struct mp_audio orig_in = *in;
        struct mp_audio *out = af->data;

        if (!test_conversion(in->format, out->format))
            return AF_DETACH;

        if ((in->format & AF_FORMAT_BITS_MASK) == AF_FORMAT_24BIT) {
            mp_audio_set_format(out, af_fmt_change_bits(in->format, 32));
        } else if ((in->format & AF_FORMAT_BITS_MASK) == AF_FORMAT_32BIT) {
            mp_audio_set_format(out, af_fmt_change_bits(in->format, 24));
        } else {
            abort();
        }

        out->rate = in->rate;
        mp_audio_set_channels(out, &in->channels);

        assert(test_conversion(in->format, out->format));

        return mp_audio_config_equals(in, &orig_in) ? AF_OK : AF_FALSE;
    }
    case AF_CONTROL_SET_FORMAT: {
        mp_audio_set_format(af->data, *(int*)arg);
        return AF_OK;
    }
    }
    return AF_UNKNOWN;
}
int main()
{
    MaRC::ViewingGeometry vg(body);

    return
        test_initialization(vg)
        && test_visibility(vg)
        && test_conversion(vg)
        ? 0 : -1;
}
Example #4
0
/*
 *  euler angle tests
 */
void setup(void)
{
    hal.console->println("euler unit tests\n");

    test_conversion(0, M_PI, 0);

    test_frame_transforms();
    test_conversions();
    test_quaternion_eulers();
    test_matrix_eulers();
    test_matrix_rotate();
}
void TestAWScriptFormatter::test_appendCode()
{
    // set
    formatter->setAppendCode(true);
    QCOMPARE(formatter->appendCode(), true);
    formatter->setCode(codeWithReturn);

    // test
    QCOMPARE(formatter->program(), fullCode);
    test_conversion();

    // reset
    formatter->setAppendCode(false);
}
Example #6
0
int
sc_main( int, char*[] )
{
#if defined(_MSC_VER) && _MSC_VER < 1900
     _set_output_format(_TWO_DIGIT_EXPONENT);
#endif
    test_print();
    test_constructors();
    test_assignment();
    test_conversion();
    test_relational();
    test_arithmetic();
    test_SC_ZERO_TIME();

    return 0;
}
void TestAWScriptFormatter::test_hasReturn()
{
    // set
    formatter->setHasReturn(false);
    QCOMPARE(formatter->hasReturn(), false);
    formatter->setCode(code);

    // test 1
    QEXPECT_FAIL("", "Should fail because appendCode set to false", Continue);
    QCOMPARE(formatter->program(), fullCode);

    // test 2
    formatter->setAppendCode(true);
    QCOMPARE(formatter->program(), fullCode);
    test_conversion();
}
Example #8
0
static int control(struct af_instance *af, int cmd, void *arg)
{
    switch (cmd) {
    case AF_CONTROL_REINIT: {
        struct mp_audio *in = arg;
        struct mp_audio orig_in = *in;
        struct mp_audio *out = af->data;

        if (!test_conversion(in->format, out->format))
            return AF_DETACH;

        out->rate = in->rate;
        mp_audio_set_channels(out, &in->channels);

        return mp_audio_config_equals(in, &orig_in) ? AF_OK : AF_FALSE;
    }
    case AF_CONTROL_SET_FORMAT: {
        mp_audio_set_format(af->data, *(int*)arg);
        return AF_OK;
    }
    }
    return AF_UNKNOWN;
}
Example #9
0
void test_conversions(void)
{
    uint8_t N = ARRAY_SIZE(angles);

    hal.console->printf("matrix/quaternion tests\n\n");

    test_conversion(1, 1.1f, 1.2f);
    test_conversion(1, -1.1f, 1.2f);
    test_conversion(1, -1.1f, -1.2f);
    test_conversion(-1, 1.1f, -1.2f);
    test_conversion(-1, 1.1f, 1.2f);

    for (uint8_t i = 0; i < N; i++)
        for (uint8_t j = 0; j < N; j++)
            for (uint8_t k = 0; k < N; k++)
                test_conversion(angles[i], angles[j], angles[k]);

    hal.console->printf("tests done\n\n");
}
Example #10
0
int initfunction(const struct ssPWD *pwd)
  {
  /* global copy so the test routines can check for critical errors */
  spwd = pwd;

  /* ******************************************************************** */
  printf ("### start ###\n");
  plan_tests(51 + 1);
 
  /* systematic conversion tests in single-byte encodings */
  test_conversion (pwd, ISO_8859_1);
  test_conversion (pwd, ISO_8859_2);
  test_conversion (pwd, ISO_8859_3);
  test_conversion (pwd, ISO_8859_4);
  test_conversion (pwd, ISO_8859_5);
  test_conversion (pwd, ISO_8859_6);
  test_conversion (pwd, ISO_8859_7);
  test_conversion (pwd, ISO_8859_8);
  test_conversion (pwd, ISO_8859_9);
  test_conversion (pwd, ISO_8859_10);
  test_conversion (pwd, ISO_8859_11);
  test_conversion (pwd, ISO_8859_13);
  test_conversion (pwd, ISO_8859_14);
  test_conversion (pwd, ISO_8859_15);
  test_conversion (pwd, ISO_8859_16);
  test_conversion (pwd, KOI8_R);
  test_conversion (pwd, KOI8_U);
  test_conversion (pwd, CP437);
  test_conversion (pwd, CP850);
 
  test_conversion (pwd, CP852);
  test_conversion (pwd, CP855);
  test_conversion (pwd, CP857);
  /* test_conversion (pwd, CP858); */
  test_conversion (pwd, CP860);
  test_conversion (pwd, CP861);
  test_conversion (pwd, CP862);
  test_conversion (pwd, CP863);
  test_conversion (pwd, CP865);
  test_conversion (pwd, CP866);
  test_conversion (pwd, CP869);
  test_conversion (pwd, CP874);

  test_conversion (pwd, CP1250);
  test_conversion (pwd, CP1251);
  test_conversion (pwd, CP1252);
  test_conversion (pwd, CP1253);
  test_conversion (pwd, CP1254);
  test_conversion (pwd, CP1255);
  test_conversion (pwd, CP1256);
  test_conversion (pwd, CP1257);
  test_conversion (pwd, CP1258);

  /* is an alias for ISO_8859_11 */
  equals (TIS_620, ISO_8859_11, "TIS-620 is also known as ISO-8859-1");
  
  test_conversion (pwd, MacRoman);
  test_conversion (pwd, MacCentralEurRoman);
  test_conversion (pwd, MacIcelandic);
  test_conversion (pwd, MacIcelandic);
  test_conversion (pwd, MacCroatian);
  test_conversion (pwd, MacRomanian);
  test_conversion (pwd, MacRumanian);
  test_conversion (pwd, MacCyrillic);
  test_conversion (pwd, MacUkrainian);
  test_conversion (pwd, MacGreek);
  test_conversion (pwd, MacTurkish);
  test_conversion (pwd, MacSami);

  /* not done yet:
  test_conversion (pwd, MacHebrew);
  test_conversion (pwd, MacThai);
  test_conversion (pwd, MacArabic);
  test_conversion (pwd, MacFarsi);
  */

  /* ******************************************************************** */
  printf ("### end ###\n");

  return PWD_INIT_OK;		/* init was okay */
  }