From Fedora Project Wiki
(Created page with "{QA/Test_Case |description=This advanced test case tests D-Bus integration by creating a simple application to send and receive signals via D-Bus. |setup= # Ensure you've installed required packages: `dbus-devel`, `gcc`, and `g++`. # Write the provided code into a file named `dbus_example.c` https://gist.github.com/sumantro93/861dc2f235dae0605fb8d5987f7563ae gist. # Compile the application with `gcc dbus_example.c $(pkg-config --cflags --libs dbus-1) -o dbus_example`...") |
No edit summary |
||
Line 1: | Line 1: | ||
{QA/Test_Case | {{QA/Test_Case | ||
|description=This advanced test case tests D-Bus integration by creating a simple application to send and receive signals via D-Bus. | |description=This advanced test case tests D-Bus integration by creating a simple application to send and receive signals via D-Bus. | ||
|setup= | |setup= |
Latest revision as of 12:40, 14 August 2023
Description
This advanced test case tests D-Bus integration by creating a simple application to send and receive signals via D-Bus.
Setup
- Ensure you've installed required packages:
dbus-devel
,gcc
, andg++
. - Write the provided code into a file named
dbus_example.c
[gist]. - Compile the application with
gcc dbus_example.c $(pkg-config --cflags --libs dbus-1) -o dbus_example
.
How to test
- Run the compiled application using
./dbus_example
. - Observe the output to ensure that the signal is sent and then successfully received.
Expected Results
- The application should send the signal successfully with the message "Signal Sent!".
- The application should then receive the signal and display the message "Received Test signal with message: Test".
Optional
For further advanced testing:
- Try creating multiple instances of the program and see how they communicate using D-Bus.
- Modify the program to send different types of data over D-Bus, such as integers or more complex data structures.
- Here's an app to send and recieve the same Dbus signal [[1]]
NOTE : You need to compile and open two terminal windows with the same example to send and recieve.