summary refs log tree commit diff
path: root/kvm/src/lib.rs
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@chromium.org>2018-03-02 10:12:30 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-03-08 00:37:34 -0800
commit8da6543e74d5e037f08ed4cc49f89ad63963c3dc (patch)
treed465f6d1aac5127dd595597111d5c9a13e4dce5f /kvm/src/lib.rs
parent532a94c1c83c1f829a03e5c95ae584a57c0e86d5 (diff)
downloadcrosvm-8da6543e74d5e037f08ed4cc49f89ad63963c3dc.tar
crosvm-8da6543e74d5e037f08ed4cc49f89ad63963c3dc.tar.gz
crosvm-8da6543e74d5e037f08ed4cc49f89ad63963c3dc.tar.bz2
crosvm-8da6543e74d5e037f08ed4cc49f89ad63963c3dc.tar.lz
crosvm-8da6543e74d5e037f08ed4cc49f89ad63963c3dc.tar.xz
crosvm-8da6543e74d5e037f08ed4cc49f89ad63963c3dc.tar.zst
crosvm-8da6543e74d5e037f08ed4cc49f89ad63963c3dc.zip
kvm: add tests for get_supported_cpuid() and get_emulated_cpuid()
TEST=cargo test -p kvm
BUG=None

Change-Id: I2af245cb94d68faf091bf6788842c1932240df3d
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/947320
Reviewed-by: Zach Reizner <zachr@chromium.org>
Diffstat (limited to 'kvm/src/lib.rs')
-rw-r--r--kvm/src/lib.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/kvm/src/lib.rs b/kvm/src/lib.rs
index 2ab3a97..970452f 100644
--- a/kvm/src/lib.rs
+++ b/kvm/src/lib.rs
@@ -1096,6 +1096,20 @@ mod tests {
     }
 
     #[test]
+    fn get_supported_cpuid() {
+        let kvm = Kvm::new().unwrap();
+        let mut cpuid = kvm.get_supported_cpuid().unwrap();
+        let cpuid_entries = cpuid.mut_entries_slice();
+        assert!(cpuid_entries.len() > 0);
+    }
+
+    #[test]
+    fn get_emulated_cpuid() {
+        let kvm = Kvm::new().unwrap();
+        kvm.get_emulated_cpuid().unwrap();
+    }
+
+    #[test]
     fn add_memory() {
         let kvm = Kvm::new().unwrap();
         let gm = GuestMemory::new(&vec![(GuestAddress(0), 0x1000)]).unwrap();