Example #1
0
static void *initproc_run(int arg1, void *arg2)
{
	switch(curtest)
	{       
	    case 0: return NULL;
		case 1:	processSetUp(); break;
		case 2: processSetUp(); break;
		case 3: processSetUp(); break;
		case 4: processSetUp(); break;
		case 5: processSetUp(); break;
		case 6: producer_consumer();break;
		case 7: deadlock();break;
		case 8: reader_writer();break;
		case 9: shellTest();break;
		case 10: dead_own(); break;
		case 11: vfs_test_setup(); break;
		case 12: add_tests(); break;
		case 13: ut_vmmap(); break;
		
	}
                
	   int status;
        while(!list_empty(&curproc->p_children))
        {
                pid_t child = do_waitpid(-1, 0, &status);
                /*dbg(DBG_INIT,"Process %d cleaned successfully\n", child);*/
        }
        
        return NULL;
}
Example #2
0
static void parse_and_add_test(char *test)
{
	if (access(test, F_OK) == 0) {
		FILE *fh;
		char t[256];

		if ((fh = fopen(test, "r")) == NULL) {
			printf("Failed to open test-list file %s\n", test);
			exit(10);
		}
		while (fgets(t, sizeof(t), fh) != NULL) {
			while (1) {
				int len = strlen(t);
				if (len == 0) {
					break;
				}
				if (!isprint(t[--len])) {
					t[len] = 0;
					continue;
				}
				break;	
			}
			parse_and_add_tests(t);
		}
		fclose(fh);
		return;
	}

	if (add_tests(test) != CUE_SUCCESS) {
		fprintf(stderr, "error: suite registration failed: %s\n",
		    CU_get_error_msg());
		exit(1);
	}
}
Example #3
0
CU_ErrorCode create_convert_numbers_suit()
{
   CU_pSuite pSuite = NULL;

   pSuite = CU_add_suite("Suite_ConvertNumbers", NULL, NULL);
   if (NULL == pSuite) {
      return CU_get_error();
   }

   return add_tests(pSuite, table);
}
Example #4
0
int main(int argc, char *argv[])
{
    const char *sparc_machines[] = { "SPARCbook", "Voyager", "SS-20", NULL };
    const char *sparc64_machines[] = { "sun4u", "sun4v", NULL };
    const char *mac_machines[] = { "mac99", "g3beige", NULL };
    const char *arch = qtest_get_arch();

    g_test_init(&argc, &argv, NULL);

    if (!strcmp(arch, "ppc") || !strcmp(arch, "ppc64")) {
        add_tests(mac_machines);
    } else if (!strcmp(arch, "sparc")) {
        add_tests(sparc_machines);
    } else if (!strcmp(arch, "sparc64")) {
        add_tests(sparc64_machines);
    } else {
        g_assert_not_reached();
    }

    return g_test_run();
}
Example #5
0
int run_test()
{
	if(CU_initialize_registry()){
		fprintf(stderr, " Initialization of Test Registry failed. ");
		exit(EXIT_FAILURE);
	} else {
		add_tests();
		
		CU_basic_set_mode(CU_BRM_VERBOSE);
        CU_basic_run_tests();
		
//		CU_set_output_filename("TestMax");
//       CU_list_tests_to_file();
//        CU_automated_run_tests();
		
		CU_cleanup_registry();
		return CU_get_error();
	}
}
Example #6
0
int main(int argc, char* argv[])
{
    CU_BasicRunMode mode = CU_BRM_VERBOSE;
    CU_ErrorAction error_action = CUEA_IGNORE;

    setvbuf(stdout, NULL, _IONBF, 0);

    if (CU_initialize_registry()) {
        fprintf(stderr, "\nInitialization of Test Registry failed.");
	exit(EXIT_FAILURE);
    }
    
    add_tests();
    CU_basic_set_mode(mode);
    CU_set_error_action(error_action);
    CU_basic_run_tests();
    CU_cleanup_registry();

    return EXIT_SUCCESS;
}
Example #7
0
int
main (int argc, char **argv)
{
	gtk_test_init (&argc, &argv);

	/* Scrolls before realization */
	add_tests (FALSE, BEFORE, FALSE, 0.0, scroll_no_align);
	if (g_test_thorough ())
		add_tests (TRUE, BEFORE, FALSE, 0.0, scroll_no_align);

	add_tests (FALSE, BEFORE, TRUE, 0.0, scroll_align_0_0);
	if (g_test_thorough ())
		add_tests (TRUE, BEFORE, TRUE, 0.0, scroll_align_0_0);

	add_tests (FALSE, BEFORE, TRUE, 0.5, scroll_align_0_5);
	if (g_test_thorough ())
		add_tests (TRUE, BEFORE, TRUE, 0.5, scroll_align_0_5);

	add_tests (FALSE, BEFORE, TRUE, 1.0, scroll_align_1_0);
	if (g_test_thorough ())
		add_tests (TRUE, BEFORE, TRUE, 1.0, scroll_align_1_0);

	/* Scrolls after realization */
	add_tests (FALSE, AFTER, FALSE, 0.0, scroll_after_no_align);
	if (g_test_thorough ())
		add_tests (TRUE, AFTER, FALSE, 0.0, scroll_after_no_align);

	add_tests (FALSE, AFTER, TRUE, 0.0, scroll_after_align_0_0);
	if (g_test_thorough ())
		add_tests (TRUE, AFTER, TRUE, 0.0, scroll_after_align_0_0);

	add_tests (FALSE, AFTER, TRUE, 0.5, scroll_after_align_0_5);
	if (g_test_thorough ())
		add_tests (TRUE, AFTER, TRUE, 0.5, scroll_after_align_0_5);

	add_tests (FALSE, AFTER, TRUE, 1.0, scroll_after_align_1_0);
	if (g_test_thorough ())
		add_tests (TRUE, AFTER, TRUE, 1.0, scroll_after_align_1_0);

	/* Scroll to end before realization, to a real position after */
	if (g_test_thorough ()) {
		add_tests (FALSE, BOTH, FALSE, 0.0, scroll_both_no_align);
		add_tests (TRUE, BOTH, FALSE, 0.0, scroll_both_no_align);

		add_tests (FALSE, BOTH, TRUE, 0.0, scroll_both_align_0_0);
		add_tests (TRUE, BOTH, TRUE, 0.0, scroll_both_align_0_0);

		add_tests (FALSE, BOTH, TRUE, 0.5, scroll_both_align_0_5);
		add_tests (TRUE, BOTH, TRUE, 0.5, scroll_both_align_0_5);

		add_tests (FALSE, BOTH, TRUE, 1.0, scroll_both_align_1_0);
		add_tests (TRUE, BOTH, TRUE, 1.0, scroll_both_align_1_0);
	}

	/* Test different alignments in view with single row */
	g_test_add ("/TreeView/scrolling/single-row/no-align",
		    ScrollFixture, "0",
		    scroll_fixture_single_setup,
		    scroll_no_align,
		    scroll_fixture_teardown);
	g_test_add ("/TreeView/scrolling/single-row/align-0.0",
		    ScrollFixture, "0",
		    scroll_fixture_single_setup,
		    scroll_align_0_0,
		    scroll_fixture_teardown);
	g_test_add ("/TreeView/scrolling/single-row/align-0.5",
		    ScrollFixture, "0",
		    scroll_fixture_single_setup,
		    scroll_align_0_5,
		    scroll_fixture_teardown);
	g_test_add ("/TreeView/scrolling/single-row/align-1.0",
		    ScrollFixture, "0",
		    scroll_fixture_single_setup,
		    scroll_align_1_0,
		    scroll_fixture_teardown);

	/* Test scrolling in a very large model; also very slow */
	if (g_test_slow ()) {
		g_test_add ("/TreeView/scrolling/large-model/constant-height/middle-no-align",
			    ScrollFixture, "50000",
			    scroll_fixture_constant_big_setup,
			    scroll_no_align,
			    scroll_fixture_teardown);
		g_test_add ("/TreeView/scrolling/large-model/constant-height/end-no-align",
			    ScrollFixture, "99999",
			    scroll_fixture_constant_big_setup,
			    scroll_no_align,
			    scroll_fixture_teardown);

		g_test_add ("/TreeView/scrolling/large-model/mixed-height/middle-no-align",
			    ScrollFixture, "50000",
			    scroll_fixture_mixed_big_setup,
			    scroll_no_align,
			    scroll_fixture_teardown);
		g_test_add ("/TreeView/scrolling/large-model/mixed-height/end-no-align",
			    ScrollFixture, "99999",
			    scroll_fixture_mixed_big_setup,
			    scroll_no_align,
			    scroll_fixture_teardown);
	}

	/* Test scrolling to a newly created row */
	g_test_add ("/TreeView/scrolling/new-row/path-0", ScrollFixture,
		    GINT_TO_POINTER (0),
		    scroll_fixture_constant_setup,
		    scroll_new_row,
		    scroll_fixture_teardown);
	g_test_add ("/TreeView/scrolling/new-row/path-4", ScrollFixture,
		    GINT_TO_POINTER (4),
		    scroll_fixture_constant_setup,
		    scroll_new_row,
		    scroll_fixture_teardown);
	/* We scroll to 8 to test a partial visible row.  The 8 is
	 * based on my font setting of "Vera Sans 11" and
	 * the separators set to 0.  (This should be made dynamic; FIXME).
	 */
	g_test_add ("/TreeView/scrolling/new-row/path-8", ScrollFixture,
		    GINT_TO_POINTER (8),
		    scroll_fixture_constant_setup,
		    scroll_new_row,
		    scroll_fixture_teardown);
	g_test_add ("/TreeView/scrolling/new-row/path-500", ScrollFixture,
		    GINT_TO_POINTER (500),
		    scroll_fixture_constant_setup,
		    scroll_new_row,
		    scroll_fixture_teardown);
	g_test_add ("/TreeView/scrolling/new-row/path-999", ScrollFixture,
		    GINT_TO_POINTER (999),
		    scroll_fixture_constant_setup,
		    scroll_new_row,
		    scroll_fixture_teardown);

	g_test_add ("/TreeView/scrolling/new-row/tree", ScrollFixture,
		    NULL,
		    scroll_fixture_tree_setup,
		    scroll_new_row_tree,
		    scroll_fixture_teardown);

	/* Test scrolling to a newly created row, in a mixed height model */
	g_test_add ("/TreeView/scrolling/new-row-mixed/path-0", ScrollFixture,
		    GINT_TO_POINTER (0),
		    scroll_fixture_mixed_setup,
		    scroll_new_row,
		    scroll_fixture_teardown);
	g_test_add ("/TreeView/scrolling/new-row-mixed/path-3", ScrollFixture,
		    GINT_TO_POINTER (3),
		    scroll_fixture_mixed_setup,
		    scroll_new_row,
		    scroll_fixture_teardown);
	/* We scroll to 8 to test a partial visible row.  The 8 is
	 * based on my font setting of "Vera Sans 11" and
	 * the separators set to 0.  (This should be made dynamic; FIXME).
	 */
	g_test_add ("/TreeView/scrolling/new-row-mixed/path-5", ScrollFixture,
		    GINT_TO_POINTER (5),
		    scroll_fixture_mixed_setup,
		    scroll_new_row,
		    scroll_fixture_teardown);
	g_test_add ("/TreeView/scrolling/new-row-mixed/path-500", ScrollFixture,
		    GINT_TO_POINTER (500),
		    scroll_fixture_mixed_setup,
		    scroll_new_row,
		    scroll_fixture_teardown);
	g_test_add ("/TreeView/scrolling/new-row-mixed/path-999", ScrollFixture,
		    GINT_TO_POINTER (999),
		    scroll_fixture_mixed_setup,
		    scroll_new_row,
		    scroll_fixture_teardown);

	g_test_add ("/TreeView/scrolling/new-row-mixed/tree", ScrollFixture,
		    NULL,
		    scroll_fixture_mixed_tree_setup,
		    scroll_new_row_tree,
		    scroll_fixture_teardown);

	/* Misc. tests */
	g_test_add ("/TreeView/scrolling/specific/bug-316689",
			ScrollFixture, NULL,
		    scroll_fixture_constant_setup, test_bug316689,
		    scroll_fixture_teardown);
	g_test_add_func ("/TreeView/scrolling/specific/bug-359231",
			test_bug359231);
	g_test_add ("/TreeView/scrolling/specific/bug-93584",
		    ScrollFixture, NULL,
		    scroll_fixture_tree_setup, test_bug93584,
		    scroll_fixture_teardown);
	g_test_add ("/TreeView/scrolling/specific/bug-111500",
		    ScrollFixture, NULL,
		    scroll_fixture_tree_setup, test_bug111500,
		    scroll_fixture_teardown);
	g_test_add ("/TreeView/scrolling/specific/bug-111500-mixed",
		    ScrollFixture, NULL,
		    scroll_fixture_mixed_tree_setup, test_bug111500_mixed,
		    scroll_fixture_teardown);
	g_test_add ("/TreeView/scrolling/specific/bug-163214",
		    ScrollFixture, NULL,
		    scroll_fixture_constant_setup, test_bug163214,
		    scroll_fixture_teardown);

	return g_test_run ();
}
TestSuite *collector_tests() {
    TestSuite *suite = create_test_suite();
    add_tests(confuse_the_collector(suite, "\"("));
    return suite;
}
Example #9
0
/* This function adds all the RTF tests to the test suite. It skips tests that
load WMF and EMF files if those modules are not compiled into GdkPixbuf. The
human tests are only added if the test suite was invoked with '-m=perf
-m=thorough'.*/
void
add_rtf_tests(void)
{
    check_wmf_and_emf();
    
    /* Fail cases */
	/* Nonexistent filename case */
	g_test_add_data_func("/rtf/parse/fail/Nonexistent filename", "", rtf_fail_case);
	/* Cases from http://www.codeproject.com/KB/recipes/RtfConverter.aspx */
	add_tests(codeprojectfailcases, "/rtf/parse/fail/", rtf_fail_case);
	/* Other */
	add_tests(variousfailcases, "/rtf/parse/fail/", rtf_fail_case);

	/* Pass cases */
	/* Examples from 'RTF Pocket Guide' by Sean M. Burke */
	add_tests(rtfbookexamples, "/rtf/parse/pass/", rtf_parse_pass_case);
	/* From http://www.codeproject.com/KB/recipes/RtfConverter.aspx */
	add_tests(codeprojectpasscases, "/rtf/parse/pass/", rtf_parse_pass_case);
	/* Other */
	add_tests(variouspasscases, "/rtf/parse/pass/", rtf_parse_pass_case);
	/* These tests export the RTF to a string and re-import it */
	add_tests(rtfbookexamples, "/rtf/write/", rtf_write_pass_case);
	add_tests(codeprojectpasscases, "/rtf/write/", rtf_write_pass_case);
	add_tests(variouspasscases, "/rtf/write/", rtf_write_pass_case);
    /* RTFD tests */
    g_test_add_data_func("/rtf/parse/pass/RTFD test", "rtfdtest.rtfd", rtf_parse_pass_case);
    g_test_add_data_func("/rtf/write/RTFD test", "rtfdtest.rtfd", rtf_write_pass_case);
    
    /* Human tests -- only on thorough testing */
    if(g_test_thorough())
    {
        add_tests(rtfbookexamples, "/rtf/parse/human/", rtf_parse_human_approval_case);
        add_tests(codeprojectpasscases, "/rtf/parse/human/", rtf_parse_human_approval_case);
        add_tests(variouspasscases, "/rtf/parse/human/", rtf_parse_human_approval_case);
    }
}