### Per-Test-Suite Setup and Tear-down Example Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/docs/advanced.md This C++ example demonstrates how to declare and define static members for shared resources, along with `SetUpTestSuite()` and `TearDownTestSuite()` methods within a test fixture class. Use this pattern when tests require expensive resources that can be safely shared. ```C++ class FooTest : public ::testing::Test { protected: // Per-test-suite set-up. // Called before the first test in this test suite. // Can be omitted if not needed. static void SetUpTestSuite() { shared_resource_ = new ...; } // Per-test-suite tear-down. // Called after the last test in this test suite. // Can be omitted if not needed. static void TearDownTestSuite() { delete shared_resource_; shared_resource_ = NULL; } // You can define per-test set-up logic as usual. virtual void SetUp() { ... } // You can define per-test tear-down logic as usual. virtual void TearDown() { ... } // Some expensive resource shared by all tests. static T* shared_resource_; }; T* FooTest::shared_resource_ = NULL; TEST_F(FooTest, Test1) { ... you can refer to shared_resource_ here ... } TEST_F(FooTest, Test2) { ... you can refer to shared_resource_ here ... } ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/CMakeLists.txt Installs the gtest and gtest_main libraries for the project. This is a foundational step for enabling testing functionalities. ```cmake install_project(gtest gtest_main) ``` -------------------------------- ### PBKDF2 with Default Parameters Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/crypto/evp/scrypt_tests.txt Example using default or minimal parameters for PBKDF2. Suitable for basic key derivation. ```python Password = "" Salt = "" N = 16 r = 1 p = 1 Key = 77d6576238657b203b19ca42c18a0497f16b4844e3074ae8dfdffa3fede21442fcd0069ded0948f8326a753a0fc81f17e8d3e0fb2e0d3628cf35e20c38d18906 ``` -------------------------------- ### SRTP Receiver Example Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/third_party/libsrtp/README.md Example of running the 'rtpw' application as an SRTP receiver. It uses the same predefined master key and security settings as the sender to establish the session. ```bash [sh2]$ test/rtpw -r -k $k -e 128 -a 0.0.0.0 9999 ``` -------------------------------- ### SRTP Sender Example Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/third_party/libsrtp/README.md Example of running the 'rtpw' application as an SRTP sender. It uses a predefined master key, enables encryption (128-bit) and message authentication. ```bash set k=c1eec3717da76195bb878578790af71c4ee9f859e197a414a78d5abc7451 [sh1]$ test/rtpw -s -k $k -e 128 -a 0.0.0.0 9999 ``` -------------------------------- ### Define a Custom Test Environment Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/docs/advanced.md Subclass `::testing::Environment` to define custom setup and teardown logic for your tests. Override `SetUp()` and `TearDown()` methods as needed. ```c++ class Environment { public: virtual ~Environment() {} // Override this to define how to set up the environment. virtual void SetUp() {} // Override this to define how to tear down the environment. virtual void TearDown() {} }; ``` -------------------------------- ### Initialize and Manage AyuSyncController Source: https://context7.com/ayugram/ayugram4a/llms.txt Provides methods for initializing, getting the instance of, and nullifying the AyuSyncController. Ensure sync is enabled before initialization. ```java // Initialize sync controller (called automatically if sync enabled) AyuSyncController.create(); ``` ```java // Get singleton instance AyuSyncController sync = AyuSyncController.getInstance(); ``` ```java // Disable sync and cleanup connections AyuSyncController.nullifyInstance(); ``` -------------------------------- ### Verify Signature with Small Public Key Y-Coordinate (Initial Example) Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha512_test.txt Verifies a signature using a message and a public key with a small y-coordinate. This is the first example provided for this scenario. ```text msg = 4d657373616765 result = valid sig = 3065023100e6fa8455bc14e730e4ca1eb5faf6c8180f2f231069b93a0bb17d33ad5513d93a36214f5ce82ca6bd785ccbacf7249a4c02303979b4b480f496357c25aa3fc850c67ff1c5a2aabd80b6020d2eac3dd7833cf2387d0be64df54a0e9b59f12c3bebf886 ``` -------------------------------- ### PBKDF2 with Increased Iterations Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/crypto/evp/scrypt_tests.txt Shows PBKDF2 with a higher iteration count (N) for enhanced security. This example uses a longer salt. ```python Password = "pleaseletmein" Salt = "SodiumChloride" N = 16384 r = 8 p = 1 Key = 7023bdcb3afd7348461c06cd81fd38ebfda8fbba904f8e3ea9b543f6545da1f2d5432955613f0fcf62d49705242a9af9e61e85dc0d651e40dfcf017b45575887 ``` -------------------------------- ### Create CMake Package Configuration Files Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/CMakeLists.txt Generates and installs CMake package configuration files (Config.cmake and ConfigVersion.cmake) for Google Test. ```cmake if (INSTALL_GTEST) include(CMakePackageConfigHelpers) set(cmake_package_name GTest) set(targets_export_name ${cmake_package_name}Targets CACHE INTERNAL "") set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated" CACHE INTERNAL "") set(cmake_files_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${cmake_package_name}") set(version_file "${generated_dir}/${cmake_package_name}ConfigVersion.cmake") write_basic_package_version_file(${version_file} COMPATIBILITY AnyNewerVersion) install(EXPORT ${targets_export_name} NAMESPACE ${cmake_package_name}:: DESTINATION ${cmake_files_install_dir}) set(config_file "${generated_dir}/${cmake_package_name}Config.cmake") configure_package_config_file("${gtest_SOURCE_DIR}/cmake/Config.cmake.in" "${config_file}" INSTALL_DESTINATION ${cmake_files_install_dir}) install(FILES ${version_file} ${config_file} DESTINATION ${cmake_files_install_dir}) endif() ``` -------------------------------- ### Define Minimalist Event Listener in C++ Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/docs/advanced.md Subclass `EmptyTestEventListener` to handle specific test events like start, result, and end. Override methods to customize output or behavior. This example prints messages for test start, result, and end. ```C++ class MinimalistPrinter : public ::testing::EmptyTestEventListener { // Called before a test starts. virtual void OnTestStart(const ::testing::TestInfo& test_info) { printf("*** Test %s.%s starting.\n", test_info.test_suite_name(), test_info.name()); } // Called after a failed assertion or a SUCCESS(). virtual void OnTestPartResult(const ::testing::TestPartResult& test_part_result) { printf("%s in %s:%d\n%s\n", test_part_result.failed() ? "*** Failure" : "Success", test_part_result.file_name(), test_part_result.line_number(), test_part_result.summary()); } // Called after a test ends. virtual void OnTestEnd(const ::testing::TestInfo& test_info) { printf("*** Test %s.%s ending.\n", test_info.test_suite_name(), test_info.name()); } }; ``` -------------------------------- ### Get Range of Deleted Messages Source: https://context7.com/ayugram/ayugram4a/llms.txt Fetch a list of deleted messages within a specified range (start and end message IDs) for a given dialog and topic, with a limit. ```java // Get range of deleted messages for a dialog List deleted = controller.getMessages( userId, dialogId, topicId, startMessageId, endMessageId, 100 // limit ); ``` -------------------------------- ### Build Google Test with Make Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/README.md Build the Google Test library and a sample test using the provided Makefile. This is suitable for systems with GNU make available. Navigate to the `make` directory and run `make`. ```bash cd ${GTEST_DIR}/make make ./sample1_unittest ``` -------------------------------- ### Initialize CMake Project Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/CMakeLists.txt Sets the minimum CMake version and project name. 'NONE' is used to defer language enabling. ```cmake cmake_minimum_required(VERSION 3.0) # Defer enabling C and CXX languages. project(BoringSSL NONE) ``` -------------------------------- ### Defining a C++ Test Fixture Class Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/docs/primer.md Derive a class from ::testing::Test and start its body with 'protected:'. Implement SetUp() for initialization and TearDown() for cleanup. Declare shared objects as members. ```c++ class QueueTest : public ::testing::Test { protected: void SetUp() override { q1_.Enqueue(1); q2_.Enqueue(2); q2_.Enqueue(3); } // void TearDown() override {} Queue q0_; Queue q1_; Queue q2_; }; ``` -------------------------------- ### Modified Signature Example 2 Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_test.txt Example of a modified signature with a different value for 'sig' compared to the first example, indicating a variation in the signature data. ```plaintext msg = 313233343030 result = invalid sig = 30660231ff12b30abef6b5476fe6b612ae557c0425661e26b44b1bfe1a138f7ca6eeda02a462743d328394f8b71dd11a2a25001f64023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82 ``` -------------------------------- ### Setting INCLUDE and LIB paths for VS2012 Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/third_party/openh264/README.md Configure INCLUDE and LIB environment variables to point to your Visual Studio and Windows SDK installations for a Win64 build with VS2012. ```shell export INCLUDE="C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include;C:\Program Files (x86)\Windows Kits\8.0\Include\um;C:\Program Files (x86)\Windows Kits\8.0\Include\shared" ``` ```shell export LIB="C:\Program Files (x86)\Windows Kits\8.0\Lib\Win8\um\x86;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib" ``` -------------------------------- ### Modified Signature Example 12 Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_test.txt This example demonstrates a modified signature with a unique hexadecimal sequence. ```plaintext msg = 313233343030 result = invalid sig = 3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023101e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82 ``` -------------------------------- ### Initialize Standalone CMake Project with Samples Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/README.md Generate native build scripts for Google Test using CMake, enabling the build of samples. Use the `-Dgtest_build_samples=ON` flag. ```bash mkdir mybuild cd mybuild cmake -Dgtest_build_samples=ON ${GTEST_DIR} ``` -------------------------------- ### Modified Signature Example 10 Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_test.txt This example presents a modified signature with a distinct hexadecimal sequence. ```plaintext msg = 313233343030 result = invalid sig = 3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70231ff1840da9fc1d2f8f8900cf485d5413b8c2574ee3a8d4ca039ce66e2a219d22358ada554576cda202fb0133b8400bd907e ``` -------------------------------- ### PBKDF2 with Standard Parameters Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/crypto/evp/scrypt_tests.txt Demonstrates PBKDF2 with common parameters for password-based key derivation. Higher N, r, and p values generally increase security. ```python Password = "password" Salt = "NaCl" N = 1024 r = 8 p = 16 Key = fdbabe1c9d3472007856e7190d01e9fe7c6ad7cbc8237830e77376634b3731622eaf30d92e22a3886ff109279d9830dac727afb94a83ee6d8360cbdfa2cc0640 ``` -------------------------------- ### Modified Signature Example 4 Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_test.txt This example shows a further modification in the signature, highlighting variations that can occur. ```plaintext msg = 313233343030 result = invalid sig = 3066023100ed4cf541094ab8901949ed51aa83fbda99e1d94bb4e401e5ec7083591125fd5b9d8bc2cd7c6b0e3ab729023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82 ``` -------------------------------- ### Initialize and Use libSRTP Session Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/third_party/libsrtp/README.md A C code snippet demonstrating the initialization of libSRTP, setting up a policy with a predetermined key, and then protecting RTP packets in a loop. Assumes 'get_rtp_packet' and 'send_srtp_packet' functions are defined elsewhere. ```c srtp_t session; srtp_policy_t policy; // Set key to predetermined value uint8_t key[30] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D}; // initialize libSRTP srtp_init(); // default policy values memset(&policy, 0x0, sizeof(srtp_policy_t)); // set policy to describe a policy for an SRTP stream crypto_policy_set_rtp_default(&policy.rtp); crypto_policy_set_rtcp_default(&policy.rtcp); policy.ssrc = ssrc; policy.key = key; policy.next = NULL; // allocate and initialize the SRTP session srtp_create(&session, &policy); // main loop: get rtp packets, send srtp packets while (1) { char rtp_buffer[2048]; unsigned len; len = get_rtp_packet(rtp_buffer); srtp_protect(session, rtp_buffer, &len); send_srtp_packet(rtp_buffer, len); } ``` -------------------------------- ### Run Test Session with Specific Algorithm Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/util/fipstools/acvp/ACVP.md Exercise the client for development purposes by passing the '-run' argument followed by the algorithm name, such as 'SHA2-256', to initiate a test session. ```shell -run SHA2-256 ``` -------------------------------- ### Modified Signature Example 13 Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_test.txt A further modified signature example, showcasing different values in the signature data. ```plaintext msg = 313233343030 result = invalid sig = 3064023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d702301840da9fc1d2f8f8900cf485d5413b8c2574ee3a8d4ca039ce66e2a219d22358ada554576cda202fb0133b8400bd907e ``` -------------------------------- ### Run Tests Against NSS with Custom Configuration Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/ssl/test/PORTING.md Example command to run the test runner against an NSS implementation. It specifies the library path, shim path, error mapping, unimplemented feature handling, and a custom configuration file. ```bash DYLD_LIBRARY_PATH=~/dev/nss-dev/nss-sandbox/dist/Darwin15.6.0_64_DBG.OBJ/lib go test -shim-path ~/dev/nss-dev/nss-sandbox/dist/Darwin15.6.0_64_DBG.OBJ/bin/nss_bogo_shim -loose-errors -allow-unimplemented -shim-config ~/dev/nss-dev/nss-sandbox/nss/external_tests/nss_bogo_shim/config.json ``` -------------------------------- ### Modified Signature Example 11 Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_test.txt Another modified signature example, showing variations in the signature data. ```plaintext msg = 313233343030 result = invalid sig = 3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70231fe1840da9fc1d2f8f8900cf485d5413b8c2574ee3a8d4ca03a07039520259af579558b46a5242978b4c327221933f8670b ``` -------------------------------- ### Meson Build Configuration for GoogleTest Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/docs/Pkgconfig.md Meson natively supports pkg-config for dependency management. This example shows how to declare a dependency on gtest_main and use it for an executable. ```meson project('my_gtest_pkgconfig', 'cpp', version : '0.0.1') gtest_dep = dependency('gtest_main') testapp = executable( 'testapp', files(['samples/sample3_unittest.cc']), dependencies : gtest_dep, install : false) test('first_and_only_test', testapp) ``` -------------------------------- ### Modified Signature Example 9 Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_test.txt Another example of a modified signature, demonstrating further variations in the signature data. ```plaintext msg = 313233343030 result = invalid sig = 3064023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70230e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc66a35cfdbf1f6aec7fa409df64a7538556300ab11327d460f ``` -------------------------------- ### Basic make commands for OpenH264 Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/third_party/openh264/README.md Standard make commands for building OpenH264. Use `make` for auto-detection, or specify architecture. `V=No` silences output, `DEBUGSYMBOLS=True` includes debug symbols. ```makefile make ``` ```makefile make ARCH=i386 ``` ```makefile make ARCH=x86_64 ``` ```makefile make V=No ``` ```makefile make DEBUGSYMBOLS=True ``` -------------------------------- ### Modified Signature Example 8 Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_test.txt This signature example shows a different pattern of modification in the 'sig' field. ```plaintext msg = 313233343030 result = invalid sig = 3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023101e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc5f8fc6adfda650a86aa74b95adbd6874b3cd8dde6cc0798f5 ``` -------------------------------- ### Modified Signature Example 7 Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_test.txt A further example of a modified signature, demonstrating different hexadecimal sequences in the signature. ```plaintext msg = 313233343030 result = invalid sig = 3066023100ed4cf541094ab8901949ed51aa83fbda99e1d94bb4e401e6250d35d71ceecf7c4571b51b33ba5fcdf542cc6b0e3ab729023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82 ``` -------------------------------- ### PBKDF2 with High Memory Requirement Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/crypto/evp/scrypt_tests.txt This example configures PBKDF2 for a very high iteration count (N) and specifies a large MaxMemory. It requires significant system resources to run and is typically disabled by default. ```python # Password = "pleaseletmein" # Salt = "SodiumChloride" # N = 1048576 # r = 8 # p = 1 # Key = 2101cb9b6a511aaeaddbbe09cf70f881ec568d574a2ffd4dabe5ee9820adaa478e56fd8f4ba5d09ffa1c6d927c40f4c337304049e8a952fbcbf45c6fa77a41a4 # MaxMemory = 10000000000 ``` -------------------------------- ### Modified Signature Example 6 Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_test.txt This example shows another altered signature, continuing the pattern of variations in the 'sig' field. ```plaintext msg = 313233343030 result = invalid sig = 306602310112b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82 ``` -------------------------------- ### Meson build commands Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/third_party/openh264/README.md Commands for building OpenH264 using the Meson build system. Includes configuring the build directory, compiling, testing, and installing. ```shell meson builddir ``` ```shell ninja -C builddir ``` ```shell meson test -C builddir -v ``` ```shell ninja -C builddir install ``` -------------------------------- ### Modified Signature Example 1 Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_test.txt Example of a modified signature, likely due to changes in the order of the group for r or s. This is a standard test case. ```plaintext msg = 313233343030 result = invalid sig = 306602310112b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19a25617aad7485e6312a8589714f647acf7a94cffbe8a724a023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82 ``` -------------------------------- ### Configure libjpeg-turbo for JPEG7 Emulation (Shell) Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/mozjpeg/README-turbo.txt Pass this argument to the configure script to build a version of libjpeg-turbo that emulates the libjpeg v7 ABI. ```shell --with-jpeg7 ``` -------------------------------- ### Example JSON Report Output Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/docs/advanced.md This is an example of the JSON report generated by GoogleTest, showing test suite and test case results, including failures. ```json { "tests": 3, "failures": 1, "errors": 0, "time": "0.035s", "timestamp": "2011-10-31T18:52:42Z", "name": "AllTests", "testsuites": [ { "name": "MathTest", "tests": 2, "failures": 1, "errors": 0, "time": "0.015s", "testsuite": [ { "name": "Addition", "status": "RUN", "time": "0.007s", "classname": "", "failures": [ { "message": "Value of: add(1, 1)\n Actual: 3\nExpected: 2", "type": "" }, { "message": "Value of: add(1, -1)\n Actual: 1\nExpected: 0", "type": "" } ] }, { "name": "Subtraction", "status": "RUN", "time": "0.005s", "classname": "" } ] }, { "name": "LogicTest", "tests": 1, "failures": 0, "errors": 0, "time": "0.005s", "testsuite": [ { "name": "NonContradiction", "status": "RUN", "time": "0.005s", "classname": "" } ] } ] } ``` -------------------------------- ### Configure libjpeg-turbo for JPEG8 Emulation (Shell) Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/mozjpeg/README-turbo.txt Pass this argument to the configure script to build a version of libjpeg-turbo that emulates the libjpeg v8 ABI. ```shell --with-jpeg8 ``` -------------------------------- ### Construct and Query UniquePtrSet Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/voip/webrtc/base/containers/README.md Demonstrates the construction of a UniquePtrSet from a vector of unique pointers and performing lookups using raw pointers. This showcases the transparent comparison feature for smart pointers. ```cpp // Declare a type alias using base::UniquePtrComparator. template using UniquePtrSet = base::flat_set, base::UniquePtrComparator>; // ... // Collect data. std::vector> ptr_vec; ptr_vec.reserve(5); std::generate_n(std::back_inserter(ptr_vec), 5, []{ return std::make_unique(0); }); // Construct a set. UniquePtrSet ptr_set(std::move(ptr_vec)); // Use raw pointers to lookup keys. int* ptr = ptr_set.begin()->get(); EXPECT_TRUE(ptr_set.find(ptr) == ptr_set.begin()); ``` -------------------------------- ### Initialize Standalone CMake Project Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/README.md Generate native build scripts for Google Test using CMake. Create a build directory, navigate into it, and run cmake with the path to the Google Test source directory. ```bash mkdir mybuild cd mybuild cmake ${GTEST_DIR} ``` -------------------------------- ### Example Generated XML Report Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/docs/advanced.md This is an example of a complete XML report generated by Google Test. It includes test counts, durations, and failure details for each test case. ```xml ... ... ``` -------------------------------- ### Run CAVP Tests with run_cavp.go Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/crypto/fipsmodule/FIPS.md Use this Go script to execute CAVP tests. It manages the set of tests and configures the `cavp` binary with necessary flags. Ensure you run it from the top of a CAVP directory. ```go util/fipstools/run_cavp.go -oracle-bin=util/fipstools/cavp -no-fax ``` -------------------------------- ### ECC Public Key with Large Y-coordinate Signature (Example 1) Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_test.txt Shows a message, its validity, and a signature for an ECC public key with a large y-coordinate. This example uses the secp384r1 curve. ```text msg = 4d657373616765 result = valid sig = 3064023015aac6c0f435cb662d110db5cf686caee53c64fe2d6d600a83ebe505a0e6fc62dc5705160477c47528c8c903fa865b5d02307f94ddc01a603f9bec5d10c9f2c89fb23b3ffab6b2b68d0f04336d499085e32d22bf3ab67a49a74c743f72473172b59f ``` -------------------------------- ### ExteraConfig Media Settings Source: https://context7.com/ayugram/ayugram4a/llms.txt Configure media sending quality and camera implementation. Options include different photo quality presets and choosing between legacy or CameraX camera APIs. ```java ExteraConfig.sendPhotosQuality = 2; // 0: 800px, 1: 1280px, 2: 2560px ``` ```java ExteraConfig.cameraType = 1; // 0: legacy, 1: CameraX ``` ```java ExteraConfig.pauseOnMinimize = true; // Pause video on app minimize ``` -------------------------------- ### GoogleTest Death Test Example: Killed by Signal Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/docs/advanced.md This example uses EXPECT_EXIT to verify that a statement terminates the process by a specific signal (SIGKILL). It also checks for a particular message on stderr. ```c++ TEST(MyDeathTest, KillMyself) { EXPECT_EXIT(KillMyself(), ::testing::KilledBySignal(SIGKILL), "Sending myself unblockable signal"); } ``` -------------------------------- ### Register Environment with a Global Variable Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/docs/advanced.md An example of registering a global test environment using a global variable. It's recommended to call `AddGlobalTestEnvironment()` explicitly in `main()` for better readability and to avoid initialization order issues. ```c++ ::testing::Environment* const foo_env = ::testing::AddGlobalTestEnvironment(new FooEnvironment); ``` -------------------------------- ### SizeSpecificPartitionAllocator Example Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/voip/webrtc/base/allocator/partition_allocator/PartitionAlloc.md Satisfies allocations up to a maximum size (N - kAllocationGranularity). Contains buckets for all multiples of kAllocationGranularity up to the maximum. Allocations exceeding the maximum size will fail. ```c++ template class SizeSpecificPartitionAllocator { // ... }; const size_t kMaxAllocation = N - kAllocationGranularity; // Allocations of size kMaxAllocation or less are satisfied. // Allocations larger than kMaxAllocation will fail. ``` -------------------------------- ### GoogleTest Death Test Example: Compound Statement Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/docs/advanced.md This example demonstrates a death test using ASSERT_DEATH with a compound statement. It verifies that the statement causes a crash with a specific error message on stderr. ```c++ TEST(MyDeathTest, Foo) { // This death test uses a compound statement. ASSERT_DEATH({ int n = 5; Foo(&n); }, "Error on line .* of Foo()" ); } ``` -------------------------------- ### ECC Public Key with Large Y-coordinate Signature (Example 2) Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_test.txt Presents a message, its validity, and a signature for an ECC public key with a large y-coordinate. This example is similar to the previous one but with a different signature. ```text msg = 4d657373616765 result = valid sig = 306602310090b95a7d194b73498fba5afc95c1aea9be073162a9edc57c4d12f459f0a1730baf2f87d7d6624aea7b931ec53370fe47023100cbc1ef470e666010604c609384b872db7fa7b8a5a9f20fdefd656be2fcc75db53948102f7ab203ea1860a6a32af246a1 ``` -------------------------------- ### Configure AyuSync - AyuConfig Source: https://context7.com/ayugram/ayugram4a/llms.txt Set up AyuSync for cross-device synchronization by configuring the server URL, token, and enabling the sync service. Supports secure connections via HTTPS/WSS. ```java // AyuSync configuration String syncServerURL = AyuConfig.getSyncServerURL(); // Default: "ayusync.cloud" String syncToken = AyuConfig.getSyncServerToken(); AyuConfig.syncEnabled = true; AyuConfig.useSecureConnection = true; // Use HTTPS/WSS ``` -------------------------------- ### Deriving Test Fixtures in googletest Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/docs/faq.md Test fixtures can be derived from a base fixture to share common setup and teardown logic. Ensure proper ordering of SetUp() and TearDown() calls between the base and derived fixtures. ```c++ // Defines a base test fixture. class BaseTest : public ::testing::Test { protected: ... }; // Derives a fixture FooTest from BaseTest. class FooTest : public BaseTest { protected: void SetUp() override { BaseTest::SetUp(); // Sets up the base fixture first. ... additional set-up work ... } void TearDown() override { ... clean-up work for FooTest ... BaseTest::TearDown(); // Remember to tear down the base fixture // after cleaning up FooTest! } ... functions and variables for FooTest ... }; // Tests that use the fixture FooTest. TEST_F(FooTest, Bar) { ... } TEST_F(FooTest, Baz) { ... } ``` -------------------------------- ### GoogleTest Death Test Example: Normal Exit Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/docs/advanced.md This example uses EXPECT_EXIT to verify that a statement exits normally with a specific exit code (0) and produces a given string on stderr. This is useful when the process is expected to terminate cleanly. ```c++ TEST(MyDeathTest, NormalExit) { EXPECT_EXIT(NormalExit(), ::testing::ExitedWithCode(0), "Success"); } ``` -------------------------------- ### Build Google Test Framework with Xcode Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/README.md Build the Google Test framework using the command line with xcodebuild. This command builds the 'Release' configuration of gtest.framework. ```bash xcodebuild ``` -------------------------------- ### Initialize YouTube Player Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/src/main/assets/youtube_embed.html Initializes the YouTube player with specified video ID, start time, and player configurations. Ensure the YT object is available and the DOM element with id 'player' exists. ```javascript var player; var posted = false; YT.ready(function() { player = new YT.Player("player", { "width": "100%%", "events": { "onReady": "onReady", "onError": "onError", "onStateChange": "onStateChange", }, "videoId": "%1$s", "height": "100%%", "playerVars": { "start": %2$d, "rel": 1, "showinfo": 0, "modestbranding": 0, "iv_load_policy": 3, "autohide": 1, "autoplay": 1, "cc_load_policy": 1, "playsinline": 1, "controls": 0 } }); player.setSize(window.innerWidth, window.innerHeight); }); ``` -------------------------------- ### C++ Example: Custom Mutually Prime Predicate-Formatter Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/docs/advanced.md Implements a custom predicate-formatter `AssertMutuallyPrime` to provide a detailed failure message for checking if two integers are mutually prime. This example demonstrates how to return `::testing::AssertionSuccess()` on success and `::testing::AssertionFailure()` with a custom message on failure. ```c++ // Returns the smallest prime common divisor of m and n, // or 1 when m and n are mutually prime. int SmallestPrimeCommonDivisor(int m, int n) { ... } // A predicate-formatter for asserting that two integers are mutually prime. ::testing::AssertionResult AssertMutuallyPrime(const char* m_expr, const char* n_expr, int m, int n) { if (MutuallyPrime(m, n)) return ::testing::AssertionSuccess(); return ::testing::AssertionFailure() << m_expr << " and " << n_expr << " (" << m << " and " << n << ") are not mutually prime, " << "as they have a common divisor " << SmallestPrimeCommonDivisor(m, n); } ``` -------------------------------- ### Compile Google Test Library with g++ Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/googletest/README.md Compile the gtest-all.cc file to create the Google Test library. Ensure `${GTEST_DIR}/include` is in the system header search path and `${GTEST_DIR}` is in the normal header search path. The `-pthread` flag is required as Google Test uses threads. ```bash g++ -std=c++11 -isystem ${GTEST_DIR}/include -I${GTEST_DIR} \ -pthread -c ${GTEST_DIR}/src/gtest-all.cc ar -rv libgtest.a gtest-all.o ``` -------------------------------- ### Truncate Integer Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/third_party/wycheproof_testvectors/dsa_test.txt Shows examples of truncating an integer value. Observe the changes in the resulting signature. ```plaintext # truncate integer msg = 48656c6c6f result = invalid sig = 303c021b1e41b479ad576905b960fe14eadb91b0ccf34843dab916173bb8c9021d00ade65988d237d30f9ef41dd424a4e1c8f16967cf3365813fe8786236 ``` ```plaintext # truncate integer msg = 48656c6c6f result = invalid sig = 303c021b41b479ad576905b960fe14eadb91b0ccf34843dab916173bb8c9cd021d00ade65988d237d30f9ef41dd424a4e1c8f16967cf3365813fe8786236 ``` ```plaintext # truncate integer msg = 48656c6c6f result = invalid sig = 303c021c1e41b479ad576905b960fe14eadb91b0ccf34843dab916173bb8c9cd021c00ade65988d237d30f9ef41dd424a4e1c8f16967cf3365813fe87862 ``` ```plaintext # truncate integer msg = 48656c6c6f result = invalid sig = 303c021c1e41b479ad576905b960fe14eadb91b0ccf34843dab916173bb8c9cd021cade65988d237d30f9ef41dd424a4e1c8f16967cf3365813fe8786236 ``` -------------------------------- ### Configure CMake for armeabi-v7a Source: https://github.com/ayugram/ayugram4a/blob/rewrite/TMessagesProj/jni/boringssl/README.MD Use this command to configure the CMake build for the armeabi-v7a ABI. Ensure ANDROID_NDK is set correctly. ```bash /Applications/sdk/cmake/3.10.2.4988404/bin/cmake -DANDROID_ABI=armeabi-v7a \ -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \ -DANDROID_NATIVE_API_LEVEL=16 \ -DCMAKE_BUILD_TYPE=Release \ -DARCH=arm \ -DOPENSSL_NO_ASM=1 \ -GNinja .. ```