OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "test/unittests/test-utils.h" |
| 6 |
| 7 #include "src/wasm/wasm-opcodes.h" |
| 8 |
| 9 namespace v8 { |
| 10 namespace internal { |
| 11 namespace wasm { |
| 12 |
| 13 class WasmOpcodesTest : public TestWithZone {}; |
| 14 |
| 15 TEST_F(WasmOpcodesTest, EveryOpcodeHasAName) { |
| 16 static const struct { |
| 17 WasmOpcode opcode; |
| 18 const char* debug_name; |
| 19 } kValues[] = { |
| 20 #define DECLARE_ELEMENT(name, opcode, sig) {kExpr##name, "kExpr" #name}, |
| 21 FOREACH_OPCODE(DECLARE_ELEMENT)}; |
| 22 |
| 23 for (size_t i = 0; i < arraysize(kValues); i++) { |
| 24 const char* result = WasmOpcodes::OpcodeName(kValues[i].opcode); |
| 25 if (strcmp("unknown", result) == 0) { |
| 26 EXPECT_TRUE(false) << "WasmOpcodes::OpcodeName(" << kValues[i].debug_name |
| 27 << ") == \"unknown\";" |
| 28 " plazz halp in src/wasm/wasm-opcodes.cc"; |
| 29 } |
| 30 } |
| 31 } |
| 32 } // namespace wasm |
| 33 } // namespace internal |
| 34 } // namespace v8 |
OLD | NEW |