Skip to content

Commit a1e9a4e

Browse files
committed
Rust: Accept test .expected changes.
1 parent 2195f0b commit a1e9a4e

File tree

8 files changed

+107
-148
lines changed

8 files changed

+107
-148
lines changed

rust/ql/test/library-tests/dataflow/global/inline-flow.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
models
2-
| 1 | Summary: repo:https://github.com/rust-lang/futures-rs:futures-executor; crate::local_pool::block_on; Argument[0]; ReturnValue; value |
2+
| 1 | Summary: futures_executor::local_pool::block_on; Argument[0]; ReturnValue; value |
33
edges
44
| main.rs:12:28:14:1 | { ... } | main.rs:17:13:17:23 | get_data(...) | provenance | |
55
| main.rs:13:5:13:13 | source(...) | main.rs:12:28:14:1 | { ... } | provenance | |

rust/ql/test/library-tests/dataflow/sources/TaintSources.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
| test.rs:779:22:779:50 | ...::new | Flow source 'RemoteSource' of type remote (DEFAULT). |
7676
| test.rs:806:16:806:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). |
7777
| test.rs:806:16:806:29 | ...::args | Flow source 'CommandLineArgs' of type commandargs (DEFAULT). |
78-
| test_futures_io.rs:19:15:19:32 | ...::connect | Flow source 'RemoteSource' of type remote (DEFAULT). |
7978
| web_frameworks.rs:11:31:11:31 | a | Flow source 'RemoteSource' of type remote (DEFAULT). |
8079
| web_frameworks.rs:11:31:11:31 | a | Flow source 'RemoteSource' of type remote (DEFAULT). |
8180
| web_frameworks.rs:22:14:22:18 | TuplePat | Flow source 'RemoteSource' of type remote (DEFAULT). |

