Karl Zhang | 3de5ab1 | 2021-05-31 11:45:48 +0800 | [diff] [blame] | 1 | /* |
Nik Dewally | bacae6c | 2024-07-30 16:58:14 +0100 | [diff] [blame] | 2 | * Copyright (c) 2019-2024, Arm Limited. All rights reserved. |
Karl Zhang | 3de5ab1 | 2021-05-31 11:45:48 +0800 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
Nik Dewally | bacae6c | 2024-07-30 16:58:14 +0100 | [diff] [blame] | 8 | #include <cstdlib> |
Karl Zhang | 3de5ab1 | 2021-05-31 11:45:48 +0800 | [diff] [blame] | 9 | |
Karl Zhang | 3de5ab1 | 2021-05-31 11:45:48 +0800 | [diff] [blame] | 10 | #include "gibberish.hpp" |
Karl Zhang | 3de5ab1 | 2021-05-31 11:45:48 +0800 | [diff] [blame] | 11 | #include "data_blocks.hpp" |
Karl Zhang | 3de5ab1 | 2021-05-31 11:45:48 +0800 | [diff] [blame] | 12 | #include "template_line.hpp" |
| 13 | #include "tf_fuzz.hpp" |
Karl Zhang | 3de5ab1 | 2021-05-31 11:45:48 +0800 | [diff] [blame] | 14 | #include "sst_template_line.hpp" |
Karl Zhang | 3de5ab1 | 2021-05-31 11:45:48 +0800 | [diff] [blame] | 15 | |
| 16 | |
| 17 | /********************************************************************************** |
| 18 | Methods of class set_sst_template_line follow: |
| 19 | **********************************************************************************/ |
| 20 | |
| 21 | //**************** set_sst_template_line methods **************** |
| 22 | |
| 23 | set_sst_template_line::set_sst_template_line (tf_fuzz_info *resources) |
| 24 | : sst_template_line (resources) // constructor) |
| 25 | { |
| 26 | return; // just to have something to pin a breakpoint onto |
| 27 | } |
| 28 | |
| 29 | |
| 30 | // Default destructor: |
| 31 | set_sst_template_line::~set_sst_template_line (void) |
| 32 | { |
| 33 | return; // just to have something to pin a breakpoint onto |
| 34 | } |
| 35 | |
| 36 | // (Default constructor not used) |
| 37 | |
| 38 | |
| 39 | |
| 40 | /********************************************************************************** |
| 41 | End of methods of class set_sst_template_line. |
| 42 | **********************************************************************************/ |
| 43 | |
| 44 | |
| 45 | /********************************************************************************** |
| 46 | Methods of class read_sst_template_line follow: |
| 47 | **********************************************************************************/ |
| 48 | |
| 49 | read_sst_template_line::read_sst_template_line (tf_fuzz_info *resources) |
| 50 | : sst_template_line (resources) // (constructor) |
| 51 | { |
| 52 | char gibberish_buffer[4096]; string databuff; |
| 53 | int data_length; |
| 54 | set_data.string_specified = (rand()%2) == 1? true : false; |
| 55 | |
| 56 | // Go ahead and create a literal-data string even if not needed: |
| 57 | data_length = test_state->gibbergen.pick_sentence_len(); |
| 58 | test_state->gibbergen.sentence (gibberish_buffer, gibberish_buffer + data_length); |
| 59 | databuff = gibberish_buffer; set_data.set (databuff); |
| 60 | |
| 61 | set_data.file_specified |
| 62 | = (!set_data.string_specified && (rand()%2) == 1)? true : false; |
| 63 | set_data.file_path = ""; // can't really devise a random path |
| 64 | } |
| 65 | |
| 66 | // Default destructor: |
| 67 | read_sst_template_line::~read_sst_template_line (void) |
| 68 | { |
| 69 | return; // just to have something to pin a breakpoint onto |
| 70 | } |
| 71 | |
| 72 | // (Default constructor not used) |
| 73 | |
| 74 | |
| 75 | /********************************************************************************** |
| 76 | End of methods of class read_sst_template_line. |
| 77 | **********************************************************************************/ |
| 78 | |
| 79 | |
| 80 | /********************************************************************************** |
| 81 | Methods of class remove_sst_template_line follow: |
| 82 | **********************************************************************************/ |
| 83 | |
| 84 | remove_sst_template_line::remove_sst_template_line (tf_fuzz_info *resources) |
| 85 | : sst_template_line (resources) // (constructor) |
| 86 | { |
| 87 | is_remove = true; // template_line's constructor defaults this to false |
| 88 | } |
| 89 | |
| 90 | // Default destructor: |
| 91 | remove_sst_template_line::~remove_sst_template_line (void) |
| 92 | { |
| 93 | return; // just to have something to pin a breakpoint onto |
| 94 | } |
| 95 | |
| 96 | // (Default constructor not used) |
| 97 | |
| 98 | |
| 99 | /********************************************************************************** |
| 100 | End of methods of class remove_sst_template_line. |
| 101 | **********************************************************************************/ |