Skip to content

Commit

Permalink
Re-enable FinalTests.mos
Browse files Browse the repository at this point in the history
This is a test for OM ticket #1078
  • Loading branch information
sjoelund committed Mar 10, 2016
1 parent 5847362 commit a4a5d33
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
4 changes: 4 additions & 0 deletions flattening/modelica/mosfiles/FinalTests.mo
Expand Up @@ -44,3 +44,7 @@ PI c1(k=2, T=3); // fine
PI c2(tf.b={33}); // error, b is declared as final
end test3;

model test4
type Distance = Real(final unit="m");
parameter Distance di(unit="mm")=0.125;
end test4;
20 changes: 15 additions & 5 deletions flattening/modelica/mosfiles/FinalTests.mos
@@ -1,8 +1,8 @@
// name: FinalTests
// keywords: final override
// status: correct
//
//
//
//
//
loadFile("FinalTests.mo");
instantiateModel(test1);
Expand All @@ -11,18 +11,28 @@ instantiateModel(test2);
getErrorString();
instantiateModel(test3);
getErrorString();
instantiateModel(test4);
getErrorString();
// Result:
// true
// ""
// "Error: Trying to override final variable in component and scope test1 by using modifiers: = (typed)10 DAE.PROP(Integer, C_CONST), value: 10 and final = (typed)1.123456 DAE.PROP(Real, C_CONST), value: 1.123456 that do not agree.
// "[flattening/modelica/mosfiles/FinalTests.mo:3:3-3:49:writable] Notification: From here:
// [flattening/modelica/mosfiles/FinalTests.mo:9:38-9:55:writable] Error: Trying to override final element p_finalPrefix5 with modifier ' = 10'.
// Error: Error occurred while flattening model test1
// "
// ""
// "[FinalTests.mo:27:3-27:23:writable] Error: Variable a1: Trying to override final variable in component a1 and scope test2 by using modifiers: = (typed)"deg" DAE.PROP(String, C_CONST), value: "deg" and final = (typed)"rad" DAE.PROP(String, C_CONST), value: "rad" that do not agree.
// "[flattening/modelica/mosfiles/FinalTests.mo:25:51-25:62:writable] Notification: From here:
// [flattening/modelica/mosfiles/FinalTests.mo:27:12-27:22:writable] Error: Trying to override final element unit with modifier ' = "deg"'.
// Error: Error occurred while flattening model test2
// "
// ""
// "Error: Trying to override final variable in component c2 and scope PI by using modifiers: = (typed){33} DAE.PROP(Integer[1], C_CONST), value: {33} and final = (typed){c2.T * c2.k, c2.k} DAE.PROP(Real[2], C_PARAM), value: {1.0,1.0} that do not agree.
// "[flattening/modelica/mosfiles/FinalTests.mo:39:27-39:36:writable] Notification: From here:
// [flattening/modelica/mosfiles/FinalTests.mo:44:7-44:16:writable] Error: Trying to override final element b with modifier ' = {33}'.
// Error: Error occurred while flattening model test3
// "
// ""
// "[flattening/modelica/mosfiles/FinalTests.mo:48:31-48:39:writable] Notification: From here:
// [flattening/modelica/mosfiles/FinalTests.mo:49:26-49:35:writable] Error: Trying to override final element unit with modifier ' = "mm"'.
// Error: Error occurred while flattening model test4
// "
// endResult
18 changes: 9 additions & 9 deletions flattening/modelica/mosfiles/Makefile
Expand Up @@ -13,6 +13,7 @@ ErrorSimPackage.mos \
ExtendsOrder.mos \
ExternalFunctionResultOrder.mos\
ExternalLibraryFunction.mos\
FinalTests.mos \
FuncNamespace.mos \
FunctionDefaultArg.mos \
GroupImport.mos \
Expand All @@ -38,12 +39,11 @@ TransformerYY.mos \
AIMC_DOL.mos \
ZeroDims.mos \
ZeroRange.mos \
vaporizing.mos
vaporizing.mos

# test that currently fail. Move up when fixed.
# test that currently fail. Move up when fixed.
# Run make testfailing
FAILINGTESTFILES = \
FinalTests.mos \

# Dependency files that are not .mo .mos or Makefile
# Add them here or they will be cleaned.
Expand All @@ -66,8 +66,8 @@ test:
@echo
@echo OPENMODELICAHOME=" $(OPENMODELICAHOME) "
@$(TEST) $(TESTFILES)
# Cleans all files that are not listed as dependencies

# Cleans all files that are not listed as dependencies
clean :
@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp
@rm -rf $(CLEAN)
Expand All @@ -76,11 +76,11 @@ clean :
# do it after cleaning and updating the folder
# then you can get a list of file names (which must be dependencies
# since you got them from repository + your own new files)
# then add them to the DEPENDENCIES. You can find the
# list in deps.txt
getdeps:
# then add them to the DEPENDENCIES. You can find the
# list in deps.txt
getdeps:
@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp
@echo $(CLEAN) | sed -r 's/deps.txt|deps.tmp//g' | sed 's/ / \\\n/g' > deps.txt
@echo $(CLEAN) | sed -r 's/deps.txt|deps.tmp//g' | sed 's/ / \\\n/g' > deps.txt
@echo Dependency list saved in deps.txt.
@echo Copy the list from deps.txt and add it to the Makefile @DEPENDENCIES

Expand Down

0 comments on commit a4a5d33

Please sign in to comment.