File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ and this project adheres to [0-based versioning](https://0ver.org/).
1717- [ Cigarette Smokers Problem] ( https://en.wikipedia.org/wiki/Cigarette_smokers_problem ) solution.
1818- New ` AM_ATOMIC_FETCH_ADD() ` macro for atomic addition.
1919- Clarification examples to FSM and HSW return macros.
20+ - ` AM_CONTAINER_OF() ` macro unit test.x
2021
2122### Changed
2223
Original file line number Diff line number Diff line change @@ -83,8 +83,19 @@ static void test_align(void) {
8383 }
8484}
8585
86+ static void test_container_of (void ) {
87+ struct foo {
88+ int a ;
89+ int b ;
90+ };
91+ struct foo foo = {.a = 1 , .b = 2 };
92+ int * bp = & foo .b ;
93+ AM_ASSERT (1 == AM_CONTAINER_OF (bp , struct foo , b )-> a );
94+ }
95+
8696int main (void ) {
8797 test_align ();
98+ test_container_of ();
8899
89100 return 0 ;
90101}
You can’t perform that action at this time.
0 commit comments