[cfe-commits] [PATCH] Add unit tests for source locations of AST nodes

Philip Craig philipjcraig at gmail.com
Tue Oct 23 04:50:17 PDT 2012



================
Comment at: unittests/AST/SourceLocationTest.cpp:186
@@ +185,3 @@
+TEST(SourceLocation, KNRParamLocation) {
+  LocationVerifier<ParmVarDecl> Verifier;
+  Verifier.expectLocation(1, 8).expectId("i");
----------------
Manuel Klimek wrote:
> Both here and below having the extra expactLocation seems superfluous, if we do not also want to support multiple locations (which probably would require a slightly different interface again).
> 
> I would just put the stuff into the constructor. Unless you have plans for adding much more to the interface...
I didn't put it in the constructor because I expect LocationVerifier and RangeVerifier to be inherited from for testing different location members of nodes, and I didn't want the derived classes to need to define constructors and forward the arguments up. Is there a way to avoid that?


http://llvm-reviews.chandlerc.com/D72



More information about the cfe-commits mailing list