2012-07-05 35 views

回答

1

下面是關於基本,因爲它可以得到:

#include "gtest/gtest.h" 

int GetSum(int a, int b) { return a + b; } 

TEST(MathsFunctions, GetSum) { 
    ASSERT_EQ(3, GetSum(1, 2)); 
} 

int main(int argc, char **argv) { 
    testing::InitGoogleTest(&argc, argv); 
    return RUN_ALL_TESTS(); 
} 

您需要提供的路徑,GTEST的包括目錄,並鏈接到gtest.lib

相關問題