A NSW court ruling has called the accuracy of roadside drug tests into question.

A driver who had tested positive for cannabis in northern NSW has now had her charges dismissed after a magistrate accepted her passive smoking defence.

Driver Nicole Spackman said she had visited her terminally ill neighbour who was smoking medicinal cannabis in her presence in the days before her roadside drug test.

Police argued it THC from passive smoking alone would not turn up on the tests, but Magistrate David Heilpern ruled that the prosecution did not provide enough evidence to refute Ms Spackman's claim.

“Scientists do not know everything about THC and its rate and method of absorption,” he said.

Ms Spackman's lawyer Steve Bolt said it could be a very important decision.

“It's landmark in the sense it's the first case I'm aware of that passive smoking has been accepted as a defence,” he told the ABC.

“It's significant because it throws into doubt the fairness of the law, that someone can inadvertently have drugs in their system for being a good Samaritan, spending time with a terminally ill friend, not be impaired and still be charged and face losing their licence.”

Recent research by Sydney University found roadside mobile saliva tests returned inaccurate results over 20 per cent of the time when testing for tetrahydrocannabinol (THC) - the main psychoactive ingredient in cannabis.

Researchers ran hundreds of tests on drivers with varying levels of THC in their system to investigate the link between cannabis and driver impairment.

Research leader Iain McGregor said the study raises concerns.

“The tests are particularly poor at detecting when people have a lot of THC in their system so they can be really stoned and getting a negative test,” he said.

The experts also found an alarming rate of false positives being recorded.

“We found on occasion the tests gave a false positive when people have very low levels of THC and that is a concern for the carriage of justice, people are not impaired and they have not had cannabis for quite a long time,” he said.

“We had someone test positive for THC who was using a placebo.”

The NSW Department of Transport says Mobile Drug Tests (MDT) do run a small risk of a false positive, but subsequent lab tests found about 97 per cent were accurate.

New South Wales has a three-stage THC-testing regime - two tests performed roadside before a third laboratory analysis if the first two come up positive.

Professor McGregor said that the lab tests are “extremely accurate”, sensitive enough to detect THC from passive smoking.

The research team also found that on some measures, drivers on cannabis were safer drivers.

“Drivers using cannabis tend to leave a bigger distance between you and the car in front and your speed tends to be lower,” Professor McGregor said.

“But in a situation where you have to process information rapidly, you're not safe if you're intoxicated.

“So I'm certainly not an advocate for driving under the influence of cannabis but it's a mistake to consider that cannabis driving is equivalent to alcohol driving.”