Skip to content

Add unit test for swssnet.h#82

Merged
stcheng merged 4 commits intosonic-net:masterfrom
qiluo-msft:qiluo/ut
Sep 16, 2016
Merged

Add unit test for swssnet.h#82
stcheng merged 4 commits intosonic-net:masterfrom
qiluo-msft:qiluo/ut

Conversation

@qiluo-msft
Copy link
Contributor

No description provided.

tests_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST) $(CFLAGS_SAI)
tests_LDADD = $(LDADD_GTEST) -lnl-genl-3 -lhiredis -lhiredis -lpthread \
-lswsscommon -lswsscommon -lgtest -lgtest_main

No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty spaces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved.

inet_ntop(AF_INET6, dst.addr.ip6, buf, INET6_ADDRSTRLEN);
EXPECT_STREQ(buf, "2001:4898:f0:f153:357c:77b2:49c9:627c");
inet_ntop(AF_INET6, dst.mask.ip6, buf, INET6_ADDRSTRLEN);
printf("%s\n", buf);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved.

using namespace std;
using namespace swss;

TEST(IpAddress, copy)
Copy link
Contributor

@stcheng stcheng Sep 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to use TEST(module_name, submodule_name) format, so it is better to use filter to test all swssnet functionalities. Same as below. You could have TEST(swssnet, copy) and TEST(swssnet, subnet) and put some tests together into one. IPv4 cases could also be added.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure. prefer keep test cases fine granularity because of easy variable naming.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe the name can be the same. not sure. you could check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean variable names inside each test case.
Resolved.

@stcheng stcheng merged commit 41e3a60 into sonic-net:master Sep 16, 2016
@qiluo-msft qiluo-msft deleted the qiluo/ut branch November 14, 2016 22:58
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
Files now end with a single newline.
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
lukasstockner pushed a commit to genesiscloud/sonic-swss that referenced this pull request Apr 2, 2023
…re-api

[component]: Introduce new firmware management API
dgsudharsan pushed a commit to dgsudharsan/sonic-swss that referenced this pull request May 21, 2025
* SRv6: add MySID counters support

* query SAI capability to check if SRv6 MySID counter is supported
* support for SRv6 MySID counter utilizing flex counter infrastructure
* extend vs test test_flex_counters.py

* SRv6: increase log level for the counters state update

Signed-off-by: Yakiv Huryk <yhuryk@nvidia.com>

---------

Signed-off-by: Yakiv Huryk <yhuryk@nvidia.com>
liuh-80 pushed a commit to liuh-80/sonic-swss that referenced this pull request Aug 31, 2025
```<br>* 32da647 - (HEAD -> 202503) Merge branch '202412' of https://github.com/Azure/sonic-swss.msft into 202503 (2025-05-26) [Sonic Automation]
* 06b16c3 - (base/202412) [fpmsyncd]Fixing blackhole route to publish protocol field to APPL_DB (sonic-net#83) (2025-05-23) [Sudharsan Dhamal Gopalarathnam]
* b801f2d - [202412] [SRv6] add MySID counters support (sonic-net#82) (2025-05-19) [Yakiv Huryk]
* a999b4d - Merge pull request sonic-net#81 from r12f/code-sync-202412 (2025-05-17) [Dashuai Zhang]
|\ 
| failure_prs.log fd87e1f - Merge remote-tracking branch 'base/202411' into code-sync-202412 (2025-05-16) [r12f]
|/| 
| failure_prs.log 623b018 - (origin/202411) [202411] Setting default nexthop weight to 1 in fpmsyncd (2025-05-15) [Kumaresh Perumal]
| |\ 
| | failure_prs.log a99088e - Removed logging code. (2025-05-15) [Mahdi Ramezani]
| | failure_prs.log 5cdc78e - Fixed a compile error. (2025-05-15) [Mahdi Ramezani]
| | failure_prs.log a79b7e0 - Set default nexthop weight to 1. Added unit tests for 'getNextHopWt'. (2025-05-15) [Mahdi Ramezani]
| |/ 
* | 2a0856b - Merge pull request sonic-net#78 from nazariig/202412-trim-azure (2025-05-14) [Nazarii Hnydyn]
* | 2daf207 - Enable FDB learning event after all ports removed from default 1Q bridge (sonic-net#79) (2025-05-09) [mssonicbld]
* | 3b70292 - Move timestamps out of counter table to avoid update too frequently (sonic-net#75) (2025-04-28) [mssonicbld]
* | 3fa0d72 - Merge pull request sonic-net#74 from mssonicbld/sonicbld/202412-merge (2025-04-23) [mssonicbld]
* | be436da - Merge branch '202411' of https://github.com/sonic-net/sonic-swss into 202412 (2025-04-23) [Sonic Automation]
|/ 
* 79f04e3 - Initialize the last fec ber computed values if not found (sonic-net#3621) (2025-04-22) [mssonicbld]<br>```
jianyuewu pushed a commit to jianyuewu/sonic-swss that referenced this pull request Dec 24, 2025
* Add SWSS_LOG_THROW macro to log and throw exception

* Combine logging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants