~ubuntu-branches/ubuntu/precise/nordugrid-arc/precise

« back to all changes in this revision

Viewing changes to src/hed/libs/client/test/JobTest.cpp

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2011-10-24 02:19:37 UTC
  • mfrom: (3.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20111024021937-8whiie90uq2oqsok
Tags: 1.1.0-2
* Backport fixes for endian independent md5 checksum
* Filter out -Wl,-Bsymbolic-functions from default Ubuntu LDFLAGS

Show diffs side-by-side

added added

removed removed

Lines of Context:
364
364
  inJobs.back().IDFromEndpoint.ChangePath("/arex/job5");
365
365
 
366
366
  inJobs.push_back(inJobs.back());
367
 
 
368
 
  // Identical jobs in job list is not allowed.
369
 
  CPPUNIT_ASSERT(!Arc::Job::WriteJobsToTruncatedFile(jobfile, inJobs));
370
 
  CPPUNIT_ASSERT(!Arc::Job::WriteJobsToFile(jobfile, inJobs, newJobs));
 
367
  inJobs.back().Name = "Job5New";
 
368
 
 
369
  // Duplicate jobs will be overwritten.
 
370
  CPPUNIT_ASSERT(Arc::Job::WriteJobsToTruncatedFile(jobfile, inJobs));
 
371
  CPPUNIT_ASSERT(Arc::Job::ReadAllJobsFromFile(jobfile, outJobs));
 
372
  CPPUNIT_ASSERT_EQUAL(4, (int)outJobs.size());
 
373
  CPPUNIT_ASSERT_EQUAL(inJobs.back().Name, outJobs.back().Name);
 
374
 
 
375
  // Truncate file.
 
376
  CPPUNIT_ASSERT(Arc::Job::WriteJobsToTruncatedFile(jobfile, std::list<Arc::Job>()));
 
377
  newJobs.clear();
 
378
  CPPUNIT_ASSERT(Arc::Job::WriteJobsToFile(jobfile, inJobs, newJobs));
 
379
  CPPUNIT_ASSERT_EQUAL(4, (int)newJobs.size());
 
380
  CPPUNIT_ASSERT(Arc::Job::ReadAllJobsFromFile(jobfile, outJobs));
 
381
  CPPUNIT_ASSERT_EQUAL(4, (int)outJobs.size());
 
382
  CPPUNIT_ASSERT_EQUAL(inJobs.back().Name, outJobs.back().Name);
 
383
  
371
384
  inJobs.pop_back();
372
385
 
373
386
  // Adding more jobs to file.