summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJustin Worthe <justin.worthe@gmail.com>2015-07-27 20:56:04 +0200
committerJustin Worthe <justin.worthe@gmail.com>2015-07-27 20:56:04 +0200
commit650a2f680ec403d8b2a044674e296b9cab7af793 (patch)
treecaa88427a7c12aca0d3770d1647bee441334a0b9 /test
parentfc6933f34f7ce4efb522e4af34f94e9e437ec31c (diff)
Added test and abstract neural node
Diffstat (limited to 'test')
-rw-r--r--test/neural_network.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/neural_network.cpp b/test/neural_network.cpp
new file mode 100644
index 0000000..ba0df4d
--- /dev/null
+++ b/test/neural_network.cpp
@@ -0,0 +1,24 @@
+#include "catch.hpp"
+#include <sstream>
+
+#include "brain/neural_network.h"
+
+SCENARIO("network is read from istream")
+{
+ GIVEN("an empty config file")
+ {
+ std::stringstream file;
+ file << "" << std::endl;
+
+ WHEN ("the network is initialized")
+ {
+ NeuralNetwork network(std::move(file), 1, 2);
+
+ THEN("the specified number of inputs and outputs are created")
+ {
+ REQUIRE(network.numberOfSensors() == 1);
+ REQUIRE(network.numberOfOutputs() == 2);
+ }
+ }
+ }
+}