Rapid diagnostic tests have greatly improved malaria treatment in the last decade, but they also had some unexpected bad consequences, a large new study has found.

As hoped, the tests — which use only a drop of blood and provide results in about 15 minutes — substantially decreased how many patients with fever were incorrectly given or sold malaria drugs when they did not have malaria.

But the number of patients who got antibiotics instead shot up, even if they were not tested for bacterial infections — a practice that encourages the emergence of drug-resistant germs.

The study also found that a disturbing number of people who tested positive for malaria still did not get malaria drugs. At five of eight testing sites in Africa, more than 20 percent did not.