Lines of code in all cases refer to the "delivered lines of source code" -- test code isn't used as input. However, the effort estimate you get by using delivered lines of source code includes the test effort, including the effort to write the lines of test code.
In general, delivered lines of source code are simply used as the most commonly available, most commonly "best" proxy for the overall scope of the project. Thus you estimate all other effort on a project (analysis, documentation, defect corrections, talking to customers, project management, etc.) using that one "lines of code" number as input. Obviously documentation isn't actually performed in terms of "lines of code," but the size of the project in lines of code can give you an idea of how much effort is needed, including documentation effort. Test effort is the same. Size in delivered lines of code gives a good proxy for test effort. The fact that the specific test activity happens to also generate lines of code is just a coincidence, and doesn't need to be considered in creating the estimate. Thus the 23% number you mention from Table 21-4 includes *all* the test effort -- writing test code, executing test code, reviewing and correcting test code, etc.
Bottom line is you should use 25 KLOC as the input.
Hope this helps!