Thanks for the advice on how to test these components. You might be interested to know what circuit they came out of!
The circuit is an electric bicycle controller. There is a main circuit board and a small one with some infrared sensing components on - the pedal assist sensor (PAS) which checks whether you are doing any work
I was fairly convinced that the problem was on the latter, but due to nasty mechanical design I wasn't able to remove it without damage, so I can't be sure. Having checked both semiconductors and found them to be sound, I think it is unlikely to be a problem with other components on the main circuit board and I wouldn't be able to test or fix it if it was. It's most likely to be related to the sensors on the secondary board.
I thought the problem was probably caused by a loose solder joint on the PAS board. You will be familiar with a mouse wheel sensor - a rotating disk with radial slots between an infra-red transmitter and an infra-red receiver. There are two of these. The left-hand pedal crank is attached to the crankshaft. The right-hand pedal crank is free to rotate on the crankshaft, but is attached to a disk with springs which bear against a similar disk on the crankshaft so that it rotates a few degrees before pushing the crankshaft. One slotted disk is attached to the crankshaft and one to the right-hand pedal, so both slotted disks rotate when the left-hand pedal is pressed and they rotate a few degrees relative to each other when the right-hand pedal is pressed. The infra-red transmitter and receiver pairs are fixed to the frame. I can upload photos of the arrangement if anyone is interested.
I was hoping that it worked by matching the pulses from the two sensors when the right-hand pedal moved a little under pressure. I therefore wired the sensors so that both sensors conducted, but the motor gives a kick then nothing, so I conclude that the sensors have to be 'flashed' on and off as well, perhaps so that the controller can check the speed. It's not practical to re-attach the slotted disks, so I would have to have a flasher circuit to simulate that - and I'm not quite sure what I need to simulate. All too much bother, so I'll chuck it and buy something else. It was worth a try though as it's daft to chuck something out that might work, so thanks again for your help.