Michael
unread,Mar 30, 2011, 5:58:04 PM3/30/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google C++ Testing Framework
I have been using Google Test Framework for about a week now and I am
trying to add a Value Parametrized test case, but if fails to compile
with the following errors :
** SNIP **
C:\...\packetize
>"c:\Program Files\MinGW\bin"\g++.exe -c gtest.cpp -I ..\..\..\Development\gtest
-1.5.0\include -ggdb -o gtest.cpp
gtest.cpp:19: error: `testRandomFillAndEmpty' has not been declared
gtest.cpp:19: error: `ParamType' was not declared in this scope
gtest.cpp:19: error: template argument 1 is invalid
gtest.cpp:19: error: ISO C++ forbids declaration of
`gtest_randomPacketPayloadte
stRandomFillAndEmpty_EvalGenerator_' with no type
gtest.cpp: In function `int
gtest_randomPacketPayloadtestRandomFillAndEmpty_Eval
Generator_()':
gtest.cpp:19: error: cannot convert
`testing::internal::ValueArray5<int, int, int, int, int>'
to `int' in return
gtest.cpp: At global scope:
gtest.cpp:19: error: `testRandomFillAndEmpty' was not declared in this
scope
gtest.cpp:19: error: template argument 1 is invalid
gtest.cpp:19: error: no matching function for call to
`testing::internal::Parame
terizedTestCaseRegistry::GetTestCasePatternHolder(const char[23],
const char[10], int)'
C:\...\packetize
>"c:\Program Files\MinGW\bin"\g++.exe --version
g++.exe (GCC) 3.4.5 (mingw-vista special r3)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There
is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
** SNIP **
I have thinned down my code to the following snippet and it still
exhibits the same error.
** SNIP **
#include <gtest\gtest.h> // Google test framework
class packetBufferRanFixture : public ::testing::TestWithParam<
unsigned int >
{
public :
packetBufferRanFixture( ):
testing::TestWithParam<unsigned int>( ){ }
protected :
virtual void SetUp( ){ }
virtual void TearDown( ){ }
};
TEST_P( packetBufferRanFixture, testRandomFillAndEmpty ){ }
INSTANTIATE_TEST_CASE_P(
randomPacketPayload,
testRandomFillAndEmpty,
::testing::Values( 2,3,5,9,10 )
);
int main( int argn, char **argv, char **env){
::testing::InitGoogleTest( &argn, argv );
return RUN_ALL_TESTS( );
}
** SNIP **
Please, any help would be greatly appreciated.