mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add CallbackKind and use it for the SMT solver
This commit is contained in:
committed by
Alex Beregszaszi
parent
0201ff5a02
commit
ddc478e3e4
@@ -46,6 +46,9 @@ function solcjs_test
|
||||
printLog "Copying contracts..."
|
||||
cp -Rf $SOLCJS_INPUT_DIR/DAO test/
|
||||
|
||||
printLog "Copying SMTChecker tests..."
|
||||
cp -Rf "$TEST_DIR"/test/libsolidity/smtCheckerTests test/
|
||||
|
||||
run_install install_fn
|
||||
|
||||
# Update version (needed for some tests)
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <string>
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <libdevcore/JSON.h>
|
||||
#include <libsolidity/interface/ReadFile.h>
|
||||
#include <libsolidity/interface/Version.h>
|
||||
#include <libsolc/libsolc.h>
|
||||
|
||||
@@ -137,9 +138,10 @@ BOOST_AUTO_TEST_CASE(with_callback)
|
||||
)";
|
||||
|
||||
CStyleReadFileCallback callback{
|
||||
[](char const* _path, char** o_contents, char** o_error)
|
||||
[](char const* _kind, char const* _path, char** o_contents, char** o_error)
|
||||
{
|
||||
// Caller frees the pointers.
|
||||
BOOST_CHECK(string(_kind) == ReadCallback::kindString(ReadCallback::Kind::ReadFile));
|
||||
if (string(_path) == "found.sol")
|
||||
{
|
||||
static string content{"import \"missing.sol\"; contract B {}"};
|
||||
|
||||
Reference in New Issue
Block a user