PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
main.cpp File Reference
#include "phoenix_assert.h"
#include "phoenix_check.h"
#include "parse_generic_string.h"
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

void checkParseGenericString ()
 Check the PLocation. More...
 
bool checkParser (const PString &name, const PString &fileContent, bool isParsingOk, const PString &expectedParsedString)
 Check the generic string parser. More...
 
int main (int argc, char **argv)
 

Function Documentation

◆ checkParseGenericString()

void checkParseGenericString ( )

Check the PLocation.

Definition at line 32 of file main.cpp.

32  {
33  phoenix_assert(checkParser("Test simple parsing", "", false, ""));
34  phoenix_assert(checkParser("Test simple parsing", "\"Simple comment\"", true, "\"Simple comment\""));
35  phoenix_assert(checkParser("Test simple parsing", "'Simple comment'", true, "'Simple comment'"));
36  phoenix_assert(checkParser("Test simple parsing", "\"\"\"Big comment\"\"\"", true, "\"\"\"Big comment\"\"\""));
37  phoenix_assert(checkParser("Test simple parsing", "'''Other big comment'''", true, "'''Other big comment'''"));
38 }
bool checkParser(const PString &name, const PString &fileContent, bool isParsingOk, const PString &expectedParsedString)
Check the generic string parser.
Definition: main.cpp:19
#define phoenix_assert(isOk)

References checkParser(), and phoenix_assert.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkParser()

bool checkParser ( const PString name,
const PString fileContent,
bool  isParsingOk,
const PString expectedParsedString 
)

Check the generic string parser.

Parameters
name: name of the test
fileContent: file to be parsed
isParsingOk: true if the parsing is expected to be OK
expectedParsedString: expected string after parsing
Returns
true on success, false otherwise

Definition at line 19 of file main.cpp.

19  {
20  PFileParser parser;
21  parser.setFileContent(fileContent);
22  PString foundString;
23  phoenix_assert(parse_generic_string(foundString, parser) == isParsingOk);
24  if(isParsingOk){
25  return phoenix_check(name, foundString, expectedParsedString);
26  }else{
27  return true;
28  }
29 }
classe qui permet de parser des fichiers texte en renvoyant les tokens les uns après les autres
Definition: PFileParser.h:20
void setFileContent(const PString &fileContent)
Set the file content.
Definition: PFileParser.cpp:50
Extends the std::string.
Definition: PString.h:16
bool parse_generic_string(PString &str, PFileParser &parser)
Parse string value.
bool phoenix_check(const std::string &testName, const std::string &val, const std::string &reference)
Check two string.

References parse_generic_string(), phoenix_assert, phoenix_check(), and PFileParser::setFileContent().

Referenced by checkParseGenericString().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 41 of file main.cpp.

41  {
43  return 0;
44 }
void checkParseGenericString()
Check the PLocation.
Definition: main.cpp:32

References checkParseGenericString().

+ Here is the call graph for this function: