From 650a2f680ec403d8b2a044674e296b9cab7af793 Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Mon, 27 Jul 2015 20:56:04 +0200 Subject: Added test and abstract neural node --- test/neural_network.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/neural_network.cpp (limited to 'test') 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 + +#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); + } + } + } +} -- cgit v1.2.3