<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Remember&#039;s Blog</title>
	<atom:link href="http://lembra.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://lembra.wordpress.com</link>
	<description>Things that you&#039;re going to need but will probably forget</description>
	<lastBuildDate>Thu, 26 Jan 2012 11:58:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='lembra.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/3347289e876bd0100b31566c7d7fc05d?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Remember&#039;s Blog</title>
		<link>http://lembra.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://lembra.wordpress.com/osd.xml" title="Remember&#039;s Blog" />
	<atom:link rel='hub' href='http://lembra.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Changing the Wallpaper on Motorola Defy+ (Android 2.3.4)</title>
		<link>http://lembra.wordpress.com/2012/01/26/changing-the-wallpaper-on-motorola-defy-android-2-3-4/</link>
		<comments>http://lembra.wordpress.com/2012/01/26/changing-the-wallpaper-on-motorola-defy-android-2-3-4/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 11:56:26 +0000</pubDate>
		<dc:creator>Eduardo</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[defy+]]></category>
		<category><![CDATA[motorola]]></category>

		<guid isPermaLink="false">http://lembra.wordpress.com/?p=1040</guid>
		<description><![CDATA[Now that I am using Defy+ I&#8217;ve been looking for a new wallpaper, and, for my surprise, was not easy to find a way to change it. Where are the stock wallpapers? I saw this question many times on different places, e.g., here , here, and here. The best I&#8217;ve found was someone pointing the directory /data/data/com.android.settings/files, but, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lembra.wordpress.com&amp;blog=7369275&amp;post=1040&amp;subd=lembra&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Now that I am using Defy+ I&#8217;ve been looking for a new wallpaper, and, for my surprise, was not easy to find a way to change it. Where are the stock wallpapers? I saw this question many times on different places, e.g., <a href="http://androidforums.com/motorola-droid/42893-where-stock-wallpaper-images-stored.html">here</a> , <a href="http://forum.xda-developers.com/showthread.php?t=912940">here</a>, and <a href="http://androidforums.com/eris-all-things-root/110902-wallpaper-location.html">here</a>. The best I&#8217;ve found was someone pointing the directory /data/data/com.android.settings/files, but, at least on Defy+ there is only an unreadable &#8220;wallpaper&#8221; script.</p>
<p>After looking for it a lil bit, I figured out by myself that, at least for Defy+ it is stored on the sdcard. The directory is <strong>/Android/data/com.motorola.blur.home/files/.profiles</strong> and the file is <strong>wp_0.png</strong>, it is a 960&#215;854 picture. Change it for the picture that you want it there is your new wallpaper!</p>
<br />Filed under: <a href='http://lembra.wordpress.com/category/android/'>Android</a> Tagged: <a href='http://lembra.wordpress.com/tag/defy/'>defy+</a>, <a href='http://lembra.wordpress.com/tag/motorola/'>motorola</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lembra.wordpress.com/1040/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lembra.wordpress.com/1040/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lembra.wordpress.com/1040/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lembra.wordpress.com/1040/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lembra.wordpress.com/1040/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lembra.wordpress.com/1040/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lembra.wordpress.com/1040/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lembra.wordpress.com/1040/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lembra.wordpress.com/1040/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lembra.wordpress.com/1040/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lembra.wordpress.com/1040/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lembra.wordpress.com/1040/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lembra.wordpress.com/1040/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lembra.wordpress.com/1040/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lembra.wordpress.com&amp;blog=7369275&amp;post=1040&amp;subd=lembra&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lembra.wordpress.com/2012/01/26/changing-the-wallpaper-on-motorola-defy-android-2-3-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3264af6ce644bfab6fb98aaa26ecdfab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Eduardo</media:title>
		</media:content>
	</item>
		<item>
		<title>Unknown or ambiguous terminal type; type just &#8216;set terminal&#8217; for a list</title>
		<link>http://lembra.wordpress.com/2011/11/15/unknown-or-ambiguous-terminal-type-type-just-set-terminal-for-a-list/</link>
		<comments>http://lembra.wordpress.com/2011/11/15/unknown-or-ambiguous-terminal-type-type-just-set-terminal-for-a-list/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 16:30:52 +0000</pubDate>
		<dc:creator>Eduardo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[gnuplot]]></category>
		<category><![CDATA[pdf]]></category>

		<guid isPermaLink="false">http://lembra.wordpress.com/?p=1025</guid>
		<description><![CDATA[This appeared when I tried to &#8220;set terminal pdf&#8221; on Gnuplot. Im using Ubuntu 10.04.  Making the long story short, I needed to install the Maverick (10.10) packets for Gnuplot. The direct links for those packages, depending on the arch, are amd64, gnuplot-nox and gnuplot-x11. For i386, gnuplot-nox and gnuplot-x11. Download, install and the same [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lembra.wordpress.com&amp;blog=7369275&amp;post=1025&amp;subd=lembra&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This appeared when I tried to &#8220;set terminal pdf&#8221; on Gnuplot. Im using Ubuntu 10.04.  Making the long story short, I needed to install the Maverick (10.10) packets for Gnuplot.</p>
<p>The direct links for those packages, depending on the arch, are amd64, <a href="http://launchpadlibrarian.net/48323764/gnuplot-nox_4.4.0-1_amd64.deb">gnuplot-nox</a> and <a href="http://launchpadlibrarian.net/48323765/gnuplot-x11_4.4.0-1_amd64.deb">gnuplot-x11</a>. For i386, <a href="http://launchpadlibrarian.net/48202884/gnuplot-nox_4.4.0-1_i386.deb">gnuplot-nox</a> and <a href="http://launchpadlibrarian.net/48202885/gnuplot-x11_4.4.0-1_i386.deb">gnuplot-x11</a>. Download, install and the same output should be something like</p>
<p><pre class="brush: bash;">
gnuplot&gt; set terminal pdf
Terminal type set to 'pdfcairo'
</pre><br />
and that is it!</pre>
<br />Filed under: <a href='http://lembra.wordpress.com/category/linux/'>Linux</a>, <a href='http://lembra.wordpress.com/category/ubuntu/'>Ubuntu</a> Tagged: <a href='http://lembra.wordpress.com/tag/gnuplot/'>gnuplot</a>, <a href='http://lembra.wordpress.com/tag/pdf/'>pdf</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lembra.wordpress.com/1025/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lembra.wordpress.com/1025/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lembra.wordpress.com/1025/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lembra.wordpress.com/1025/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lembra.wordpress.com/1025/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lembra.wordpress.com/1025/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lembra.wordpress.com/1025/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lembra.wordpress.com/1025/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lembra.wordpress.com/1025/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lembra.wordpress.com/1025/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lembra.wordpress.com/1025/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lembra.wordpress.com/1025/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lembra.wordpress.com/1025/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lembra.wordpress.com/1025/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lembra.wordpress.com&amp;blog=7369275&amp;post=1025&amp;subd=lembra&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lembra.wordpress.com/2011/11/15/unknown-or-ambiguous-terminal-type-type-just-set-terminal-for-a-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3264af6ce644bfab6fb98aaa26ecdfab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Eduardo</media:title>
		</media:content>
	</item>
		<item>
		<title>Adding a Samsung ML-1865w laser printer to Ubuntu</title>
		<link>http://lembra.wordpress.com/2011/10/23/1012/</link>
		<comments>http://lembra.wordpress.com/2011/10/23/1012/#comments</comments>
		<pubDate>Sun, 23 Oct 2011 15:15:14 +0000</pubDate>
		<dc:creator>emanuelvianna</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[printer]]></category>
		<category><![CDATA[samsung]]></category>

		<guid isPermaLink="false">http://lembra.wordpress.com/?p=1012</guid>
		<description><![CDATA[Samsung ML-1865w laser printer is a good alternative for those who print much more in black and white than in color. I was trying to add it to Ubuntu, but it was not found automatically by Ubuntu. So I need to add its driver manually, following the steps below: See ya! Filed under: Ubuntu Tagged: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lembra.wordpress.com&amp;blog=7369275&amp;post=1012&amp;subd=lembra&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Samsung ML-1865w laser printer is a good alternative for those who print much more in black and white than in color. I was trying to add it to Ubuntu, but it was not found automatically by Ubuntu. So I need to add its driver manually, following the steps below: </p>
<p><pre class="brush: bash; gutter: false;">
# enter in a temporarty directory
cd /var/tmp

# downloads the unified linux driver
wget http://org.downloadcenter.samsung.com/downloadfile/ContentsFile.aspx?CDSite=UNI_HK_EN&amp;CttFileID=3182440&amp;CDCttType=DR&amp;ModelType=N&amp;ModelName=ML-1865W&amp;VPath=DR/201106/20110602161236937/UnifiedLinuxDriver_0.98.tar.gz

# unconpressing driver 
tar -xzf UnifiedLinuxDriver_0.98.tar.gz

# remove compressed drive
rm UnifiedLinuxDriver_0.98.tar.gz

# enter 
cd cdroot

# run autorun -&gt; It will open a window -&gt; Next -&gt; I accept -&gt; Next -&gt; Add user: vianna -&gt; Next -&gt; Mark &quot;Disable LPT support&quot; -&gt; Wait installing pr
sudo ./autorun

# remove install directory
cd ..; rm -rf cdroot
</pre></p>
<p>See ya!</p>
<br />Filed under: <a href='http://lembra.wordpress.com/category/ubuntu/'>Ubuntu</a> Tagged: <a href='http://lembra.wordpress.com/tag/driver/'>driver</a>, <a href='http://lembra.wordpress.com/tag/printer/'>printer</a>, <a href='http://lembra.wordpress.com/tag/samsung/'>samsung</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lembra.wordpress.com/1012/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lembra.wordpress.com/1012/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lembra.wordpress.com/1012/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lembra.wordpress.com/1012/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lembra.wordpress.com/1012/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lembra.wordpress.com/1012/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lembra.wordpress.com/1012/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lembra.wordpress.com/1012/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lembra.wordpress.com/1012/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lembra.wordpress.com/1012/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lembra.wordpress.com/1012/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lembra.wordpress.com/1012/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lembra.wordpress.com/1012/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lembra.wordpress.com/1012/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lembra.wordpress.com&amp;blog=7369275&amp;post=1012&amp;subd=lembra&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lembra.wordpress.com/2011/10/23/1012/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4de927c3acbc3ed9ead620b5eab18d8a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Emanuel</media:title>
		</media:content>
	</item>
		<item>
		<title>Building Google Test Framework with CMake</title>
		<link>http://lembra.wordpress.com/2011/10/17/building-google-test-framework-with-cmake/</link>
		<comments>http://lembra.wordpress.com/2011/10/17/building-google-test-framework-with-cmake/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 04:23:34 +0000</pubDate>
		<dc:creator>emanuelvianna</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[cmake]]></category>
		<category><![CDATA[google-test]]></category>
		<category><![CDATA[gtest]]></category>
		<category><![CDATA[Makefile]]></category>
		<category><![CDATA[unit test]]></category>

		<guid isPermaLink="false">http://lembra.wordpress.com/?p=976</guid>
		<description><![CDATA[For those who does not know GTest (Google Test Framework), it is a simple way to make unit tests in C and C++ source code. But what is an unit test? In GTest Documentation you will find an in-depth description, but in general terms, one unit test consists in a specific test of one function [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lembra.wordpress.com&amp;blog=7369275&amp;post=976&amp;subd=lembra&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For those who does not know <a href="http://code.google.com/p/googletest/">GTest</a> (Google Test Framework), it is a simple way to make unit tests in C and C++ source code.</p>
<p><strong>But what is an unit test?</strong></p>
<p>In GTest Documentation you will find an in-depth description, but in general terms, one unit test consists in a specific test of one function of one source file from an application. It has basically an initialization phase to allows you to call the correspondent function. Then it comprises on make some sanity tests (assertions) to check if your code is behaving as expected.</p>
<p><strong>How GTest works?</strong></p>
<p>GTest provides some assertion macros which simplify the tests as the following numerical comparison assertions (there is also some macros for binary and string comparison):</p>
<table class="wikitable">
<tbody>
<tr>
<td style="border:1px solid #ccc;padding:5px;"><strong>Fatal assertion</strong></td>
<td style="border:1px solid #ccc;padding:5px;"><strong>Nonfatal assertion</strong></td>
<td style="border:1px solid #ccc;padding:5px;"><strong>Verifies</strong></td>
</tr>
<tr>
<td style="border:1px solid #ccc;padding:5px;"><tt>ASSERT_EQ(</tt><em>expected</em><tt>, </tt><em>actual</em><tt>);</tt></td>
<td style="border:1px solid #ccc;padding:5px;"><tt>EXPECT_EQ(</tt><em>expected</em><tt>, </tt><em>actual</em><tt>);</tt></td>
<td style="border:1px solid #ccc;padding:5px;"><em>expected</em> <tt>==</tt> <em>actual</em></td>
</tr>
<tr>
<td style="border:1px solid #ccc;padding:5px;"><tt>ASSERT_NE(</tt><em>val1</em><tt>, </tt><em>val2</em><tt>);</tt></td>
<td style="border:1px solid #ccc;padding:5px;"><tt>EXPECT_NE(</tt><em>val1</em><tt>, </tt><em>val2</em><tt>);</tt></td>
<td style="border:1px solid #ccc;padding:5px;"><em>val1</em> <tt>!=</tt> <em>val2</em></td>
</tr>
<tr>
<td style="border:1px solid #ccc;padding:5px;"><tt>ASSERT_LT(</tt><em>val1</em><tt>, </tt><em>val2</em><tt>);</tt></td>
<td style="border:1px solid #ccc;padding:5px;"><tt>EXPECT_LT(</tt><em>val1</em><tt>, </tt><em>val2</em><tt>);</tt></td>
<td style="border:1px solid #ccc;padding:5px;"><em>val1</em> <tt>&lt;</tt> <em>val2</em></td>
</tr>
<tr>
<td style="border:1px solid #ccc;padding:5px;"><tt>ASSERT_LE(</tt><em>val1</em><tt>, </tt><em>val2</em><tt>);</tt></td>
<td style="border:1px solid #ccc;padding:5px;"><tt>EXPECT_LE(</tt><em>val1</em><tt>, </tt><em>val2</em><tt>);</tt></td>
<td style="border:1px solid #ccc;padding:5px;"><em>val1</em> <tt>&lt;=</tt> <em>val2</em></td>
</tr>
<tr>
<td style="border:1px solid #ccc;padding:5px;"><tt>ASSERT_GT(</tt><em>val1</em><tt>, </tt><em>val2</em><tt>);</tt></td>
<td style="border:1px solid #ccc;padding:5px;"><tt>EXPECT_GT(</tt><em>val1</em><tt>, </tt><em>val2</em><tt>);</tt></td>
<td style="border:1px solid #ccc;padding:5px;"><em>val1</em> <tt>&gt;</tt> <em>val2</em></td>
</tr>
<tr>
<td style="border:1px solid #ccc;padding:5px;"><tt>ASSERT_GE(</tt><em>val1</em><tt>, </tt><em>val2</em><tt>);</tt></td>
<td style="border:1px solid #ccc;padding:5px;"><tt>EXPECT_GE(</tt><em>val1</em><tt>, </tt><em>val2</em><tt>);</tt></td>
<td style="border:1px solid #ccc;padding:5px;"><em>val1</em> <tt>&gt;=</tt> <em>val2</em></td>
</tr>
</tbody>
</table>
<p><strong>How to build a simple example?</strong></p>
<p>The first step is download the source code and build the GTest library, which can be performed using g++ compiler (replace $(GTEST_DIR) by the place of GTest directory):<pre class="brush: bash; gutter: false;">
wget http://googletest.googlecode.com/files/gtest-1.6.0.zip
unzip gtest-1.6.0.zip
g++ -I ${GTEST_DIR}/include -I ${GTEST_DIR} -c ${GTEST_DIR}/src/gtest-all.cc
ar -rv libgtest.a gtest-all.o
</pre></p>
<p>It will generates the libraries libgtest.a (which contains GTest binaries). Consider a simple unit test example of a C source code named <strong>test1.c</strong>:<br />
<pre class="brush: cpp; gutter: false;">
#include &lt;gtest/gtest.h&gt;
TEST(MathTest, TwoPlusTwoEqualsFour) {
EXPECT_EQ(2 + 2, 4);
}
int main(int argc, char **argv) {
::testing::InitGoogleTest( &amp;argc, argv );
return RUN_ALL_TESTS();
}
</pre></p>
<p>To build it, it is necessary to defines the GTest headers directory (parameter includes dir -I), compile the source code and link it with the GTest library (libgtest.a) and pthread, as shown below (again, replace $(GTEST_DIR) by the GTest directory):<br />
<pre class="brush: bash; gutter: false;">
g++ -I ${GTEST_DIR}/include test1.c libgtest.a -lpthread -o test1
</pre></p>
<p>The call and the output is as follows:<br />
<pre class="brush: plain; gutter: false;">
./test1
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from MathTest
[ RUN      ] MathTest.TwoPlusTwoEqualsFour
[       OK ] MathTest.TwoPlusTwoEqualsFour (0 ms)
[----------] 1 test from MathTest (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (0 ms total)
[  PASSED  ] 1 test.
</pre></p>
<p><strong>How to build GTest samples?</strong></p>
<p>Jointly with the GTest, it also comes some C++ unit test examples, found in the samples directory. You can build this examples using CMake a simpler and powerful tool to generate Makefiles. It can be installed using apt-get:<br />
<pre class="brush: bash; gutter: false;">
sudo apt-get install cmake
</pre></p>
<p>The CMake uses a configuration file named CMakeLists.txt. The common way to build a project with CMake is create a build directory, generate a Makefile using CMake and build it with make. One advantage of using CMake is that you separate the deploy from source code and can make the deploy in multiple places with the same CMake file.<br />
<pre class="brush: bash; gutter: false;">
cd gtest-1.6.0
mkdir build
cd build
cmake -Dgtest_build_samples=ON ..
make
</pre></p>
<p>Now you can execute all examples that comes GTest.<br />
<pre class="brush: bash; gutter: false;">
cd gtest-1.6.0/build
./sample1_unittest
./sample2_unittest
...
./sample10_unittest
</pre></p>
<p><strong>How to build your own CMake?</strong></p>
<p>A last tip is how to build a CMakeFile.txt for your project. Instead of use the CMake file provided by GTest, let&#8217;s make our own CMake to build the GTest&#8217;s sample 1 (Factorial test). The CMake file will requires to know where you unzip GTest, which can be performed through an environment variable named GTEST_ROOT (replace &#8220;/tmp/gtest-1.6.0&#8243; by the GTest directory).<br />
<pre class="brush: bash; gutter: false;">
GTEST_ROOT=&quot;/tmp/gtest-1.6.0&quot;
export GTEST_ROOT
</pre></p>
<p>Then, creates a <strong>CMakeLists.txt</strong> with the content below:<br />
<pre class="brush: bash; gutter: false;">
cmake_minimum_required(VERSION 2.6)
project(sample1)
enable_testing()
find_package (Threads)
message(STATUS GTEST_ROOT=$ENV{GTEST_ROOT})
include_directories($ENV{GTEST_ROOT}/include)
link_directories($ENV{GTEST_ROOT}/mybuild)
add_executable(sample1 sample1.cc sample1_unittest.cc)
target_link_libraries(sample1 gtest gtest_main)
target_link_libraries(sample1 ${CMAKE_THREAD_LIBS_INIT})
add_test(NAME sample1 COMMAND sample1)
</pre></p>
<p>To build it you should repeat the same steps above:<br />
<pre class="brush: bash; gutter: false;">
mkdir build
cd build
cmake ..
make
</pre></p>
<p>The call and output of this example is as follows:<br />
<pre class="brush: plain; gutter: false;">
./sample1
[==========] Running 6 tests from 2 test cases.
[----------] Global test environment set-up.
[----------] 3 tests from FactorialTest
[ RUN      ] FactorialTest.Negative
[       OK ] FactorialTest.Negative (0 ms)
[ RUN      ] FactorialTest.Zero
[       OK ] FactorialTest.Zero (0 ms)
[ RUN      ] FactorialTest.Positive
[       OK ] FactorialTest.Positive (0 ms)
[----------] 3 tests from FactorialTest (0 ms total)

[----------] 3 tests from IsPrimeTest
[ RUN      ] IsPrimeTest.Negative
[       OK ] IsPrimeTest.Negative (0 ms)
[ RUN      ] IsPrimeTest.Trivial
[       OK ] IsPrimeTest.Trivial (0 ms)
[ RUN      ] IsPrimeTest.Positive
[       OK ] IsPrimeTest.Positive (0 ms)
[----------] 3 tests from IsPrimeTest (0 ms total)

[----------] Global test environment tear-down
[==========] 6 tests from 2 test cases ran. (1 ms total)
[  PASSED  ] 6 tests.
</pre></p>
<p>See ya!</p>
<br />Filed under: <a href='http://lembra.wordpress.com/category/cc/'>C/C++</a>, <a href='http://lembra.wordpress.com/category/linux/'>Linux</a> Tagged: <a href='http://lembra.wordpress.com/tag/c/'>c</a>, <a href='http://lembra.wordpress.com/tag/cmake/'>cmake</a>, <a href='http://lembra.wordpress.com/tag/google-test/'>google-test</a>, <a href='http://lembra.wordpress.com/tag/gtest/'>gtest</a>, <a href='http://lembra.wordpress.com/tag/makefile/'>Makefile</a>, <a href='http://lembra.wordpress.com/tag/unit-test/'>unit test</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lembra.wordpress.com/976/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lembra.wordpress.com/976/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lembra.wordpress.com/976/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lembra.wordpress.com/976/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lembra.wordpress.com/976/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lembra.wordpress.com/976/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lembra.wordpress.com/976/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lembra.wordpress.com/976/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lembra.wordpress.com/976/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lembra.wordpress.com/976/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lembra.wordpress.com/976/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lembra.wordpress.com/976/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lembra.wordpress.com/976/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lembra.wordpress.com/976/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lembra.wordpress.com&amp;blog=7369275&amp;post=976&amp;subd=lembra&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lembra.wordpress.com/2011/10/17/building-google-test-framework-with-cmake/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4de927c3acbc3ed9ead620b5eab18d8a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Emanuel</media:title>
		</media:content>
	</item>
		<item>
		<title>Force Google Chrome Close a Hanged Tab</title>
		<link>http://lembra.wordpress.com/2011/10/08/force-google-chrome-close-a-hanged-tab/</link>
		<comments>http://lembra.wordpress.com/2011/10/08/force-google-chrome-close-a-hanged-tab/#comments</comments>
		<pubDate>Sat, 08 Oct 2011 18:50:22 +0000</pubDate>
		<dc:creator>Eduardo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[chrome]]></category>

		<guid isPermaLink="false">http://lembra.wordpress.com/?p=973</guid>
		<description><![CDATA[My Chrome 9.0 had two hanged tabs, and those were not being identified by the browser, I mean, informing me that they were problematic. The computer was 2 days on but Chrome was endlessly loading those 2 tabs. In order to force a tab being closed in Chrome read this Google Support&#8217;s article. Basically you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lembra.wordpress.com&amp;blog=7369275&amp;post=973&amp;subd=lembra&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My Chrome 9.0 had two hanged tabs, and those were not being identified by the browser, I mean, informing me that they were problematic. The computer was 2 days on but Chrome was endlessly loading those 2 tabs. In order to force a tab being closed in Chrome read <a href="http://www.google.com/support/chrome/bin/answer.py?answer=95672">this</a> Google Support&#8217;s article. Basically you have to go to the Menu &gt; Tools &gt; Task Manager &gt; Choose tab &gt; Close it.</p>
<br />Filed under: <a href='http://lembra.wordpress.com/category/linux/'>Linux</a> Tagged: <a href='http://lembra.wordpress.com/tag/chrome/'>chrome</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/lembra.wordpress.com/973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/lembra.wordpress.com/973/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/lembra.wordpress.com/973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/lembra.wordpress.com/973/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/lembra.wordpress.com/973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/lembra.wordpress.com/973/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/lembra.wordpress.com/973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/lembra.wordpress.com/973/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/lembra.wordpress.com/973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/lembra.wordpress.com/973/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/lembra.wordpress.com/973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/lembra.wordpress.com/973/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/lembra.wordpress.com/973/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/lembra.wordpress.com/973/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=lembra.wordpress.com&amp;blog=7369275&amp;post=973&amp;subd=lembra&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://lembra.wordpress.com/2011/10/08/force-google-chrome-close-a-hanged-tab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3264af6ce644bfab6fb98aaa26ecdfab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Eduardo</media:title>
		</media:content>
	</item>
	</channel>
</rss>
