Skip to content

Commit

Permalink
WIP:
Browse files Browse the repository at this point in the history
  • Loading branch information
thedodd committed Aug 22, 2024
1 parent cfa78bf commit fea60f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
16 changes: 11 additions & 5 deletions extension/src/stats_agg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1644,13 +1644,19 @@ mod tests {

let control = state.unwrap();
let buffer = stats1d_trans_serialize(Inner::from(control.clone()).internal().unwrap());
let buffer = pgrx::varlena::varlena_to_byte_slice(buffer.0.cast_mut_ptr());
// let buffer =
// pgrx::varlena::varlena_to_byte_slice(buffer.0.cast_mut_ptr::<pg_sys::varlena>());

let expected = pgrx::varlena::rust_byte_slice_to_bytea(buffer);
let new_state =
stats1d_trans_deserialize_inner(bytea(pg_sys::Datum::from(expected.as_ptr())));
// let expected = pgrx::varlena::rust_byte_slice_to_bytea(buffer);
// let new_state =
// stats1d_trans_deserialize_inner(bytea(pg_sys::Datum::from(expected.as_ptr())));
let new_state = stats1d_trans_deserialize_inner(buffer);

assert_eq!(&*new_state, &*control);
assert_eq!(
&*new_state, &*control,
"unexpected difference in bytes output, got:\n{:?}\nexpected:\n{:?}",
&*new_state, &*control
);
}
}

Expand Down
4 changes: 2 additions & 2 deletions tools/build
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ while [ $# -gt 0 ]; do
$nop cargo fetch
export RUSTC_BOOTSTRAP=1
export __CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS=nightly
export RUSTFLAGS='-Z sanitizer=memory'
# export RUSTFLAGS='-Z sanitizer=memory'
rustup component add rust-src --toolchain 1.74.0-x86_64-unknown-linux-gnu
$nop cargo test -Zbuild-std --profile $profile --target --target x86_64-unknown-linux-gnu --features "$pg pg_test" --no-default-features -- stats_agg::tests
$nop cargo test -Zbuild-std --profile $profile --target --target x86_64-unknown-linux-gnu --features "$pg pg_test" --no-default-features -- --nocapture stats_agg::tests
;;

install)
Expand Down

0 comments on commit fea60f8

Please sign in to comment.