Skip to content

Commit d293e87

Browse files
committed
test(cpp): fix protobuf model CI failures
Share standard string stubs between the protobuf and Asio fixtures and regenerate expectations for their new source locations. Add the eight missing protobuf signature expectations.
1 parent d603cdd commit d293e87

8 files changed

Lines changed: 737 additions & 734 deletions

File tree

cpp/ql/test/library-tests/dataflow/external-models/asio_streams.cpp

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
11

22
// --- stub library headers ---
33

4-
namespace std {
5-
typedef unsigned long size_t;
6-
#define SIZE_MAX 0xFFFFFFFF
4+
#include "std_string.h"
75

8-
template <class T> class allocator {
9-
};
10-
11-
template<class charT> struct char_traits {
12-
};
13-
14-
template<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
15-
class basic_string {
16-
public:
17-
basic_string(const charT* s, const Allocator& a = Allocator());
18-
};
19-
20-
typedef basic_string<char> string;
6+
#define SIZE_MAX 0xFFFFFFFF
217

8+
namespace std {
229
class string_view {
2310
public:
2411
string_view(const char* s);

cpp/ql/test/library-tests/dataflow/external-models/flow.expected

Lines changed: 579 additions & 579 deletions
Large diffs are not rendered by default.

cpp/ql/test/library-tests/dataflow/external-models/protobuf.cpp

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,9 @@
11

22
// --- stub library headers ---
33

4-
namespace std {
5-
typedef unsigned long size_t;
6-
7-
template <class T> class allocator {
8-
};
9-
10-
template<class charT> struct char_traits {
11-
};
12-
13-
template<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
14-
class basic_string {
15-
public:
16-
basic_string();
17-
basic_string(const charT* s, const Allocator& a = Allocator());
18-
const charT* data() const;
19-
size_t size() const;
20-
};
21-
22-
typedef basic_string<char> string;
4+
#include "std_string.h"
235

6+
namespace std {
247
class istream {
258
public:
269
istream();

cpp/ql/test/library-tests/dataflow/external-models/sinks.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
| asio_streams.cpp:135:29:135:39 | recv_buffer | remote-sink |
2-
| asio_streams.cpp:145:29:145:39 | send_buffer | remote-sink |
1+
| asio_streams.cpp:122:29:122:39 | recv_buffer | remote-sink |
2+
| asio_streams.cpp:132:29:132:39 | send_buffer | remote-sink |
33
| test.cpp:12:10:12:10 | 0 | test-sink |
44
| test.cpp:14:10:14:10 | x | test-sink |
55
| test.cpp:18:10:18:10 | y | test-sink |

cpp/ql/test/library-tests/dataflow/external-models/sources.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
| asio_streams.cpp:129:34:129:44 | read_until output argument | remote |
1+
| asio_streams.cpp:116:34:116:44 | read_until output argument | remote |
22
| azure.cpp:253:48:253:60 | call to GetBodyStream | remote |
33
| azure.cpp:273:52:273:61 | call to GetHeaders | remote |
44
| azure.cpp:277:38:277:44 | call to GetBody | remote |
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#ifndef CODEQL_TEST_STD_STRING_H
2+
#define CODEQL_TEST_STD_STRING_H
3+
4+
namespace std {
5+
typedef unsigned long size_t;
6+
7+
template <class T> class allocator {
8+
};
9+
10+
template<class charT> struct char_traits {
11+
};
12+
13+
template<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
14+
class basic_string {
15+
public:
16+
basic_string();
17+
basic_string(const charT* s, const Allocator& a = Allocator());
18+
const charT* data() const;
19+
size_t size() const;
20+
};
21+
22+
typedef basic_string<char> string;
23+
}
24+
25+
#endif

cpp/ql/test/library-tests/dataflow/external-models/steps.expected

Lines changed: 117 additions & 117 deletions
Large diffs are not rendered by default.

cpp/ql/test/library-tests/dataflow/taint-tests/test_mad-signatures.expected

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14064,6 +14064,10 @@ getSignatureParameterName
1406414064
| (const Command *,const size_t,const BlockSplit *,const BlockSplit *,const BlockSplit *,const uint8_t *,size_t,size_t,uint8_t,uint8_t,const ContextType *,HistogramLiteral *,HistogramCommand *,HistogramDistance *) | | BrotliBuildHistogramsWithContext | 11 | HistogramLiteral * |
1406514065
| (const Command *,const size_t,const BlockSplit *,const BlockSplit *,const BlockSplit *,const uint8_t *,size_t,size_t,uint8_t,uint8_t,const ContextType *,HistogramLiteral *,HistogramCommand *,HistogramDistance *) | | BrotliBuildHistogramsWithContext | 12 | HistogramCommand * |
1406614066
| (const Command *,const size_t,const BlockSplit *,const BlockSplit *,const BlockSplit *,const uint8_t *,size_t,size_t,uint8_t,uint8_t,const ContextType *,HistogramLiteral *,HistogramCommand *,HistogramDistance *) | | BrotliBuildHistogramsWithContext | 13 | HistogramDistance * |
14067+
| (const Cord &) | MessageLite | MergeFromString | 0 | const Cord & |
14068+
| (const Cord &) | MessageLite | MergePartialFromString | 0 | const Cord & |
14069+
| (const Cord &) | MessageLite | ParseFromString | 0 | const Cord & |
14070+
| (const Cord &) | MessageLite | ParsePartialFromString | 0 | const Cord & |
1406714071
| (const Curl_easy *,const connectdata *,int) | | Curl_conn_is_http2 | 0 | const Curl_easy * |
1406814072
| (const Curl_easy *,const connectdata *,int) | | Curl_conn_is_http2 | 1 | const connectdata * |
1406914073
| (const Curl_easy *,const connectdata *,int) | | Curl_conn_is_http2 | 2 | int |
@@ -24746,6 +24750,10 @@ getSignatureParameterName
2474624750
| (string_buf *,unsigned char **,size_t *) | | _libssh2_get_string | 0 | string_buf * |
2474724751
| (string_buf *,unsigned char **,size_t *) | | _libssh2_get_string | 1 | unsigned char ** |
2474824752
| (string_buf *,unsigned char **,size_t *) | | _libssh2_get_string | 2 | size_t * |
24753+
| (string_view) | MessageLite | MergeFromString | 0 | string_view |
24754+
| (string_view) | MessageLite | MergePartialFromString | 0 | string_view |
24755+
| (string_view) | MessageLite | ParseFromString | 0 | string_view |
24756+
| (string_view) | MessageLite | ParsePartialFromString | 0 | string_view |
2474924757
| (string_view,string_view) | basic_resolver<InternetProtocol> | resolve | 0 | string_view |
2475024758
| (string_view,string_view) | basic_resolver<InternetProtocol> | resolve | 1 | string_view |
2475124759
| (string_view,string_view,error_code &) | basic_resolver<InternetProtocol> | resolve | 0 | string_view |

0 commit comments

Comments
 (0)