Hi Abramo, On Thu, Oct 18, 2012 at 7:17 PM, Philip Craig <[email protected]> wrote: > On Sat, Oct 6, 2012 at 3:55 PM, Enea Zaffanella <[email protected]> > wrote: >> On 10/06/2012 01:44 AM, Philip Craig wrote: >>> >>> On Fri, Oct 5, 2012 at 2:40 PM, Abramo Bagnara >>> <[email protected]> wrote: >>>> >>>> Il 05/10/2012 00:15, Chandler Carruth ha scritto: >>>>> >>>>> On Thu, Oct 4, 2012 at 3:12 PM, Chandler Carruth <[email protected] >>>>> <mailto:[email protected]>> wrote: >>>>> >>>>> Can we get a test case for this? >>>>> >>>>> >>>>> Also, not just for this, but for all of the source location fixes you're >>>>> making? >>>> >>>> >>>> This problem has been discussed a few time in past, but after discussion >>>> on the list we failed to find a nice (and easy) solution for testing. >>>> >>>> If things are now changed with tooling infrastructure, this would be >>>> nice to hear. If someone is so kind to write a test for this patch we >>>> will be happy to add the others replicating the same mechanism shown. >>>> >>>> The testcase if very simple "void f(i) { }", what it should be tested is >>>> that source range for ParamDecl matches the 'i'. >>> >>> >>> Here's a patch for the test. I don't know whether you want to keep >>> these tests from the other RAV tests or not. >> >> >> +TEST(RecursiveASTVisitor, KNRParamLoc) { >> + VarDeclVisitor Visitor; >> + Visitor.ExpectMatch("i", 1, 8); >> + EXPECT_TRUE(Visitor.runOver("void f(i) { }", VarDeclVisitor::Lang_C)); >> +} >> >> >> Is this going (or can be modified) to also check for the end location of the >> parameter source range? > > Sorry for the late reply. It should be fairly straightforward to > create a visitor that checks the range, based on the existing > ExpectedLocationVisitor in TestVisitor.h. I can try to update the > patch for that in the next few days unless someone else is keen to.
I've placed an updated patch at http://llvm-reviews.chandlerc.com/D72 If you can give me examples of the code for the other fixes you have made, I can add them to the patch to make sure the unit test framework can handle them easily. _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
