Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
spbro
OpenXG-RAN
Commits
db871d15
Commit
db871d15
authored
Sep 27, 2023
by
luis_pereira87
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ctest test for reverse_bits function
parent
9def5cfa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
0 deletions
+60
-0
common/utils/CMakeLists.txt
common/utils/CMakeLists.txt
+4
-0
common/utils/nr/tests/CMakeLists.txt
common/utils/nr/tests/CMakeLists.txt
+5
-0
common/utils/nr/tests/reverse_bits_test.c
common/utils/nr/tests/reverse_bits_test.c
+51
-0
No files found.
common/utils/CMakeLists.txt
View file @
db871d15
...
@@ -9,3 +9,7 @@ if(ENABLE_WEBSRV)
...
@@ -9,3 +9,7 @@ if(ENABLE_WEBSRV)
endif
()
endif
()
add_subdirectory
(
T
)
add_subdirectory
(
T
)
if
(
ENABLE_TESTS
)
add_subdirectory
(
nr/tests
)
endif
()
common/utils/nr/tests/CMakeLists.txt
0 → 100644
View file @
db871d15
add_executable
(
reverse_bits_test reverse_bits_test.c ../nr_common.c
)
target_link_libraries
(
reverse_bits_test UTIL minimal_lib
)
add_dependencies
(
tests reverse_bits_test
)
add_test
(
NAME reverse_bits_test COMMAND reverse_bits_test
)
common/utils/nr/tests/reverse_bits_test.c
0 → 100644
View file @
db871d15
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include "common/utils/assertions.h"
#include "../nr_common.c"
int
main
()
{
uint64_t
in
=
0x1
;
uint64_t
out
=
reverse_bits
(
in
,
0
);
if
(
out
!=
0x0
)
return
-
1
;
in
=
0x1
;
out
=
reverse_bits
(
in
,
1
);
if
(
out
!=
0x1
)
return
-
1
;
in
=
0x1
;
out
=
reverse_bits
(
in
,
64
);
if
(
out
!=
0x8000000000000000
)
return
-
1
;
in
=
0x20F
;
out
=
reverse_bits
(
in
,
10
);
if
(
out
!=
0x3C1
)
return
-
1
;
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment