<div dir="ltr">Hi David,<div><br></div><div>Add the unit tests for the changes. Please have a look at the following diff for the changes in unit test file.</div><div><br></div><div><div>40,44d39</div><div>< { "0X400", 1024 },</div>
<div>< { "0x40a", 1034 },</div><div>< { "0X40b", 1035 },</div><div>< { "0x40e", 1038 },</div><div>< { "0X40f", 1039 },</div>
<div>55c50</div><div>< static char *invalid_tests_inputs[] = { "", "-1", "k", "08", "09", "4611686018427387904G" };</div><div>---</div><div>> static char *invalid_tests_inputs[] = { "", "-1", "k", "4611686018427387904G" };</div>
</div><div><br></div><div><br></div><div>Thanks and regards,<br>Sandeep.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 25, 2014 at 7:22 AM, David Goulet <span dir="ltr"><<a href="mailto:dgoulet@efficios.com" target="_blank">dgoulet@efficios.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 21 Mar (00:22:57), Sandeep K Chaudhary wrote:<br>
> Hi guys,<br>
><br>
> I checked the fix suggested in the bug description and it is correct.<br>
><br>
> Changing<br>
><br>
> ret = regcomp(®ex, "^\\(0x\\)\\{0,1\\}[0-9][0-9]*\\([kKMG]\\{0,1\\}\\)$", 0);<br>
><br>
> to<br>
><br>
> ret = regcomp(®ex,<br>
> "^(((0x|0X)[0-9A-Fa-f]+)|(0[0-7]*)|([1-9][0-9]*))[kKMG]?$", REG_EXTENDED);<br>
><br>
> will take care of the following three problems that exist in the first regex<br>
><br>
><br>
</div>> - It accepts a leading 0 (without a following x or X) to represent an<br>
<div class="">> octal value, but simultaneously accepts the digits 8 and 9 in said octal<br>
</div>> value (this yields -1).<br>
> - It does not support the leading 0X hexadecimal indicator but does<br>
<div class="">> support a leading 0x (see following).<br>
</div>> - It accepts a leading 0x to represent an hexadecimal value but rejects<br>
<div class="">> the a..f and A..F digits in said value.<br>
><br>
><br>
> Please let me know your views, and then I can submit a patch for this.<br>
<br>
</div>Unfortunately I don't speak regex well enough to tell you if this is<br>
absolutely correct but what you should do with your patch is add unit<br>
test(s) that fix the three problems you list here.<br>
<br>
Most probably in:<br>
<br>
tests/unit/test_utils_parse_size_suffix.c<br>
<br>
Cheers!<br>
David<br>
<br>
><br>
> Thanks and regards,<br>
> Sandeep.<br>
<br>
> _______________________________________________<br>
> lttng-dev mailing list<br>
> <a href="mailto:lttng-dev@lists.lttng.org">lttng-dev@lists.lttng.org</a><br>
> <a href="http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" target="_blank">http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Thanks and regards,<br>Sandeep K Chaudhary.
</div>