Skip to content

Commit 17c9f7b

Browse files
riptlripatel-fd
authored andcommitted
Few test improvements
1 parent 3c4023e commit 17c9f7b

File tree

6 files changed

+10
-4
lines changed

6 files changed

+10
-4
lines changed

src/ballet/base64/Local.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
$(call add-hdrs,fd_base64.h)
22
$(call add-objs,fd_base64,fd_ballet)
33
$(call make-unit-test,test_base64,test_base64,fd_ballet fd_util)
4+
$(call run-unit-test,test_base64)
45
ifdef FD_HAS_HOSTED
56
$(call make-fuzz-test,fuzz_base64_dec,fuzz_base64_dec,fd_ballet fd_util)
67
$(call make-fuzz-test,fuzz_base64_enc,fuzz_base64_enc,fd_ballet fd_util)

src/ballet/blake3/Local.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ $(call add-objs,blake3_sse2,fd_ballet)
1111
endif
1212

1313
$(call make-unit-test,test_blake3,test_blake3,fd_ballet fd_util)
14+
$(call run-unit-test,test_blake3)
1415
ifdef FD_HAS_HOSTED
1516
$(call make-fuzz-test,fuzz_blake3,fuzz_blake3,fd_ballet fd_util)
1617
endif

src/ballet/utf8/test_utf8.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ typedef struct fd_utf8_test_vector fd_utf8_test_vector_t;
1313
https://github.com/rust-lang/rust/blob/master/library/alloc/tests/str.rs */
1414

1515
static fd_utf8_test_vector_t const _single_glyph_vec[] = {
16-
{ NULL, 0UL, 1 },
1716
{ "\xc0\x80", 2UL, 0 },
1817
{ "\xc0\xae", 2UL, 0 },
1918
{ "\xe0\x80\x80", 3UL, 0 },
@@ -25,6 +24,7 @@ static fd_utf8_test_vector_t const _single_glyph_vec[] = {
2524
{ "\xED\xBF\xBF", 3UL, 0 },
2625
{ "\xC2\x80", 2UL, 1 },
2726
{ "\xDF\xBF", 2UL, 1 },
27+
{ "\xE1\x9B\x89", 3UL, 1 },
2828
{ "\xE0\xA0\x80", 3UL, 1 },
2929
{ "\xED\x9F\xBF", 3UL, 1 },
3030
{ "\xEE\x80\x80", 3UL, 1 },
@@ -41,17 +41,18 @@ main( int argc,
4141

4242
/* Check single glyphs */
4343

44+
FD_TEST( fd_utf8_verify( NULL, 0UL )==1 );
4445
for( fd_utf8_test_vector_t const * vec = _single_glyph_vec; vec->input; vec++ ) {
4546
FD_TEST( fd_utf8_verify( vec->input, vec->sz ) == vec->result );
4647

4748
for( ulong sz=1UL; sz < vec->sz; sz++ ) {
4849
/* Smaller size */
49-
FD_TEST( fd_utf8_verify( vec->input, sz ) == -1 );
50+
FD_TEST( fd_utf8_verify( vec->input, sz )==0 );
5051
/* Insert null byte */
5152
char input[ 8 ];
5253
fd_memcpy( input, vec->input, vec->sz );
5354
input[ sz-1UL ] = '\0';
54-
FD_TEST( fd_utf8_verify( input, vec->sz ) == -1 );
55+
FD_TEST( fd_utf8_verify( input, vec->sz )==0 );
5556
}
5657
}
5758

src/disco/bundle/Local.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ $(call add-hdrs,fd_bundle_tile.h)
88
$(call add-objs,fd_bundle_auth fd_bundle_client,fd_disco)
99
ifdef FD_HAS_HOSTED
1010
$(call make-unit-test,test_bundle_client,test_bundle_client,fd_disco fd_waltz fd_flamenco fd_tango fd_ballet fd_util,$(OPENSSL_LIBS))
11+
$(call run-unit-test,test_bundle_client)
1112
$(call make-fuzz-test,fuzz_bundle_client,fuzz_bundle_client,fd_disco fd_waltz fd_flamenco fd_tango fd_ballet fd_util,$(OPENSSL_LIBS))
1213
$(call make-fuzz-test,fuzz_bundle_auth_resp,fuzz_bundle_auth_resp,fd_disco fd_waltz fd_flamenco fd_tango fd_ballet fd_util,$(OPENSSL_LIBS))
1314
endif

src/disco/bundle/test_bundle_client.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,9 @@ test_bundle_ping( fd_wksp_t * wksp ) {
219219
FD_TEST( charge_busy==0 );
220220
FD_TEST( fd_h2_rbuf_used_sz( grpc_client->frame_tx )==0 );
221221
FD_TEST( state->defer_reset==0 );
222-
state->last_ping_tx_ticks -= (long)state->ping_threshold_ticks + 1L;
222+
state->last_ping_tx_ticks -= (long)state->ping_threshold_ticks + (long)(state->ping_threshold_ticks>>1) + 1L;
223223
FD_TEST( fd_bundle_client_ping_is_timeout( state, old_ts )==0 );
224+
state->ping_randomize = ULONG_MAX; /* max delay */
224225
FD_TEST( fd_bundle_client_ping_is_due( state, old_ts )==1 );
225226
charge_busy = 0;
226227
fd_bundle_client_step( state, &charge_busy );

src/disco/net/xdp/Local.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ ifdef FD_HAS_ALLOCA
22
$(call add-objs,fd_xdp_tile,fd_disco)
33
ifdef FD_ARCH_SUPPORTS_SANDBOX
44
$(call make-unit-test,test_xdp_tile,test_xdp_tile,fd_disco fd_tango fd_waltz fd_util)
5+
$(call run-unit-test,test_xdp_tile)
56
endif
67
endif

0 commit comments

Comments
 (0)