Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When including Lib, test throws "Program errored with 3221225785 code" #51

Open
manuelgonzalvez opened this issue Sep 14, 2023 · 0 comments

Comments

@manuelgonzalvez
Copy link

Good morning, i am wrapping my head around this.

i'm on PlatformIO in VScode, using Unity as test suite.
i am using Windows 10, installed minGW, test compiles and runs whitout including ArduinoFake".
As soon as i do it, ( without adding code to the test file) i get that error.

i assume it's not a minGW issue, because if i coment the "#include" and "using namespace" lines, the tests run correctly (for the hardcoded assertion).

platformio.ini

[platformio]
default_envs = native

[env:native]
platform = native
test_framework = unity
test_ignore = test/test_embedded
test_filter = test/test_native
build_flags = 
    -std=gnu++11

debug_test = test/test_native
lib_deps = ArduinoFake

test_constructors.cpp

#include "../.pio/libdeps/native/ArduinoFake/src/ArduinoFake.h"
#include <unity.h>

using namespace fakeit;
void setUp(void) {
    // set stuff up here
}

void tearDown(void) {
    // clean stuff up here
}

void test_setup_function_default_host(void)
{
    TEST_ASSERT_TRUE(1 == (2-1));
}

int main(int argc, char **argv) {
    UNITY_BEGIN();

    RUN_TEST(test_setup_function_default_host);

    UNITY_END();
    return 0;
}

command output

pio test -e "native" -f "test_native" -vv
Processing test_native in native environment
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Building...
Verbose mode can be enabled via `-v, --verbose` option
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 2 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ArduinoFake @ 0.4.0
|-- Unity @ 2.5.2
Building in test mode
Compiling .pio\build\native\unity_config_build\unity_config.o
Compiling .pio\build\native\test\test_native\test_constructors.o
Compiling .pio\build\native\libbcd\ArduinoFake\ArduinoFake.o
Compiling .pio\build\native\libbcd\ArduinoFake\ClientFake.o
Compiling .pio\build\native\libbcd\ArduinoFake\EEPROMFake.o
Compiling .pio\build\native\libbcd\ArduinoFake\FunctionFake.o
Compiling .pio\build\native\libbcd\ArduinoFake\PrintFake.o
Compiling .pio\build\native\libbcd\ArduinoFake\SPIFake.o
Compiling .pio\build\native\libbcd\ArduinoFake\SerialFake.o
Compiling .pio\build\native\libbcd\ArduinoFake\StreamFake.o
Compiling .pio\build\native\libbcd\ArduinoFake\WireFake.o
Compiling .pio\build\native\libbcd\ArduinoFake\arduino\IPAddress.o
Compiling .pio\build\native\libbcd\ArduinoFake\arduino\WString.o
Compiling .pio\build\native\libbcd\ArduinoFake\arduino\noniso.o
Compiling .pio\build\native\lib6e1\Unity\unity.o
Archiving .pio\build\native\lib6e1\libUnity.a
Indexing .pio\build\native\lib6e1\libUnity.a
Archiving .pio\build\native\libbcd\libArduinoFake.a
Indexing .pio\build\native\libbcd\libArduinoFake.a
Linking .pio\build\native\program.exe


Testing...
Program errored with 3221225785 code

Any hints? as i am not including any code, i think i am not missing any part of the function mocking.

i also searched some posts regarding that exact error code, and reinstalled minGW in consequence. but still no success.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant