Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
monticore
EmbeddedMontiArc
generators
CNNArch2X
Commits
9d0ed96a
Commit
9d0ed96a
authored
Apr 11, 2020
by
Julian Treiber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added weights path tests
parent
32e96d15
Pipeline
#267264
passed with stage
in 1 minute and 30 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
src/test/java/de/monticore/lang/monticar/cnnarch/generator/WeightsPathConfigParserTest.java
...nticar/cnnarch/generator/WeightsPathConfigParserTest.java
+47
-0
No files found.
src/test/java/de/monticore/lang/monticar/cnnarch/generator/WeightsPathConfigParserTest.java
0 → 100644
View file @
9d0ed96a
/* (c) https://github.com/MontiCore/monticore */
package
de.monticore.lang.monticar.cnnarch.generator
;
import
de.monticore.lang.monticar.cnnarch._symboltable.*
;
import
de.monticore.lang.monticar.cnnarch.predefined.AllPredefinedVariables
;
import
de.monticore.symboltable.Scope
;
import
de.se_rwth.commons.logging.Log
;
import
org.junit.Before
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
public
class
WeightsPathConfigParserTest
extends
AbstractSymtabTest
{
@Before
public
void
setUp
()
{
// ensure an empty log
Log
.
getFindings
().
clear
();
Log
.
enableFailQuick
(
false
);
}
@Test
public
void
testWeightsPathConfigParserValidComponent
()
{
WeightsPathConfigParser
parser
=
new
WeightsPathConfigParser
(
"src/test/resources/architectures/weights_paths.txt"
);
String
weights_path
=
parser
.
getWeightsPath
(
"ComponentName"
);
assertTrue
(
"Wrong weights path returned"
,
weights_path
.
equals
(
"/path/to/training/weights"
));
}
@Test
public
void
testWeightsPathConfigParserInvalidComponent
()
{
WeightsPathConfigParser
parser
=
new
WeightsPathConfigParser
(
"src/test/resources/architectures/weights_paths.txt"
);
String
weights_path
=
parser
.
getWeightsPath
(
"NotExistingComponent"
);
assertTrue
(
"For not listed components, null should be returned"
,
weights_path
==
null
);
assertTrue
(
Log
.
getFindings
().
size
()
==
1
);
}
@Test
public
void
testWeightsPathConfigParserInvalidPath
()
{
WeightsPathConfigParser
parser
=
new
WeightsPathConfigParser
(
"invalid/path/weights_paths.txt"
);
assertTrue
(
Log
.
getFindings
().
size
()
==
1
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment