Skip to content

Commit

Permalink
Test for binding/variable multi-source type error
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Jan 11, 2017
1 parent 7e6f4d2 commit ad316fd
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
1 change: 1 addition & 0 deletions flattening/modelica/modification/ArrayModTypeError.mo
Expand Up @@ -11,6 +11,7 @@ end ArrayModTypeError;

// Result:
// Error processing file: ArrayModTypeError.mo
// [flattening/modelica/modification/ArrayModTypeError.mo:7:16-7:46:writable] Notification: From here:
// [flattening/modelica/modification/ArrayModTypeError.mo:7:3-7:47:writable] Error: Array dimension mismatch, expression {4, 5, 6} has type Integer[3], expected array dimensions [2].
// Error: Error occurred while flattening model ArrayModTypeError
//
Expand Down
26 changes: 26 additions & 0 deletions flattening/modelica/modification/ArrayModTypeError2.mo
@@ -0,0 +1,26 @@
// name: ArrayModTypeError2
// keywords: modification array type
// status: incorrect
//

model ArrayModTypeError
Real y[2, 2];
equation
der(y) = -y;
end ArrayModTypeError;

model ArrayModTypeError2
ArrayModTypeError arr(y(start = {{1, 2, 3}, {4, 5, 6}}));
end ArrayModTypeError2;

// Result:
// Error processing file: ArrayModTypeError2.mo
// [flattening/modelica/modification/ArrayModTypeError2.mo:13:27-13:57:writable] Notification: From here:
// [flattening/modelica/modification/ArrayModTypeError2.mo:7:3-7:15:writable] Error: Array dimension mismatch, expression {4, 5, 6} has type Integer[3], expected array dimensions [2].
// Error: Error occurred while flattening model ArrayModTypeError2
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
//
// Execution failed!
// endResult
19 changes: 10 additions & 9 deletions flattening/modelica/modification/Makefile
Expand Up @@ -3,6 +3,7 @@ TEST=../../../rtest -v
TESTFILES=\
ArrayModif.mo \
ArrayModTypeError.mo \
ArrayModTypeError2.mo \
Bug3817.mos \
DisturbedResistance1.mo \
DisturbedResistance3.mo \
Expand Down Expand Up @@ -58,7 +59,7 @@ UsertypeArrayMod.mo \
TestMissingModifiers.mos


# test that currently fail. Move up when fixed.
# test that currently fail. Move up when fixed.
# Run make testfailing
FAILINGTESTFILES=\
DisturbedResistance2.mo \
Expand All @@ -71,7 +72,7 @@ ModifyConstant6.mo \
DEPENDENCIES = \
*.mo \
*.mos \
Makefile
Makefile

CLEAN = `ls | grep -w -v -f deps.tmp`

Expand All @@ -96,7 +97,7 @@ test :
@echo
@$(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 -f $(CLEAN)
Expand All @@ -105,14 +106,14 @@ 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
@echo Copy the list from deps.txt and add it to the Makefile @DEPENDENCIES

failingtest :
@echo
@echo Running failing tests:
Expand Down

0 comments on commit ad316fd

Please sign in to comment.