Compare commits
	
		
			6 Commits
		
	
	
		
			af92e316da
			...
			9ec9a70e5c
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						
						
							
						
						9ec9a70e5c
	
				 | 
					
					
						|||
| 
						
						
							
						
						a28ee34151
	
				 | 
					
					
						|||
| 
						
						
							
						
						1a292c6316
	
				 | 
					
					
						|||
| 
						
						
							
						
						e4ff89fee9
	
				 | 
					
					
						|||
| 
						
						
							
						
						e03a107d83
	
				 | 
					
					
						|||
| 
						
						
							
						
						c549f7def5
	
				 | 
					
					
						
							
								
								
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
Cargo.lock -merge linguist-generated=false
 | 
			
		||||
@@ -1527,7 +1527,9 @@ dependencies = [
 | 
			
		||||
name = "fsv"
 | 
			
		||||
version = "0.1.0"
 | 
			
		||||
dependencies = [
 | 
			
		||||
 "anyhow",
 | 
			
		||||
 "fsv-sys",
 | 
			
		||||
 "num_enum",
 | 
			
		||||
 "thiserror",
 | 
			
		||||
 "utils",
 | 
			
		||||
]
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								crates/fsv-sys/src/bindings.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								crates/fsv-sys/src/bindings.rs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
#![allow(non_upper_case_globals)]
 | 
			
		||||
#![allow(non_camel_case_types)]
 | 
			
		||||
#![allow(non_snake_case)]
 | 
			
		||||
#![allow(unused)]
 | 
			
		||||
 | 
			
		||||
pub mod BINDINGS_V1_40_14 {
 | 
			
		||||
    include!(concat!(env!("OUT_DIR"), "/bindings_1.40.14.rs"));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub mod BINDINGS_V1_40_13 {
 | 
			
		||||
    include!(concat!(env!("OUT_DIR"), "/bindings_1.40.13.rs"));
 | 
			
		||||
}
 | 
			
		||||
@@ -1,16 +1,17 @@
 | 
			
		||||
#![allow(non_upper_case_globals)]
 | 
			
		||||
#![allow(non_camel_case_types)]
 | 
			
		||||
#![allow(non_snake_case)]
 | 
			
		||||
 | 
			
		||||
use std::marker::PhantomData;
 | 
			
		||||
 | 
			
		||||
mod bindings;
 | 
			
		||||
use bindings::*;
 | 
			
		||||
 | 
			
		||||
#[derive(Debug, Clone)]
 | 
			
		||||
pub enum SUPPORTED_FSV_VERSIONS {
 | 
			
		||||
pub enum SupportedFsvVersion {
 | 
			
		||||
    V1_40_14, // 1.40.14
 | 
			
		||||
    V1_40_13, // 1.40.13
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
impl SUPPORTED_FSV_VERSIONS {
 | 
			
		||||
impl SupportedFsvVersion {
 | 
			
		||||
    fn as_str(&self) -> &'static str {
 | 
			
		||||
        match self {
 | 
			
		||||
            Self::V1_40_14 => "1.40.14",
 | 
			
		||||
@@ -19,14 +20,6 @@ impl SUPPORTED_FSV_VERSIONS {
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
mod BINDINGS_V1_40_14 {
 | 
			
		||||
    include!(concat!(env!("OUT_DIR"), "/bindings_1.40.14.rs"));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
mod BINDINGS_V1_40_13 {
 | 
			
		||||
    include!(concat!(env!("OUT_DIR"), "/bindings_1.40.13.rs"));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[derive(thiserror::Error, Debug)]
 | 
			
		||||
pub enum Error {
 | 
			
		||||
    #[error(transparent)]
 | 
			
		||||
@@ -66,26 +59,26 @@ mod sealed { pub trait Sealed {}}
 | 
			
		||||
/// Wrapper around the SESAM-VITALE library
 | 
			
		||||
/// This struct is responsible for loading the library and providing an interface to call its functions.
 | 
			
		||||
/// The library is loaded at creation and kept in memory until the struct is dropped.
 | 
			
		||||
pub trait SSVLibrary_Common {
 | 
			
		||||
pub trait SSVLibraryCommon {
 | 
			
		||||
    fn new(path: &str) -> Result<Self, Error> where Self: Sized;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub trait SSVLibrary_Version: sealed::Sealed {}
 | 
			
		||||
pub trait SSVLibraryVersion: sealed::Sealed {}
 | 
			
		||||
 | 
			
		||||
pub struct V1_40_13 {}
 | 
			
		||||
impl sealed::Sealed for V1_40_13 {}
 | 
			
		||||
impl SSVLibrary_Version for V1_40_13 {}
 | 
			
		||||
impl SSVLibraryVersion for V1_40_13 {}
 | 
			
		||||
 | 
			
		||||
pub struct V1_40_14 {}
 | 
			
		||||
impl sealed::Sealed for V1_40_14 {}
 | 
			
		||||
impl SSVLibrary_Version for V1_40_14 {}
 | 
			
		||||
impl SSVLibraryVersion for V1_40_14 {}
 | 
			
		||||
 | 
			
		||||
pub struct SSVLibrary<Version: SSVLibrary_Version> {
 | 
			
		||||
pub struct SSVLibrary<Version: SSVLibraryVersion> {
 | 
			
		||||
    _version: PhantomData<Version>,
 | 
			
		||||
    library: libloading::Library,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
impl<Version: SSVLibrary_Version> SSVLibrary_Common for SSVLibrary<Version> {
 | 
			
		||||
impl<Version: SSVLibraryVersion> SSVLibraryCommon for SSVLibrary<Version> {
 | 
			
		||||
    fn new(path: &str) -> Result<Self, Error> {
 | 
			
		||||
        let library = unsafe { libloading::Library::new(path)?};
 | 
			
		||||
        Ok(Self {
 | 
			
		||||
@@ -137,14 +130,14 @@ impl SSVLibrary<V1_40_13> {
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub fn get_library_path(version: &SUPPORTED_FSV_VERSIONS) -> String {
 | 
			
		||||
pub fn get_library_path(version: &SupportedFsvVersion) -> String {
 | 
			
		||||
    let root_path = get_library_root_path();
 | 
			
		||||
    let library_name = get_library_name();
 | 
			
		||||
    let version = version.as_str();
 | 
			
		||||
    format!("{root_path}/{version}/lib/{library_name}")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
pub fn sesam_ini_path(version: &SUPPORTED_FSV_VERSIONS) -> String {
 | 
			
		||||
pub fn sesam_ini_path(version: &SupportedFsvVersion) -> String {
 | 
			
		||||
    let root_path = get_sesam_ini_root_path();
 | 
			
		||||
    let version = version.as_str();
 | 
			
		||||
    format!("{root_path}/{version}/conf/sesam.ini")
 | 
			
		||||
@@ -171,22 +164,22 @@ mod test {
 | 
			
		||||
 | 
			
		||||
    #[test]
 | 
			
		||||
    fn test_initlib2() {
 | 
			
		||||
        let lib_path = &get_library_path(&SUPPORTED_FSV_VERSIONS::V1_40_13);
 | 
			
		||||
        let lib_path = &get_library_path(&SupportedFsvVersion::V1_40_13);
 | 
			
		||||
        let ssv_library = SSVLibrary::<V1_40_13>::new(lib_path).expect("SSVLibrary::new failed");
 | 
			
		||||
 | 
			
		||||
        let sesam_ini_str =
 | 
			
		||||
            CString::new(sesam_ini_path(&SUPPORTED_FSV_VERSIONS::V1_40_13)).expect("CString::new failed");
 | 
			
		||||
            CString::new(sesam_ini_path(&SupportedFsvVersion::V1_40_13)).expect("CString::new failed");
 | 
			
		||||
        let result = unsafe { ssv_library.ssv_init_lib2(sesam_ini_str.as_ptr()) }.unwrap();
 | 
			
		||||
        assert_eq!(result, 0);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #[test]
 | 
			
		||||
    fn test_lire_config_and_carte_ps() {
 | 
			
		||||
        let lib_path = &get_library_path(&SUPPORTED_FSV_VERSIONS::V1_40_13);
 | 
			
		||||
        let lib_path = &get_library_path(&SupportedFsvVersion::V1_40_13);
 | 
			
		||||
        let ssv_library = SSVLibrary::<V1_40_13>::new(lib_path).expect("SSVLibrary::new failed");
 | 
			
		||||
 | 
			
		||||
        let sesam_ini_str =
 | 
			
		||||
            CString::new(sesam_ini_path(&SUPPORTED_FSV_VERSIONS::V1_40_13)).expect("CString::new failed");
 | 
			
		||||
            CString::new(sesam_ini_path(&SupportedFsvVersion::V1_40_13)).expect("CString::new failed");
 | 
			
		||||
        let result = unsafe { ssv_library.ssv_init_lib2(sesam_ini_str.as_ptr()) }.unwrap();
 | 
			
		||||
        assert_eq!(result, 0);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -4,6 +4,8 @@ version = "0.1.0"
 | 
			
		||||
edition = "2021"
 | 
			
		||||
 | 
			
		||||
[dependencies]
 | 
			
		||||
anyhow = "1.0.89"
 | 
			
		||||
num_enum = "0.7.3"
 | 
			
		||||
thiserror = "1.0.64"
 | 
			
		||||
 | 
			
		||||
fsv-sys = { path = "../fsv-sys" }
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										82
									
								
								crates/fsv/src/ssv/errors_ssv.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										82
									
								
								crates/fsv/src/ssv/errors_ssv.rs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,82 @@
 | 
			
		||||
use num_enum::FromPrimitive;
 | 
			
		||||
use thiserror::Error;
 | 
			
		||||
 | 
			
		||||
#[derive(Error, Debug, Eq, PartialEq, FromPrimitive)]
 | 
			
		||||
#[repr(u16)]
 | 
			
		||||
pub enum SSVErrorCodes {
 | 
			
		||||
    #[error("Le fichier `tablebin.smc` est inaccessible en lecture (inexistant ou pas de droits d'accès).")]
 | 
			
		||||
    FileMissingTablebinMsc = 0xF610, // tablebin.smc
 | 
			
		||||
    #[error("Le fichier `scripts.sms` est inaccessible en lecture (inexistant ou pas de droits d'accès).")]
 | 
			
		||||
    FileMissingScriptsSms = 0xF611, // scripts.sms
 | 
			
		||||
    #[error("Le fichier `tablebin.ssv` est inaccessible en lecture (inexistant ou pas de droits d'accès).")]
 | 
			
		||||
    FileMissingTablebinSsv = 0xF612, // tablebin.ssv
 | 
			
		||||
    #[error("Le fichier `script.ssv` est inaccessible en lecture (inexistant ou pas de droits d'accès).")]
 | 
			
		||||
    FileMissingScriptSsv = 0xF613, // script.ssv
 | 
			
		||||
    #[error("La version du fichier `tablebin.smc` est incompatible avec la bibliothèque des SSV.")]
 | 
			
		||||
    FileVersionIncompatibleTablebinMsc = 0xF620, // tablebin.smc
 | 
			
		||||
    #[error("La version du fichier `scripts.sms` est incompatible avec la bibliothèque des SSV.")]
 | 
			
		||||
    FileVersionIncompatibleScriptsSms = 0xF621, // scripts.sms
 | 
			
		||||
    #[error("La version du fichier `tablebin.ssv` est incompatible avec la bibliothèque des SSV.")]
 | 
			
		||||
    FileVersionIncompatibleTablebinSsv = 0xF622, // tablebin.ssv
 | 
			
		||||
    #[error("La version du fichier `script.ssv` est incompatible avec la bibliothèque des SSV.")]
 | 
			
		||||
    FileVersionIncompatibleScriptSsv = 0xF623, // script.ssv
 | 
			
		||||
    #[error("L'intégrité du fichier `tablebin.smc` est incorrecte.")]
 | 
			
		||||
    FileIntegrityIncorrectTablebinMsc = 0xF630, // tablebin.smc
 | 
			
		||||
    #[error("L'intégrité du fichier `scripts.sms` est incorrecte.")]
 | 
			
		||||
    FileIntegrityIncorrectScriptsSms = 0xF631, // scripts.sms
 | 
			
		||||
    #[error("L'intégrité du fichier `tablebin.ssv` est incorrecte.")]
 | 
			
		||||
    FileIntegrityIncorrectTablebinSsv = 0xF632, // tablebin.ssv
 | 
			
		||||
    #[error("L'intégrité du fichier `script.ssv` est incorrecte.")]
 | 
			
		||||
    FileIntegrityIncorrectScriptSsv = 0xF633, // script.ssv
 | 
			
		||||
    #[error("La structure interne du fichier `tablebin.smc` est invalide.")]
 | 
			
		||||
    FileStructureInvalidTablebinMsc = 0xF640, // tablebin.smc
 | 
			
		||||
    #[error("La structure interne du fichier `scripts.sms` est invalide.")]
 | 
			
		||||
    FileStructureInvalidScriptsSms = 0xF641, // scripts.sms
 | 
			
		||||
    #[error("La structure interne du fichier `tablebin.ssv` est invalide.")]
 | 
			
		||||
    FileStructureInvalidTablebinSsv = 0xF642, // tablebin.ssv
 | 
			
		||||
    #[error("La structure interne du fichier `script.ssv` est invalide.")]
 | 
			
		||||
    FileStructureInvalidScriptSsv = 0xF643, // script.ssv
 | 
			
		||||
    #[error("Le fichier `tablebin.smc` n'a pas pu être chargé en mémoire. Essayez de libérer de la mémoire.")]
 | 
			
		||||
    FileLoadFailedTablebinMsc = 0xF650, // tablebin.smc
 | 
			
		||||
    #[error("Le fichier `scripts.sms` n'a pas pu être chargé en mémoire. Essayez de libérer de la mémoire.")]
 | 
			
		||||
    FileLoadFailedScriptsSms = 0xF651, // scripts.sms
 | 
			
		||||
    #[error("Le fichier `tablebin.ssv` n'a pas pu être chargé en mémoire. Essayez de libérer de la mémoire.")]
 | 
			
		||||
    FileLoadFailedTablebinSsv = 0xF652, // tablebin.ssv
 | 
			
		||||
    #[error("Le fichier `script.ssv` n'a pas pu être chargé en mémoire. Essayez de libérer de la mémoire.")]
 | 
			
		||||
    FileLoadFailedScriptSsv = 0xF653, // script.ssv
 | 
			
		||||
    #[error("Le nom du fichier `tablebin.smc` est invalide.")]
 | 
			
		||||
    FileNameInvalidTablebinMsc = 0xF660, // tablebin.smc
 | 
			
		||||
    #[error("Le nom du fichier `scripts.sms` est invalide.")]
 | 
			
		||||
    FileNameInvalidScriptsSms = 0xF661, // scripts.sms
 | 
			
		||||
    #[error("Le nom du fichier `tablebin.ssv` est invalide.")]
 | 
			
		||||
    FileNameInvalidTablebinSsv = 0xF662, // tablebin.ssv
 | 
			
		||||
    #[error("Le nom du fichier `script.ssv` est invalide.")]
 | 
			
		||||
    FileNameInvalidScriptSsv = 0xF663, // script.ssv
 | 
			
		||||
    #[error("La fonction Initialiser Librairie est déjà appelée.")]
 | 
			
		||||
    FunctionInitLib2AlreadyCalled = 0xF670, // Warning
 | 
			
		||||
    #[error("Le fichier SESAM.INI est inaccessible en lecture (fichier ou droit d’accès manquant) ou ne contient pas le chemin des tables binaires des SSV.")]
 | 
			
		||||
    SesamIniMissingFileOrTablebinPath = 0xF680,
 | 
			
		||||
    #[error("Le chemin du répertoire de travail est absent du fichier SESAM.INI.")]
 | 
			
		||||
    SesamIniMissingWorkDir = 0xF6F1,
 | 
			
		||||
    #[error("Les fichiers d’extension adm ne sont pas accessibles en écriture.")]
 | 
			
		||||
    AdmFilesNotWritable = 0xF6F2, // Warning
 | 
			
		||||
    #[error("Aucune version de FSV du socle technique trouvé. Vérifier que la version du fichier script.sms est bonne.")]
 | 
			
		||||
    NoFsvVersionFound = 0xF6F4,
 | 
			
		||||
    #[error("Librairie SGD absente ou incomplète.")]
 | 
			
		||||
    LibraryMissingOrIncompleteSGD = 0xF6F5,
 | 
			
		||||
    #[error("Librairie SMC absente ou incomplète.")]
 | 
			
		||||
    LibraryMissingOrIncompleteSMC = 0xF6F6,
 | 
			
		||||
    #[error("Librairie SJS absente ou incomplète.")]
 | 
			
		||||
    LibraryMissingOrIncompleteSJS = 0xF6F7,
 | 
			
		||||
    #[error("Librairie SMS absente ou incomplète.")]
 | 
			
		||||
    LibraryMissingOrIncompleteSMS = 0xF6F8,
 | 
			
		||||
    #[error("Section MGC absente / clé RepertoireConfigTrace absente / fichier log4crc.xml non trouvé à l’emplacement indiqué par la clé RepertoireConfigTrace du fichier SESAM.INI.")]
 | 
			
		||||
    SesamIniTracingConfigMissing = 0xFF22, // Warning
 | 
			
		||||
    #[error("Interface Full PC/SC : problème de chargement de la librairie cryptographique ou erreur retournée par la librairie cryptographique.")]
 | 
			
		||||
    PCSCInterfaceCryptoLibraryError = 0xFF25,
 | 
			
		||||
    #[error("Valorisation incorrecte des paramètres de gestion de l'accès aux ressources dans le SESAM.INI. Vérifier les valeurs des clés tempoexclusivite, repetitionexclusivite, tempoexclusivitePCSC, repetitionexclusivitePCSC")]
 | 
			
		||||
    SesamIniResourceAccessParamsIncorrect = 0xFF2A,
 | 
			
		||||
    #[num_enum(catch_all)]
 | 
			
		||||
    #[error("Erreur inattendue de la librairie SSV (code d'erreur: {0}).")]
 | 
			
		||||
    Unexpected(u16),
 | 
			
		||||
}
 | 
			
		||||
@@ -1,11 +1,24 @@
 | 
			
		||||
use thiserror::Error;
 | 
			
		||||
 | 
			
		||||
use fsv_sys::{get_library_path, Error as FsvError, SSVLibrary, SSVLibrary_Common, SUPPORTED_FSV_VERSIONS, V1_40_13, V1_40_14};
 | 
			
		||||
use fsv_sys::{
 | 
			
		||||
    get_library_path,
 | 
			
		||||
    Error as FsvError,
 | 
			
		||||
    SSVLibrary,
 | 
			
		||||
    SSVLibraryCommon,
 | 
			
		||||
    SupportedFsvVersion,
 | 
			
		||||
    V1_40_13,
 | 
			
		||||
    V1_40_14
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
mod errors_ssv;
 | 
			
		||||
use errors_ssv::SSVErrorCodes;
 | 
			
		||||
 | 
			
		||||
#[derive(Error, Debug)]
 | 
			
		||||
pub enum Error {
 | 
			
		||||
    #[error(transparent)]
 | 
			
		||||
    SysLibrary(#[from] FsvError)
 | 
			
		||||
    FSVSysLibrary(#[from] FsvError),
 | 
			
		||||
    #[error(transparent)]
 | 
			
		||||
    SSVError(#[from] SSVErrorCodes),
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// Enum to hold the different versions of the SSV library
 | 
			
		||||
@@ -20,14 +33,14 @@ pub struct SSV {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
impl SSV {
 | 
			
		||||
    fn new(version: SUPPORTED_FSV_VERSIONS) -> Result<Self, Error> {
 | 
			
		||||
    fn new(version: SupportedFsvVersion) -> Result<Self, Error> {
 | 
			
		||||
        let library = match version {
 | 
			
		||||
            SUPPORTED_FSV_VERSIONS::V1_40_13 => {
 | 
			
		||||
            SupportedFsvVersion::V1_40_13 => {
 | 
			
		||||
                let lib_path = get_library_path(&version);
 | 
			
		||||
                let library = SSVLibrary::<V1_40_13>::new(&lib_path)?;
 | 
			
		||||
                SsvLibraryVersion::V1_40_13(library)
 | 
			
		||||
            },
 | 
			
		||||
            SUPPORTED_FSV_VERSIONS::V1_40_14 => {
 | 
			
		||||
            SupportedFsvVersion::V1_40_14 => {
 | 
			
		||||
                let lib_path = get_library_path(&version);
 | 
			
		||||
                let library = SSVLibrary::<V1_40_14>::new(&lib_path)?;
 | 
			
		||||
                SsvLibraryVersion::V1_40_14(library)
 | 
			
		||||
@@ -42,15 +55,17 @@ impl SSV {
 | 
			
		||||
    /// Implement: SSV_InitLIB2
 | 
			
		||||
    pub fn init_library(&self, sesam_ini_path: &str) -> Result<(), Error> {
 | 
			
		||||
        let sesam_ini_path = std::ffi::CString::new(sesam_ini_path).expect("CString::new failed");
 | 
			
		||||
        match &self.library {
 | 
			
		||||
        let result = match &self.library {
 | 
			
		||||
            SsvLibraryVersion::V1_40_13(library) => {
 | 
			
		||||
                let result = unsafe { library.ssv_init_lib2(sesam_ini_path.as_ptr()) }?;
 | 
			
		||||
                println!("SSV_InitLIB2 result: {}", result);
 | 
			
		||||
                unsafe { library.ssv_init_lib2(sesam_ini_path.as_ptr()) }?
 | 
			
		||||
            },
 | 
			
		||||
            SsvLibraryVersion::V1_40_14(library) => {
 | 
			
		||||
                let result = unsafe { library.ssv_init_lib2(sesam_ini_path.as_ptr()) }?;
 | 
			
		||||
                println!("SSV_InitLIB2 result: {}", result);
 | 
			
		||||
                unsafe { library.ssv_init_lib2(sesam_ini_path.as_ptr()) }?
 | 
			
		||||
            },
 | 
			
		||||
        };
 | 
			
		||||
        if result != 0 {
 | 
			
		||||
            let error = SSVErrorCodes::from(result);
 | 
			
		||||
            return Err(Error::SSVError(error));
 | 
			
		||||
        }
 | 
			
		||||
        Ok(())
 | 
			
		||||
    }
 | 
			
		||||
@@ -61,19 +76,21 @@ mod tests {
 | 
			
		||||
    use std::env;
 | 
			
		||||
 | 
			
		||||
    use utils::config::load_config;
 | 
			
		||||
    use anyhow::Result;
 | 
			
		||||
 | 
			
		||||
    use super::*;
 | 
			
		||||
 | 
			
		||||
    fn init() -> SSV {
 | 
			
		||||
    fn init() -> Result<SSV> {
 | 
			
		||||
        load_config().unwrap();
 | 
			
		||||
        SSV::new(SUPPORTED_FSV_VERSIONS::V1_40_13).expect("SSV::new failed")
 | 
			
		||||
        Ok(SSV::new(SupportedFsvVersion::V1_40_13)?)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #[test]
 | 
			
		||||
    fn test_init_library() {
 | 
			
		||||
        let lib = init();
 | 
			
		||||
    fn test_init_library() -> Result<()> {
 | 
			
		||||
        let lib = init()?;
 | 
			
		||||
        let sesam_ini_path = env::var("SESAM_INI_PATH").expect("SESAM_INI_PATH must be set");
 | 
			
		||||
        lib.init_library(&sesam_ini_path).expect("init_library failed");
 | 
			
		||||
        lib.init_library(&sesam_ini_path)?;
 | 
			
		||||
        Ok(())
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #[test]
 | 
			
		||||
		Reference in New Issue
	
	Block a user