OSDN Git Service

Workaround ASan false positive in RouteController.
[android-x86/system-netd.git] / server / IptablesBaseTest.h
index 11330c2..a8521b1 100644 (file)
@@ -22,13 +22,18 @@ class IptablesBaseTest : public ::testing::Test {
 public:
     IptablesBaseTest();
 
+    typedef std::vector<std::pair<IptablesTarget, std::string>> ExpectedIptablesCommands;
+
     static int fake_android_fork_exec(int argc, char* argv[], int *status, bool, bool);
+    static int fakeExecIptables(IptablesTarget target, ...);
     static int fakeExecIptablesRestore(IptablesTarget target, const std::string& commands);
     void expectIptablesCommands(const std::vector<std::string>& expectedCmds);
+    void expectIptablesCommands(const ExpectedIptablesCommands& expectedCmds);
     void expectIptablesRestoreCommands(const std::vector<std::string>& expectedCmds);
+    void expectIptablesRestoreCommands(const ExpectedIptablesCommands& expectedCmds);
 
 protected:
     static std::vector<std::string> sCmds;
-    static std::vector<std::string> sRestoreCmds;
+    static ExpectedIptablesCommands sRestoreCmds;
+    int expectIptablesCommand(IptablesTarget target, int pos, const std::string& cmd);
 };
-