unit testing: made Tokenizer functions public so they can be unit tested

This commit is contained in:
Daniel Marjamäki 2010-03-17 22:08:02 +01:00
parent 2441a79c7b
commit 89719b023e
3 changed files with 6 additions and 13 deletions

View File

@ -135,10 +135,6 @@ public:
*/
bool simplifyCalculations();
#ifndef _MSC_VER
private:
#endif
/** Insert array size where it isn't given */
void arraySize();
@ -408,9 +404,6 @@ private:
*/
void updateClassList();
/** Disable assignments.. */
Tokenizer(const Tokenizer &);
/**
* assert that tokens are ok - used during debugging for example
* to catch problems in simplifyTokenList.
@ -448,7 +441,12 @@ private:
bool duplicateTypedef(Token **tokPtr, const Token *name);
void duplicateTypedefError(const Token *tok1, const Token *tok2, const std::string & type);
/** Disable assignment operator */
private:
/** Disable copy constructor, no implementation */
Tokenizer(const Tokenizer &);
/** Disable assignment operator, no implementation */
Tokenizer &operator=(const Tokenizer &);
Token *_tokens, *_tokensBack;

View File

@ -19,9 +19,7 @@
#include "testsuite.h"
#define private public
#include "tokenize.h"
#undef private
#include "token.h"
#include <sstream>
@ -2347,7 +2345,6 @@ private:
Settings settings;
Tokenizer tokenizer(&settings, this);
tokenizer._files.push_back("test.cpp");
std::istringstream istr(code);
tokenizer.createTokens(istr);

View File

@ -23,9 +23,7 @@
#include <cstring>
#include "testsuite.h"
#define private public
#include "tokenize.h"
#undef private
#include "token.h"
extern std::ostringstream errout;