Skip to content

Commit

Permalink
Ref AntelopeIO#99: Add test
Browse files Browse the repository at this point in the history
This test fails without the fix to issue AntelopeIO#99, and passes with it.
The failure is a bit odd -- it doesn't fail because cdt-cpp crashes;
rather, it fails because the crashed cdt-cpp did not output an abi
file and therefore it cannot match the golden record... But hey, it
does test the issue, just rather indirectly. =)
  • Loading branch information
nathanielhourt committed Mar 19, 2023
1 parent 347c4d3 commit 53fefe5
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
38 changes: 38 additions & 0 deletions tests/toolchain/abigen-pass/tagged_number_test.abi
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"____comment": "This file was generated with eosio-abigen. DO NOT EDIT ",
"version": "eosio::abi/1.2",
"types": [],
"structs": [
{
"name": "TaggedNumber_3472950412842106880",
"base": "",
"fields": [
{
"name": "value",
"type": "uint64"
}
]
},
{
"name": "test",
"base": "",
"fields": [
{
"name": "",
"type": "TaggedNumber_3472950412842106880"
}
]
}
],
"actions": [
{
"name": "test",
"type": "test",
"ricardian_contract": ""
}
],
"tables": [],
"ricardian_clauses": [],
"variants": [],
"action_results": []
}
17 changes: 17 additions & 0 deletions tests/toolchain/abigen-pass/tagged_number_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <eosio/eosio.hpp>

using namespace eosio;

template<uint64_t Tag>
struct TaggedNumber {
uint64_t value;
};

class [[eosio::contract]] tagged_number_test : public contract {
public:
using contract::contract;

[[eosio::action]]
void test(TaggedNumber<"a.tag"_n.value>) {
}
};
9 changes: 9 additions & 0 deletions tests/toolchain/abigen-pass/tagged_number_test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"tests" : [
{
"expected" : {
"abi-file" : "tagged_number_test.abi"
}
}
]
}

0 comments on commit 53fefe5

Please sign in to comment.