Skip to content

Commit 0e165f3

Browse files
committed
wip
1 parent 3f72382 commit 0e165f3

4 files changed

Lines changed: 22 additions & 9 deletions

File tree

.github/workflows-in/rarearchs.ys

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
:use common: :all
44
:: workflow-setup()
55

6+
# NOTE: to debug with qemu and gdb:
7+
# https://stackoverflow.com/questions/59906042/how-to-debug-mips-interactively
8+
69
jobs:
710
xcompile:
811
:: setup-job('rarearchs' 'xcompile')

test/test_lib/test_engine.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ void test_new_parser_events_ints_from_yaml(ReferenceYaml const& yaml, std::strin
9595
{
9696
extra::EventHandlerInts handler{};
9797
using IntType = extra::ievt::DataType;
98-
std::vector<IntType> actual_evts(num_ints(yaml.expected_ints.data(), yaml.expected_ints.size()));
98+
//NOTE! crashes in MIPS64 Debug c++20 (but not c++11) when size is 0:
99+
//std::vector<IntType> actual_evts(empty.size());
100+
std::vector<IntType> actual_evts; // DO THIS!
101+
size_t size_reference = num_ints(yaml.expected_ints.data(), yaml.expected_ints.size());
99102
int size_estimated = extra::estimate_events_ints_size(to_csubstr(yaml.parsed));
100103
// there was an error in gcc<5 where the copy buffer was NOT
101104
// assigned when using a std::string:
@@ -107,6 +110,10 @@ void test_new_parser_events_ints_from_yaml(ReferenceYaml const& yaml, std::strin
107110
ParseEngine<extra::EventHandlerInts> parser(&handler);
108111
parser.parse_in_place_ev("(testyaml)", to_substr(copy));
109112
EXPECT_GE(size_estimated, handler.required_size_events());
113+
if(yaml.expected_ints_enabled)
114+
{
115+
EXPECT_EQ(size_reference, handler.required_size_events());
116+
}
110117
size_t sz = (size_t)handler.required_size_events();
111118
if (!handler.fits_buffers())
112119
{
@@ -145,7 +152,7 @@ void test_new_parser_events_ints_from_yaml(ReferenceYaml const& yaml, std::strin
145152
/*ignore_container_style*/false,
146153
/*ignore_scalar_style*/false,
147154
/*ignore_tag_normalization*/true);
148-
}
155+
}
149156
}
150157

151158
void test_new_parser_tree_from_yaml(ReferenceYaml const& yaml)

test/test_lib/test_events_ints_helpers.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ namespace c4 {
77
namespace yml {
88
namespace extra {
99

10+
size_t num_ints(IntEventWithScalar const *evt, size_t evt_size)
11+
{
12+
size_t sz = 0;
13+
for(size_t i = 0; i < evt_size; ++i)
14+
sz += evt[i].required_size();
15+
return sz;
16+
}
17+
1018

1119
void test_events_ints(IntEventWithScalar const* expected, size_t expected_sz,
1220
ievt::DataType const* actual, size_t actual_sz,

test/test_lib/test_events_ints_helpers.hpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,8 @@ struct IntEventWithScalar
3232
};
3333

3434

35-
inline C4_NO_INLINE size_t num_ints(IntEventWithScalar const *evt, size_t evt_size)
36-
{
37-
size_t sz = 0;
38-
for(size_t i = 0; i < evt_size; ++i)
39-
sz += evt[i].required_size();
40-
return sz;
41-
}
35+
size_t num_ints(IntEventWithScalar const *evt, size_t evt_size);
36+
4237

4338
void test_events_ints(IntEventWithScalar const* expected, size_t expected_sz,
4439
ievt::DataType const* actual, size_t actual_sz,

0 commit comments

Comments
 (0)