Test of the violation of local realism in quantum mechanics without Bell inequalities