Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
neworderofjamie committed Jan 12, 2023
1 parent 5323f54 commit 5e5e6a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 4 additions & 2 deletions include/genn/genn/code_generator/initGroupMerged.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,16 @@ class CustomUpdateInitGroupMergedBase : public GroupMerged<G>
//! Is the var init parameter referenced?
bool isVarInitParamReferenced(const std::string &varName, const std::string &paramName) const
{
const auto *varInitSnippet = this->getArchetype().getVarInitialisers().at(varName).getSnippet();
A archetypeAdaptor(this->getArchetype());
const auto *varInitSnippet = archetypeAdaptor.getVarInitialisers().at(varName).getSnippet();
return this->isParamReferenced({varInitSnippet->getCode()}, paramName);
}

//! Is the var init derived parameter referenced?
bool isVarInitDerivedParamReferenced(const std::string &varName, const std::string &paramName) const
{
const auto *varInitSnippet = this->getArchetype().getVarInitialisers().at(varName).getSnippet();
A archetypeAdaptor(this->getArchetype());
const auto *varInitSnippet = archetypeAdaptor.getVarInitialisers().at(varName).getSnippet();
return this->isParamReferenced({varInitSnippet->getCode()}, paramName);
}
};
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/customConnectivityUpdate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ TEST(CustomConnectivityUpdate, DependentVariables)
{}, {});

// Attach custom update model
WUVarReferences cu3VarRefs{{"var", createWUVarRef(sg3, "g")}};
WUVarReferences cu3VarRefs{{"a", createWUVarRef(sg3, "g")}};
model.addCustomUpdate<Sum>("CustomUpdate3", "Test1", {}, {{"sum", 0.0}}, cu3VarRefs);

// Attach custom connectivity update
Expand Down Expand Up @@ -256,7 +256,7 @@ TEST(CustomConnectivityUpdate, DependentVariablesManualReferences)
{}, {});

// Attach custom update model
WUVarReferences cu3VarRefs{{"var", createWUVarRef(synapseGroups[i], "g")}};
WUVarReferences cu3VarRefs{{"a", createWUVarRef(synapseGroups[i], "g")}};
customUpdates[i] = model.addCustomUpdate<Sum>("CustomUpdate" + std::to_string(i), "Test1", {}, {{"sum", 0.0}}, cu3VarRefs);

// Attach custom connectivity update
Expand Down Expand Up @@ -577,14 +577,14 @@ TEST(CustomConnectivityUpdate, MixedPreDelayGroups)
{}, {}, {}, {},
WUVarReferences{{"g", createWUVarRef(syn1, "g")}},
VarReferences{{"threshLow", createVarRef(pre1, "V")},
{"threshHigh", createVarRef(pre1, "U")}}, {});
{"threshHigh", createVarRef(pre1, "V")}}, {});

// Create custom update with both presynaptic var references to different (delay) groups
model.addCustomConnectivityUpdate<RemoveSynapsePre>("CustomConnectivityUpdate2", "Test2", "Synapses1",
{}, {}, {}, {},
WUVarReferences{{"g", createWUVarRef(syn1, "g")}},
VarReferences{{"threshLow", createVarRef(pre1, "V")},
{"threshHigh", createVarRef(pre2, "U")}}, {});
{"threshHigh", createVarRef(pre2, "V")}}, {});
try {
model.finalize();
FAIL();
Expand Down Expand Up @@ -626,14 +626,14 @@ TEST(CustomConnectivityUpdate, MixedPostDelayGroups)
{}, {}, {}, {},
WUVarReferences{{"g", createWUVarRef(syn1, "g")}},
{}, VarReferences{{"threshLow", createVarRef(post1, "V")},
{"threshHigh", createVarRef(post2, "U")}});
{"threshHigh", createVarRef(post1, "V")}});

// Create custom update with both postsynaptic var references to different (delay) groups
model.addCustomConnectivityUpdate<RemoveSynapsePost>("CustomConnectivityUpdate2", "Test2", "Synapses1",
{}, {}, {}, {},
WUVarReferences{{"g", createWUVarRef(syn1, "g")}},
{}, VarReferences{{"threshLow", createVarRef(post1, "V")},
{"threshHigh", createVarRef(post2, "U")}});
{"threshHigh", createVarRef(post2, "V")}});
try {
model.finalize();
FAIL();
Expand Down

0 comments on commit 5e5e6a5

Please sign in to comment.