rust-vmm / vm-virtio

virtio implementation
Apache License 2.0
364 stars 87 forks source link

Unify unit test cases of QueueState and QueueStateSync #122

Open jiangliu opened 2 years ago

jiangliu commented 2 years ago

One review comments for #120 Hmm, looks like most of the tests here would apply to other QueueStateT implementations just as well. It would actually be great to have a battery of tests for the QueueStateT interface that can then be reused to test all implementations (so far there's QueueState and QueueStateSync), and then separate tests for stuff that's specific to QueueStateSync in particular (altho there's not that much truly specific stuff IMO; even the test where multiple threads are spawned can be seen as generic due to lock being part of the high level interface).

Not sure exactly just how much effort that would require, so maybe doing it as part of this PR is not the best approach, but then I think we should at least have an issue and tackle it b4 publishing.

andreeaflorescu commented 2 years ago

For now we should start with de-duplicated the following tests that are exactly the same (except for the initialization):

We can work next on having all the tests ported to the queue guard as well. This should be though a separate issue.