Changeset 3e6b93
- Timestamp:
- Feb 4, 2015, 9:56:43 PM (11 years ago)
- Parents:
- 76a109
- git-author:
- Frederik Heber <heber@…> (09/23/14 16:34:50)
- git-committer:
- Frederik Heber <heber@…> (02/04/15 21:56:43)
- Files:
- 
      - 4 edited
 
 
Legend:
- Unmodified
- Added
- Removed
- 
      src/Parameters/Value_impl.hppr76a109 r3e6b93 119 119 inline const T & Value<T>::get() const throw(ParameterValueException) 120 120 { 121 if (!isValid(value)) throw ParameterValueException(); 121 // Actions' parameters may later become invalid because a file has been 122 // written that was supposed to not exist (!FilePresentValidator()) 123 // if (!isValid(value)) throw ParameterValueException(); 122 124 if (!ValueSet) throw ParameterValueException(); 123 125 return value; … … 131 133 inline void Value<T>::set(const T & _value) throw(ParameterException) 132 134 { 133 // any value may be set, this allows Actions to have invalid parameters 134 // (e.g. because the given atom id does not yet exist) that are checked 135 // on performCall() 136 // if (!isValid(_value)) throw ParameterValueException(); 135 if (!isValid(_value)) throw ParameterValueException(); 137 136 if (!ValueSet) 138 137 ValueSet = true; 
- 
      src/Parameters/unittests/ContinuousValueTest.cppr76a109 r3e6b93 155 155 { 156 156 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); 162 161 } 163 162 … … 187 186 188 187 // 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); 195 192 196 193 // checking all valid ones … … 400 397 { 401 398 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); 408 403 } 409 404 
- 
      src/Parameters/unittests/DiscreteValueTest.cppr76a109 r3e6b93 175 175 176 176 // setting invalid and getting it, throws 177 test.set(4); 178 std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl; 179 CPPUNIT_ASSERT_THROW(test.get(), ParameterValueException); 180 test.set(0); 181 std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl; 182 CPPUNIT_ASSERT_THROW(test.get(), ParameterValueException); 177 std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl; 178 CPPUNIT_ASSERT_THROW(test.set(4), ParameterValueException); 179 std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl; 180 CPPUNIT_ASSERT_THROW(test.set(0), ParameterValueException); 183 181 184 182 // checking all valid ones … … 203 201 204 202 // setting invalid and getting it, throws 205 test.setAsString(toString(4)); 206 std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl; 207 CPPUNIT_ASSERT_THROW(test.getAsString(), ParameterValueException); 208 test.setAsString(toString(0)); 209 std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl; 210 CPPUNIT_ASSERT_THROW(test.getAsString(), ParameterValueException); 203 std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl; 204 CPPUNIT_ASSERT_THROW(test.setAsString(toString(4)), ParameterValueException); 205 std::cout << "The following Assert failures are intended and do not indicate a failure of the test." << std::endl; 206 CPPUNIT_ASSERT_THROW(test.setAsString(toString(0)), ParameterValueException); 211 207 212 208 // checking all valid ones 
- 
      tests/regression/Parser/SetParameters/Mpqc/testsuite-parser-set-parameters-mpqc-none.atr76a109 r3e6b93 21 21 AT_KEYWORDS([options mpqc set-mpqc-parameters]) 22 22 23 AT_CHECK([../../molecuilder -i test.in -o mpqc -l ${abs_top_srcdir}/tests/regression/Parser/SetParameters/Mpqc/pre/test.xyz -v 1 --set-parser-parameters "mpqc"], 5, [stdout], [ignore]) 23 AT_CHECK([../../molecuilder \ 24 -i test.in \ 25 -o mpqc \ 26 -l ${abs_top_srcdir}/tests/regression/Parser/SetParameters/Mpqc/pre/test.xyz \ 27 -v 1 \ 28 --set-parser-parameters "mpqc" \ 29 --parser-parameters ""], 134, [stdout], [ignore]) 24 30 25 31 AT_CLEANUP 
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  
