C³ÌÐò£ºÊ¹Óà googletest ²âÊÔ¿ò¼Ü
googletest C/C++ ²âÊÔ¿ò¼Ü·Ç³£ºÃÓ㬽éÉܼ°ÏÂÔØÇë¿´ http://code.google.com/p/googletest/
//============================================================================
// ʹÓà googletest ²âÊÔ¿ò¼Ü
//============================================================================
// Returns n! (the factorial of n). For negative n, n! is defined to be 1.
int Factorial(int n)
{
int result = 1;
for (int i = 1; i <= n; i++)
{
result *= i;
}
return result;
}
#include "src/gtest-all.cc"
// Tests Factorial().
// Tests factorial of negative numbers.
TEST(FactorialTest, Negative)
{
EXPECT_EQ(1, Factorial(-5));
EXPECT_EQ(1, Factorial(-1));
EXPECT_TRUE(Factorial(-10)> 0);
}
// Tests factorial of 0.
TEST(FactorialTest, Zero)
{
EXPECT_EQ(1, Factorial(0));
}
// Tests factorial of positive numbers.
TEST(FactorialTest, Positive)
{
EXPECT_EQ(1, Factorial(1));
EXPECT_EQ(2, Factorial(2));
EXPECT_EQ(6, Factorial(3));
EXPECT_EQ(40320, Factorial(8));
}
#include "src/gtest_main.cc"
Ïà¹ØÎĵµ£º
XCode£ºÄã¿ÉÒÔ°ÑËü¿´³ÉÊÇÒ»¸ö¿ª·¢»·¾³£¬¾ÍºÃÏñVisual Studio»òÕßNetbeans»òÕßSharpDevelopÒ»ÑùµÄÍæ
Òâ¡£Äã¿ÉÒÔ½«Interface BuilderÈÏΪÊÇVisual StudioÖÐÓÃÀ´»½çÃæµÄÄDz¿·Ö¹¦Äܵ¥¶ÀÌá³öÀ´µÄ³ÌÐò¡£
Objective-C£ºÕâÊÇÒ»ÖÖÓïÑÔ£¬¾ÍºÃÏñc++ÊÇÒ»ÖÖÓïÑÔ£¬JavaÊÇÒ»ÖÖÓïÑÔ£¬c#ÊÇÒ»ÖÖÓïÑÔ£¬Ýº¸èÀúÊ·Ò²ÊÇÒ»
ÖÖÓïÑÔÒ»Ñù¡£
Coco ......
ÌâÍâÆª£ºµ¥Ôª²âÊÔÄÑÓÚ³¤ÆÚ¼á³ÖµÄÔÒòÓë½â¾ö̽ÌÖ
ÉÏһƪ¡¶µ¥Ôª²âÊÔÐ§Òæ¡·£¬ÓÐÍøÓÑÆÀÂÛ˵£º“µ¥Ôª²âÊԵĺô¦»ù±¾ÈËÈËÖªµÀ£¬¾ÍÊÇÄѼá³Ö£¡”¡£ÕâÒ»ÆÀÂÛÑÏÖØÌáÐÑÁËÎÒ£¬²»´í£¬“ÄѼá³Ö”Ò²ÊÇÒ»¸öÆÕ±éÏÖ×´¡£Èç¹û²»Äܼá³Ö£¬ÄÇÒ»Çж¼Êǰ״Òò´Ë£¬ÕâÀï²åÈëÒ»¸öÌâÍâÆª£¬Ì½ÌÖµ¥Ôª²âÊÔÄÑÓÚ³¤Æ ......
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.spri ......
ת×Ô£ºhttp://dev.yesky.com/12/3067012.shtml
¶¯Ì¬Á¬½Ó¿âµÄ´´½¨²½Ö裺
¡¡¡¡Ò»¡¢´´½¨Non-MFC DLL¶¯Ì¬Á´½Ó¿â
¡¡¡¡1¡¢´ò¿ªFile —> New —> ProjectÑ¡ÏѡÔñWin32 Dynamic-Link Library —>sample project
¡¡¡¡—>¹¤³ÌÃû£ºDllDemo
¡¡¡¡2¡¢Ð½¨Ò»¸ö.hÎļþDllDemo.h
ÒÔÏÂÊÇÒýÓÃÆ¬¶Î£º
......
µÚ¶þÕ Õ÷·þ¿É²âÐÔÄÑÌâ
2.1 ¿É²âÐÔÎÊÌâÏê½â£¨1£©
µ¥Ôª²âÊÔÐ§ÒæÌØ±ð¸ß£¬·½·¨Ò²ºÜ¼òµ¥£¬µ«È´³¢ÊÔµÄÆóÒµºÜ¶à£¬³É¹¦ÊµÊ©µÄÆóÒµºÜÉÙ£¬ÎªÊ²Ã´ÄØ£¿Ö÷ÒªÔÒò¾ÍÊÇÄÑÓÚÍ»ÆÆ¿É²âÐÔÎÊÌâ¡£“¿É²â”Õâ¸ö´Ê£¬Òâ˼ÒѾºÜÃ÷°×ÁË£¬Èç¹û²»“¿É²â”µÄ»°£¬ÄǾÍÊDz»Äܲ⣬û·¨²â£¬¾ÍÊÇ× ......