Skip to content

Commit

Permalink
[Fix] Fix sys test
Browse files Browse the repository at this point in the history
Signed-off-by: csh <[email protected]>
  • Loading branch information
L-jasmine committed Nov 14, 2023
1 parent 03e1573 commit 18073d3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions crates/wasmedge-sys/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@ mod tests {
#[test]
#[ignore]
fn test_plugin_wasmedge_process() {
use crate::AsInstance;

use super::*;

PluginManager::load_plugins_from_default_paths();
Expand Down Expand Up @@ -560,6 +562,8 @@ mod tests {
#[cfg(all(target_os = "linux", feature = "wasi_crypto", not(feature = "static")))]
#[test]
fn test_plugin_wasi_crypto() {
use crate::AsInstance;

use super::*;

PluginManager::load_plugins_from_default_paths();
Expand All @@ -571,7 +575,7 @@ mod tests {

// get `wasmedge_process` plugin
let result = PluginManager::find("wasi_crypto");
assert!(result.is_some());
assert!(result.is_ok());
let plugin = result.unwrap();
assert_eq!(plugin.name(), "wasi_crypto");
assert_eq!(plugin.mod_count(), 5);
Expand All @@ -589,7 +593,7 @@ mod tests {
// get `wasi_crypto_asymmetric_common` module instance from plugin
{
let result = plugin.mod_instance("wasi_crypto_asymmetric_common");
assert!(result.is_some());
assert!(result.is_ok());
let instance = result.unwrap();
assert_eq!(
instance.name().unwrap(),
Expand Down Expand Up @@ -626,7 +630,7 @@ mod tests {
// get `wasi_crypto_common` module instance from plugin
{
let result = plugin.mod_instance("wasi_crypto_common");
assert!(result.is_some());
assert!(result.is_ok());
let instance = result.unwrap();
assert_eq!(instance.name().unwrap(), "wasi_ephemeral_crypto_common");
assert_eq!(instance.func_len(), 10);
Expand All @@ -650,7 +654,7 @@ mod tests {
// get `wasi_crypto_kx` module instance from plugin
{
let result = plugin.mod_instance("wasi_crypto_kx");
assert!(result.is_some());
assert!(result.is_ok());
let instance = result.unwrap();
assert_eq!(instance.name().unwrap(), "wasi_ephemeral_crypto_kx");
assert_eq!(instance.func_len(), 3);
Expand All @@ -663,7 +667,7 @@ mod tests {
// get `wasi_crypto_signatures` module instance from plugin
{
let result = plugin.mod_instance("wasi_crypto_signatures");
assert!(result.is_some());
assert!(result.is_ok());
let instance = result.unwrap();
assert_eq!(instance.name().unwrap(), "wasi_ephemeral_crypto_signatures");
assert_eq!(instance.func_len(), 11);
Expand All @@ -688,7 +692,7 @@ mod tests {
// get `wasi_crypto_symmetric` module instance from plugin
{
let result = plugin.mod_instance("wasi_crypto_symmetric");
assert!(result.is_some());
assert!(result.is_ok());
let instance = result.unwrap();
assert_eq!(instance.name().unwrap(), "wasi_ephemeral_crypto_symmetric");
assert_eq!(instance.func_len(), 28);
Expand Down

0 comments on commit 18073d3

Please sign in to comment.