Split GetECVersion to allow saner unit testing.

Previously, GetECVersion() accepted a (const char *) parameter that
was used solely as a flag meaning "unit test this function with
the specified data in place of mosys output".  This change splits
the function into GetECVersion() and ParseECVersion(), and only unit
tests the second part.

BUG=None
TEST=unit tests

Change-Id: Ic48d18c02bd1924f49a0d8f0034ccb1ae8b5231e
Reviewed-on: https://chromium-review.googlesource.com/174883
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
diff --git a/utils.h b/utils.h
index 6f6539f..30c2ccd 100644
--- a/utils.h
+++ b/utils.h
@@ -61,11 +61,14 @@
 // chrome os firmware.
 std::string GetFirmwareVersion();
 
-// Returns the ec version or an empty string if the system is not running a
-// custom chrome os ec. If input_line is not NULL, reads from this line,
-// otherwise polls the system for the input line. input_line should contain
-// fw_version=value.
-std::string GetECVersion(const char* input_line);
+// Parse the firmware version from one line of output from the
+// "mosys" command.
+std::string ParseECVersion(std::string input_line);
+
+// Reads and parses the ec version from the "mosys" command.  Returns
+// the version found, or an empty string if the system is not running a
+// custom chrome os ec.
+std::string GetECVersion();
 
 // Writes the data passed to path. The file at path will be overwritten if it
 // exists. Returns true on success, false otherwise.