From Fedora Project Wiki

Revision as of 12:40, 14 August 2023 by Sumantrom (talk | contribs) (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`...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

{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=

  1. Ensure you've installed required packages: dbus-devel, gcc, and g++.
  2. Write the provided code into a file named dbus_example.c [gist].
  3. Compile the application with gcc dbus_example.c $(pkg-config --cflags --libs dbus-1) -o dbus_example.

|actions=

  1. Run the compiled application using ./dbus_example.
  2. Observe the output to ensure that the signal is sent and then successfully received.

|results=

  1. The application should send the signal successfully with the message "Signal Sent!".
  2. The application should then receive the signal and display the message "Received Test signal with message: Test".

|optional=For further advanced testing:

  1. Try creating multiple instances of the program and see how they communicate using D-Bus.
  2. Modify the program to send different types of data over D-Bus, such as integers or more complex data structures.
  3. 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. }}