Skip to content

defects in stdio.c #20

Open
Open
@ghost

Description

I think open source is the way to go in embedded programming. I like your project. Awesome work!

I came across your project when I was looking for sprintf with reasonable footprint. I thought I give it some spin with unity tests. I found some defects and I thought I would double check with you if you are interested and if you are planning to fix them. I have the impression that there are probably some more. I also verified the problem on the target (LPC1343).

// this works
TEST(sprintf, DoubleNoFormat)
{
char output[80];
TEST_ASSERT_EQUAL(20, my_sprintf(output, "double: %f\n", 1234.56789));
TEST_ASSERT_EQUAL_STRING("double: 1234.567890\n", output);
}

TEST(sprintf, DoubleSimple)
{
char output[80];
TEST_ASSERT_EQUAL(17, my_sprintf(output, "double: %.3f\n", 1234.56789));
TEST_ASSERT_EQUAL_STRING("double: 1234.567\n", output);
}

Unity test run 1 of 1
.....!!..
tests/test_sprintf.c:93:TEST(sprintf, DoubleSimple):FAIL: Expected 17 Was -1

I noticed that the library was originally developed by Atmel. Do you know by any chance a project that continued the work?

Cheers,
Mark

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions