We use state-of-the-art, three-dimensional non-local thermodynamic equilibrium (non-LTE) radiative magnetohydrodynamic simulations of the quiet solar atmosphere to carry out detailed tests of chromospheric magnetic field diagnostics from free-free radiation at millimeter and submillimeter wavelengths (mm/submm). The vertical component of the magnetic field was deduced from the mm/submm brightness spectra and the degree of circular polarization synthesized at millimeter frequencies. We used the frequency bands observed by the Atacama Large Millimeter/Submillimeter Array (ALMA) as a convenient reference. The magnetic field maps obtained describe the longitudinal magnetic field at the effective formation heights of the relevant wavelengths in the solar chromosphere. The comparison of the deduced and model chromospheric magnetic fields at the spatial resolution of both the model and current observations demonstrates a good correlation, but has a tendency to underestimate the model field. The systematic discrepancy of about 10 percent is probably due to averaging of the restored field over the heights contributing to the radiation, weighted by the strength of the contribution. On the whole, the method of probing the longitudinal component of the magnetic field with free-free emission at mm/submm wavelengths is found to be applicable to measurements of the weak quiet-Sun magnetic fields. However, successful exploitation of this technique requires very accurate measurements of the polarization properties (primary beam and receiver polarization response) of the antennas, which will be the principal factor that determines the level to which chromospheric magnetic fields can be measured. Consequently, high-resolution and high-precision observations of circularly polarized radiation at millimeter wavelengths can be a powerful tool for producing chromospheric longitudinal magnetograms.