From: Paul Moore <[email protected]>

Signed-off-by: Paul Moore <[email protected]>
---
 tests/16-sim-arch_basic.c  |   15 +++++++++++++++
 tests/16-sim-arch_basic.py |    4 ++++
 2 files changed, 19 insertions(+)

diff --git a/tests/16-sim-arch_basic.c b/tests/16-sim-arch_basic.c
index df89aa3f..02c55d65 100644
--- a/tests/16-sim-arch_basic.c
+++ b/tests/16-sim-arch_basic.c
@@ -40,6 +40,21 @@ int main(int argc, char *argv[])
        if (ctx == NULL)
                return ENOMEM;
 
+       /* NOTE: not strictly necessary since we get the native arch by default
+        *       but it serves as a good sanity check for the code and boosts
+        *       our code coverage numbers */
+       rc = seccomp_arch_exist(ctx, seccomp_arch_native());
+       if (rc != 0)
+               goto out;
+
+       rc = seccomp_arch_remove(ctx, SCMP_ARCH_NATIVE);
+       if (rc != 0)
+               goto out;
+
+       /* NOTE: more sanity/coverage tests (see above) */
+       rc = seccomp_arch_add(ctx, SCMP_ARCH_NATIVE);
+       if (rc != 0)
+               goto out;
        rc = seccomp_arch_remove(ctx, SCMP_ARCH_NATIVE);
        if (rc != 0)
                goto out;
diff --git a/tests/16-sim-arch_basic.py b/tests/16-sim-arch_basic.py
index 1bf92d69..7d7a05f9 100755
--- a/tests/16-sim-arch_basic.py
+++ b/tests/16-sim-arch_basic.py
@@ -30,6 +30,10 @@ from seccomp import *
 
 def test(args):
     f = SyscallFilter(KILL)
+    # NOTE: some of these arch functions are not strictly necessary, but are
+    #       here for test sanity/coverage
+    f.remove_arch(Arch())
+    f.add_arch(Arch())
     f.remove_arch(Arch())
     f.add_arch(Arch("x86"))
     f.add_arch(Arch("x86_64"))

-- 
You received this message because you are subscribed to the Google Groups 
"libseccomp" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to