diff --git a/test/v4l2_device/buffer_sharing.cpp b/test/v4l2_device/buffer_sharing.cpp
index 45b07fc4905b826e..09695239ee4b9e80 100644
--- a/test/v4l2_device/buffer_sharing.cpp
+++ b/test/v4l2_device/buffer_sharing.cpp
@@ -27,14 +27,6 @@ public:
 	{
 	}
 
-private:
-	const unsigned int bufferCount = 4;
-
-	V4L2Device *output_;
-
-	unsigned int framesCaptured_;
-	unsigned int framesOutput_;
-
 protected:
 	int init()
 	{
@@ -182,6 +174,14 @@ protected:
 
 		V4L2DeviceTest::cleanup();
 	}
+
+private:
+	const unsigned int bufferCount = 4;
+
+	V4L2Device *output_;
+
+	unsigned int framesCaptured_;
+	unsigned int framesOutput_;
 };
 
 TEST_REGISTER(BufferSharingTest);
