-
Notifications
You must be signed in to change notification settings - Fork 22
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
Update test to enhance code coverage #90
Conversation
galin-chung-nguyen
commented
Feb 11, 2025
- Fix Swap instruction impl in machine.rs
- Fix memory layout allocation in config.rs
zkmemory/src/config.rs
Outdated
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::ConfigArgs; | ||
use crate::base::{Base, B256}; | ||
use crate::config::{Config, DefaultConfig}; | ||
extern crate std; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No std
zkmemory/src/config.rs
Outdated
@@ -122,13 +125,19 @@ where | |||
self.register.low() + (T::from(index) * self.word_size), | |||
) | |||
} | |||
|
|||
/// Get the buffer size in bytes | |||
pub fn buffer_size_in_bytes(&self) -> T { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't modify program to test
zkmemory/src/machine.rs
Outdated
@@ -1,4 +1,5 @@ | |||
extern crate alloc; | |||
extern crate std; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No std
zkmemory/src/machine.rs
Outdated
@@ -927,6 +936,8 @@ mod tests { | |||
for instruction in program { | |||
sm.exec(&instruction); | |||
} | |||
assert_eq!(sm.get_memory_address().0, B256::from(35840)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any better way to compare?
zkmemory/src/config.rs
Outdated
@@ -77,11 +78,12 @@ where | |||
/// Create a new config for given arguments | |||
pub fn new(word_size: T, args: ConfigArgs<T>) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix this @chiro-hiro
d487bb3
to
8ede785
Compare
zkmemory/Cargo.toml
Outdated
@@ -32,3 +32,7 @@ nova-snark = { workspace = true } | |||
bellpepper-core = { workspace = true } | |||
poseidon = { path = "../poseidon" } | |||
arecibo = { workspace = true } | |||
|
|||
[features] | |||
default = ["no_std"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?