rust/ql/test/library-tests/dataflow/sources/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ fn test_io_stdin() -> std::io::Result<()> {
214214
{
215215
let mut buffer = Vec::<u8>::new();
216216
let _bytes = std::io::stdin().read_to_end(&mut buffer)?; // $ Alert[rust/summary/taint-sources]
217-
sink(&buffer); // $ hasTaintFlow -- @hvitved: works in CI, but not for me locally
217+
sink(&buffer); // $ MISSING: hasTaintFlow
218218
}
219219

220220
{

rust/ql/test/library-tests/dataflow/sources/test_futures_io.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ use std::task::{Context, Poll};
1616

1717
async fn test_futures_rustls_futures_io() -> io::Result<()> {
1818
let url = "www.example.com:443";
19-
let tcp = TcpStream::connect(url).await?; // $ Alert[rust/summary/taint-sources]
20-
sink(&tcp); // $ hasTaintFlow=url
19+
let tcp = TcpStream::connect(url).await?; // $ MISSING: Alert[rust/summary/taint-sources]
20+
sink(&tcp); // $ MISSING: hasTaintFlow=url
2121
let config = rustls::ClientConfig::builder()
2222
.with_root_certificates(rustls::RootCertStore::empty())
2323
.with_no_client_auth();
2424
let connector = TlsConnector::from(Arc::new(config));
2525
let server_name = rustls::pki_types::ServerName::try_from("www.example.com").unwrap();
2626
let mut reader = connector.connect(server_name, tcp).await?;
27-
sink(&reader); // $ hasTaintFlow=url
27+
sink(&reader); // $ MISSING: hasTaintFlow=url
2828

2929
{
3030
// using the `AsyncRead` trait (low-level)
3131
let mut buffer = [0u8; 64];
3232
let mut pinned = Pin::new(&mut reader);
33-
sink(&pinned); // $ hasTaintFlow=url
33+
sink(&pinned); // $ MISSING: hasTaintFlow=url
3434
let mut cx = Context::from_waker(futures::task::noop_waker_ref());
3535
let bytes_read = pinned.poll_read(&mut cx, &mut buffer); // we cannot correctly resolve this call, since it relies on `Deref`
3636
if let Poll::Ready(Ok(n)) = bytes_read {
@@ -43,7 +43,7 @@ async fn test_futures_rustls_futures_io() -> io::Result<()> {
4343
// using the `AsyncReadExt::read` extension method (higher-level)
4444
let mut buffer1 = [0u8; 64];
4545
let bytes_read1 = futures::io::AsyncReadExt::read(&mut reader, &mut buffer1).await?;
46-
sink(&buffer1[..bytes_read1]); // $ hasTaintFlow=url
46+
sink(&buffer1[..bytes_read1]); // $ MISSING: hasTaintFlow=url
4747

4848
let mut buffer2 = [0u8; 64];
4949
let bytes_read2 = reader.read(&mut buffer2).await?; // we cannot resolve the `read` call, which comes from `impl<R: AsyncRead + ?Sized> AsyncReadExt for R {}` in `async_read_ext.rs`
@@ -52,25 +52,25 @@ async fn test_futures_rustls_futures_io() -> io::Result<()> {
5252
}
5353

5454
let mut reader2 = futures::io::BufReader::new(reader);
55-
sink(&reader2); // $ hasTaintFlow=url
55+
sink(&reader2); // $ MISSING: hasTaintFlow=url
5656

5757
{
5858
// using the `AsyncBufRead` trait (low-level)
5959
let mut pinned = Pin::new(&mut reader2);
60-
sink(&pinned); // $ hasTaintFlow=url
60+
sink(&pinned); // $ MISSING: hasTaintFlow=url
6161
let mut cx = Context::from_waker(futures::task::noop_waker_ref());
6262
let buffer = pinned.poll_fill_buf(&mut cx);
6363
if let Poll::Ready(Ok(buf)) = buffer {
64-
sink(&buffer); // $ hasTaintFlow=url
64+
sink(&buffer); // $ MISSING: hasTaintFlow=url
6565
sink(buf); // $ MISSING: hasTaintFlow=url
6666
}
6767

6868
// using the `AsyncBufRead` trait (alternative syntax)
6969
let buffer2 = Pin::new(&mut reader2).poll_fill_buf(&mut cx);
7070
match (buffer2) {
7171
Poll::Ready(Ok(buf)) => {
72-
sink(&buffer2); // $ hasTaintFlow=url
73-
sink(buf); // $ hasTaintFlow=url
72+
sink(&buffer2); // $ MISSING: hasTaintFlow=url
73+
sink(buf); // $ MISSING: hasTaintFlow=url
7474
}
7575
_ => {
7676
// ...
@@ -88,7 +88,7 @@ async fn test_futures_rustls_futures_io() -> io::Result<()> {
8888
// using the `AsyncRead` trait (low-level)
8989
let mut buffer = [0u8; 64];
9090
let mut pinned = Pin::new(&mut reader2);
91-
sink(&pinned); // $ hasTaintFlow=url
91+
sink(&pinned); // $ MISSING: hasTaintFlow=url
9292
let mut cx = Context::from_waker(futures::task::noop_waker_ref());
9393
let bytes_read = pinned.poll_read(&mut cx, &mut buffer);
9494
sink(&buffer); // $ MISSING: hasTaintFlow=url
@@ -101,7 +101,7 @@ async fn test_futures_rustls_futures_io() -> io::Result<()> {
101101
// using the `AsyncReadExt::read` extension method (higher-level)
102102
let mut buffer1 = [0u8; 64];
103103
let bytes_read1 = futures::io::AsyncReadExt::read(&mut reader2, &mut buffer1).await?;
104-
sink(&buffer1[..bytes_read1]); // $ hasTaintFlow=url
104+
sink(&buffer1[..bytes_read1]); // $ MISSING: hasTaintFlow=url
105105

106106
let mut buffer2 = [0u8; 64];
107107
let bytes_read2 = reader2.read(&mut buffer2).await?; // we cannot resolve the `read` call, which comes from `impl<R: AsyncRead + ?Sized> AsyncReadExt for R {}` in `async_read_ext.rs`
@@ -111,10 +111,10 @@ async fn test_futures_rustls_futures_io() -> io::Result<()> {
111111
{
112112
// using the `AsyncBufRead` trait (low-level)
113113
let mut pinned = Pin::new(&mut reader2);
114-
sink(&pinned); // $ hasTaintFlow=url
114+
sink(&pinned); // $ MISSING: hasTaintFlow=url
115115
let mut cx = Context::from_waker(futures::task::noop_waker_ref());
116116
let buffer = pinned.poll_fill_buf(&mut cx);
117-
sink(&buffer); // $ hasTaintFlow=url
117+
sink(&buffer); // $ MISSING: hasTaintFlow=url
118118
if let Poll::Ready(Ok(buf)) = buffer {
119119
sink(buf); // $ MISSING: hasTaintFlow=url
120120
}

0 commit comments

Comments
 (0)