Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ libc = { version = "0.2.58", optional = true }
xenctrl = { git = "https://github.com/Wenzel/xenctrl", optional = true }
xenstore = { git = "https://github.com/Wenzel/xenstore", optional = true }
xenforeignmemory = { git = "https://github.com/Wenzel/xenforeignmemory", optional = true }
kvmi = { version = "0.2.1", optional = true }
arnabcs17b006 marked this conversation as resolved.
Show resolved Hide resolved
kvmi = { git = "https://github.com/Wenzel/kvmi", optional = true }
fdp = { git = "https://github.com/Wenzel/fdp", optional = true }
winapi = { version = "0.3.8", features = ["tlhelp32", "winnt", "handleapi", "securitybaseapi"], optional = true }
widestring = { version = "0.4.0", optional = true }
Expand Down
11 changes: 6 additions & 5 deletions src/api.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::cmp::PartialEq;
use std::convert::TryInto;
use std::error::Error;
use std::ffi::{CStr, IntoStringError};
Expand Down Expand Up @@ -62,7 +63,7 @@ impl TryInto<DriverInitParam> for DriverInitParamFFI {

///an x86 segment register
#[repr(C)]
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct SegmentReg {
///Stores the base address of a code segment
pub base: u64,
Expand All @@ -75,7 +76,7 @@ pub struct SegmentReg {
/// x86 System Table Registers
/// (GDTR, IDTR)
#[repr(C)]
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct SystemTableReg {
/// 32/64 bits linear base address
pub base: u64,
Expand All @@ -85,7 +86,7 @@ pub struct SystemTableReg {

///Represents all x86 registers on a specific VCPU
#[repr(C)]
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct X86Registers {
/// 8 byte general purpose register.
pub rax: u64,
Expand Down Expand Up @@ -318,7 +319,7 @@ pub enum InterceptType {

/// Various types of events along with their relevant attributes being handled by this driver
#[repr(C)]
#[derive(Debug)]
#[derive(Debug, PartialEq)]
pub enum EventType {
///Cr register interception
Cr {
Expand Down Expand Up @@ -357,7 +358,7 @@ pub enum EventType {

///Types of x86 control registers are listed here
#[repr(C)]
#[derive(Debug, Copy, Clone)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum CrType {
///Has various control flags that modify the basic operation of the processor.
Cr0,
Expand Down
Loading