wasm_exec_env_test.cc 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #include "test_helper.h"
  6. #include "gtest/gtest.h"
  7. #include "wasm_exec_env.h"
  8. class wasm_exec_env_test_suite : public testing::Test
  9. {
  10. protected:
  11. // You should make the members protected s.t. they can be
  12. // accessed from sub-classes.
  13. // virtual void SetUp() will be called before each test is run. You
  14. // should define it if you need to initialize the variables.
  15. // Otherwise, this can be skipped.
  16. virtual void SetUp() {}
  17. // virtual void TearDown() will be called after each test is run.
  18. // You should define it if there is cleanup work to do. Otherwise,
  19. // you don't have to provide it.
  20. //
  21. virtual void TearDown() {}
  22. };
  23. TEST_F(wasm_exec_env_test_suite, wasm_exec_env_create)
  24. {
  25. EXPECT_EQ(nullptr, wasm_exec_env_create(nullptr, 0));
  26. }
  27. TEST_F(wasm_exec_env_test_suite, wasm_exec_env_create_internal)
  28. {
  29. EXPECT_EQ(nullptr, wasm_exec_env_create_internal(nullptr, UINT32_MAX));
  30. }
  31. TEST_F(wasm_exec_env_test_suite, wasm_exec_env_pop_jmpbuf)
  32. {
  33. WASMExecEnv exec_env;
  34. exec_env.jmpbuf_stack_top = nullptr;
  35. EXPECT_EQ(nullptr, wasm_exec_env_pop_jmpbuf(&exec_env));
  36. }