Ignore:
Timestamp:
Feb 4, 2015, 9:56:43 PM (11 years ago)
Author:
Frederik Heber <heber@…>
Parents:
76a109
git-author:
Frederik Heber <heber@…> (09/23/14 16:34:50)
git-committer:
Frederik Heber <heber@…> (02/04/15 21:56:43)
Message:

Changed checking of Parameter::isValid() on set(), not on get().

  • this would fix problems with ActionQueue::OutputAs...() commands that need to get() parameter values after usage by the Action. If files were forced to be non-present before, then written by the Action, the Validator will then fail.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parameters/unittests/ContinuousValueTest.cpp

    r76a109 r3e6b93  
    155155  {
    156156    Value<int> test(*ValidIntRange);
    157     test.setAsString(toString(5));
    158     CPPUNIT_ASSERT_THROW(test.getAsString(), ParameterValueException);
    159     test.setAsString(toString(0));
    160     std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
    161     CPPUNIT_ASSERT_THROW(test.getAsString(), ParameterValueException);
     157    std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
     158    CPPUNIT_ASSERT_THROW(test.setAsString(toString(5)), ParameterValueException);
     159    std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
     160    CPPUNIT_ASSERT_THROW(test.setAsString(toString(0)), ParameterValueException);
    162161  }
    163162
     
    187186
    188187  // setting invalid and getting it, throws ParameterValueException
    189   test.set(5);
    190   std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
    191   CPPUNIT_ASSERT_THROW(test.get(), ParameterValueException);
    192   test.set(0);
    193   std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
    194   CPPUNIT_ASSERT_THROW(test.get(), ParameterValueException);
     188  std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
     189  CPPUNIT_ASSERT_THROW(test.set(5), ParameterValueException);
     190  std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
     191  CPPUNIT_ASSERT_THROW(test.set(0), ParameterValueException);
    195192
    196193  // checking all valid ones
     
    400397  {
    401398    Value<Vector> test(*ValidVectorRange);
    402     test.set(Vector(5,0,0));
    403     std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
    404     CPPUNIT_ASSERT_THROW(test.get(), ParameterValueException);
    405     test.set(Vector(5,20,5));
    406     std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
    407     CPPUNIT_ASSERT_THROW(test.get(), ParameterValueException);
     399    std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
     400    CPPUNIT_ASSERT_THROW(test.set(Vector(5,0,0)), ParameterValueException);
     401    std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl;
     402    CPPUNIT_ASSERT_THROW(test.set(Vector(5,20,5)), ParameterValueException);
    408403  }
    409404
Note: See TracChangeset for help on using the changeset viewer.