Change in osmo-msc[master]: VLR tests: add logging macro with explicit value description

2018-12-18 Thread Max
Max has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12336 )

Change subject: VLR tests: add logging macro with explicit value description
..

VLR tests: add logging macro with explicit value description

To avoid leaking structure details into test we sometimes have to
separate value description from actual value. Introduce new macro which
makes that possible and convert old one into trivial wrapper around it.

Change-Id: Ic462297edac4c55689f93cc45771c8b5e2aed864
---
M tests/msc_vlr/msc_vlr_tests.h
1 file changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Max: Looks good to me, approved
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/tests/msc_vlr/msc_vlr_tests.h b/tests/msc_vlr/msc_vlr_tests.h
index f7ff940..7eb6d24 100644
--- a/tests/msc_vlr/msc_vlr_tests.h
+++ b/tests/msc_vlr/msc_vlr_tests.h
@@ -182,11 +182,13 @@
OSMO_ASSERT(accepted == expect_accepted); \
} while (false)

-#define VERBOSE_ASSERT(val, expect_op, fmt) \
+#define VAL_ASSERT(desc, val, expect_op, fmt)  \
do { \
-   log(#val " == " fmt, (val)); \
+   log(desc " == " fmt, (val)); \
OSMO_ASSERT((val) expect_op); \
-   } while (0);
+   } while (0)
+
+#define VERBOSE_ASSERT(val, expect_op, fmt) VAL_ASSERT(#val, val, expect_op, 
fmt)

 #define EXPECT_CONN_COUNT(N) VERBOSE_ASSERT(llist_count(>ran_conns), == 
N, "%d")


--
To view, visit https://gerrit.osmocom.org/12336
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic462297edac4c55689f93cc45771c8b5e2aed864
Gerrit-Change-Number: 12336
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 


Change in osmo-msc[master]: VLR tests: add logging macro with explicit value description

2018-12-18 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/12336 )

Change subject: VLR tests: add logging macro with explicit value description
..


Patch Set 2: Code-Review+2

Trivial rename from previous revision which got +2 already.


--
To view, visit https://gerrit.osmocom.org/12336
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic462297edac4c55689f93cc45771c8b5e2aed864
Gerrit-Change-Number: 12336
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Comment-Date: Tue, 18 Dec 2018 14:32:46 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: VLR tests: add logging macro with explicit value description

2018-12-18 Thread Max
Hello Stefan Sperling, Pau Espin Pedrol, Neels Hofmeyr, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/12336

to look at the new patch set (#2).

Change subject: VLR tests: add logging macro with explicit value description
..

VLR tests: add logging macro with explicit value description

To avoid leaking structure details into test we sometimes have to
separate value description from actual value. Introduce new macro which
makes that possible and convert old one into trivial wrapper around it.

Change-Id: Ic462297edac4c55689f93cc45771c8b5e2aed864
---
M tests/msc_vlr/msc_vlr_tests.h
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/36/12336/2
--
To view, visit https://gerrit.osmocom.org/12336
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic462297edac4c55689f93cc45771c8b5e2aed864
Gerrit-Change-Number: 12336
Gerrit-PatchSet: 2
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 


Change in osmo-msc[master]: VLR tests: add logging macro with explicit value description

2018-12-18 Thread Stefan Sperling
Stefan Sperling has posted comments on this change. ( 
https://gerrit.osmocom.org/12336 )

Change subject: VLR tests: add logging macro with explicit value description
..


Patch Set 1: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/12336/1/tests/msc_vlr/msc_vlr_tests.h
File tests/msc_vlr/msc_vlr_tests.h:

https://gerrit.osmocom.org/#/c/12336/1/tests/msc_vlr/msc_vlr_tests.h@185
PS1, Line 185: #define V_ASSERT(desc, val, expect_op, fmt)  \
Perhaps call this VAL_ASSERT instead of V_ASSERT? It's hard to tell the 
semantic difference between V_ and VERBOSE_; VAL_ and VERBOSE_ would be a 
clearer distinction.



--
To view, visit https://gerrit.osmocom.org/12336
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic462297edac4c55689f93cc45771c8b5e2aed864
Gerrit-Change-Number: 12336
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Comment-Date: Tue, 18 Dec 2018 11:11:47 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: VLR tests: add logging macro with explicit value description

2018-12-17 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/12336 )

Change subject: VLR tests: add logging macro with explicit value description
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/12336
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic462297edac4c55689f93cc45771c8b5e2aed864
Gerrit-Change-Number: 12336
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Comment-Date: Mon, 17 Dec 2018 17:44:19 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: VLR tests: add logging macro with explicit value description

2018-12-17 Thread Max
Max has uploaded this change for review. ( https://gerrit.osmocom.org/12336


Change subject: VLR tests: add logging macro with explicit value description
..

VLR tests: add logging macro with explicit value description

To avoid leaking structure details into test we sometimes have to
separate value description from actual value. Introduce new macro which
makes that possible and convert old one into trivial wrapper around it.

Change-Id: Ic462297edac4c55689f93cc45771c8b5e2aed864
---
M tests/msc_vlr/msc_vlr_tests.h
1 file changed, 5 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/36/12336/1

diff --git a/tests/msc_vlr/msc_vlr_tests.h b/tests/msc_vlr/msc_vlr_tests.h
index f7ff940..3629967 100644
--- a/tests/msc_vlr/msc_vlr_tests.h
+++ b/tests/msc_vlr/msc_vlr_tests.h
@@ -182,11 +182,13 @@
OSMO_ASSERT(accepted == expect_accepted); \
} while (false)

-#define VERBOSE_ASSERT(val, expect_op, fmt) \
+#define V_ASSERT(desc, val, expect_op, fmt)\
do { \
-   log(#val " == " fmt, (val)); \
+   log(desc " == " fmt, (val)); \
OSMO_ASSERT((val) expect_op); \
-   } while (0);
+   } while (0)
+
+#define VERBOSE_ASSERT(val, expect_op, fmt) V_ASSERT(#val, val, expect_op, fmt)

 #define EXPECT_CONN_COUNT(N) VERBOSE_ASSERT(llist_count(>ran_conns), == 
N, "%d")
 

--
To view, visit https://gerrit.osmocom.org/12336
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic462297edac4c55689f93cc45771c8b5e2aed864
Gerrit-Change-Number: 12336
Gerrit-PatchSet: 1
Gerrit-Owner: Max