<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Unit Test on The Dangling Pointer</title><link>https://aaron.blog/tags/unit-test/</link><description>Recent content in Unit Test on The Dangling Pointer</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 06 Aug 2014 19:52:11 +0000</lastBuildDate><atom:link href="https://aaron.blog/tags/unit-test/index.xml" rel="self" type="application/rss+xml"/><item><title>Asynchronous unit testing Core Data with Xcode 6</title><link>https://aaron.blog/asynchronous-unit-testing-core-data-with-xcode-6/</link><pubDate>Wed, 06 Aug 2014 19:52:11 +0000</pubDate><guid>https://aaron.blog/asynchronous-unit-testing-core-data-with-xcode-6/</guid><description>&lt;p&gt;The &lt;a href="http://github.com/wordpress-mobile/WordPress-iOS" rel="noopener"&gt;WordPress for iOS&lt;/a&gt; project had a number of unit tests using Core Data and a custom asynchronous test helper.  The helper used a semaphore in a global scope and a bit of method swizzling to give a wait/notify mechanism.  The problem with this solution was the global semaphore and poorly written tests causing a conflict.  Tests would call the ending wait and previous tests running Core Data would fire off notifies causing a mismatch between the original test and the recipient of the message to pass by the current semaphore.&lt;/p&gt;</description></item><item><title>If you run Unit Tests in Xcode</title><link>https://aaron.blog/if-you-run-unit-tests-in-xcode/</link><pubDate>Thu, 24 Apr 2014 21:31:18 +0000</pubDate><guid>https://aaron.blog/if-you-run-unit-tests-in-xcode/</guid><description>&lt;p&gt;If you run unit tests inside of Xcode, you may wish to turn on the behavior to show the test results after they run.&lt;/p&gt;&lt;figure class="kg-card kg-image-card"&gt;&lt;a href="https://aaron.blog/content/images/wordpress-com/2014/04/testbehaviors.png"&gt;&lt;img src="testbehaviors.png" class="kg-image" alt="TestBehaviors" loading="lazy" width="696" height="510"&gt;&lt;/a&gt;&lt;/figure&gt;&lt;ol&gt;&lt;li&gt;Go to Preferences in Xcode.&lt;/li&gt;&lt;li&gt;Click on the Behaviors tab.&lt;/li&gt;&lt;li&gt;Click on Succeeds.&lt;/li&gt;&lt;li&gt;Check the box shown and select "Show" then "Test Navigator".&lt;/li&gt;&lt;li&gt;Repeat step 4 for Fails as well.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Now when your tests finish (failed or succeeded) you'll see the pretty green or red marks.&lt;/p&gt;</description></item></channel></rss>