<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Unit tests: how to mock nrf_drv_gpiote.h ? (_WIN32 prevents nrf.h to include my platform bitfield header)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25034/unit-tests-how-to-mock-nrf_drv_gpiote-h-_win32-prevents-nrf-h-to-include-my-platform-bitfield-header</link><description>Hello, 
 I&amp;#39;m using Ceedling, Unity + CMock to implement unit tests but I&amp;#39;m running into issues when it comes to mocking nrf_drv_gpiote.h. 
 I&amp;#39;m trying to test a file, call it foo.c, which includes nrf_drv_gpiote.h, therefore in my test (test_foo.c)</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 14 Sep 2017 09:27:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25034/unit-tests-how-to-mock-nrf_drv_gpiote-h-_win32-prevents-nrf-h-to-include-my-platform-bitfield-header" /><item><title>RE: Unit tests: how to mock nrf_drv_gpiote.h ? (_WIN32 prevents nrf.h to include my platform bitfield header)</title><link>https://devzone.nordicsemi.com/thread/98588?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 09:27:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70a7120f-a957-471b-a571-ba6a46522c0e</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Thank you, that was a pain but I finally managed to get that working. I had not understood that the files in device_wrappers were used in addition to the SDK ones, I&amp;#39;ve tried to replace the ones from the SDKs with those and it obviously didn&amp;#39;t work. I also had to add two defines : HOST and SUPPRESS_INLINE_IMPLEMENTATION and to replace the nRF51 includes in the new nrf.h with the ones for nrf52.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit tests: how to mock nrf_drv_gpiote.h ? (_WIN32 prevents nrf.h to include my platform bitfield header)</title><link>https://devzone.nordicsemi.com/thread/98587?ContentTypeID=1</link><pubDate>Tue, 12 Sep 2017 08:04:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c05018f1-1aef-49a2-8891-02342e4efe10</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;It is in mesh SDK v 0.9.2.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit tests: how to mock nrf_drv_gpiote.h ? (_WIN32 prevents nrf.h to include my platform bitfield header)</title><link>https://devzone.nordicsemi.com/thread/98586?ContentTypeID=1</link><pubDate>Tue, 12 Sep 2017 07:38:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89312abb-b6de-47fe-b7ab-ef3b4513683b</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Hi Martin, thank you for your answer. I couldn&amp;#39;t find the folder &amp;quot;mesh/test/include/device_wrappers&amp;quot; nor the file nrf_mesh_cmsis_mock.h both in the SDK 13.0.0 and 14.0.0. Is it possible that those aren&amp;#39;t distributed with the SDK but can be found on GitHub ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unit tests: how to mock nrf_drv_gpiote.h ? (_WIN32 prevents nrf.h to include my platform bitfield header)</title><link>https://devzone.nordicsemi.com/thread/98585?ContentTypeID=1</link><pubDate>Tue, 12 Sep 2017 07:06:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ba235c1-432e-4453-96e3-722872a6766f</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;We have had this issue too and our current workaround is to make a new nrf.h file for the host and then include that in the unit tests. You will find the new file in the folder &amp;quot;mesh/test/include/device_wrappers&amp;quot; and it should also make it possible to mock peripherals through nrf_mesh_cmsis_mock.h.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>