2011년 11월 19일 토요일

googletest



C++ 에서 Unit Test 라도 한번 해보려고 하면 머리가 아프다.






Google's framework for writing C++ tests


http://code.google.com/p/googletest/








#include "stdafx.h"
#include <gtest/gtest.h>


TEST( MyTest, Test1)
{
int a1 = 3;
int a2 = 3;
ASSERT_EQ( a1, a2);
}




TEST( MyTest, Test2)
{
int a1 = 1;
int a2 = 2;
ASSERT_EQ( a1, a2);
}




int _tmain(int argc, _TCHAR* argv[])
{
testing::InitGoogleTest( &argc, argv);

RUN_ALL_TESTS();


return 0;
}



C++







C++ 이 진리다.