<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	
	>
<channel>
	<title>
	Comments on: Integrating Mocking With C++ Default Parameters	</title>
	<atom:link href="https://www.fluentcpp.com/2018/08/21/default-parameters-mocking/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2018/08/21/default-parameters-mocking/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Tue, 28 Aug 2018 09:56:00 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.3</generator>
	<item>
		<title>
		By: Jonathan O'Connor		</title>
		<link>https://www.fluentcpp.com/2018/08/21/default-parameters-mocking/#comment-1251</link>

		<dc:creator><![CDATA[Jonathan O'Connor]]></dc:creator>
		<pubDate>Tue, 28 Aug 2018 09:56:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2260#comment-1251</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/08/21/default-parameters-mocking/#comment-1241&quot;&gt;Dirk Reum&lt;/a&gt;.

Very interesting idea. I have seen a C++ mocking framework that replaces the implementation of functions with Python code at runtime. It relies on the linker DWARF(?) data to get the addresses.

For more information look at the last talk here: https://www.meetup.com/cppdug/events/251408066/]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/08/21/default-parameters-mocking/#comment-1241">Dirk Reum</a>.</p>
<p>Very interesting idea. I have seen a C++ mocking framework that replaces the implementation of functions with Python code at runtime. It relies on the linker DWARF(?) data to get the addresses.</p>
<p>For more information look at the last talk here: <a href="https://www.meetup.com/cppdug/events/251408066/" rel="nofollow ugc">https://www.meetup.com/cppdug/events/251408066/</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jeff Andrews		</title>
		<link>https://www.fluentcpp.com/2018/08/21/default-parameters-mocking/#comment-1242</link>

		<dc:creator><![CDATA[Jeff Andrews]]></dc:creator>
		<pubDate>Wed, 22 Aug 2018 00:52:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2260#comment-1242</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.fluentcpp.com/2018/08/21/default-parameters-mocking/#comment-1241&quot;&gt;Dirk Reum&lt;/a&gt;.

My sentiments exactly]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.fluentcpp.com/2018/08/21/default-parameters-mocking/#comment-1241">Dirk Reum</a>.</p>
<p>My sentiments exactly</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dirk Reum		</title>
		<link>https://www.fluentcpp.com/2018/08/21/default-parameters-mocking/#comment-1241</link>

		<dc:creator><![CDATA[Dirk Reum]]></dc:creator>
		<pubDate>Tue, 21 Aug 2018 15:47:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2260#comment-1241</guid>

					<description><![CDATA[One option not yet mentioned: Remember you have another &quot;seam&quot; in your code, that is the linker. You can keep your code above exactly as is but link your tests against a dummy logging library that does nothing, while the production code would link against the real logger.]]></description>
			<content:encoded><![CDATA[<p>One option not yet mentioned: Remember you have another &#8220;seam&#8221; in your code, that is the linker. You can keep your code above exactly as is but link your tests against a dummy logging library that does nothing, while the production code would link against the real logger.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Abel Suranyi		</title>
		<link>https://www.fluentcpp.com/2018/08/21/default-parameters-mocking/#comment-1240</link>

		<dc:creator><![CDATA[Abel Suranyi]]></dc:creator>
		<pubDate>Tue, 21 Aug 2018 09:20:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2260#comment-1240</guid>

					<description><![CDATA[Hi,

It&#039;s a good article. I have only one thing to add which can help to make the code more simple. In tests it is allowed to declare the function signature with different default parameters.

In this case it will be something similar:

int f(int x, int y, const LoggerSeam&#038; logger = LoggerMock());

(I didn&#039;t try it, so they possibly will collide during lookup if they are present in the same scope, but declared in different namespace level/scope it must work.)]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>It&#8217;s a good article. I have only one thing to add which can help to make the code more simple. In tests it is allowed to declare the function signature with different default parameters.</p>
<p>In this case it will be something similar:</p>
<p>int f(int x, int y, const LoggerSeam&amp; logger = LoggerMock());</p>
<p>(I didn&#8217;t try it, so they possibly will collide during lookup if they are present in the same scope, but declared in different namespace level/scope it must work.)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sergio Adán		</title>
		<link>https://www.fluentcpp.com/2018/08/21/default-parameters-mocking/#comment-1239</link>

		<dc:creator><![CDATA[Sergio Adán]]></dc:creator>
		<pubDate>Tue, 21 Aug 2018 08:01:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=2260#comment-1239</guid>

					<description><![CDATA[You can provide logging facility by using a static class or function that must be initialized before using it. Then in production you initialize the real logging class but in testing mock class should be initialized. 

You can see an example in the following link: https://wandbox.org/permlink/IeZ9wZU60lOi88kW

Now, as you can see f function does not need to know if it is in a real context or in a testing one and it wont be a responsibility of the caller to know what logging class should be use.


Of course the most appropriate solution depends on the nature of the project.


Regards]]></description>
			<content:encoded><![CDATA[<p>You can provide logging facility by using a static class or function that must be initialized before using it. Then in production you initialize the real logging class but in testing mock class should be initialized. </p>
<p>You can see an example in the following link: <a href="https://wandbox.org/permlink/IeZ9wZU60lOi88kW" rel="nofollow ugc">https://wandbox.org/permlink/IeZ9wZU60lOi88kW</a></p>
<p>Now, as you can see f function does not need to know if it is in a real context or in a testing one and it wont be a responsibility of the caller to know what logging class should be use.</p>
<p>Of course the most appropriate solution depends on the nature of the project.</p>
<p>Regards</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
