IVGCVSW-2515 Fix compilation when TfParser is disabled

Change-Id: Ia0019134f76764cd4fe6ed9dc1423b8aba411d33
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 682e2cf..82f7d11 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,14 +48,12 @@
     src/armnnUtils/VerificationHelpers.cpp
     src/armnnUtils/ParserHelper.hpp
     src/armnnUtils/ParserHelper.cpp
+    src/armnnUtils/ParserPrototxtFixture.hpp
+    src/armnnUtils/PrototxtConversions.hpp
+    src/armnnUtils/PrototxtConversions.cpp
     src/armnnUtils/TensorUtils.hpp
     src/armnnUtils/TensorUtils.cpp
     )
-if(BUILD_TF_PARSER OR BUILD_CAFFE_PARSER)
-    list(APPEND armnnUtils_sources
-    src/armnnUtils/ParserPrototxtFixture.hpp
-    )
-endif()
 
 add_library_ex(armnnUtils STATIC ${armnnUtils_sources})
 
@@ -394,7 +392,7 @@
         src/armnn/test/UnitTests.cpp
         src/armnn/test/UnitTests.hpp
         src/armnn/test/UtilsTests.cpp
-        src/armnnUtils/test/ParsePrototxtFixtureTest.cpp
+        src/armnnUtils/test/PrototxtConversionsTest.cpp
         src/armnnUtils/test/ParserHelperTest.cpp
         )
 
diff --git a/src/armnnTfParser/test/Mean.cpp b/src/armnnTfParser/test/Mean.cpp
index 1304162..d736829 100644
--- a/src/armnnTfParser/test/Mean.cpp
+++ b/src/armnnTfParser/test/Mean.cpp
@@ -3,9 +3,12 @@
 // SPDX-License-Identifier: MIT
 //
 
-#include <boost/test/unit_test.hpp>
 #include "armnnTfParser/ITfParser.hpp"
-#include "ParserPrototxtFixture.hpp"
+
+#include <ParserPrototxtFixture.hpp>
+#include <PrototxtConversions.hpp>
+
+#include <boost/test/unit_test.hpp>
 
 BOOST_AUTO_TEST_SUITE(TensorflowParser)
 
@@ -29,7 +32,7 @@
 
         for (unsigned int i = 0; i < protobufAxis.size(); ++i)
         {
-            protobufAxisString.append(ConvertInt32ToOctalString(static_cast<int>(protobufAxis[i])));
+            protobufAxisString.append(armnnUtils::ConvertInt32ToOctalString(static_cast<int>(protobufAxis[i])));
         }
 
         m_Prototext = R"(node {
diff --git a/src/armnnUtils/ParserPrototxtFixture.hpp b/src/armnnUtils/ParserPrototxtFixture.hpp
index 154f6be..be35e46 100644
--- a/src/armnnUtils/ParserPrototxtFixture.hpp
+++ b/src/armnnUtils/ParserPrototxtFixture.hpp
@@ -9,8 +9,6 @@
 
 #include <test/TensorHelpers.hpp>
 
-#include <armnnOnnxParser/IOnnxParser.hpp>
-
 #include <Network.hpp>
 #include <VerificationHelpers.hpp>
 
@@ -61,9 +59,6 @@
     void RunTest(const std::map<std::string, std::vector<float>>& inputData,
         const std::map<std::string, std::vector<float>>& expectedOutputData);
 
-    /// Converts an int value into the Protobuf octal representation
-    std::string ConvertInt32ToOctalString(int value);
-
     std::string                                         m_Prototext;
     std::unique_ptr<TParser, void(*)(TParser* parser)>  m_Parser;
     armnn::IRuntimePtr                                  m_Runtime;
@@ -253,19 +248,4 @@
     }
 }
 
-template<typename TParser>
-std::string ParserPrototxtFixture<TParser>::ConvertInt32ToOctalString(int value)
-{
-    std::stringstream ss;
-    std::string returnString;
-    for (int i = 0; i < 4; ++i)
-    {
-        ss << "\\";
-        ss << std::setw(3) << std::setfill('0') << std::oct << ((value >> (i * 8)) & 0xFF);
-    }
-
-    ss >> returnString;
-    return returnString;
-}
-
 } // namespace armnnUtils
diff --git a/src/armnnUtils/PrototxtConversions.cpp b/src/armnnUtils/PrototxtConversions.cpp
new file mode 100644
index 0000000..1a6c053
--- /dev/null
+++ b/src/armnnUtils/PrototxtConversions.cpp
@@ -0,0 +1,32 @@
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#include "PrototxtConversions.hpp"
+
+#include <boost/format.hpp>
+
+#include <iomanip>
+#include <sstream>
+#include <string>
+
+namespace armnnUtils
+{
+
+/// Converts an int value into the Prototxt octal representation
+std::string ConvertInt32ToOctalString(int value)
+{
+    std::stringstream ss;
+    std::string returnString;
+    for (int i = 0; i < 4; ++i)
+    {
+        ss << "\\";
+        ss << std::setw(3) << std::setfill('0') << std::oct << ((value >> (i * 8)) & 0xFF);
+    }
+
+    ss >> returnString;
+    return returnString;
+}
+
+} // namespace armnnUtils
diff --git a/src/armnnUtils/PrototxtConversions.hpp b/src/armnnUtils/PrototxtConversions.hpp
new file mode 100644
index 0000000..c90af9e
--- /dev/null
+++ b/src/armnnUtils/PrototxtConversions.hpp
@@ -0,0 +1,16 @@
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+#include <string>
+
+namespace armnnUtils
+{
+
+/// Converts an int value into the Prototxt octal representation
+std::string ConvertInt32ToOctalString(int value);
+
+} // namespace armnnUtils
diff --git a/src/armnnUtils/test/ParsePrototxtFixtureTest.cpp b/src/armnnUtils/test/PrototxtConversionsTest.cpp
similarity index 81%
rename from src/armnnUtils/test/ParsePrototxtFixtureTest.cpp
rename to src/armnnUtils/test/PrototxtConversionsTest.cpp
index 926658e..e06fbe0 100644
--- a/src/armnnUtils/test/ParsePrototxtFixtureTest.cpp
+++ b/src/armnnUtils/test/PrototxtConversionsTest.cpp
@@ -3,17 +3,16 @@
 // SPDX-License-Identifier: MIT
 //
 
-#include <ParserPrototxtFixture.hpp>
+#include <PrototxtConversions.hpp>
 
 #include <boost/test/unit_test.hpp>
-#include "armnnTfParser/ITfParser.hpp"
 
-BOOST_AUTO_TEST_SUITE(ParsePrototxtFixtureSuite)
+BOOST_AUTO_TEST_SUITE(PrototxtConversions)
 
-using Fixture = armnnUtils::ParserPrototxtFixture<armnnTfParser::ITfParser>;
-
-BOOST_FIXTURE_TEST_CASE(ConvertInt32ToOctalStringTest, Fixture)
+BOOST_AUTO_TEST_CASE(ConvertInt32ToOctalStringTest)
 {
+    using armnnUtils::ConvertInt32ToOctalString;
+
     std::string octalString = ConvertInt32ToOctalString(1);
     BOOST_ASSERT(octalString.compare("\\\\001\\\\000\\\\000\\\\000"));