I'm still not convinced we should prefer the Cheshire Cat idiom (over Interface Class) here, but if we are taking this approach then impl should be const.
~~~~
+std::string mir_test_framework::udev_recordings_path()
+{
+ std::string bin_path = MIR_BUILD_PREFIX"/bin/udev_recordings";
+ std::string share_path = MIR_INSTALL_PREFIX"/share/udev_recordings";
+
+ if (boost::filesystem::exists(bin_path))
+ return bin_path;
+ else if (boost::filesystem::exists(share_path))
+ return share_path;
+
+ BOOST_THROW_EXCEPTION(std::runtime_error("Failed to find udev_recordings in standard search locations"));
+}
Can this really be the right behaviour? An installed test binary looks in the location where it was built? Even though a developer may be making changes there?
The older logic (based on the executable path) seems less surprising.
+namespace mir uint8_t> get_random_ data(unsigned size);
+{
...
+class CookieFactory
...
+std::vector<
We reserve the general mir namespace for system setup. These could be in a "cookie" namespace.
~~~~
+class CookieFactory std::vector< uint8_t> const& secret); to_cookie( uint64_ t const& timestamp); timestamp( MirCookie const& cookie); ptr<CookieImpl> impl;
+{
+public:
+ CookieFactory(
+ ~CookieFactory() noexcept;
+
+ MirCookie timestamp_
+
+ bool attest_
+
+private:
+ class CookieImpl;
+ std::unique_
+};
I'm still not convinced we should prefer the Cheshire Cat idiom (over Interface Class) here, but if we are taking this approach then impl should be const.
~~~~
+std::string mir_test_ framework: :udev_recording s_path( ) PREFIX" /bin/udev_ recordings" ; PREFIX" /share/ udev_recordings "; :filesystem: :exists( bin_path) ) :filesystem: :exists( share_path) ) EXCEPTION( std::runtime_ error(" Failed to find udev_recordings in standard search locations"));
+{
+ std::string bin_path = MIR_BUILD_
+ std::string share_path = MIR_INSTALL_
+
+ if (boost:
+ return bin_path;
+ else if (boost:
+ return share_path;
+
+ BOOST_THROW_
+}
Can this really be the right behaviour? An installed test binary looks in the location where it was built? Even though a developer may be making changes there?
The older logic (based on the executable path) seems less surprising.
~~~~
+ CookieFactory( std::vector< uint8_t> const& secret);
This will throw if the secret is too small, but the behaviour and minimum size is not documented anywhere.
I suggest providing a static class member (minimum_ secret_ size) and documenting the requirement.