If the computer can identify the device’s capabilities (using some kind of bus command, I’m not very familiar with the USB protocol) separately from speed testing the cable+device combination, no reason why it couldn’t work for USB 2/3/4.
Of course, this approach relies on the device accurately reporting its capabilities, which may not be the case for the more cheap-and-cheerful gadgets.
If the computer can identify the device’s capabilities (using some kind of bus command, I’m not very familiar with the USB protocol) separately from speed testing the cable+device combination, no reason why it couldn’t work for USB 2/3/4.
Of course, this approach relies on the device accurately reporting its capabilities, which may not be the case for the more cheap-and-cheerful gadgets.