  According to time-distance helioseismology, information about internal fluid
motions is encoded in the travel times of solar waves. The inverse problem
consists of inferring 3-D vector flows from a set of travel-time measurements.
Here we investigate the potential of time-distance helioseismology to infer 3-D
convective velocities in the near-surface layers of the Sun. We developed a new
Subtractive Optimally Localised Averaging (SOLA) code suitable for pipeline
pseudo-automatic processing. Compared to its predecessor, the code was improved
by accounting for additional constraints in order to get the right answer
within a given noise level. The main aim of this study is to validate results
obtained by our inversion code. We simulate travel-time maps using a snapshot
from a numerical simulation of solar convective flows, realistic Born
travel-time sensitivity kernels, and a realistic model of travel-time noise.
These synthetic travel times are inverted for flows and the results compared
with the known input flow field. Additional constraints are implemented in the
inversion: cross-talk minimization between flow components and spatial
localization of inversion coefficients. Using modes f, p1 through p4, we show
that horizontal convective flow velocities can be inferred without bias, at a
signal-to-noise ratio greater than one in the top 3.5 Mm, provided that
observations span at least four days. The vertical component of velocity (v_z),
if it were to be weak, is more difficult to infer and is seriously affected by
cross-talk from horizontal velocity components. We emphasise that this
cross-talk must be explicitly minimised in order to retrieve v_z in the top 1
Mm. We also show that statistical averaging over many different areas of the
Sun allows for reliably measuring of average properties of all three flow
components in the top 5.5 Mm of the convection zone.
