Esempio n. 1
0
int
main(int argc, char **argv)
{
    static TestUtilsTest tests[] = {
	TU_TEST(test_sync, 60),
	TU_END()
    };

    glib_init();
    return testutils_run_tests(argc, argv, tests);
}
Esempio n. 2
0
int
main(int argc, char **argv)
{
    static TestUtilsTest tests[] = {
        TU_TEST(test_encode, 90),
        TU_TEST(test_decode, 90),
        TU_TEST(test_roundtrip, 90),
        TU_TEST(test_roundtrip_rand, 90),
        TU_END()
    };
    return testutils_run_tests(argc, argv, tests);
}
Esempio n. 3
0
int
main(int argc, char **argv)
{
    static TestUtilsTest tests[] = {
	TU_TEST(test_old_impls, 90),
	TU_TEST(test_inter_proc_locking, 60),
	TU_TEST(test_intra_proc_locking, 60),
	TU_END()
    };

    glib_init();
    return testutils_run_tests(argc, argv, tests);
}
Esempio n. 4
0
int
map_scale_ifmx_to_odbc(int coltype, int collen)
{
	IxSQLType       ifmxtype = (IxSQLType)coltype;
	int             odbcscale;

	switch (ifmxtype)
	{
	case ix_CHAR:
	case ix_NCHAR:
	case ix_VARCHAR:
	case ix_NVARCHAR:
#ifdef SQLLVARCHAR
	case ix_LVARCHAR:
#endif
	case ix_TEXT:
	case ix_BYTE:
	case ix_FLOAT:
	case ix_SMALLFLOAT:
		odbcscale = SQL_NO_TOTAL;
		break;
	case ix_INTEGER:
	case ix_SMALLINT:
#ifdef SQLBOOL
	case ix_BOOL:
#endif
	case ix_SERIAL:
		odbcscale = 0;
		break;

	case ix_DECIMAL:
	case ix_MONEY:
		odbcscale = PRECDEC(collen);
		if (odbcscale == 0xFF)
			odbcscale = SQL_NO_TOTAL;	/* Floating-point */
		break;
	case ix_DATETIME:
	case ix_INTERVAL:
		odbcscale = TU_END(collen) - TU_SECOND;
		if (odbcscale < 0)
			odbcscale = SQL_NO_TOTAL;	/* No seconds component, no scale */
		break;
	default:
		/* Can only happen if some previously unknown type arrives */
		/* The most likely case is with Informix-Universal Server */
		odbcscale = SQL_NO_TOTAL;
		break;
	}

	return(odbcscale);
}
Esempio n. 5
0
int
main(int argc, char **argv)
{
    static TestUtilsTest tests[] = {
	TU_TEST(test_round_trip, 90),
	TU_TEST(test_unquote_string, 90),
	TU_TEST(test_split_quoted_strings, 90),
	TU_TEST(test_split_quoted_strings_edge, 90),
	TU_TEST(test_strquotedstr_skipping, 90),
	TU_TEST(test_strquotedstr_edge_invalid, 90),
	TU_TEST(test_strquotedstr_edge_valid, 90),
	TU_END()
    };

    return testutils_run_tests(argc, argv, tests);
}
Esempio n. 6
0
/* Map Informix INTERVAL types to equivalent ODBC types */
static int
ivmap(int collen)
{
	int             tu_s = TU_START(collen);
	int             tu_e = TU_END(collen);
	int             odbctype;

	if (tu_s == TU_YEAR && tu_e == TU_YEAR)
		odbctype = SQL_INTERVAL_YEAR;
	else if (tu_s == TU_YEAR && tu_e == TU_MONTH)
		odbctype = SQL_INTERVAL_YEAR_TO_MONTH;
	else if (tu_s == TU_MONTH && tu_e == TU_MONTH)
		odbctype = SQL_INTERVAL_MONTH;
	else if (tu_s == TU_DAY && tu_e == TU_DAY)
		odbctype = SQL_INTERVAL_DAY;
	else if (tu_s == TU_DAY && tu_e == TU_HOUR)
		odbctype = SQL_INTERVAL_DAY_TO_HOUR;
	else if (tu_s == TU_DAY && tu_e == TU_MINUTE)
		odbctype = SQL_INTERVAL_DAY_TO_MINUTE;
	else if (tu_s == TU_DAY && tu_e >= TU_SECOND)
		odbctype = SQL_INTERVAL_DAY_TO_SECOND;
	else if (tu_s == TU_HOUR && tu_e == TU_HOUR)
		odbctype = SQL_INTERVAL_HOUR;
	else if (tu_s == TU_HOUR && tu_e == TU_MINUTE)
		odbctype = SQL_INTERVAL_HOUR_TO_MINUTE;
	else if (tu_s == TU_HOUR && tu_e >= TU_SECOND)
		odbctype = SQL_INTERVAL_HOUR_TO_SECOND;
	else if (tu_s == TU_MINUTE && tu_e == TU_MINUTE)
		odbctype = SQL_INTERVAL_MINUTE;
	else if (tu_s == TU_MINUTE && tu_e >= TU_SECOND)
		odbctype = SQL_INTERVAL_MINUTE_TO_SECOND;
	else if (tu_s >= TU_SECOND && tu_e >= TU_SECOND)
		odbctype = SQL_INTERVAL_SECOND;
	else
	{
		/**
	     ** Should never happen.
	     ** ODBC supports all interval types Informix does
	     */
		odbctype = SQL_CHAR;
	}
	return(odbctype);
}
Esempio n. 7
0
int
main(int argc, char **argv)
{
#if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE)
    static TestUtilsTest tests[] = {
	TU_TEST(test_decr_wait, 90),
	TU_TEST(test_wait_empty, 90),
	TU_TEST(test_force_adjust, 90),
	TU_TEST(test_force_set, 90),
	TU_END()
    };

    glib_init();

    return testutils_run_tests(argc, argv, tests);
#else
    g_fprintf(stderr, "No thread support on this platform -- nothing to test\n");
    return 0;
#endif
}
Esempio n. 8
0
/* Map Sqlflex DATETIME types to equivalent ODBC types */
static int  dtmap(int collen)
{
	int tu_s = TU_START(collen);
	int tu_e = TU_END(collen);
	int odbctype;

	/**
	** Most of Sqlflex's DATETIME types do not have corresponding ODBC types.
	** Regard them as undefined types (SQL_TYPE_NULL).
	*/
	if (tu_s == TU_YEAR && tu_e == TU_DAY)
		odbctype = SQL_DATE;
	else if (tu_s == TU_YEAR && tu_e >= TU_SECOND)
		odbctype = SQL_TIMESTAMP;
	else if (tu_s == TU_HOUR && tu_e >= TU_SECOND)
		odbctype = SQL_TIME;
	else
		odbctype = SQL_CHAR;
	return(odbctype);
}
Esempio n. 9
0
int
main(int argc, char **argv)
{
    static TestUtilsTest tests[] = {
	TU_TEST(test_validate_regexp, 90),
	TU_TEST(test_match, 90),
	TU_TEST(test_validate_glob, 90),
	TU_TEST(test_glob_to_regex, 90),
	TU_TEST(test_match_glob, 90),
	TU_TEST(test_match_tar, 90),
	TU_TEST(test_make_exact_host_expression, 90),
	TU_TEST(test_match_host, 90),
	TU_TEST(test_make_exact_disk_expression, 90),
	TU_TEST(test_match_disk, 90),
	TU_TEST(test_match_datestamp, 90),
	TU_TEST(test_match_level, 90),
	TU_END()
    };

    return testutils_run_tests(argc, argv, tests);
}
Esempio n. 10
0
int
main(int argc, char **argv)
{
    int result;
    static TestUtilsTest tests[] = {
        TU_TEST(test_vfs_free_space, 90),
	TU_END()
    };

    glib_init();
    config_init(0, NULL);
    device_api_init();

    /* TODO: if more tests are added, we'll need a setup/cleanup hook
     * for testutils */
    device_path = setup_vtape_dir();

    result = testutils_run_tests(argc, argv, tests);

    cleanup_vtape_dir(device_path);
    amfree(device_path);

    return result;
}