From 9b8664daf17dac9efb1f4add9d00c562e4ddbf40 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sat, 1 Nov 2025 08:58:34 +0100 Subject: fix tests --- tests/administration_rw_tests.cpp | 12 ++---------- tests/test_helper.cpp | 35 ----------------------------------- 2 files changed, 2 insertions(+), 45 deletions(-) (limited to 'tests') diff --git a/tests/administration_rw_tests.cpp b/tests/administration_rw_tests.cpp index 794c12a..be52f5f 100644 --- a/tests/administration_rw_tests.cpp +++ b/tests/administration_rw_tests.cpp @@ -18,20 +18,13 @@ static void teardown_cb(void *data) { TEST _administration_rw_taxrate(void) { tax_rate pw; - tax_rate pr; u32 count; administration_writer::create(); administration::create_empty(test_file_path); { - pw = administration::tax_rate_create_empty(); - pw.rate = 10.0f; - pw.type = tax_rate_type::TAX_RATE_OUTGOING_INVOICE; - strops::copy(pw.internal_code, "NL/21", sizeof(pw.internal_code)); - strops::copy(pw.category_code, "S", sizeof(pw.category_code)); - strops::copy(pw.tax_sections[pw.tax_section_count++], "NL/1a", MAX_LEN_SHORT_DESC); - + administration::tax_rate_get_by_internal_code(&pw, "NL/21"); count = administration::tax_rate_count(); administration::tax_rate_enable(pw); @@ -41,8 +34,7 @@ TEST _administration_rw_taxrate(void) administration_reader::open_existing(test_file_path); { ASSERT_EQ(count+1, administration::tax_rate_count()); - ASSERT_EQ(A_ERR_SUCCESS, administration::tax_rate_get_by_internal_code(&pr, pw.internal_code)); - ASSERT_MEM_EQ(&pw, &pr, sizeof(tax_rate)); + ASSERT_EQ(A_ERR_SUCCESS, administration::tax_rate_is_enabled(pw)); } PASS(); diff --git a/tests/test_helper.cpp b/tests/test_helper.cpp index 980fe8c..c99bdd0 100644 --- a/tests/test_helper.cpp +++ b/tests/test_helper.cpp @@ -48,41 +48,6 @@ static contact _create_nl_consumer() return pw; } - -static billing_item _create_bi1() -{ - billing_item item = administration::billing_item_create_empty(); - item.amount = 1; - item.amount_is_percentage = 0; - strops::copy(item.description, "Shampoo", MAX_LEN_LONG_DESC); - item.net_per_item = 10.00f; - item.discount = 2.0f; - item.discount_is_percentage = 0; - - tax_rate rate; - administration::tax_rate_get_by_internal_code(&rate, "NL/21"); - strops::copy(item.tax_internal_code, rate.internal_code, MAX_LEN_SHORT_DESC); - - return item; -} - -static billing_item _create_bi2() -{ - billing_item item = administration::billing_item_create_empty(); - item.amount = 2; - item.amount_is_percentage = 0; - strops::copy(item.description, "Soap", MAX_LEN_LONG_DESC); - item.net_per_item = 5.00f; - item.discount = 5.0f; - item.discount_is_percentage = 1; - - tax_rate rate; - administration::tax_rate_get_by_internal_code(&rate, "NL/21"); - strops::copy(item.tax_internal_code, rate.internal_code, MAX_LEN_SHORT_DESC); - - return item; -} - static billing_item _create_bi3() { billing_item item = administration::billing_item_create_empty(); -- cgit v1.2.3-70-g09d2