From 3fd43cd5fcb22bb65bf2a92a25d95d801b11c9e0 Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Wed, 1 Jun 2016 18:58:58 -0700 Subject: Initial checkin for typhoon chess engine. --- src/autoplay/child_process_test.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/autoplay/child_process_test.cc (limited to 'src/autoplay/child_process_test.cc') diff --git a/src/autoplay/child_process_test.cc b/src/autoplay/child_process_test.cc new file mode 100644 index 0000000..d723701 --- /dev/null +++ b/src/autoplay/child_process_test.cc @@ -0,0 +1,13 @@ +#include "child_process.h" +#include "gtest/gtest.h" + +TEST(ChildProcessTest, BasicUsage) { + util::ChildProcess ps("/usr/bin/bc"); + ps.Start(); + ps.Flush(); + ps.Send("1 + 1\n"); + char buf[128]; + ps.Receive(buf, 128); + EXPECT_STREQ("2\n", buf); + ps.Stop(); +} -- cgit v1.3