data/train/cpp/329aa46a78fe0d79aaf5745112f36e25e43ce459RepoManager_test.cc
BOOST_AUTO_TEST_CASE(service_file_link_bug)
{
  TmpDir tmpCachePath;
  RepoManagerOptions opts( RepoManagerOptions::makeTestSetup( tmpCachePath ) ) ;

  filesystem::mkdir( opts.knownReposPath );
  filesystem::mkdir( opts.knownServicesPath );
  RepoManager manager(opts);

  //test service
  ServiceInfo service("test", DATADIR.asDirUrl() );
  service.setEnabled(true);

  manager.addService(service);
  // now internally, service is associated with the file
  // where it was saved

  // the following line reset the file association with the bug
  manager.modifyService(service.alias(), service);
  // and the following modifyService fails because there is no
  // association
  manager.modifyService(service.alias(), service);
}
// regression test for services bug
// if you modify a service that you just
// added and saved, the service was not associated with its
// file internally
regression test for services bug
if you modify a service that you just
added and saved, the service was not associated with its
file internally
regression test for services bug if you modify a service that you just added and saved the service was not associated with its file internally
BOOST_AUTO_TEST_CASE(service_file_link_bug)
{
  TmpDir tmpCachePath;
  RepoManagerOptions opts( RepoManagerOptions::makeTestSetup( tmpCachePath ) ) ;
  filesystem::mkdir( opts.knownReposPath );
  filesystem::mkdir( opts.knownServicesPath );
  RepoManager manager(opts);
  ServiceInfo service("test", DATADIR.asDirUrl() );
  service.setEnabled(true);
  manager.addService(service);
  manager.modifyService(service.alias(), service);
  manager.modifyService(service.alias(), service);
}
BOOST_AUTO_TEST_CASE ( service_file_link_bug ) { TmpDir tmpCachePath ; RepoManagerOptions opts ( RepoManagerOptions :: makeTestSetup ( tmpCachePath ) ) ; filesystem :: mkdir ( opts . knownReposPath ) ; filesystem :: mkdir ( opts . knownServicesPath ) ; RepoManager manager ( opts ) ; ServiceInfo service ( " " , DATADIR . asDirUrl ( ) ) ; service . setEnabled ( true ) ; manager . addService ( service ) ; manager . modifyService ( service . alias ( ) , service ) ; manager . modifyService ( service . alias ( ) , service ) ; }
regression test for services bug
if you modify a service that you just
added and saved, the service was not associated with its
file internally
regression test for services bug if you modify a service that you just added and saved the service was not associated with its file internally
//test service // now internally, service is associated with the file // where it was saved // the following line reset the file association with the bug // and the following modifyService fails because there is no // association