OUTPUT:
RETVAL
+AV *
+test_valid_utf8_to_uvchr(s)
+
+ SV *s
+ PREINIT:
+ STRLEN retlen;
+ UV ret;
+ STRLEN slen;
+
+ CODE:
+ /* Call utf8n_to_uvchr() with the inputs. It always asks for the
+ * actual length to be returned
+ *
+ * Length to assume <s> is; not checked, so could have buffer overflow
+ */
+ RETVAL = newAV();
+ sv_2mortal((SV*)RETVAL);
+
+ ret
+ = valid_utf8_to_uvchr((U8*) SvPV(s, slen), &retlen);
+
+ /* Returns the return value in [0]; <retlen> in [1] */
+ av_push(RETVAL, newSVuv(ret));
+ av_push(RETVAL, newSVuv(retlen));
+
+ OUTPUT:
+ RETVAL
+
SV *
test_uvchr_to_utf8_flags(uv, flags)
diag "The warnings were: " . join(", ", @warnings);
}
+ undef @warnings;
+
+ $ret_ref = test_valid_utf8_to_uvchr($bytes);
+ is($ret_ref->[0], $n, "Verify valid_utf8_to_uvchr($display_bytes) returns $hex_n");
+ is($ret_ref->[1], $len, "Verify valid_utf8_to_uvchr() for $hex_n returns expected length");
+
+ unless (is(scalar @warnings, 0,
+ "Verify valid_utf8_to_uvchr() for $hex_n generated no warnings"))
+ {
+ diag "The warnings were: " . join(", ", @warnings);
+ }
+
# Similarly for uvchr_to_utf8
my $this_uvchr_flags = $look_for_everything_uvchr_to;
if ($n > 2 ** 31 - 1) {