diff options
author | Justin Worthe <justin.worthe@gmail.com> | 2015-09-01 19:47:58 +0200 |
---|---|---|
committer | Justin Worthe <justin.worthe@gmail.com> | 2015-09-01 19:47:58 +0200 |
commit | 84d9333a4ac4b9d60dc9b525b8006456d6f614dc (patch) | |
tree | 47f6a2c1d95d2b9ab1425fdbf038acd7c6f2b68a /test/neural_network.cpp | |
parent | f35c5fca6a9faaa1caf3c1992844adf9033744e8 (diff) |
Fixed memory leak
Diffstat (limited to 'test/neural_network.cpp')
-rw-r--r-- | test/neural_network.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/test/neural_network.cpp b/test/neural_network.cpp index dd029d6..801f0ec 100644 --- a/test/neural_network.cpp +++ b/test/neural_network.cpp @@ -28,7 +28,7 @@ SCENARIO("network is read from istream") file << "s0 n3 0.5" << std::endl; file << "n3 n1 1" << std::endl; file << "b0 n0 0.4" << std::endl; - file << "b0 n3 0.5" << std:: endl; + file << "b0 n3 0.5" << std::endl; WHEN("the network is initialized") { @@ -41,4 +41,25 @@ SCENARIO("network is read from istream") } } } + + GIVEN("a valid recurrant config file") + { + std::stringstream file; + file << "s0 n3 0.5" << std::endl; + file << "n3 n1 1" << std::endl; + file << "b0 n0 0.4" << std::endl; + file << "b0 n3 0.5" << std::endl; + file << "n1 n3 0.5" << std::endl; + + WHEN("the network converges") + { + NeuralNetwork network(std::move(file), 1, 3); + + THEN("the network is constructed correctly") + { + network.setInput(0, 1); + REQUIRE(network.findMaxOutputIndex() == 1); + } + } + } } |