Exemplo n.º 1
0
int main()
{
	InitConstants();
	printf("tc_1\n");
	//TestCase_1();
	printf("tc_2\n");
	//TestCase_2();
	printf("tc_3\n");
	TestCase_3();
	printf("tc_4\n");
	//TestCase_4();
	printf("tc_5\n");
	//TestCase_5();

//	Test1(10, value);
//	Test1(-2, value);
//	Test1(-1, value);

//	Test2(0, value);
//	Test2(10, value);
//	Test2(-2, value);
//	Test2(-1, value);

	getchar();
	getchar();
	while (1);
	return 0;
}
Exemplo n.º 2
0
int
main(int argc, char **argv)
{
    int domainId = 4; 
    int testAppId = 0;
    int i;
    DDSDomainParticipantFactory *factory = DDSDomainParticipantFactory::get_instance();
	int errors = 0;
	DDS_DomainParticipantFactoryQos fqos;
		
	factory->get_qos(fqos);
	fqos.profile.ignore_environment_profile = DDS_BOOLEAN_TRUE;
	fqos.profile.ignore_resource_profile = DDS_BOOLEAN_TRUE;
    fqos.resource_limits.max_objects_per_thread = 8192;
    factory->set_qos(fqos);
	
	for (i = 0; i < argc; ++i)
    {
        if (!strcmp("-testAppId",argv[i]))
        {
            ++i;
            if (i == argc)
            {
                printf("-testAppId <testAppId>\n");
                break;
            }
            testAppId = strtol(argv[i],NULL,0);
        }
        else if (!strcmp("-domainId",argv[i]))
        {
            ++i;
            if (i == argc)
            {
                printf("-domainId <domainId>\n");
                break;
            }
            domainId = strtol(argv[i],NULL,0);
        }
        else if (!strcmp("-help",argv[i]))
        {
			cout << "-domainId <domain id>" << endl;
			cout << "-testAppId <app id>" << endl;
			cout << "-help" << endl;
			cout << "-verbose" << endl;
        }
		else if (!strcmp("-verbose",argv[i]))
		{
			NDDSConfigLogger::get_instance()->set_verbosity_by_category(NDDS_CONFIG_LOG_CATEGORY_API, 
																		NDDS_CONFIG_LOG_VERBOSITY_STATUS_ALL);
			
			NDDSConfigLogger::get_instance()->set_verbosity_by_category(NDDS_CONFIG_LOG_CATEGORY_PLATFORM , 
																		NDDS_CONFIG_LOG_VERBOSITY_STATUS_ALL);
			
			NDDSConfigLogger::get_instance()->set_verbosity_by_category(NDDS_CONFIG_LOG_CATEGORY_COMMUNICATION , 
																		NDDS_CONFIG_LOG_VERBOSITY_STATUS_ALL);
			
			NDDSConfigLogger::get_instance()->set_verbosity_by_category(NDDS_CONFIG_LOG_CATEGORY_DATABASE , 
																		NDDS_CONFIG_LOG_VERBOSITY_STATUS_ALL);
			
			NDDSConfigLogger::get_instance()->set_verbosity_by_category(NDDS_CONFIG_LOG_CATEGORY_ENTITIES , 
																		NDDS_CONFIG_LOG_VERBOSITY_STATUS_ALL);
		}		
    }        
    
    if (i < argc) {
        return -1;
    }
	
	if (domainId < 0) 
	{
		cout << "domainId must be >= 0" << endl;
		return -1;
	}
	
	if (testAppId < 0) 
	{
		cout << "testAppId must be >= 0" << endl;
		return -1;
	}
		
	// ACP tests
	if (0) {
	errors += TestCase_1(domainId,testAppId);
	errors += TestCase_2(domainId,testAppId);
	errors += TestCase_3(domainId,testAppId);
	errors += TestCase_4(domainId,testAppId);
	errors += TestCase_5(domainId,testAppId);
	errors += TestCase_6(domainId,testAppId);
	errors += TestCase_7(domainId,testAppId);
	errors += TestCase_8(domainId,testAppId);
	
	// SCP test		
	errors += TestCase_9(domainId,testAppId);
	errors += TestCase_10(domainId,testAppId);
	}
	errors += TestCase_11(domainId,testAppId);

	if (errors != 0) 
	{
		cout << "Test result: FAILED (" << errors << " errors)" << endl;
	}
	else
	{
		cout << "Test result: PASSED" << endl;;
	}
	return errors;
}