Astrophysical tests of atomic data important for the stellar Mg abundance determinations