ayushkarnawat/6.172

[P1] Incorrect bit strings format for empty string

ayushkarnawat opened this issue · 0 comments

Describe the bug

When compiling WITHOUT any optimization enabled (e.g. -O0), and running unittests on empty bitstrings (e.g. ""), we get an assertion error stating that the bits in the bitarray are not in a compatible format (e.g. not a 0 or 1). Assertion Failed: boolfromchar

Steps to reproduce

[user@system:~]$ mkdir -p build/debug
[user@system:~]$ cmake -B build/debug && make -C ./build/debug/projects/p1
[user@system:~]$ ./build/debug/projects/p1/everybit -t projects/p1/data/mytests
Testing file data/mytests.

Running test #1...
Assertion failed: (c == '0' || c == '1'), function boolfromchar, file src/tests.c, line 331.
zsh: abort      ./everybit -t data/mytests

Expected behavior

Each bit in the string is valid and all unit tests pass.