| /* |
| * Copyright (c) 2019-2024, Arm Limited. All rights reserved. |
| * |
| * SPDX-License-Identifier: BSD-3-Clause |
| * |
| */ |
| |
| #include <cstdlib> |
| |
| #include "gibberish.hpp" |
| #include "data_blocks.hpp" |
| #include "template_line.hpp" |
| #include "tf_fuzz.hpp" |
| #include "sst_template_line.hpp" |
| |
| |
| /********************************************************************************** |
| Methods of class set_sst_template_line follow: |
| **********************************************************************************/ |
| |
| //**************** set_sst_template_line methods **************** |
| |
| set_sst_template_line::set_sst_template_line (tf_fuzz_info *resources) |
| : sst_template_line (resources) // constructor) |
| { |
| return; // just to have something to pin a breakpoint onto |
| } |
| |
| |
| // Default destructor: |
| set_sst_template_line::~set_sst_template_line (void) |
| { |
| return; // just to have something to pin a breakpoint onto |
| } |
| |
| // (Default constructor not used) |
| |
| |
| |
| /********************************************************************************** |
| End of methods of class set_sst_template_line. |
| **********************************************************************************/ |
| |
| |
| /********************************************************************************** |
| Methods of class read_sst_template_line follow: |
| **********************************************************************************/ |
| |
| read_sst_template_line::read_sst_template_line (tf_fuzz_info *resources) |
| : sst_template_line (resources) // (constructor) |
| { |
| char gibberish_buffer[4096]; string databuff; |
| int data_length; |
| set_data.string_specified = (rand()%2) == 1? true : false; |
| |
| // Go ahead and create a literal-data string even if not needed: |
| data_length = test_state->gibbergen.pick_sentence_len(); |
| test_state->gibbergen.sentence (gibberish_buffer, gibberish_buffer + data_length); |
| databuff = gibberish_buffer; set_data.set (databuff); |
| |
| set_data.file_specified |
| = (!set_data.string_specified && (rand()%2) == 1)? true : false; |
| set_data.file_path = ""; // can't really devise a random path |
| } |
| |
| // Default destructor: |
| read_sst_template_line::~read_sst_template_line (void) |
| { |
| return; // just to have something to pin a breakpoint onto |
| } |
| |
| // (Default constructor not used) |
| |
| |
| /********************************************************************************** |
| End of methods of class read_sst_template_line. |
| **********************************************************************************/ |
| |
| |
| /********************************************************************************** |
| Methods of class remove_sst_template_line follow: |
| **********************************************************************************/ |
| |
| remove_sst_template_line::remove_sst_template_line (tf_fuzz_info *resources) |
| : sst_template_line (resources) // (constructor) |
| { |
| is_remove = true; // template_line's constructor defaults this to false |
| } |
| |
| // Default destructor: |
| remove_sst_template_line::~remove_sst_template_line (void) |
| { |
| return; // just to have something to pin a breakpoint onto |
| } |
| |
| // (Default constructor not used) |
| |
| |
| /********************************************************************************** |
| End of methods of class remove_sst_template_line. |
| **********************************************************************************/ |