magnesium test, a blood test used to measure levels of magnesium, an electrolyte that is critical in nearly all metabolic processes. Abnormal levels may indicate renal insufficiency, chronic renal disease, uncontrolled diabetes, diabetic acidosis, Addison’s disease, hypothyroidism, malnutrition, malabsorption, hypoparathyroidism, and alcoholism.