Exemple #1
0
int
run_main (int argc, ACE_TCHAR *argv[])
{
  ACE_START_TEST (ACE_TEXT ("Service_Config_Test"));

  testOrderlyInstantiation (argc, argv);
  testFailedServiceInit (argc, argv);
  testLoadingServiceConfFile (argc, argv);
  testLoadingServiceConfFileAndProcessNo (argc, argv);
  testUnloadingACELoggingStrategy (argc, argv);
  testLimits (argc, argv);
  testrepository (argc, argv);
#if defined (ACE_HAS_WTHREADS) || defined (ACE_HAS_PTHREADS)
  unsigned int n_threads = 64;
#if defined (ACE_DEFAULT_THREAD_KEYS)
  n_threads = 2 * ACE_DEFAULT_THREAD_KEYS;
#endif
  // Test with a large amount of threads to determine whether
  // TSS works correctly with non ACE threads
  for (unsigned int i = 0 ; i < n_threads; i++)
    {
      testNonACEThread();
    }
#endif

  ACE_END_TEST;
  return error;
}
void GameManager::update(double delta_t){
    if(_paused || _gameOver) { glutPostRedisplay(); return; }
		for(std::list<StaticObject*>::iterator object=_game_objects.begin(); object != _game_objects.end(); object++){
					(*object)->update(delta_t);
		}
	
		for(std::list<DynamicObject*>::iterator object=_cars.begin(); object != _cars.end(); object++){
					(*object)->update(delta_t);
					testLimits(*object);
		}
		for(std::list<TimberLog*>::iterator object=_timberLogs.begin(); object != _timberLogs.end(); object++){
					(*object)->update(delta_t);
					testLimits(*object);
		}

		_frog->update(delta_t);
				
		glutPostRedisplay();
}
Exemple #3
0
edk::char8* File::readStringFromTheBinFile(FILE* arq,edk::char8* limits,edk::uint32 count,bool use){

    //First read the next character
    edk::char8 temp = '\0';

    //string return
    edk::char8* ret = NULL;

    //test if have the end of the file
    if(feof(arq)){
        //then create the simple string
        edk::char8* str = new edk::char8[count+1u];
        //copy the end character '\0'
        if(str){
            //
            str[count]='\0';
        }
        //return the string
        return str;
    }

    fread(&temp,1u,1u,this->arq);

    //test if read the end character or the end of the file
    if(feof(arq) || testLimits(temp,limits) || temp=='\0'){
        //have the end of the read

        //alloc the new string
        edk::char8* str = NULL;
        //test if use the limit character
        if(use && temp!='\0'){
            //Copy the end and the limit character
            str = new edk::char8[count+2u];
            if(str){
                //
                str[count+1u]='\0';
                str[count]=temp;
            }
        }
        else{
            //Copy just the end character
            str = new edk::char8[count+1u];
            if(str){
                //
                str[count]='\0';
            }
        }
        //return the string
        return str;
        }
    else{
        //keep trying
        ret = this->readStringFromTheBinFile(arq,limits,count+1u,use);

        //Test if the ret is alloc
        if(ret){
            //then copy the character readed (temp)
            ret[count]=temp;
        }
    }
    //return the ret string
    return ret;
}
Exemple #4
0
edk::char8* File::readStringFromTheFile(FILE* arq,edk::char8* limits,edk::uint32 count,bool use){

    //First read the next character
    edk::char8 temp = '\0';

    //string return
    edk::char8* ret = NULL;

    //test if have the end of the file
    if(feof(arq)){
        //then create the simple string
        edk::char8* str = new edk::char8[count+1u];
        //copy the end character '\0'
        if(str){
            //
            str[count]='\0';
        }
        //return the string
        return str;
    }

    #ifdef _WIN32
            //Windows 32
            #ifdef _MSC_VER
                //Visual C
                fscanf_s(arq,"%c",&temp);
            #endif
            #ifdef __GNUC__
                #ifdef __cplusplus
                    //G++
                    fscanf(arq,"%c",&temp);
                #else
                    //GCC
                #endif
            #endif
        #endif
        #ifdef _WIN64
            //Windows 64
            #ifdef _MSC_VER
                //Visual C
                fscanf_s(arq,"%c",&temp);
            #endif
            #ifdef __GNUC__
                #ifdef __cplusplus
                    //G++
                    fscanf(arq,"%c",&temp);
                #else
                    //GCC
                #endif
            #endif
        #endif
        #ifdef __linux__
            //LINUX
            #ifdef __GNUC__
                #ifdef __cplusplus
                    //G++
                    fscanf(arq,"%c",&temp);
                #else
                    //GCC
                #endif
            #endif
        #endif
        #ifdef __APPLE__
            //MACOS
            #ifdef __GNUC__
                #ifdef __cplusplus
                    //G++
                    fscanf(arq,"%c",&temp);
                #else
                    //GCC
                #endif
            #endif
        #endif
    //test if read the end character or the end of the file

    if(feof(arq) || testLimits(temp,limits) || temp=='\0'){
        //have the end of the read

        //alloc the new string
        edk::char8* str = NULL;
        //test if use the limit character
        if(use && temp!='\0'){
            //Copy the end and the limit character
            str = new edk::char8[count+2u];
            if(str){
                //
                str[count+1u]='\0';
                str[count]=temp;
            }
        }
        else{
            //Copy just the end character
            str = new edk::char8[count+1u];
            if(str){
                //
                str[count]='\0';
            }
        }
        //return the string
        return str;
        }
    else{
        //keep trying
        ret = this->readStringFromTheFile(arq,limits,count+1u,use);

        //Test if the ret is alloc
        if(ret){
            //then copy the character readed (temp)
            ret[count]=temp;
        }
    }
    //return the ret string
    return ret;
}