Skip to content

Commit

Permalink
check result of system()
Browse files Browse the repository at this point in the history
  • Loading branch information
omaraflak committed Aug 28, 2023
1 parent e63183e commit 5dfdcf4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/banana_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,8 @@ TEST(Function, ParametersConversion) {
}

TEST(NATIVE, PRIMES) {
system("g++ ./external/prime.cpp -o ./external/prime.so -shared -fPIC");
std::vector<std::string> libs = {"./external/prime.so"};
EXPECT_EQ("541\n", exe("@native(\"math::prime\") long nthPrime(long n); print nthPrime(100);", libs));
EXPECT_EQ(system("g++ ./external/prime.cpp -o ./external/prime.so -shared -fPIC"), 0);
EXPECT_EQ("541\n", exe("@native(\"math::prime\") long nthPrime(long n); print nthPrime(100);", {"./external/prime.so"}));
}

TEST(FIBONACCI, RECURSION) {
Expand Down

0 comments on commit 5dfdcf4

Please sign in to comment.