summaryrefslogtreecommitdiff
path: root/test/neural_network.cpp
diff options
context:
space:
mode:
authorJustin Worthe <justin.worthe@gmail.com>2015-08-01 14:56:40 +0200
committerJustin Worthe <justin.worthe@gmail.com>2015-08-01 14:56:40 +0200
commit1f40ce6f3c710d6339d2001a56f401b6a9dcd525 (patch)
treeb035845ea059742bf425603c33a2eaed706f7239 /test/neural_network.cpp
parent7e8dce7224214cbb82e9191917de9f234fe38cb7 (diff)
First integration test
Diffstat (limited to 'test/neural_network.cpp')
-rw-r--r--test/neural_network.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/neural_network.cpp b/test/neural_network.cpp
index ba0df4d..6040c83 100644
--- a/test/neural_network.cpp
+++ b/test/neural_network.cpp
@@ -21,4 +21,24 @@ SCENARIO("network is read from istream")
}
}
}
+
+ GIVEN("a valid config file")
+ {
+ std::stringstream file;
+ file << "s0 n2 0.5" << std::endl;
+ file << "n2 n1 1" << std::endl;
+ file << "b0 n0 0.4" << std::endl;
+ file << "b0 n2 0.5" << std:: endl;
+
+ WHEN("the network is initialized")
+ {
+ NeuralNetwork network(std::move(file), 1, 2);
+
+ THEN("the network is constructed correctly")
+ {
+ network.setInput(0, 1);
+ REQUIRE(network.findMaxOutputIndex() == 1);
+ }
+ }
+ }
}