summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/administration_rw_tests.cpp (renamed from tests/run_tests.cpp)25
1 files changed, 13 insertions, 12 deletions
diff --git a/tests/run_tests.cpp b/tests/administration_rw_tests.cpp
index e9092a6..6d57596 100644
--- a/tests/run_tests.cpp
+++ b/tests/administration_rw_tests.cpp
@@ -47,10 +47,7 @@ TEST _administration_rw_taxbracket(void)
{
ASSERT_EQ(count+1, administration_tax_bracket_count());
ASSERT_EQ(1, administration_tax_bracket_get_by_id(&pr, pw.id));
- ASSERT_STR_EQ(pr.id, pw.id);
- ASSERT_STR_EQ(pr.country_code, pw.country_code);
- ASSERT_STR_EQ(pr.category_code, pw.category_code);
- ASSERT_EQ(pr.rate, pw.rate);
+ ASSERT_MEM_EQ(&pw, &pr, sizeof(country_tax_bracket));
}
PASS();
@@ -80,9 +77,7 @@ TEST _administration_rw_costcenter(void)
{
ASSERT_EQ(count+1, administration_cost_center_count());
ASSERT_EQ(1, administration_cost_center_get_by_id(&pr, pw.id));
- ASSERT_STR_EQ(pr.id, pw.id);
- ASSERT_STR_EQ(pr.code, pw.code);
- ASSERT_STR_EQ(pr.description, pw.description);
+ ASSERT_MEM_EQ(&pw, &pr, sizeof(cost_center));
}
PASS();
@@ -110,8 +105,7 @@ TEST _administration_rw_project(void)
{
ASSERT_EQ(count+1, administration_project_count());
ASSERT_EQ(1, administration_project_get_by_id(&pr, pw.id));
- ASSERT_STR_EQ(pr.id, pw.id);
- ASSERT_STR_EQ(pr.description, pw.description);
+ ASSERT_MEM_EQ(&pw, &pr, sizeof(project));
}
PASS();
@@ -128,6 +122,13 @@ 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));
+ pw.type = contact_type::CONTACT_CONSUMER;
+
count = administration_contact_count();
administration_contact_add(pw);
@@ -138,13 +139,13 @@ TEST _administration_rw_contact(void)
{
ASSERT_EQ(count+1, administration_contact_count());
ASSERT_EQ(1, administration_contact_get_by_id(&pr, pw.id));
- ASSERT_STR_EQ(pr.id, pw.id);
+ ASSERT_MEM_EQ(&pw, &pr, sizeof(contact));
}
PASS();
}
-SUITE(administration_io) {
+SUITE(administration_rw) {
SET_SETUP(setup_cb, NULL);
SET_TEARDOWN(teardown_cb, NULL);
@@ -159,6 +160,6 @@ int main(int argc, char **argv) {
timer_lib_initialize();
GREATEST_MAIN_BEGIN();
- RUN_SUITE(administration_io);
+ RUN_SUITE(administration_rw);
GREATEST_MAIN_END();
} \ No newline at end of file