Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

Macro expansion infinite loop.

<< < (5/11) > >>

oBFusCATed:
OK, what about the test for all the other bugs/cases you've fixed?

MortenMacFly:

--- Quote from: ollydbg on January 31, 2015, 03:57:40 pm ---Fixed by the V3 patches(you can apply V3 after applying V2, which means it can apply on https://github.com/obfuscated/codeblocks_sf/tree/ollydbg/cc_macro)

--- End quote ---
...can I get them there? They won't apply otherwise.

oBFusCATed:
Morten: Check again...

ollydbg:

--- Quote from: oBFusCATed on February 01, 2015, 01:02:09 pm ---OK, what about the test for all the other bugs/cases you've fixed?

--- End quote ---
There many tests file under src\plugins\codecompletion\testing, but running the cctest don't seem to improve much. ;)

--- Code: ------ C:/before-patch.txt Sun Feb 01 22:09:43 2015
+++ C:/after-patch.txt Sun Feb 01 22:00:48 2015
@@ -77,15 +77,15 @@
 Total 1 tests, 1 PASS, 0 FAIL
 --------------------------------------------------------
 ********************************************************
   Testing in file: F:\cb_sf_git\trunk\src\plugins\codecompletion\testing\cc_mfc_expand_event_table.cpp
 ********************************************************
-*FAIL:  mymiss  mymissingfunc1
-*FAIL:  mymiss  mymissingfunc2
-*FAIL:  mymiss  mymissingfunc3
+-PASS:  mymiss  mymissingfunc1
+-PASS:  mymiss  mymissingfunc2
+-PASS:  mymiss  mymissingfunc3
 --------------------------------------------------------
-Total 3 tests, 0 PASS, 3 FAIL
+Total 3 tests, 3 PASS, 0 FAIL
 --------------------------------------------------------
 ********************************************************
   Testing in file: F:\cb_sf_git\trunk\src\plugins\codecompletion\testing\cc_namespaces.cpp
 ********************************************************
 -PASS: my_namespace.nested_namespace.  variable


--- End code ---
Look, it only fixes three Fails.

But please note that checking every token in the Tokenizer level is the only correct way to handle all the C-preprocessor directives and macro expansions, currently the higher level(Parserthread) class has many hacks to do this. If you look at the ParserThread.cpp, there are many code to check a token to see whether it is a macro usage or not. My patch serials just do all the macro expansion in the Tokenizer level, and it will make Parserthread's code much clean and simple.

oBFusCATed:
Ok, so your changes fix already failing tests.  ;D

For me writing parsers is a task, when test-driven-development can be applied with great success.
The idea is simple:
1. first write a test that fails
2. then write the code to fix the failure.
3. repeat 1

Always make sure that no change is made if there is not test for it.
And of course make sure that after a change is made all test pass.
Doing this prevents introducing changes that break already working cases/features.

p.s. CC code is one place of C::B I have no intention to dig in and make myself familiar with, so I cannot comment if the changes you're making are good
p.p.s. This is the reason I'm asking you to add tests. It is an easy way to check if everything is working :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version