DynamicScheduleRepeat.m
上传用户:shenzhenrh
上传日期:2013-05-12
资源大小:2904k
文件大小:1k
源码类别:

信息检索与抽取

开发平台:

Unix_Linux

  1. /*
  2. Name:         DynamicScheduleRepeat.m
  3. Description:  DynamicScheduleRepeat tests for presence of dynamic scheduling 
  4.               bug in schedule with repeat cycle. 
  5. Test suite:   activity
  6. */
  7. #import <simtools.h>
  8. #import "DSRSwarm.h"
  9. int 
  10. main (int argc, const char ** argv) 
  11. {
  12.   id theSwarm;
  13.   
  14.   initSwarmBatch (argc, argv);
  15.   
  16.   theSwarm = [DSRSwarm create: globalZone];
  17.   
  18.   [theSwarm buildActions];
  19.   [theSwarm activateIn: nil];
  20.   [[theSwarm getActivity] run];
  21.   
  22.   if (stimes[0] != 1)
  23.     {
  24.       fprintf (stderr, "Error dynamic update failed, action added after currentntime but before first action in the schedule never was performed!n ");
  25.       return 1;
  26.     }
  27.   if (stimes[1] != 11)
  28.     {
  29.       fprintf (stderr, "Error dynamic update failed, action added in previousnrepeat cycle never performed!n");
  30.       return 1;
  31.     }
  32.   if (stimes[2] != 15)
  33.     {
  34.       fprintf (stderr, "Error dynamic update failed, action added in previous repeat cycle before current time, never performed in last repeat cycle!n" );
  35.       return 1;
  36.     }
  37.   if (stimes[3] != 21)
  38.     {
  39.       fprintf (stderr,  "Error dynamic update failed, action added two repeat cycles ago, that was performed in previous cycle never performed in last repeat cycle!n ");
  40.       return 1;
  41.     }
  42.   if (stimes[4] != 25)
  43.     {
  44.       fprintf (stderr,  "Error dynamic update failed, action added before current time two repeat cycles ago, that was performed in previous cycle never performed in last repeat cyclen ");
  45.       return 1;
  46.     }
  47.   return 0;
  48. }