summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/administration_rw_tests.cpp26
-rw-r--r--tests/administration_validation_tests.cpp130
-rw-r--r--tests/test_helper.cpp62
3 files changed, 109 insertions, 109 deletions
diff --git a/tests/administration_rw_tests.cpp b/tests/administration_rw_tests.cpp
index 375fe0a..0bea1ce 100644
--- a/tests/administration_rw_tests.cpp
+++ b/tests/administration_rw_tests.cpp
@@ -26,9 +26,9 @@ TEST _administration_rw_taxrate(void)
administration_create_empty(test_file_path);
{
pw = administration_tax_rate_create_empty();
- strops_copy(pw.country_code, "NL", sizeof(pw.country_code));
+ strops::copy(pw.country_code, "NL", sizeof(pw.country_code));
pw.rate = 10.0f;
- strops_copy(pw.category_code, "S", sizeof(pw.category_code));
+ strops::copy(pw.category_code, "S", sizeof(pw.category_code));
count = administration_tax_rate_count();
administration_tax_rate_add(pw);
@@ -57,8 +57,8 @@ TEST _administration_rw_costcenter(void)
administration_create_empty(test_file_path);
{
pw = administration_cost_center_create_empty();
- strops_copy(pw.code, "CODE", sizeof(pw.code));
- strops_copy(pw.description, "Description", sizeof(pw.description));
+ strops::copy(pw.code, "CODE", sizeof(pw.code));
+ strops::copy(pw.description, "Description", sizeof(pw.description));
count = administration_cost_center_count();
administration_cost_center_add(pw);
@@ -87,7 +87,7 @@ TEST _administration_rw_project(void)
administration_create_empty(test_file_path);
{
pw = administration_project_create_empty();
- strops_copy(pw.description, "Test Project", sizeof(pw.description));
+ strops::copy(pw.description, "Test Project", sizeof(pw.description));
count = administration_project_count();
administration_project_add(pw);
@@ -115,12 +115,12 @@ TEST _administration_rw_contact(void)
administration_create_empty(test_file_path);
{
pw = administration_contact_create_empty();
- strops_copy(pw.name, "John Johnsson", sizeof(pw.name));
- strops_copy(pw.address.address1, "Address 1", sizeof(pw.address.address1));
- strops_copy(pw.address.country_code, "FR", sizeof(pw.address.country_code));
- strops_copy(pw.address.city, "Paris", sizeof(pw.address.city));
- strops_copy(pw.address.postal, "12345", sizeof(pw.address.postal));
- strops_copy(pw.email, "test@test.com", sizeof(pw.email));
+ strops::copy(pw.name, "John Johnsson", sizeof(pw.name));
+ strops::copy(pw.address.address1, "Address 1", sizeof(pw.address.address1));
+ strops::copy(pw.address.country_code, "FR", sizeof(pw.address.country_code));
+ strops::copy(pw.address.city, "Paris", sizeof(pw.address.city));
+ strops::copy(pw.address.postal, "12345", sizeof(pw.address.postal));
+ strops::copy(pw.email, "test@test.com", sizeof(pw.email));
pw.type = contact_type::CONTACT_CONSUMER;
count = administration_contact_count();
@@ -152,7 +152,7 @@ TEST _administration_rw_info(void)
ai_service ss = {0};
ss.provider = AI_PROVIDER_OPENAI;
- strops_copy(ss.api_key_public, "123", sizeof(ss.api_key_public));
+ strops::copy(ss.api_key_public, "123", sizeof(ss.api_key_public));
administration_set_ai_service(ss);
ais = administration_get_ai_service();
@@ -327,7 +327,7 @@ TEST _administration_rw_b2b2c_invoice(void)
inv = administration_invoice_create_empty();
inv.supplier = _create_nl_business();
inv.customer = _create_nl_business();
- strops_copy(inv.addressee.name, "Piet Pinda", sizeof(inv.addressee.name));
+ strops::copy(inv.addressee.name, "Piet Pinda", sizeof(inv.addressee.name));
inv.addressee.address = _create_nl_consumer().address;
inv.is_triangulation = 1;
inv.is_outgoing = 1;
diff --git a/tests/administration_validation_tests.cpp b/tests/administration_validation_tests.cpp
index f406efd..3803469 100644
--- a/tests/administration_validation_tests.cpp
+++ b/tests/administration_validation_tests.cpp
@@ -8,7 +8,7 @@ TEST _administration_validate_project_add(void)
ASSERT_EQ(administration_project_add(p1), A_ERR_MISSING_DESCRIPTION);
- strops_copy(p1.description, "test project", sizeof(p1.description));
+ strops::copy(p1.description, "test project", sizeof(p1.description));
ASSERT_EQ(administration_project_add(p1), A_ERR_SUCCESS);
PASS();
@@ -21,7 +21,7 @@ TEST _administration_validate_project_import(void)
ASSERT_EQ(administration_project_import(p1), A_ERR_MISSING_DESCRIPTION);
- strops_copy(p1.description, "test project", sizeof(p1.description));
+ strops::copy(p1.description, "test project", sizeof(p1.description));
ASSERT_EQ(administration_project_import(p1), A_ERR_SUCCESS);
PASS();
@@ -33,15 +33,15 @@ TEST _administration_validate_project_update(void)
administration_create_empty("");
project p1 = administration_project_create_empty();
- strops_copy(p1.description, "test project", sizeof(p1.description));
+ strops::copy(p1.description, "test project", sizeof(p1.description));
ASSERT_EQ(administration_project_add(p1), A_ERR_SUCCESS);
ASSERT_EQ(administration_project_update(p1), A_ERR_SUCCESS);
- strops_copy(p1.description, "", sizeof(p1.description));
+ strops::copy(p1.description, "", sizeof(p1.description));
ASSERT_EQ(administration_project_update(p1), A_ERR_MISSING_DESCRIPTION);
- strops_copy(p1.id, "-1", sizeof(p1.id));
- strops_copy(p1.description, "test project 2", sizeof(p1.description));
+ strops::copy(p1.id, "-1", sizeof(p1.id));
+ strops::copy(p1.description, "test project 2", sizeof(p1.description));
ASSERT_EQ(administration_project_update(p1), A_ERR_NOT_FOUND);
PASS();
@@ -52,13 +52,13 @@ TEST _administration_validate_project_remove(void)
administration_create_empty("");
project p1 = administration_project_create_empty();
- strops_copy(p1.description, "test project", sizeof(p1.description));
+ strops::copy(p1.description, "test project", sizeof(p1.description));
ASSERT_EQ(administration_project_add(p1), A_ERR_SUCCESS);
ASSERT_EQ(administration_project_remove(p1), A_ERR_SUCCESS);
ASSERT_EQ(administration_project_add(p1), A_ERR_SUCCESS);
- strops_copy(p1.id, "-1", sizeof(p1.id));
+ strops::copy(p1.id, "-1", sizeof(p1.id));
ASSERT_EQ(administration_project_remove(p1), A_ERR_NOT_FOUND);
PASS();
@@ -71,7 +71,7 @@ TEST _administration_validate_project_isvalid(void)
ASSERT_EQ(administration_project_is_valid(p1), A_ERR_MISSING_DESCRIPTION);
- strops_copy(p1.description, "test project", sizeof(p1.description));
+ strops::copy(p1.description, "test project", sizeof(p1.description));
ASSERT_EQ(administration_project_is_valid(p1), A_ERR_SUCCESS);
PASS();
@@ -108,7 +108,7 @@ TEST _administration_validate_taxrate_update(void)
ASSERT_EQ(administration_tax_rate_add(p1), A_ERR_SUCCESS);
ASSERT_EQ(administration_tax_rate_update(p1), A_ERR_SUCCESS);
- strops_copy(p1.id, "-1", sizeof(p1.id));
+ strops::copy(p1.id, "-1", sizeof(p1.id));
ASSERT_EQ(administration_tax_rate_update(p1), A_ERR_NOT_FOUND);
PASS();
@@ -120,14 +120,14 @@ TEST _administration_validate_costcenter_add(void)
{
administration_create_empty("");
cost_center p1 = administration_cost_center_create_empty();
- strops_copy(p1.code, "TEST", sizeof(p1.code));
- strops_copy(p1.description, "description", sizeof(p1.description));
+ strops::copy(p1.code, "TEST", sizeof(p1.code));
+ strops::copy(p1.description, "description", sizeof(p1.description));
ASSERT_EQ(administration_cost_center_add(p1), A_ERR_SUCCESS);
ASSERT_EQ(administration_cost_center_add(p1), A_ERR_CODE_EXISTS);
- strops_copy(p1.code, "", sizeof(p1.code));
+ strops::copy(p1.code, "", sizeof(p1.code));
ASSERT_EQ(administration_cost_center_add(p1), A_ERR_MISSING_CODE);
- strops_copy(p1.description, "", sizeof(p1.description));
+ strops::copy(p1.description, "", sizeof(p1.description));
ASSERT_EQ(administration_cost_center_add(p1), A_ERR_MISSING_CODE|A_ERR_MISSING_DESCRIPTION);
PASS();
@@ -137,14 +137,14 @@ TEST _administration_validate_costcenter_import(void)
{
administration_create_empty("");
cost_center p1 = administration_cost_center_create_empty();
- strops_copy(p1.code, "TEST", sizeof(p1.code));
- strops_copy(p1.description, "description", sizeof(p1.description));
+ strops::copy(p1.code, "TEST", sizeof(p1.code));
+ strops::copy(p1.description, "description", sizeof(p1.description));
ASSERT_EQ(administration_cost_center_import(p1), A_ERR_SUCCESS);
ASSERT_EQ(administration_cost_center_import(p1), A_ERR_CODE_EXISTS);
- strops_copy(p1.code, "", sizeof(p1.code));
+ strops::copy(p1.code, "", sizeof(p1.code));
ASSERT_EQ(administration_cost_center_import(p1), A_ERR_MISSING_CODE);
- strops_copy(p1.description, "", sizeof(p1.description));
+ strops::copy(p1.description, "", sizeof(p1.description));
ASSERT_EQ(administration_cost_center_import(p1), A_ERR_MISSING_CODE|A_ERR_MISSING_DESCRIPTION);
PASS();
@@ -155,19 +155,19 @@ TEST _administration_validate_costcenter_update(void)
{
administration_create_empty("");
cost_center p1 = administration_cost_center_create_empty();
- strops_copy(p1.code, "TEST", sizeof(p1.code));
- strops_copy(p1.description, "description", sizeof(p1.description));
+ strops::copy(p1.code, "TEST", sizeof(p1.code));
+ strops::copy(p1.description, "description", sizeof(p1.description));
ASSERT_EQ(administration_cost_center_add(p1), A_ERR_SUCCESS);
ASSERT_EQ(administration_cost_center_update(p1), A_ERR_SUCCESS);
- strops_copy(p1.code, "", sizeof(p1.code));
+ strops::copy(p1.code, "", sizeof(p1.code));
ASSERT_EQ(administration_cost_center_update(p1), A_ERR_MISSING_CODE);
- strops_copy(p1.description, "", sizeof(p1.description));
+ strops::copy(p1.description, "", sizeof(p1.description));
ASSERT_EQ(administration_cost_center_update(p1), A_ERR_MISSING_CODE|A_ERR_MISSING_DESCRIPTION);
- strops_copy(p1.id, "-1", sizeof(p1.id));
- strops_copy(p1.code, "TEST", sizeof(p1.code));
- strops_copy(p1.description, "description", sizeof(p1.description));
+ strops::copy(p1.id, "-1", sizeof(p1.id));
+ strops::copy(p1.code, "TEST", sizeof(p1.code));
+ strops::copy(p1.description, "description", sizeof(p1.description));
ASSERT_EQ(administration_cost_center_update(p1), A_ERR_NOT_FOUND);
PASS();
@@ -177,20 +177,20 @@ TEST _administration_validate_costcenter_isvalid(void)
{
administration_create_empty("");
cost_center p1 = administration_cost_center_create_empty();
- strops_copy(p1.code, "TEST", sizeof(p1.code));
- strops_copy(p1.description, "description", sizeof(p1.description));
+ strops::copy(p1.code, "TEST", sizeof(p1.code));
+ strops::copy(p1.description, "description", sizeof(p1.description));
ASSERT_EQ(administration_cost_center_is_valid(p1), A_ERR_SUCCESS);
- strops_copy(p1.code, "", sizeof(p1.code));
+ strops::copy(p1.code, "", sizeof(p1.code));
ASSERT_EQ(administration_cost_center_is_valid(p1), A_ERR_MISSING_CODE);
- strops_copy(p1.code, "", sizeof(p1.code));
- strops_copy(p1.description, "", sizeof(p1.description));
+ strops::copy(p1.code, "", sizeof(p1.code));
+ strops::copy(p1.description, "", sizeof(p1.description));
ASSERT_EQ(administration_cost_center_is_valid(p1), A_ERR_MISSING_CODE|A_ERR_MISSING_DESCRIPTION);
- strops_copy(p1.code, "TEST", sizeof(p1.code));
- strops_copy(p1.description, "description", sizeof(p1.description));
+ strops::copy(p1.code, "TEST", sizeof(p1.code));
+ strops::copy(p1.description, "description", sizeof(p1.description));
ASSERT_EQ(administration_cost_center_add(p1), A_ERR_SUCCESS);
ASSERT_EQ(administration_cost_center_is_valid(p1), A_ERR_CODE_EXISTS);
@@ -203,12 +203,12 @@ TEST _administration_validate_costcenter_isvalid(void)
contact _create_test_contact()
{
contact p1 = administration_contact_create_empty();
- strops_copy(p1.name, "John Johnsson", sizeof(p1.name));
- strops_copy(p1.address.address1, "Address 1", sizeof(p1.address.address1));
- strops_copy(p1.address.country_code, "FR", sizeof(p1.address.country_code));
- strops_copy(p1.address.city, "Paris", sizeof(p1.address.city));
- strops_copy(p1.address.postal, "12345", sizeof(p1.address.postal));
- strops_copy(p1.email, "test@test.com", sizeof(p1.email));
+ strops::copy(p1.name, "John Johnsson", sizeof(p1.name));
+ strops::copy(p1.address.address1, "Address 1", sizeof(p1.address.address1));
+ strops::copy(p1.address.country_code, "FR", sizeof(p1.address.country_code));
+ strops::copy(p1.address.city, "Paris", sizeof(p1.address.city));
+ strops::copy(p1.address.postal, "12345", sizeof(p1.address.postal));
+ strops::copy(p1.email, "test@test.com", sizeof(p1.email));
p1.type = contact_type::CONTACT_CONSUMER;
return p1;
}
@@ -220,15 +220,15 @@ TEST _administration_validate_contact_add(void)
ASSERT_EQ(administration_contact_add(p1), A_ERR_SUCCESS);
- strops_copy(p1.name, "", sizeof(p1.name));
+ strops::copy(p1.name, "", sizeof(p1.name));
ASSERT_EQ(administration_contact_add(p1), A_ERR_MISSING_NAME);
- strops_copy(p1.address.address1, "", sizeof(p1.address.address1));
+ strops::copy(p1.address.address1, "", sizeof(p1.address.address1));
ASSERT_EQ(administration_contact_add(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1);
- strops_copy(p1.address.city, "", sizeof(p1.address.city));
+ strops::copy(p1.address.city, "", sizeof(p1.address.city));
ASSERT_EQ(administration_contact_add(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY);
- strops_copy(p1.address.postal, "", sizeof(p1.address.postal));
+ strops::copy(p1.address.postal, "", sizeof(p1.address.postal));
ASSERT_EQ(administration_contact_add(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|A_ERR_MISSING_POSTAL);
- strops_copy(p1.address.country_code, "", sizeof(p1.address.country_code));
+ strops::copy(p1.address.country_code, "", sizeof(p1.address.country_code));
ASSERT_EQ(administration_contact_add(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|A_ERR_MISSING_POSTAL|A_ERR_MISSING_COUNTRYCODE);
p1.type = contact_type::CONTACT_BUSINESS;
@@ -246,15 +246,15 @@ TEST _administration_validate_contact_import(void)
ASSERT_EQ(administration_contact_import(p1), A_ERR_SUCCESS);
- strops_copy(p1.name, "", sizeof(p1.name));
+ strops::copy(p1.name, "", sizeof(p1.name));
ASSERT_EQ(administration_contact_import(p1), A_ERR_MISSING_NAME);
- strops_copy(p1.address.address1, "", sizeof(p1.address.address1));
+ strops::copy(p1.address.address1, "", sizeof(p1.address.address1));
ASSERT_EQ(administration_contact_import(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1);
- strops_copy(p1.address.city, "", sizeof(p1.address.city));
+ strops::copy(p1.address.city, "", sizeof(p1.address.city));
ASSERT_EQ(administration_contact_import(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY);
- strops_copy(p1.address.postal, "", sizeof(p1.address.postal));
+ strops::copy(p1.address.postal, "", sizeof(p1.address.postal));
ASSERT_EQ(administration_contact_import(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|A_ERR_MISSING_POSTAL);
- strops_copy(p1.address.country_code, "", sizeof(p1.address.country_code));
+ strops::copy(p1.address.country_code, "", sizeof(p1.address.country_code));
ASSERT_EQ(administration_contact_import(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|A_ERR_MISSING_POSTAL|A_ERR_MISSING_COUNTRYCODE);
p1.type = contact_type::CONTACT_BUSINESS;
@@ -273,27 +273,27 @@ TEST _administration_validate_contact_update(void)
ASSERT_EQ(administration_contact_add(p1), A_ERR_SUCCESS);
ASSERT_EQ(administration_contact_update(p1), A_ERR_SUCCESS);
- strops_copy(p1.name, "", sizeof(p1.name));
+ strops::copy(p1.name, "", sizeof(p1.name));
ASSERT_EQ(administration_contact_update(p1), A_ERR_MISSING_NAME);
- strops_copy(p1.address.address1, "", sizeof(p1.address.address1));
+ strops::copy(p1.address.address1, "", sizeof(p1.address.address1));
ASSERT_EQ(administration_contact_update(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1);
- strops_copy(p1.address.city, "", sizeof(p1.address.city));
+ strops::copy(p1.address.city, "", sizeof(p1.address.city));
ASSERT_EQ(administration_contact_update(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY);
- strops_copy(p1.address.postal, "", sizeof(p1.address.postal));
+ strops::copy(p1.address.postal, "", sizeof(p1.address.postal));
ASSERT_EQ(administration_contact_update(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|A_ERR_MISSING_POSTAL);
- strops_copy(p1.address.country_code, "", sizeof(p1.address.country_code));
+ strops::copy(p1.address.country_code, "", sizeof(p1.address.country_code));
ASSERT_EQ(administration_contact_update(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|A_ERR_MISSING_POSTAL|A_ERR_MISSING_COUNTRYCODE);
p1.type = contact_type::CONTACT_BUSINESS;
ASSERT_EQ(administration_contact_update(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|
A_ERR_MISSING_POSTAL|A_ERR_MISSING_COUNTRYCODE|A_ERR_MISSING_TAXID|A_ERR_MISSING_BUSINESSID);
- strops_copy(p1.id, "-1", sizeof(p1.id));
- strops_copy(p1.name, "John Johnsson", sizeof(p1.name));
- strops_copy(p1.address.address1, "Address 1", sizeof(p1.address.address1));
- strops_copy(p1.address.country_code, "FR", sizeof(p1.address.country_code));
- strops_copy(p1.address.city, "Paris", sizeof(p1.address.city));
- strops_copy(p1.address.postal, "12345", sizeof(p1.address.postal));
+ strops::copy(p1.id, "-1", sizeof(p1.id));
+ strops::copy(p1.name, "John Johnsson", sizeof(p1.name));
+ strops::copy(p1.address.address1, "Address 1", sizeof(p1.address.address1));
+ strops::copy(p1.address.country_code, "FR", sizeof(p1.address.country_code));
+ strops::copy(p1.address.city, "Paris", sizeof(p1.address.city));
+ strops::copy(p1.address.postal, "12345", sizeof(p1.address.postal));
p1.type = contact_type::CONTACT_CONSUMER;
ASSERT_EQ(administration_contact_update(p1), A_ERR_NOT_FOUND);
@@ -310,7 +310,7 @@ TEST _administration_validate_contact_remove(void)
ASSERT_EQ(administration_contact_remove(p1), A_ERR_SUCCESS);
ASSERT_EQ(administration_contact_add(p1), A_ERR_SUCCESS);
- strops_copy(p1.id, "-1", sizeof(p1.id));
+ strops::copy(p1.id, "-1", sizeof(p1.id));
ASSERT_EQ(administration_contact_remove(p1), A_ERR_NOT_FOUND);
PASS();
@@ -324,15 +324,15 @@ TEST _administration_validate_contact_isvalid(void)
ASSERT_EQ(administration_contact_is_valid(p1), A_ERR_SUCCESS);
ASSERT_EQ(administration_contact_is_valid(p1), A_ERR_SUCCESS);
- strops_copy(p1.name, "", sizeof(p1.name));
+ strops::copy(p1.name, "", sizeof(p1.name));
ASSERT_EQ(administration_contact_is_valid(p1), A_ERR_MISSING_NAME);
- strops_copy(p1.address.address1, "", sizeof(p1.address.address1));
+ strops::copy(p1.address.address1, "", sizeof(p1.address.address1));
ASSERT_EQ(administration_contact_is_valid(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1);
- strops_copy(p1.address.city, "", sizeof(p1.address.city));
+ strops::copy(p1.address.city, "", sizeof(p1.address.city));
ASSERT_EQ(administration_contact_is_valid(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY);
- strops_copy(p1.address.postal, "", sizeof(p1.address.postal));
+ strops::copy(p1.address.postal, "", sizeof(p1.address.postal));
ASSERT_EQ(administration_contact_is_valid(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|A_ERR_MISSING_POSTAL);
- strops_copy(p1.address.country_code, "", sizeof(p1.address.country_code));
+ strops::copy(p1.address.country_code, "", sizeof(p1.address.country_code));
ASSERT_EQ(administration_contact_is_valid(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|A_ERR_MISSING_POSTAL|A_ERR_MISSING_COUNTRYCODE);
p1.type = contact_type::CONTACT_BUSINESS;
diff --git a/tests/test_helper.cpp b/tests/test_helper.cpp
index aedaccc..38aa655 100644
--- a/tests/test_helper.cpp
+++ b/tests/test_helper.cpp
@@ -22,17 +22,17 @@ char* extract_dir = "build\\extracted";
static contact _create_nl_business()
{
contact pw = administration_contact_create_empty();
- strops_copy(pw.name, "Dutch Company BV", sizeof(pw.name));
- strops_copy(pw.address.address1, "Address 1", sizeof(pw.address.address1));
- strops_copy(pw.address.country_code, "NL", sizeof(pw.address.country_code));
- strops_copy(pw.address.city, "Amsterdam", sizeof(pw.address.city));
- strops_copy(pw.address.region, "Noord-Holland", sizeof(pw.address.region));
- strops_copy(pw.address.postal, "1234AA", sizeof(pw.address.postal));
- strops_copy(pw.taxid, "T123", sizeof(pw.taxid));
- strops_copy(pw.businessid, "B321", sizeof(pw.businessid));
- strops_copy(pw.email, "test@test.com", sizeof(pw.email));
- strops_copy(pw.phone_number, "+311234567", sizeof(pw.phone_number));
- strops_copy(pw.bank_account, "IBAN123456789", sizeof(pw.bank_account));
+ strops::copy(pw.name, "Dutch Company BV", sizeof(pw.name));
+ strops::copy(pw.address.address1, "Address 1", sizeof(pw.address.address1));
+ strops::copy(pw.address.country_code, "NL", sizeof(pw.address.country_code));
+ strops::copy(pw.address.city, "Amsterdam", sizeof(pw.address.city));
+ strops::copy(pw.address.region, "Noord-Holland", sizeof(pw.address.region));
+ strops::copy(pw.address.postal, "1234AA", sizeof(pw.address.postal));
+ strops::copy(pw.taxid, "T123", sizeof(pw.taxid));
+ strops::copy(pw.businessid, "B321", sizeof(pw.businessid));
+ strops::copy(pw.email, "test@test.com", sizeof(pw.email));
+ strops::copy(pw.phone_number, "+311234567", sizeof(pw.phone_number));
+ strops::copy(pw.bank_account, "IBAN123456789", sizeof(pw.bank_account));
pw.type = contact_type::CONTACT_BUSINESS;
return pw;
}
@@ -40,14 +40,14 @@ static contact _create_nl_business()
static contact _create_nl_consumer()
{
contact pw = administration_contact_create_empty();
- strops_copy(pw.name, "Piet Pinda", sizeof(pw.name));
- strops_copy(pw.address.address1, "Address 2", sizeof(pw.address.address1));
- strops_copy(pw.address.country_code, "NL", sizeof(pw.address.country_code));
- strops_copy(pw.address.city, "Maastricht", sizeof(pw.address.city));
- strops_copy(pw.address.region, "Limburg", sizeof(pw.address.region));
- strops_copy(pw.address.postal, "4321AA", sizeof(pw.address.postal));
- strops_copy(pw.email, "test@test.com", sizeof(pw.email));
- strops_copy(pw.phone_number, "+317654321", sizeof(pw.phone_number));
+ strops::copy(pw.name, "Piet Pinda", sizeof(pw.name));
+ strops::copy(pw.address.address1, "Address 2", sizeof(pw.address.address1));
+ strops::copy(pw.address.country_code, "NL", sizeof(pw.address.country_code));
+ strops::copy(pw.address.city, "Maastricht", sizeof(pw.address.city));
+ strops::copy(pw.address.region, "Limburg", sizeof(pw.address.region));
+ strops::copy(pw.address.postal, "4321AA", sizeof(pw.address.postal));
+ strops::copy(pw.email, "test@test.com", sizeof(pw.email));
+ strops::copy(pw.phone_number, "+317654321", sizeof(pw.phone_number));
pw.type = contact_type::CONTACT_CONSUMER;
return pw;
}
@@ -58,7 +58,7 @@ static billing_item _create_bi1(invoice *inv)
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);
+ strops::copy(item.description, "Shampoo", MAX_LEN_LONG_DESC);
item.net_per_item = 10.00f;
item.discount = 2.0f;
item.discount_is_percentage = 0;
@@ -67,7 +67,7 @@ static billing_item _create_bi1(invoice *inv)
char* _country_codes[2] = {inv->supplier.address.country_code, inv->customer.address.country_code};
u32 tax_rate_count = administration_tax_rate_get_by_country(buffer, 2, _country_codes);
tax_rate rand_rate = buffer[tax_rate_count-1];
- strops_copy(item.tax_rate_id, rand_rate.id, MAX_LEN_ID);
+ strops::copy(item.tax_rate_id, rand_rate.id, MAX_LEN_ID);
return item;
}
@@ -77,7 +77,7 @@ static billing_item _create_bi2(invoice *inv)
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);
+ strops::copy(item.description, "Soap", MAX_LEN_LONG_DESC);
item.net_per_item = 5.00f;
item.discount = 5.0f;
item.discount_is_percentage = 1;
@@ -86,7 +86,7 @@ static billing_item _create_bi2(invoice *inv)
char* _country_codes[2] = {inv->supplier.address.country_code, inv->customer.address.country_code};
u32 tax_rate_count = administration_tax_rate_get_by_country(buffer, 2, _country_codes);
tax_rate rand_rate = buffer[tax_rate_count-1];
- strops_copy(item.tax_rate_id, rand_rate.id, MAX_LEN_ID);
+ strops::copy(item.tax_rate_id, rand_rate.id, MAX_LEN_ID);
return item;
}
@@ -96,7 +96,7 @@ static billing_item _create_bi3(invoice *inv)
billing_item item = administration_billing_item_create_empty();
item.amount = 1;
item.amount_is_percentage = 0;
- strops_copy(item.description, "Guacamole", MAX_LEN_LONG_DESC);
+ strops::copy(item.description, "Guacamole", MAX_LEN_LONG_DESC);
item.net_per_item = 10.00f;
item.discount = 2.0f;
item.discount_is_percentage = 0;
@@ -105,7 +105,7 @@ static billing_item _create_bi3(invoice *inv)
char* _country_codes[2] = {inv->supplier.address.country_code, inv->customer.address.country_code};
u32 tax_rate_count = administration_tax_rate_get_by_country(buffer, 2, _country_codes);
tax_rate rand_rate = buffer[tax_rate_count-1];
- strops_copy(item.tax_rate_id, rand_rate.id, MAX_LEN_ID);
+ strops::copy(item.tax_rate_id, rand_rate.id, MAX_LEN_ID);
return item;
}
@@ -115,7 +115,7 @@ static billing_item _create_bi4(invoice *inv)
billing_item item = administration_billing_item_create_empty();
item.amount = 3;
item.amount_is_percentage = 0;
- strops_copy(item.description, "Bananas", MAX_LEN_LONG_DESC);
+ strops::copy(item.description, "Bananas", MAX_LEN_LONG_DESC);
item.net_per_item = 4.00f;
item.discount = 0.0f;
item.discount_is_percentage = 0;
@@ -124,7 +124,7 @@ static billing_item _create_bi4(invoice *inv)
char* _country_codes[2] = {inv->supplier.address.country_code, inv->customer.address.country_code};
u32 tax_rate_count = administration_tax_rate_get_by_country(buffer, 2, _country_codes);
tax_rate rand_rate = buffer[tax_rate_count-1];
- strops_copy(item.tax_rate_id, rand_rate.id, MAX_LEN_ID);
+ strops::copy(item.tax_rate_id, rand_rate.id, MAX_LEN_ID);
return item;
}
@@ -134,7 +134,7 @@ static billing_item _create_bi5(invoice *inv)
billing_item item = administration_billing_item_create_empty();
item.amount = 5;
item.amount_is_percentage = 0;
- strops_copy(item.description, "Apple", MAX_LEN_LONG_DESC);
+ strops::copy(item.description, "Apple", MAX_LEN_LONG_DESC);
item.net_per_item = 1.00f;
item.discount = 5.0f;
item.discount_is_percentage = 1;
@@ -143,7 +143,7 @@ static billing_item _create_bi5(invoice *inv)
char* _country_codes[2] = {inv->supplier.address.country_code, inv->customer.address.country_code};
u32 tax_rate_count = administration_tax_rate_get_by_country(buffer, 2, _country_codes);
tax_rate rand_rate = buffer[tax_rate_count-1];
- strops_copy(item.tax_rate_id, rand_rate.id, MAX_LEN_ID);
+ strops::copy(item.tax_rate_id, rand_rate.id, MAX_LEN_ID);
return item;
}
@@ -153,7 +153,7 @@ static billing_item _create_bi6(invoice *inv)
billing_item item = administration_billing_item_create_empty();
item.amount = 10;
item.amount_is_percentage = 1;
- strops_copy(item.description, "Tip", MAX_LEN_LONG_DESC);
+ strops::copy(item.description, "Tip", MAX_LEN_LONG_DESC);
item.net_per_item = 50.00f;
item.discount = 0.0f;
item.discount_is_percentage = 0;
@@ -162,7 +162,7 @@ static billing_item _create_bi6(invoice *inv)
char* _country_codes[2] = {inv->supplier.address.country_code, inv->customer.address.country_code};
u32 tax_rate_count = administration_tax_rate_get_by_country(buffer, 2, _country_codes);
tax_rate rand_rate = buffer[tax_rate_count-1];
- strops_copy(item.tax_rate_id, rand_rate.id, MAX_LEN_ID);
+ strops::copy(item.tax_rate_id, rand_rate.id, MAX_LEN_ID);
return item;
}